Abstract
Understanding users' product preferences is essential to the efficacy of a recommendation system. Precision marketing leverages users' historical data to discern these preferences and recommends products that align with them. However, recent browsing and purchase records might better reflect current purchasing inclinations. Transformer-based recommendation systems have made strides in sequential recommendation tasks, but they often fall short in utilizing product image style information and shopping cart data effectively. In light of this, we propose Style4Rec, a transformer-based e-commerce recommendation system that harnesses style and shopping cart information to enhance existing transformer-based sequential product recommendation systems. Style4Rec represents a significant step forward in personalized e-commerce recommendations, outperforming benchmarks across various evaluation metrics. Style4Rec resulted in notable improvements: HR@5 increased from 0.681 to 0.735, NDCG@5 increased from 0.594 to 0.674, and MRR@5 increased from 0.559 to 0.654.
Introduction
Most sequential recommendation systems—which predict a user's next purchase based on their immediate history—rely almost exclusively on purchase records. However, this approach has two major blind spots. First, it often ignores visual aesthetics. Two products might belong to the same category, like "chairs," but possess vastly different styles, such as minimalist versus baroque. Existing models struggle to capture these visual preferences. Second, it overlooks intent signals. Items added to a shopping cart but not purchased are strong indicators of interest, yet they are frequently discarded in favor of "cleaner" purchase-only data. Style4Rec tackles the challenge of effectively fusing these heterogeneous data types—images and cart interactions—into a high-performance Transformer architecture.
Methodology
The Style4Rec architecture consists of a multi-layer Transformer encoder enhanced by a specialized embedding pipeline designed to capture both visual style and user intent.
Neural Style Extraction
Instead of using standard object detection, which merely identifies what an item is, the authors utilize a modified Neural Style Transfer algorithm. They extract feature maps from a pre-trained VGG-19 network and calculate Gram matrices. These matrices represent the correlations between different features, effectively capturing the "texture" or "style" of the product. To maintain model efficiency, max-pooling is applied to these matrices to create compact style embeddings.
Shopping Cart Integration
The model differentiates between "purchase sessions" and "shopping cart sessions." Cart data is used during the training and validation phases to help the model learn broader user interests. However, it is excluded during testing to ensure the model is evaluated on its ability to predict actual real-world purchases, preventing data leakage from the target signal.
Hybrid Embeddings
The final input to the Transformer is a concatenation of three elements: learnable product embeddings, sinusoidal positional embeddings to track sequence order, and the newly generated style embeddings. This allows the model to process the sequence of interactions with a rich understanding of both the items' identity and their visual appeal.
Experimental Results
The researchers utilized a real-world dataset from a partner e-commerce company specializing in household goods, containing approximately 490,000 interactions across 38,000 user sessions. Style4Rec demonstrated substantial improvements over established benchmarks like BERT4Rec and SASRec across all major metrics:
- Hit Ratio (HR@5): Increased from 0.681 (SASRec) to 0.735.
- NDCG@5: Improved from 0.594 to 0.674.
- MRR@5: Rose from 0.559 to 0.654.
Ablation studies confirmed that while adding style embeddings or shopping cart data individually helped, the combination of both yielded the highest performance gains, proving that visual and intent signals are complementary.
Conclusion
Style4Rec presents a significant step forward in personalized e-commerce recommendation systems. By moving beyond simple purchase history to include visual style and cart interactions, the model achieves a more nuanced understanding of user preference. Future work may involve incorporating precise timestamps for time-aware modeling and testing the architecture on broader public benchmarks to further validate its generalizability.
Summary updated