Leveraging User Session for Personalized E- Commerce Recommendation
- Stella ONIBONOJE
- Adebola OJO
- 86-96
- Jul 30, 2024
- Information Technology
Leveraging User Session for Personalized E- Commerce Recommendation
Stella ONIBONOJE, Adebola OJO
Department of Computer Science, University of Ibadan, Nigeria
DOI: https://doi.org/10.51584/IJRIAS.2024.907010
Received: 10 June 2024; Revised: 17 June 2024; Accepted: 20 June 2024; Published: 30 July 2024
ABSTRACT
The advent of the internet has propelled many shopping activities online, leading to the rapid growth of e-commerce. This shift has revolutionized the shopping experience, offering unparalleled convenience with anytime, anywhere access via computers and internet connectivity. Moreover, the vast array of easily accessible choices empowers buyers to make well-informed decisions.
Numerous websites have emerged to provide e-commerce services, catering either as a complement to physical stores or as standalone businesses. However, the abundance of offerings often leads to information overload for buyers, making product searches time-consuming and frustrating.
Personalized e-commerce recommendations alleviate this challenge by guiding users to relevant products swiftly, enhancing the overall shopping experience and ultimately boosting product sales.
The study focuses on creating a session-based recommendation system for e-commerce websites, leveraging Recurrent Neural Networks with LSTM architectures to analyze sequential user behavior and browsing context for personalized product recommendations. The research methodology encompasses data collection and preprocessing, where data was splitted into training, testing and validation set. The model was efficiency was evaluated using precision, recall and mean reciprocal rank with the result showing considerable promise for recommendation.
This research makes a substantial contribution by suggesting tailored options, users are more likely to find suitable products, leading to increased satisfaction and repeat purchases, thereby benefiting e-commerce platforms.
Keywords: E-commerce, Recurrent Neural Networks, User behavior analysis, Session-based recommendation system
INTRODUCTION
Recommender systems have undergone significant evolution since their inception with the rise of the Internet (Castells & Jannach, 2023). These systems play a crucial role in modern online services by offering personalized suggestions to users. Utilizing algorithms to filter information and predict user preferences, they enhance content discovery across various domains such as e-commerce and social media (Dong, 2023).
Session-based recommender systems (SBRSs) different from other recommender systems (RSs), such as content-based RSs and collaborative filtering-based RSs. While the latter typically model long-term, static user preferences, SBRSs focus on capturing short-term, dynamic user preferences. This enables SBRSs to offer recommendations that are more timely and accurate, taking into account the evolving context of users’ sessions. Session-based recommendation systems often employ different machine learning algorithms to forecast user preferences using their behavioral patterns.
SBRS often face challenges like sparse data, leading to the application of techniques like Contrastive Learning (CL) to enhance embedding learning. Its focus on providing recommendations to users based on their short-term preferences within ongoing sessions, in contrast to traditional long-term preference models (Wang et al., 2023).
Personalization in recommendation systems involves tailoring suggestions to users’ preferences and behaviors (H K et al., 2023). Its plays a crucial role in providing tailored content and enhancing user engagement in diverse fields like education, e-commerce, and news recommendations. It aims to enhance user experience by offering items aligned with individual interests, learning patterns, and profiles. Various machine learning algorithms utilize in session-based recommendation systems to predict user preferences based on behavior sequences. Some prevalent algorithms include Graph Neural Networks (GNNs) (Li et al., 2023; Wu et al., 2023), Gated Recurrent Unit (GRU) and Transformer-based algorithms and models incorporating self-supervised learning and contrastive learning ( Li et al., 2023).
Statement of Problem
Effectively encoding complex sequential user actions and multivariate browse context is a key challenge in session based recommender system because the existing system rely on sequence of product interaction and fail to account for richer behavioral contextual information.
Research Objectives
The aim of this research is to develop a session-based recommendation system for e-commerce websites that incorporates sequential user behavior and browsing context to provide personalized product recommendations using Recurrent Neural Network with LSTM architectures.
The purpose is to develop novel techniques for session modeling, improve personalization and user intent prediction or e commerce recommendations and establish new benchmarks.
Structure of the work
The paper is structured to give an overview of the research, beginning with a literature review that situates the study within the context of existing work. The methodology section details the data collection, analysis, and model development used. The results section presents the model’s performance metrics and outcomes. The discussion interprets these findings, and the conclusion summarizes the research and suggests directions for future studies.
LITERATURE REVIEW
Overview of the existing system
Salampasis (2023) focuses on the prediction of next-item, next-basket, and purchase intent tasks in the absence of user profiles and purchase data. The research utilizes RNN /LSTM to model user interaction, Long Short-Term Memory (LSTM) models, which consistently outperform other methods in session-based recommendation tasks. Mean Reciprocal Rank (MRR) was used to assess the effectiveness of the models.
Li and Gao (2021) research on a session recommendation integrating context-aware and gated graph neural networks (CA-GGNNs). The CA-GGNN model combines session sequence information with context information on Yoochoose and Diginetica datasets using a soft attention mechanism. The model utilizes a gated graph neural network (GGNN) to obtain item embedding in the session graph. The model evaluation metrics achieves the best performance of P@20 and MRR@20 compared with the model with only input context and also compared with the model that only integrates interval context, the CA-GGNN model improves P by about 1.54%, 1.31%, and 0.25%, and MRR improves by about 0.91%, 0.21%, and 0.44%. ) which indicates that both kinds of contextual information are important for session recommendation.
Erritali (2021) discusses the application of hybrid approach to improve recommendation system by combining the K Nearest Neighbor algorithm and the model based SVD algorithm to predict movie ratings of users. The study utilizes the collaborative filtering approach and matrix factorization algorithm based on singular value decomposition on Movie lens 100k Dataset, which comprising of 100,000 ratings. The dataset contains demographic details such as age, gender, and occupation. Model evaluated on Root Mean Square Error (RMSE), Mean Absolute Error (MAE), precision, and recall rates SVD model outperforms KNN and the random predictor in all metrics.
Liu (2022) addressed the attribute missing problem and reducing data sparsely and improve recommendation accuracy through an attention mechanism it constructs graph with users, items, and attributes, utilizing a message-passing strategy, and designing an attention mechanism to filter messages based on the influence of item attributes on user preferences. Effectively utilizes attribute information to improve user and item representations. The model outperforms several state-of-the-art methods in recommendation accuracy.
Quadrana (2017) introduces a novel algorithm based on RNNs for personalized session based recommendations, utilizing a hierarchical structure with session-level and user-level GRUs to transfer long-term user interest dynamics to session-level for improved recommendations, using two datasets for experiments, optimizing models, applying dropout regularization, using single-layer GRU networks, tuning hyper parameters with random search, evaluating based on next-item prediction task and metrics, Hierarchical RNN models outperform other baselines in terms of Recall, Precision, and MRR on different datasets, demonstrating the effectiveness of personalized session-based recommendation strategies.
Tan (2016) session-based recommendation as a sequence-based prediction problem, aiming to predict the next user interaction within a session. The research focused on enhancing recurrent models by incorporating data augmentation, addressing temporal shifts, and exploring alternative models based on embedding. They employed data augmentation techniques, model pre-training, distillation, and proposing a novel model for direct item embedding prediction. Evaluation on the RecSys Challenge 2015 dataset showed significant improvements of 12.8% and 14.8% in Recall@20 and MRR@20 metrics.
(Quadrana et al., 2017) introduces a novel algorithm based on RNNs for personalized session-based recommendations, utilizing a hierarchical structure with session-level and user-level GRUs to transfer long-term user interest dynamics to session-level for improved recommendations, using two datasets for experiments, optimizing models, applying dropout regularization, using single-layer GRU networks, tuning hyper parameters with random search, evaluating based on next-item prediction task and metrics.
(Wu et al., 2019)focused on improving session-based recommendation systems using Graph Neural Networks (GNNs). They represent session sequences as directed session graphs, leveraging GNNs to capture complex item transitions. Key aspects include introducing a novel perspective on session modeling, utilizing gated GNNs, predicting next-click probabilities, and conducting extensive experiments on real-world datasets (Yoochoose and Diginetica) to demonstrate effectiveness. The methodology used includes: Graph Neural Networks (GNNs) model session sequences as directed graphs to capture item transitions; Gated GNNs obtain latent vectors for session nodes, representing global preference and current user interest; Back-Propagation Through Time (BPTT) enables training and performance improvement; Attention Networks enhance session representations; and Baseline algorithms (POP, S-POP, Item-KNN, BPR-MF) are compared to SR-GNN. The Datasets were evaluated using Precision, Recall, F1 Score, MRR, and NDCG metrics
MODEL AND METHOD
This session describes personalized recommendation model using recurrent neural network with LSTM architecture on E-commerce products.
Research Design
The design of the research is represented in the diagram, Figure 3.1 introduces overview of the model architecture and flow of work through components. It begins by inputting the collected data in to system for preprocessing the e-commerce data using the preprocessing technique such as label encoding and padding session length and further splitting the dataset, model generate the fixed size length as output of the model.
Data collection and preprocessing
The data was sourced from Kaggle (https://www.kaggle.com/code/aleenashelvi/ecommerce data-analysis) which is publicly available and stored in csv file. This dataset contains 26 million users’ events from ecommerce website, randomly filtered by removing subset of 2 million data point which does not have non-value out of the original dataset of about 26 million with non-value containing user interactions. data contains browsing Sessions, User Ids, Timestamps, Product Ids, Category Ids, Brand, Price Actions taken (e.g., view, add to cart, purchase). The dataset was divided into three subsets: 10 % of the 2 million dataset was set up for testing the model. 20% of what was left for training the model what used for validation.
Model Development
The recurrent neutral utilize the Long Short-Term Memory (LSTM) Encoder-Decoder Architecture, networks has the ability handle sequential data, This architecture is designed to tackle the vanishing gradient problem, which can impede traditional RNNs from effectively learning long-term dependencies. Figure 3.2 depicts LSTM encoder and decoder for the model Architecture
The LSTM has layer, the first layer which is the input layer of the LSTM that receives the sequential data which represents user interaction in the e commerce platform. The hidden layer, that process the sequential input data has a cell state and hidden state, the cell state caries the information throughout the processing of the sequence allowing network to retain long term dependence and the hidden state capture current memory of the LTM and pass it to the next phase. The output layer of the LSTM network produces a representation based on processed sequential data. The output layer generates the probabilities for different products indicating their relevance to the user. The encoder module takes the sequence of user actions within a session as input and encodes this information into a fixed-length hidden state representation using a Long Short-Term Memory (LSTM) recurrent neural network. The LSTM unit’s ability to selectively remember and forget information allows it to effectively capture the temporal dependencies in the user’s browsing behavior. While the decoder module then uses the encoded session representation to generate a probability distribution over the next possible user actions. This allows the model to make personalized recommendations tailored to the user’s current context. The decoder also employs an LSTM structure to generate the output sequence. This allows the model to learn to predict the next action given the sequence of past actions.
Metric Evaluation
Personalized recommendation system was evaluated using Precision, Recall and Mean reciprocal rank (MRR) to understand the trained model on unseen dataset. These metrics provide insight into the model behaviors, to assess how well trained model generalizes. Evaluating the performance of a model help to assess the system performance in terms of how accurately relevant items are identified and ranking the recommendation in order of relevance.
Figure 3.2 Model Architecture
RESULT
Result and Finding
The evaluation of our model’s performance began with an assessment of training accuracy at different epochs 10, 20, and 30 are 0.8917, 0.8856, and 0.8893 respectively. Prediction made at epoch 10 has highest accuracy prediction value of 89.17% compared to others. When training the loss function at each epoch recorded 0.2791, 0.2803, and 0.2804. Epoch 10 has the lowest loss function value of 27.91 % which indicate better performance compare to other Epoch. This in depict in Figure A, B, C, D, E, F.
A
B
C
D
E
F
DISCUSSION
As the testing, it was deduces that the Precision and MRR improves while a light decrease in Recall is recorded as the number of epoch increase when the model is tested with unseen data. This provide insight to the training process that , the recommendation system becomes more precise in identifying relevant items and improves in ranking the recommendations, but may slightly sacrifice the ability to retrieve all relevant items (recall).
Initially registering at 89.17%, the model exhibited a progressive enhancement, closing at 88.93% by the thirty epoch. These trends are illustrated in Table 4.1
At Epoch 10, the recommendation system achieved an accuracy of 89.17% which means that approximately 89 out of 100 recommendations, the system accurately predicted recommended item relevant to the user’s preferences. This suggests that the system was able to learn the user’s preferences and tastes effectively during the initial training stages. At epoch 20 indicating a slight decrease compared to epoch 10. The model’s accuracy dropped to 88.56% indicating that the model started to learning the training data too much (over fit), and may not generalize well to new user preferences or the model is not capturing the nuances and patterns in the user data sufficiently(under fit). At epoch 30, the accuracy is 88.33%, showing a slight improvement from epoch 20 but still lower than the accuracy at epoch 10. The fluctuation in the accuracy could be a result of over fitting or under fitting.
The fluctuations in model performance, particularly in Precision and Recall highlight important dynamics in the model’s learning process while the recommendation system becomes more precise in identifying relevant items, this precision comes at a cost to Recall, suggesting a trade-off that needs careful management. These challeges can be addressed by exploring techniques such as cross-validation, regularization, or adjusting model complexity.
In addressing potential overfitting which occurs when the model becomes too tailored to the training data, capturing noise rather than the underlying patterns leading to decreased generalization on unseen data, techniques such as early stopping could be considederd , where training halts once performance on validation data begins to decline, or regularization methods that penalize overly complex models encouraging it to focus on more relevant patterns. Additionally, experimenting with different model architectures or tuning hyperparameters may improve the model’s ability to generalize better across unseen data.
On the other hand, if the model is unable to capture the complexities of user interactions and preferences indicating underfitting, it may not perform optimally even with sufficient data as the system fails to identify all relevant items. To address this, increasing model complexity by adding layers or units in neural networks or employing more sophisticated algorithms such as ensemble methods may be necessary. Ensuring that the model architecture aligns with the data’s complexity can improve its ability to generalize and capture nuanced patterns.The increase or decrease in the accuracy may be as result of various factors such as model architecture, the optimization algorithm and model hyper-parameter settings.
Table 4.1 Model Result
Metrics | Precision | Recall | MRR |
10 | 0.7488 | 0.8608 | 0.9428 |
20 | 0.7535 | 0.8195 | 0.9395 |
30 | 0.7621 | 0.8092 | 0.9422 |
Scalability of the model on larger datasets and user interaction data density
LSTM networks are designed to manage sequential data and can be trained on large datasets. The model employs an Encoder-Decoder architecture, which helps in managing long-term dependencies in user interactions. The scalability of the proposed session-based recommendation system, which utilizes Recurrent Neural Networks (RNN) with Long Short-Term Memory (LSTM) architectures, can be discussed in terms of its performance with larger datasets and user interaction data density. The model built on a dataset of 2 million user events for training, present both opportunities and challenges. The model ensures that it can handle a significant volume of data efficiently .As the dataset size increases, the model can benefit from richer patterns in user behavior and item characteristics, which enhances its predictive capabilities of the recommendation model. However, with larger datasets, computational demands also rise. Efficient training strategies, such as mini-batch processing and leveraging distributed computing resources, will be essential to maintain feasible training times and resource usage.
The dataset contains various types of user interactions, such as views, adds to cart, and purchases. The model benefits from having more information to learn from user behavior patterns which accurately capture individual preferences leading to improved recommendation quality in scenario where user interaction data is dense. Conversely, in scenarios with sparse interaction data that is infrequent user engagement, the model may face challenges such as cold-start problems, where new users or items lack sufficient interaction history. In addressing this, hybrid recommendation strategies that combine collaborative filtering with content-based approaches can be employed to help leverage additional data such as product features, user demographics.
CONCLUSION
This research investigates the performance of a recommendation system by analyzing Precision, Recall, and Mean Reciprocal Rank (MRR) metrics on a test dataset as the number of training epoch’s increases. The findings indicate that with more training epochs, the system’s Precision and MRR improve, demonstrating enhanced capability in accurately identifying and ranking relevant items. However, this improvement comes with a slight decrease in Recall, suggesting a marginal reduction in the system’s ability to retrieve all relevant items.
Initially, the system demonstrated a Precision of 89.17% at Epoch 10, indicating strong performance in accurately identifying relevant items. As training continued to Epoch 20, Precision slightly decreased to 88.56%, and by Epoch 30, it further adjusted to 88.33%. These fluctuations suggest that the model might be experiencing over fitting, where it becomes too specific to the training data, or under fitting, where it fails to capture complex patterns in user preferences. The variations in Precision, Recall, and MRR highlight the impact of training dynamics and model parameters on overall performance. ln conclusion, while the recommendation system shows improved precision and ranking with increased epochs, careful management of training parameters is essential to balance precision and recall and to avoid over fitting or under fitting.
REFERENCE
- Bu, X., Luo, K., & Zeng, Y. (2023). The Impact of Personalized Recommendation on Digital Satisfaction of Users. Lecture Notes in Education Psychology and Public Media, 3(1). https://doi.org/10.54254/2753-7048/3/2022523
- Castells, P., & Jannach, D. (2023) Recommender Systems: A Primer. http://arxiv.org/abs/2302.02579
- Dong, Y. (2023). Music Recommendation System Based on Machine Learning. In Highlights in Science, Engineering and Technology AMMMP (Vol. 2023).
- Erritali, M., Hssina, B., & Grota, A. (2021). Building Recommendation Systems Using the Algorithms KNN and SVD. International Journal of Recent Contributions from Engineering, Science & IT (IJES), 9(1). https://doi.org/10.3991/ijes.v9i1.20569
- H K, S., K Praghnya Iyer, Himaja K R, & Rahisha Pokharel. (2023). Personalized Movie Recommendation System. International Journal of Information Technology, Research and Applications, 2(1). https://doi.org/10.59461/ijitra.v2i1.40
- He, J., Yang, B., & Tian, Y. (2023). Session-based Recommendation with Preference Interaction. Journal of Computing and Electronic Information Management, 10(1). https://doi.org/10.54097/jceim.v10i1.5336
- Jia, B., Cao, J., Qian, S., Zhu, N., Dong, X., Zhang, L., Cheng, L., & Mo, L. (2023). SMONE: A Session-based Recommendation Model Based on Neighbor Sessions with Similar Probabilistic Intentions. ACM Transactions on Knowledge Discovery from Data, 17(8). https://doi.org/10.1145/3587099
- Li, D., & Gao, Q. (2021). Session Recommendation Model Based on Context-Aware and Gated Graph Neural Networks. Computational Intelligence and Neuroscience, 2021. https://doi.org/10.1155/2021/7266960
- Li, Z., Wang, X., Yang, C., Yao, L., McAuley, J., & Xu, G. (2023). Exploiting Explicit and Implicit Item relationships for Session-based Recommendation. WSDM 2023 – Proceedings of the 16th ACM International Conference on Web Search and Data Mining. https://doi.org/10.1145/3539597.3570432
- Lingmei Wu and Liqiang Zhang and Xing Zhang and Linli Jiang and Chunmei Wu SGT: Session-based Recommendation with GRU and Transformer, doi 30564/jcsr.v5i2.5610, issue 2, journal of Computer Science Research, volume 5, 2023,
- Liu, F., Cheng, Z., Zhu, L., Liu, C., & Nie, L. (2022). An Attribute-Aware Attentive GCN Model for Attribute Missing in Recommendation. IEEE Transactions on Knowledge and Data Engineering, 34(9). https://doi.org/10.1109/TKDE.2020.3040772
- Quadrana, M., Karatzoglou, A., Hidasi, B., & Cremonesi, P. (2017). Personalizing session-based recommendations with hierarchical recurrent neural networks. RecSys 2017 – Proceedings of the 11th ACM Conference on Recommender Systems. https://doi.org/10.1145/3109859.3109896
- Quadrana, M., Karatzoglou, A., Hidasi, B., & Cremonesi, P. (2017). Personalizing session-based recommendations with hierarchical recurrent neural networks. RecSys 2017 – Proceedings of the 11th ACM Conference on Recommender Systems. https://doi.org/10.1145/3109859.3109896
- Salampasis, M., Katsalis, A., Siomos, T., Delianidi, M., Tektonidis, D., Christantonis, K., Kaplanoglou, P., Karaveli, I., Bourlis, C., & Diamantaras, K. (2023). A Flexible Session-Based Recommender System for e-Commerce. Applied Sciences (Switzerland), 13(5). https://doi.org/10.3390/app13053347
- Shi Z, Wang X, Lipani A 2023 Self Contrastive Learning for Session-based Recommendation http://arxiv.org/abs/2306.01266
- Tan, Y. K., Xu, X., & Liu, Y. (2016). Improved Recurrent Neural Networks for Session-based Recommendations. http://arxiv.org/abs/1606.08117
- Wu, L., Zhang, L., Zhang, X., Jiang, L., & Wu, C. (2023). SGT: Session-based Recommendation with GRU and Transformer. Journal of Computer Science Research, 5(2). https://doi.org/10.30564/jcsr.v5i2.5610
- Wu, S., Tang, Y., Zhu, Y., Wang, L., Xie, X., & Tan, T. (2019). Session-based recommendation with graph neural networks. 33rd AAAI Conference on Artificial Intelligence, AAAI 2019, 31st Innovative Applications of Artificial Intelligence Conference, IAAI 2019 and the 9th AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019. https://doi.org/10.1609/aaai.v33i01.3301346
- Xiao lei Liu and Shaoshuai Li and Mingming Ha and Qiongxu Ma and Binfeng Wang and Yunan Zhao and Linxun Chen and Xiaobo Guo, Hyperbolic Contrastive Graph Representation Learning for Session-based Recommendation, journal IEEE Transactions on Knowledge and Data Engineering, 2023 doi 10.1109/TKDE.2023.3295063, issn 15582191,