Next Article in Journal
Compact Tri-Band Bandpass Filter with Wide Upper Stopband Based on Spoof Surface Plasmon Polaritons and Open-/Short-Circuited Stubs
Previous Article in Journal
Two-Stage Isolated Bidirectional DC-DC Converter with Low Profile and Double Heat Sink for Battery Charging/Discharging System
Previous Article in Special Issue
Comparison of Medical Opinions About the Decrease in Autopsies in Mexican Hospitals Using Data Mining
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Consumer Transactions Simulation Through Generative Adversarial Networks Under Stock Constraints in Large-Scale Retail

1
Systems Research Institute, Polish Academy of Sciences ul. Newelska 6, 01-447 Warsaw, Poland
2
Faculty of Physics and Applied Computer Science, AGH University of Science and Technology al. Mickiewicza 30, 30-059 Kraków, Poland
3
Faculty of Mathematics and Information Science, Warsaw University of Technology, 01-447 Warsaw, Poland
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(2), 284; https://doi.org/10.3390/electronics14020284
Submission received: 22 October 2024 / Revised: 3 January 2025 / Accepted: 10 January 2025 / Published: 12 January 2025
(This article belongs to the Special Issue Data Retrieval and Data Mining)

Abstract

:
In the rapidly evolving domain of large-scale retail data systems, envisioning and simulating future consumer transactions has become a crucial area of interest. It offers significant potential to fortify demand forecasting and fine-tune inventory management. This paper presents an innovative application of Generative Adversarial Networks (GANs) to generate synthetic retail transaction data, specifically focusing on a novel system architecture that combines consumer behavior modeling with stock-keeping unit (SKU) availability constraints to address real-world assortment optimization challenges. We diverge from conventional methodologies by integrating SKU data into our GAN architecture and using more sophisticated embedding methods (e.g., hyper-graphs). This design choice enables our system to generate not only simulated consumer purchase behaviors but also reflects the dynamic interplay between consumer behavior and SKU availability—an aspect often overlooked, among others, because of data scarcity in legacy retail simulation models. Our GAN model generates transactions under stock constraints, pioneering a resourceful experimental system with practical implications for real-world retail operation and strategy. Preliminary results demonstrate enhanced realism in simulated transactions measured by comparing generated items with real ones using methods employed earlier in related studies. This underscores the potential for more accurate predictive modeling.

1. Introduction

Assortment planning, a cornerstone of retail operations [1,2] for many large-scale chains, is fraught with complexities Rooderkerk and Kök [3]. Determining the optimal mix of products a retailer should offer involves navigating a myriad of constraints, from limited display space to procurement budgets and strategic vendor decisions. The foundation for these decisions lies in merchandise categories, groups of stock-keeping units (SKUs) (a unique code or identifier assigned to a specific product to track inventory, sales, and manage stock levels) perceived as substitutes by customers Goyal et al. [4]. These decisions span from long-term strategic choices, such as defining merchandise variety, to tactical considerations like inventory levels and pricing [5].
In the complex and dynamic field of retail, the ability to accurately model and understand customer behavior is crucial for optimizing operations and enhancing the customer experience, which further complicates the landscape [6]. While some consumers enter a store with a specific product in mind, others are influenced by the retailer’s displayed SKUs, ads, and discounts. Thus, a retailer’s sales volume becomes a function of demand, customer preferences, and strategic and tactical decisions [7]. Despite the wealth of consumer transaction data, many retailers still lean heavily on qualitative judgments. However, the tide is turning, with the industry gradually embracing a more data-driven approach [8].

1.1. Problem Statement

Understanding and simulating customer behavior is paramount for optimizing operations and enhancing customer experience in the contemporary large-scale retail landscape. Companies gather business-critical data in consumer relationship management (CRM) [9] and enterprise resource planning (ERP) systems [10] to ensure smooth operations, better compliance, and effective data governance. Effectively modeling collected data for tangible commercial impact presents several challenges we aim to address with our research: data scarcity, versatility, and privacy.
Data Scarcity and Versatility: While vast amounts of transactional data are available through loyalty programs, more than half of consumers can be inactive members calling out reward programs and irrelevant communication as primary reasons for inactivity [11] This creates a fundamental difficulty in consumer behavior analysis as the collected data cannot be generalized through repeated purchase patterns and are limited to the most loyal customers, enabling their identification via point-of-sales transactional systems. One of the recent studies [12] also finds that are least loyal to retailers and tend to choose them more wisely than any other preceding generations [13], which also sets an additional challenge for retail in the long-term and forces them to focus substantially on more advanced and out-of-the-box analytical methods.
Privacy Considerations: As retailers increasingly rely on data-driven strategies to optimize operations and customer experience, the ethical and legal implications of data privacy become more pronounced. Collecting and analyzing consumer data, especially through CRM and ERP systems [14] often involve sensitive information such as personal identifiers, purchase history, and payment details. While these data are invaluable for analytics and personalization, it poses significant risks if mishandled or subjected to unauthorized access. According to a recent study on data privacy in the era of big data [15], there is a growing concern about the potential misuse of such data, including unauthorized resale, identity theft, and other forms of exploitation. This necessitates the implementation of robust data governance frameworks that comply with privacy regulations, such as the General Data Protection Regulation (GDPR) and European Parliament and Council of the European Union [16], and incorporate advanced cryptographic and anonymization techniques to safeguard consumer privacy. GAN models have been used to generate synthetic data, ensuring privacy-preserving downstream tasks [17]. The challenge lies in balancing the utility of the data for analytics purposes with the imperative to protect consumer privacy, a concern we aim to address in our research.
In light of these complexities and rapidly increasing data volumes, there is a pressing need for advanced research in deep learning for assortment management. While retail transactions provide valuable insights, they merely scratch the surface of the myriad of possible transaction combinations. Delving deeper into this expansive realm of potential transactions can reveal pivotal insights into aspects like product demand trends, shifting consumer inclinations, pricing dynamics, and variations tied to seasons in a previously undiscovered way. These data, encompassing transactional details, customer demographics, and product specifications, empower retailers to enhance customer service. Deep learning, with its ability to process vast amounts of data and discern patterns that might be imperceptible to traditional algorithms, offers a promising avenue for tackling the multifaceted challenges of assortment planning. The sheer volume and granularity of retail data and the dynamic nature of consumer preferences make it a prime candidate for applying deep learning techniques. By leveraging deep learning, retailers can potentially achieve more accurate demand forecasts [18] optimize inventory levels in real-time, and tailor assortments to individual consumer preferences, thereby driving increased sales and profitability [19].
We believe our contribution—delivering a framework of transactional data generation under stock constraints—unlocks additional opportunities in assortment optimization and dynamic consumer behavior modeling. Existing methodologies [20] underline the intricate nature of the assortment optimization problem. Its depth, focusing on the product mix within a category, encapsulates the challenge of balancing the introduction of new products against the potential cannibalization of sales from existing products [21]. Also, the sequential nature of purchases requires the consideration of evolving behaviors and enduring patterns, adding layers of intricacy to modeling. Legacy approaches applied in traditional retail cannot ensure the agility to address the pace of changing preferences [22]. Moreover, despite the extensive volume of transactional data, individual customer interactions with the vast array of products and broad assortments often result in sparse datasets [23]. It renders many related tasks computationally intractable, highlighting the need for more robust modeling methodologies.

1.2. Objectives and Contributions

Our innovative methodology authentically simulates sequences of customer product baskets over time, leveraging a comprehensive dataset of customer transactions. Our approach can simulate plausible individual customer transactions, offering a holistic view of buyers’ behaviors. This capability paves the way for novel applications, from predicting future purchases to facilitating research access to simulated datasets that mirror restricted original data due to privacy constraints. We hypothesize that this solution can be beneficial in estimating demand transference and its incrementality—we discuss these notions in more detail in Section 5.
The primary objective of our research and the described study is to advance the field of customer modeling by introducing innovative techniques for generating realistic retail transactions under stock availability limitations. We aim to bridge the gaps between traditional methods, ongoing research, and the evolving needs of the retail sector, ensuring that the simulated data are authentic and reflective of real-world consumer behaviors. Our key contributions are as follows:
  • Enhanced Product and Consumer Representation: We introduce an innovative approach of combining SKUs with transactional data, performing a comparative analysis of product embeddings using both the classic word2vec method [24] and the advanced hyper-graph model [25]. Similarly, our research contrasts consumer embeddings generated through a recurrent neural network (RNN) [26] with those produced by Cleora, offering a comprehensive perspective on representation efficacy.
  • Innovative Use of GAN with Stocks Data: Combined with stock data availability, our adoption of the classic GAN architecture for generative modeling pushes the research in the field forward, ensuring that the generated data closely mirrors real-world transactional patterns. To the best of our knowledge, variations in stock data representation (weighted and unweighted embeddings) have been tested for the first time in our research to uncover the impact on generated transaction accuracy in the frame of the GAN architecture.
Beyond theoretical contributions, our research has tangible, practical implications for the retail sector. By generating authentic transactional data, retailers can gain actionable insights, optimize inventory management, and enhance customer experiences.

2. Related Work

While GANs were initially popularized for image generation tasks, their applications have expanded across various domains. For instance, they have been used for super-resolution tasks to generate photo-realistic images at large upscaling factors [27]. In feature learning, Context Encoders utilize GANs for inpainting, where the network learns to fill in missing parts of images conditioned on their surroundings [28]. Moreover, GANs have been employed for domain adaptation tasks, effectively bridging the domain gap between different data distributions [29]. GANs have also been successfully employed in various medical [30] and financial applications [31,32]—extending beyond their traditional visual data domain.
To our knowledge, there are two most relevant and practical applications of GANs in online [33] and offline [34] retail. Both studies use product and customer embeddings to capture the semantic and sequential relationships between products and customers. Product embeddings were derived from textual descriptions of products using a pre-trained language model, while customer embeddings were learned from transactional data using an autoencoder. The authors then trained a conditional GAN to generate a basket of products for a given customer and week and an LSTM to update the customer’s state after each basket. This way, they could sample over a distribution of a customer’s future sequence of baskets, which could vary depending on the customer’s preferences, needs, and behavior. The authors evaluated their method on a real-world retail dataset. They showed that it could produce baskets similar to real baskets in product features, basket sizes, and sequential patterns. They also showed that the generated baskets were hard to distinguish from the real baskets by a classifier, indicating that their method could generate realistic and diverse sequences of transactions.
Our work extends the above approaches by incorporating stock data availability into the generation process. Stock data availability refers to the information about the quantity of products in the store or warehouse, which can affect the customer’s purchase decisions and the retailer’s operations planning. We acknowledge the scarcity, quality, and availability challenges of these data among retailers; however, ignoring stock data availability can lead to unrealistic or suboptimal sequences of transactions, as customers may not be able to buy the products they want or need, or retailers may not be able to replenish the products in time. Therefore, given that we possess a rare proprietary dataset with detailed stock information through a commercial partnership, we propose to modify the conditional GAN to consider the stock data availability when generating and updating the baskets. We hypothesize that this will result in more accurate and valuable sequences of transactions for retail analytics. Another more broadly related study addresses data generation aspects introducing CTAB-GAN [35] for better privacy preservability. Our research echoes the considerations described by authors with a more specific narrowed retail industry application.

3. Proposed Approach

The methodology presented in this section aims to bridge the gap between theoretical advancements in machine learning and practical challenges in offline retail analytics. We employ Generative Adversarial Networks (GANs) as a foundational tool for simulating customer behavior, extending their capabilities to accommodate real-world constraints such as SKU stock limitations.

3.1. Overview of Generative Adversarial Networks

Generative Adversarial Networks (GANs) [36] are acknowledged for their ability to generate data closely resembling real-world distributions. The networks consist of two neural networks, the Generator and the Discriminator, trained in a min-max adversarial setting. The Generator aims to produce synthetic data, while the Discriminator’s role is to distinguish between real and generated data. The training process involves a game-theoretic approach where both networks are optimized until the Generator produces data that the Discriminator can hardly distinguish from real data.
Further developed, Wasserstein GAN (WGAN) and its modification with gradient penalty (WGAN-GP) address the issue of training instability commonly observed in standard GANs by adopting the Wasserstein distance as the loss function. This modification leads to more stable training and higher-quality generated samples [37].
min G max D ( E x ~ p d a t a [ l o g D ( x ) ] + E z ~ p z [ l o g ( 1 D ( G ( z ) ) ) ] )
where we adopt the following notation (also in all our equations): G—the Generator network, responsible for generating synthetic data that aims to mimic the real data distribution; D—the Discriminator network, responsible for distinguishing between real and synthetic (generated) data; x—a sample from the real data distribution; and z—a sample from the latent space or noise distribution.
Wasserstein GAN (WGAN): A significant advancement in the GAN landscape is the introduction of Wasserstein GAN (WGAN). WGANs address the issue of training instability, commonly observed in standard GANs, by adopting the Wasserstein distance as the loss function. This modification leads to more stable training and higher-quality generated samples [37].
min G max D ( E x ~ p d a t a [ D ( x ) ] E z ~ p z [ D ( G ( z ) ) ] )
In WGAN, the Discriminator (often referred to as the “Critic” in this context) is not restricted to output probabilities, allowing for a broader range of output values.
WGAN with Gradient Penalty (WGAN-GP): Building upon WGAN, the WGAN-GP introduces a gradient penalty term to the loss function. This addition further stabilizes the training process and enables the use of more complex architectures without the need for extensive hyperparameter tuning [37].
min G max D ( E x ~ p d a t a [ D ( x ) ] E z ~ p z [ D ( G ( z ) ) ] + λ E x ^ ~ p x ^ [ ( x ^ D ( x ^ ) 2 1 ) 2 ] )
where λ is the penalty coefficient and x ^ is sampled uniformly along a straight line between a pair of real and generated data points.
Unlike the above classical architectures, we leverage the conditional and controllable GAN approach demonstrated in Section 4.2, integrating a stock representation. Our target objective function used to establish generative adversarial network looks as follows:
min G max D ( E x ~ p d a t a [ D ( x ) ] E p , s [ D ( G ( p , s ) ) ] + λ E x ^ ~ p x ^ [ ( x ^ D ( x ^ ) 2 1 ) 2 ] )
where we adopt the following notation:
  • G—the Generator network, responsible for generating synthetic data that aims to mimic the real data distribution;
  • D—the Discriminator network, responsible for distinguishing between real and synthetic (generated) data;
  • x—a sample from the real data distribution; p—product embedding, s—stock embedding, λ—the penalty coefficient, and x ^ —sampled uniformly along a straight line between a pair of real and generated data points.
In this way, we secured the possibility of the simulation of various stock scenarios that are crucial for retailers’ category planning and assortment management decisions. For example, when a retailer removes a product from the assortment, it will result in a different stock embedding—a different set of transactions will be generated by the network under new stock conditions.

3.2. Features and Representations

The proposed GAN model leverages multiple types of embeddings and features, including stock, customer, and product embeddings. We aim to compare different ways of representing products, customers, and stocks to observe changes in model performance and uncover the most efficient combination. Therefore, we engineer the following features and representations:
  • Product: Similarly to the related research we referred to in Section 2, we generate a simple representation using word2vec but also leverage [25] as a potentially more advanced alternative that has proven to be effective in one of our previous studies [removed for blind review] in a comparable setting. Unlike word2vec, we use Cleora to generate embeddings not only using product names but also including the information about product interactions within purchase baskets.
  • Customer: We use RNN architecture that has been used by other researchers for similar applications [38] to extract consumer representation from the last layer of the network’s hidden layer. As a comparison, we use the abovementioned Cleora algorithm with the relevant input parameters to enable both product and consumer embedding outputs.
  • Dates: Retail data often exhibit strong seasonal patterns. By using cyclic features for dates, our model can capture these patterns effectively, allowing for a more accurate and realistic transaction generation. Hence, we extract cyclic features from the transaction dates, such as the day of the week, the day of the month, and the month itself.
  • Price: We transform unit price using a natural logarithm to reduce the dynamic range of a variable since some values are significantly larger than others. The variability of prices is expected when handling a wide range of assortments in large-scale retail.
  • Stocks: The generation of stock embeddings is a two-step process involving the unweighted and weighted aggregation of product embeddings (we use Cleora-generated embeddings that hold more information than the ones generated with word2vec). Firstly, for each unique combination of site and date, a subset of product indices with the corresponding product embeddings and quantities is extracted. For unweighted representation, the mean of the product embeddings is computed, whereas for weighted representation, a weighted average of the product embeddings is computed using the quantities as weights.
The lengths of product, customer, dates, and price are 1024, 256, 6, and 1, respectively; this results in a 1287-length transnational item representation. Since we use product embeddings to compute stock representation, it has the same length—1024. All features and representations are scaled to the range [−1, 1].
Cleora was chosen for its scalability and effectiveness in generating embeddings with contextual product interactions. Compared to methods like BERT or static embeddings, Cleora has shown a higher efficiency in transaction modeling in prior research [39]. Similarly, RNN was selected for consumer embeddings due to its ability to capture sequential purchase patterns, offering advantages over autoencoders for temporal tasks.

4. Experiments and Results

The objective of this section is to rigorously evaluate the efficacy of the proposed GAN model in generating realistic transaction data that adheres to real-world constraints. We employ a comprehensive experimental setup, leveraging proprietary data and employing multiple performance metrics to assess the quality of the generated transactions.

4.1. Dataset

The dataset used in this research is provided by one of the largest retailers in Europe, holding a significant share of the domestic market. This unique dataset offers a rare opportunity to study consumer behavior and retail operations at scale. The data encompasses various aspects of retail transactions, including but not limited to customers, products (Product ID, Product Name, Size, and other metadata), transactional details (e.g., ID, price, quantity, date, etc.), stores (Store ID, City, and other metadata), and stocks (availability and quantity of a product per day per store).
The dataset is particularly valuable for several reasons. Its scale allows for a robust statistical analysis and the training of complex machine learning models like GANs. The diversity means it is likely to be representative of broader shopping behaviors in Europe, thereby increasing the generalizability of the research findings. The dataset includes fine-grained details, such as product embeddings, transaction dates, and unit prices, which are crucial for the nuanced understanding and modeling of consumer behavior. Sourced from an industry leader, the dataset reflects real-world retail operations, making the research findings directly applicable to practical challenges in retail management.
The data offer a broad temporal and spatial scope as they were collected from 986 distinct retail sites over 58 days, or approximately eight weeks. It encompasses an impressive 2,061,078 customers. The dataset is particularly rich in transactional data, containing 31,183,932 transactions. It records an average of approximately 3,464,881 transactions per week. This high volume of transactional data is crucial for training sophisticated machine learning models, such as the Generative Adversarial Network (GAN) model proposed in this study. Each transaction involves an average of nearly 14 products, of which around 11 are unique. This diversity is further emphasized by the fact that each customer purchases an average of approximately 106 unique products, making the dataset highly suitable for studying assortment planning. About half (1,049,775) of the repeated customers in our training dataset have engaged in transactions at multiple sites. This high customer loyalty indicates recurring purchase patterns essential for accurate demand forecasting. Moreover, the dataset includes 29,393,436 transactions involving more than two products, and 2,055,421 transactions involving at least five distinct products, in a single transaction, while the overall assortment of the retailer contains more than 55,000 unique SKUs. These statistics underscore the complexity of consumer buying behavior, which is a central focus of this research. To enhance the dataset’s reliability, pre-processing steps were applied, including the deduplication, normalization, and imputation of missing values. These steps are crucial for ensuring robust embeddings and a consistent performance during model training.
In summary, the dataset’s extensive scale, diversity, and granularity make it an exceptional resource for investigating the challenges and opportunities in retail operations, particularly in assortment planning and demand forecasting. Given its real-world relevance and the scale at which the data have been collected, the research findings are expected to have direct and significant implications for the retail industry, especially for large-scale retailers.

4.2. Model Design and Training

We experimented with various architectures and configurations of our GAN model. There are two observations worth noting, based solely on the architectural experimentation: WGAN-GP significantly increases the stability of training even in the first epochs. At the same time, slightly different architectures for Generator and Discriminator help to avoid mode collapse at the initial training stages (even when a gradient penalty is not applied). The final architecture (Figure 1) we used in this study is described below. Hyperparameter values were selected based on a grid search over learning rates, batch sizes, and hidden layer dimensions. The final configuration prioritized stability (e.g., through WGAN-GP) and performance, as shown in Figure 2.
The Generator is a neural network comprising four fully connected layers with the following dimensions:
  • Layer I: 2048 input units (product and stock embeddings) to 1024 output units, followed by a LeakyReLU (https://pytorch.org/docs/stable/generated/torch.nn.LeakyReLU.html, accessed on 1 April 2024) activation.
  • Layer II: 1024 to 512 units, followed by a LeakyReLU activation.
  • Layer III: 512 to 256 units, followed by a LeakyReLU activation.
  • Output Layer: 256 to 1287 units, followed by a Tanh activation.
The Discriminator also consists of a neural network with three fully connected layers:
  • Layer I: 1287 input units to 512 output units, followed by a LeakyReLU activation and a dropout layer.
  • Layer II: 512 to 128 units, followed by a LeakyReLU activation and another dropout layer.
  • Output Layer: 128 to 1 unit, followed by a sigmoid activation.
The generator’s loss function is a weighted combination of the GAN loss and a reconstruction loss (Equation (5)). The GAN loss aims to deceive the discriminator, while the reconstruction loss ensures that the generated embeddings are close to the real product embeddings.
L R = 1 N i = 1 N e r e a l , i e g e n , i 2 2
where N—number of samples, ereal,i—real product embedding for the ith sample, and egen,i—generated product embedding for the ith sample.
Two different optimization algorithms are employed for training the Generator and Discriminator: the Generator uses the with a learning rate of 0.0002 [40] and β values of (0.5, 0.999), and the Discriminator uses the RMSprop optimizer [41] with a learning rate of 0.0002. The Discriminator is trained five times for each Generator update. The Discriminator loss is computed using real and fake orders and a gradient penalty term to enforce the Lipschitz constraint [42].
The training process of the proposed Generative Adversarial Network (GAN) model is formalized as Algorithm 1 to provide a structured and easily interpretable overview of the vital computational steps. Although we cannot publish a full PyTorch implementation because of the proprietary nature of collaboration and data sourcing, by delineating the process in this manner, we aim to offer a transparent and replicable framework that can be readily understood and implemented by researchers and practitioners alike. The training, evaluation, and inference processes were performed using NVIDIA DGX A100 40 GB.
Algorithm 1. Training Process of the Proposed GAN Model
1: Input: Training dataset, batch size, number of epochs
2: Initialize: Generator G, Discriminator D
3: Initialize: Optimizers optimizer_G, optimizer_D
4: for epoch in 1, 2, …, epochs do
5:        for mini-batch in DataLoader do
6:              Extract real orders and stock embeddings
7:             Extract product embeddings from real orders
8:              Move all data to computation device (GPU)
9:                 for iteration in 1, 2, …, ncritic do
10:                    Generate fake orders using G
11:      Compute Discriminator loss LD
12:      Update D using optimizer_D
13:              Generate fake orders using G
14:              Compute Generator loss LG
15:                Update G using optimizer_G

4.3. Performance Metrics

Evaluating the performance of Generative Adversarial Networks (GANs) is challenging, especially in non-visual domains. The limitations of GANs in discriminative tasks and their sensitivity to domain shifts make the evaluation process intricate [43]. To address these challenges, we employ a multi-faceted approach to assess the quality of the generated transactions using the following metrics.
Jensen–Shannon Divergence (JSD): A symmetric measure of the similarity between two probability distributions. It is particularly useful for comparing the distributions of real and generated transactions in our context. The JSD is the average of two Kullback–Leibler divergences, one for P and one for Q, the probability distributions of real and generated transactions, respectively.
J S D ( P , Q ) = 1 2 D K L ( P M ) + 1 2 D K L ( Q M )
where
M = 1 2 ( P + Q ) ,   D K L ( P Q ) = x P ( x ) l o g P ( x ) Q ( x )
In retail transactions, the tail behavior of the distribution can be crucial. JSD is sensitive to differences in the tails of the distributions, making it a suitable metric for our application. A lower JSD value means that the two distributions are more similar in an information-theoretic sense.
Earth Mover’s Distance (EMD): Measures the distance between the probability distributions of real and generated transactions. Similarly to the above, a lower EMD value indicates that less “work” is required to transform one distribution into another, suggesting that the two distributions are more similar.
E M D ( P , Q ) = i n f γ ϵ ( P , Q )   X × Y   d ( x , y ) d γ ( x , y )
Classification Accuracy (Acc): Utilizes a simple binary classifier to distinguish between real and fake samples in the downstream task. We follow the same approach used previously in [34] to create a classifier different from the one used to train GAN. An accuracy of around 0.5 would mean that the classifier cannot distinguish a real transaction representation from a generated one.
By employing these metrics, we aim to provide a comprehensive and robust evaluation of the quality of transactions generated by our GAN model. Each metric offers a unique perspective: EMD focuses on the overall distribution, classification accuracy provides an operational view, and JSD gives a balanced and bounded measure. It is worth highlighting that both EMD and JSD are used to measure the similarity between two probability distributions. Still, they have different properties and sensitivities that make them suitable for diverse types of analyses. EMD is useful for understanding the overall shape and spread of the distribution, including the impact of outliers, which could represent high-value transactions, while JSD compares the core behaviors of customer transactions, especially when outliers are less of a concern. Together, they allow for a nuanced understanding of the model’s performance.

4.4. Results and Discussion

In this section, we present the results of our experiments designed to evaluate the efficacy of various GAN models in generating plausible retail transactions. The models were trained using different combinations of consumer and product embeddings, with and without including stock information, including its weighting variation. Our experiments demonstrate that Cleora outperforms word2vec-based embeddings in EMD and JSD metrics, emphasizing its suitability for large-scale retail datasets.
In evaluating our GAN models, summarized in Table 1, we observed significant performance variations based on the type of embeddings and the inclusion of stock information. The EMD and JSD metrics were lower for models trained with weighted stocks, indicating a closer match to the real data distribution. Particularly, models utilizing RNN for consumer embeddings and Cleora for product embeddings achieved the best results with EMD and JSD values of 0.16 and 0.07, respectively. These models also achieved a classification accuracy closest to 0.5, which is considered ideal in the context of GANs as it signifies that the generated transactions are nearly indistinguishable from the real ones. In comparison to [33] which used LSTMs, our GAN-based approach incorporating stock constraints achieved a superior alignment with real-world distributions (lower EMD and JSD). Similarly, our method improved that of [34] by capturing assortment dynamics.
When comparing these results to models trained without stocks, the importance of incorporating stock information becomes evident. Models without stock information had higher EMD and JSD values, indicating a greater divergence from the real data distribution. Moreover, their classification accuracy was far from the ideal 0.5 mark, making them more easily distinguishable from real transactions. These findings strongly support our hypothesis that weighted stocks provide more informative embeddings, thereby enhancing the performance of GANs in generating realistic retail transactions.

5. Conclusions and Future Work

In this study, we have presented a novel approach to generating realistic retail transactions using GANs. Our work is distinguished by incorporating stock information into the model, a feature often overlooked in previous research. Through the evaluation involving multiple metrics (i.e., EMD, JSD, Acc), we demonstrated that including weighted stock information significantly enhances the quality of the generated transactions. Our research contributes to the growing body of work on applying deep learning techniques in the retail industry, offering a new avenue for enhancing the realism and utility of generated transaction data. This framework can simulate transaction scenarios under varying inventory levels, aiding in demand impact forecasting, pricing strategies, and inventory optimization for large retailers. While this research used proprietary data, future work could explore public datasets like Instacart or Dunnhumby to validate findings as soon as stock data become available in opensource. The modular design of our approach ensures its adaptability to different datasets and retail contexts.
The current research serves as a foundational step for employing deep learning in assortment optimization within large-scale retail—our approach leverages Cleora embeddings and GPU training, allowing its scalability to millions of transactions. Our findings pave the way for several future research directions, which could extend this to distributed systems for even larger datasets or varying hardware configurations. One immediate extension is the development of a transferable demand model that can adapt to new data quickly, offering a scalable solution for large retailers’ category management efforts [44]. While the notion of transferable demand was studied earlier with a statistical approach [45] our goal is to create a more robust deep learning model that not only adapts to changing customer preferences but can also be easily transferred to different retail settings or scaled up to accommodate larger datasets. This would involve incorporating more advanced machine learning techniques and perhaps integrating other forms of data to create a more holistic model. While our model captures SKU constraints effectively, future work could address the sparsity of datasets with advanced GAN variants like CTAB-GAN or improved embedding techniques. Comparisons to state-of-the-art methods further validate our approach’s robustness. The potential of the GAN model in this study also suggests that other neural network architectures could be explored for similar applications. Finally, the ultimate validation of these models would come from their deployment in real-world retail settings. By focusing on these areas, future work can offer more robust and effective solutions for assortment optimization, contributing to the broader application of deep learning and computer science in complex industrial problems.

Author Contributions

Research: S.T., A.W. and S.Ł.; Implementation: S.T.; Experiment design: S.T., A.W. and S.Ł.; Writing: S.T., A.W. and S.Ł.; Editing: S.T., A.W. and S.Ł. All authors have read and agreed to the published version of the manuscript.

Funding

A.W. was partially funded by the European Union under the Horizon Europe grant OMINO (grant no. 101086321) and by the Polish Ministry of Education and Science within the framework of the program titled International Projects Co-Financed (However, the views and opinions expressed are those of the authors only and do not necessarily reflect those of the European Union or the European Research Executive Agency. Neither the European Union nor the European Research Executive Agency can be held responsible for them). A.W. was also co-financed with funds from the Polish Ministry of Education and Science under the programme entitled International Co-Financed Projects. This research was also carried out with the support of the Faculty of Mathematics and Information Science at Warsaw University of Technology, its Laboratory of Bioinformatics and Computational Genomics, and the High-Performance Computing Center.

Data Availability Statement

The dataset used in this study was provided by a commercial partner and contains proprietary retail transaction data, including detailed stock information. Due to confidentiality agreements and the sensitive nature of the data, it is not publicly available. This dataset’s inclusion of accurate stock information is a unique feature that underpins the novelty of our research. While public datasets, such as the Instacart Online Grocery Shopping dataset or the Dunnhumby dataset, may serve as benchmarks for similar experiments, they lack the detailed stock data necessary to replicate the full scope of our work. Researchers interested in adapting the methodology to alternative datasets are encouraged to contact the authors for further discussion.

Acknowledgments

This work was supported by a computational grant received from the Faculty of Mathematics and Information Science from the Warsaw University of Technology, allowing us to perform modeling using the HPC cluster.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Bahng, Y.; Rogers, F.T.; Kincade, D.H. Assortment planning for retail buying, retail store operations, and firm performance. J. Distrib. Sci. 2018, 16, 15–27. [Google Scholar] [CrossRef]
  2. Kök, A.G.; Fisher, M.L.; Vaidyanathan, R. Assortment planning: Review of literature and industry practice. In Retail Supply Chain Management: Quantitative Models and Empirical Studies; Springer: Boston, MA, USA, 2015; pp. 175–236. [Google Scholar]
  3. Rooderkerk, R.P.; Kök, A.G. Omnichannel assortment planning. In Operations in an Omnichannel World; Springer: Cham/Geneva, Switzerland, 2019; pp. 51–86. [Google Scholar]
  4. Goyal, V.; Levi, R.; Segev, D. Near-optimal algorithms for the assortment planning problem under dynamic substitution and stochastic demand. Oper. Res. 2016, 64, 219–235. [Google Scholar] [CrossRef]
  5. Méndez-Díaz, I.; Miranda-Bront, J.J.; Vulcano, G.; Zabala, P. A branch-and-cut algorithm for the latent class logit assortment problem. Electron. Notes Discret. Math. 2010, 36, 383–390. [Google Scholar] [CrossRef]
  6. Nazir, S.; Khadim, S.; Asadullah, M.A.; Syed, N. Exploring the influence of artificial intelligence technology on consumer repurchase intention: The mediation and moderation approach. Technol. Soc. 2023, 72, 102190. [Google Scholar] [CrossRef]
  7. Gallego, G.; Topaloglu, H. Revenue Management and Pricing Analytics; Springer Nature: Dordrecht, The Netherlands, 2019; Volume 209. [Google Scholar]
  8. Müller, S.; Huber, J.; Fleischmann, M.; Stuckenschmidt, H. Data-Driven Inventory Management Under Customer Substitution. 2020. SSRN 3624026. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3624026 (accessed on 5 March 2024).
  9. Anshari, M.; Almunawar, M.N.; Lim, S.A.; Al-Mudimigh, A. Customer relationship management and big data enabled: Personalization & customization of services. Appl. Comput. Inform. 2019, 15, 94–101. [Google Scholar]
  10. Adjie Eryadi, R.; Nizar Hidayanto, A. Critical success factors for business intelligence implementation in an enterprise resource planning system environment using dematel: A case study at a cement manufacture company in Indonesia. J. Inf. Technol. Manag. 2020, 12, 67–85. [Google Scholar]
  11. Alshurideh, M.; Gasaymeh, A.; Ahmed, G.; Alzoubi, H.; Kurd, B. Loyalty program effectiveness: Theoretical reviews and practical proofs. Uncertain Supply Chain Manag. 2020, 8, 599–612. [Google Scholar] [CrossRef]
  12. OxfordDictionaries. Gen z. 2023. Available online: https://www.oed.com/dictionary/gen-z_n (accessed on 3 January 2025).
  13. Thangavel, P.; Pathak, P.; Chandra, B. Consumer decision-making style of gen z: A generational cohort analysis. Glob. Bus. Rev. 2022, 23, 710–728. [Google Scholar] [CrossRef]
  14. Stankov, I.; Tsochev, G. Vulnerability and protection of business management systems: Threats and challenges. Probl. Eng. Cybern. Robot. 2020, 72, 29–40. [Google Scholar] [CrossRef]
  15. Robertson, V.H. Excessive data collection: Privacy considerations and abuse of dominance in the era of big data. Common Mark. Law Rev. 2020, 57, 161–190. [Google Scholar] [CrossRef]
  16. European Parliament and Council of the European Union. Regulation (EU) 2016/679 of the European Parliament and of the Council. Available online: https://data.europa.eu/eli/reg/2016/679/oj (accessed on 3 January 2025).
  17. Fonseca, J.; Bacao, F. Tabular and latent space synthetic data generation: A literature review. J. Big Data 2023, 10, 115. [Google Scholar] [CrossRef]
  18. Salinas, D.; Flunkert, V.; Gasthaus, J.; Januschowski, T. Deepar: Probabilistic forecasting with autoregressive recurrent networks. Int. J. Forecast. 2020, 36, 1181–1191. [Google Scholar] [CrossRef]
  19. Fisher, M.L.; Krishnan, J.K.; Netessine, S. Retail Store Execution: An Empirical Study. 2006. SSRN 2319839. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2319839 (accessed on 3 January 2025).
  20. Sinha, D.; Tulabandhula, T. Optimizing revenue over data-driven assortments. arXiv 2017, arXiv:1708.05510. [Google Scholar]
  21. McColl, R.; Macgilchrist, R.; Rafiq, S. Estimating cannibalizing effects of sales promotions: The impact of price cuts and store type. J. Retail. Consum. Serv. 2020, 53, 101982. [Google Scholar] [CrossRef]
  22. Hollebeek, L.D.; Sprott, D.E.; Andreassen, T.W.; Costley, C.; Klaus, P.; Kuppelwieser, V.; Karahasanovic, A.; Taguchi, T.; Islam, J.U.; Rather, R.A. Customer engagement in evolving technological environments: Synopsis and guiding propositions. Eur. J. Mark. 2019, 53, 2018–2023. [Google Scholar] [CrossRef]
  23. Apeh, E.T.; Gabrys, B.; Schierz, A. Customer profile classification using transactional data. In Proceedings of the 2011 Third World Congress on Nature and Biologically Inspired Computing, Salamanca, Spain, 19–21 October 2011; IEEE: Piscataway, NJ, USA; pp. 37–43. [Google Scholar]
  24. Mikolov, T.; Chen, K.; Corrado, G.; Dean, J. Efficient estimation of word representations in vector space. arXiv 2013, arXiv:1301.3781. [Google Scholar]
  25. Rychalska, B.; Bąbel, P.; Gołuchowski, K.; Michałowski, A.; Dąbrowski, J.; Biecek, P. Cleora: A simple, strong and scalable graph embedding scheme. In Neural Information Processing: 28th International Conference, ICONIP 2021, Sanur, Bali, Indonesia, 8–12 December 2021, Proceedings, Part IV 28; Springer: Cham, Switzerland, 2021; pp. 338–352. [Google Scholar]
  26. Sherstinsky, A. Fundamentals of recurrent neural network (rnn) and long short-term memory (lstm) network. Phys. D Nonlinear Phenom. 2020, 404, 132306. [Google Scholar] [CrossRef]
  27. Ledig, C.; Theis, L.; Huszar, F.; Caballero, J.; Cunningham, A.; Acosta, A. Photo-realistic single image super-resolution using a generative adversarial network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 4681–4690. [Google Scholar]
  28. Pathak, D.; Krahenbuhl, P.; Donahue, J.; Darrell, T.; Efros, A.A. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2536–2544. [Google Scholar]
  29. Tzeng, E.; Hoffman, J.; Saenko, K.; Darrell, T. Adversarial discriminative domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 7167–7176. [Google Scholar]
  30. Zhou, T.; Li, Q.; Lu, H.; Cheng, Q.; Zhang, X. Gan review: Models and medical image fusion applications. Inf. Fusion 2023, 91, 134–148. [Google Scholar] [CrossRef]
  31. Assefa, S.A.; Dervovic, D.; Mahfouz, M.; Tillman, R.E.; Reddy, P.; Veloso, M. Generating synthetic data in finance: Opportunities, challenges and pitfalls. In Proceedings of the First ACM International Conference on AI in Finance, New York, NY, USA, 15–16 October 2020; pp. 1–8. [Google Scholar]
  32. Takahashi, S.; Chen, Y.; Tanaka-Ishii, K. Modeling financial time-series with generative adversarial networks. Phys. A Stat. Mech. Its Appl. 2019, 527, 121261. [Google Scholar] [CrossRef]
  33. Kumar, A.; Biswas, A.; Sanyal, S. ecommercegan: A generative adversarial network for e-commerce. arXiv 2018, arXiv:1801.03244. [Google Scholar]
  34. Doan, T.; Veira, N.; Keng, B. Generating realistic sequences of customer-level transactions for retail datasets. In Proceedings of the 2018 IEEE International Conference on Data Mining Workshops (ICDMW), Singapore, 17–20 November 2018; IEEE: Piscataway, NJ, USA; pp. 820–827. [Google Scholar]
  35. Zhao, Z.; Kunar, A.; Birke, R.; Chen, L.Y. Ctab-gan: Effective table data synthesizing. In Proceedings of the Asian Conference on Machine Learning, Virtually, 17–19 November 2021; PMLR, 2021; pp. 97–112. [Google Scholar]
  36. Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial nets. Adv. Neural Inf. Process. Syst. 2014, 27. [Google Scholar]
  37. Gulrajani, I.; Ahmed, F.; Arjovsky, M.; Dumoulin, V.; Courville, A.C. Improved training of wasserstein gans. Adv. Neural Inf. Process. Syst. 2017, 30. [Google Scholar]
  38. Salampasis, M.; Siomos, T.; Katsalis, A.; Diamantaras, K.; Christantonis, K.; Delianidi, M.; Karaveli, I. Comparison of rnn and embeddings methods for next-item and last-basket session-based recommendations. In Proceedings of the 2021 13th International Conference on Machine Learning and Computing, Shenzhen China, 26 February–1 March 2021; pp. 477–484. [Google Scholar]
  39. Tkachuk, S.; Wróblewska, A.; Dabrowski, J.; Łukasik, S. Identifying Substitute and Complementary Products for Assortment Optimization with Cleora Embeddings. In Proceedings of the 2022 International Joint Conference on Neural Networks (IJCNN), Padua, Italy, 18–23 July 2022; IEEE: Piscataway, NJ, USA. [Google Scholar]
  40. Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
  41. Tieleman, T.; Hinton, G. Lecture 6.5-rmsprop, Coursera: Neural Networks for Machine Learning; Technical Report, 6; University of Toronto: Toronto, ON, Canada, 2012. [Google Scholar]
  42. Liu, K.; Qiu, G. Lipschitz constrained gans via boundedness and continuity. Neural Comput. Appl. 2020, 32, 18271–18283. [Google Scholar] [CrossRef]
  43. Saxena, D.; Cao, J. Generative adversarial networks (gans) challenges, solutions, and future directions. ACM Comput. Surv. (CSUR) 2021, 54, 1–42. [Google Scholar] [CrossRef]
  44. Karampatsa, M.; Grigoroudis, E.; Matsatsinis, N.F. Retail category management: A review on assortment and shelf-space planning models. In Operational Research in Business and Economics: 4th International Symposium and 26th National Conference on Operational Research, Chania, Greece, June 2015; Springer: Cham, Switzerland, 2015; pp. 35–67. [Google Scholar]
  45. Mahalanobish, O.; Mishra, S.; Das, A.; Misra, S. Capturing Demand Transference in Retail—A Statistical Approach. 2017. SSRN 3227753. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3227753 (accessed on 3 January 2025).
Figure 1. Proposed augmentation of conditional GAN.
Figure 1. Proposed augmentation of conditional GAN.
Electronics 14 00284 g001
Figure 2. Stabilization of discriminator training process (illustrative example).
Figure 2. Stabilization of discriminator training process (illustrative example).
Electronics 14 00284 g002
Table 1. Results for models trained on various embeddings.
Table 1. Results for models trained on various embeddings.
ConsumerProductStocks (Unweighted)Stocks (Weighted)No Stocks
EMDJSDAccEMDJSDAccEMDJSDAcc
CleoraCleora0.230.120.600.180.090.580.350.200.68
Cleoraw2v0.280.160.630.240.120.610.400.240.71
RNNCleora0.210.100.580.160.070.540.330.180.66
RNNw2v0.260.140.610.220.110.590.380.220.69
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Tkachuk, S.; Łukasik, S.; Wróblewska, A. Consumer Transactions Simulation Through Generative Adversarial Networks Under Stock Constraints in Large-Scale Retail. Electronics 2025, 14, 284. https://doi.org/10.3390/electronics14020284

AMA Style

Tkachuk S, Łukasik S, Wróblewska A. Consumer Transactions Simulation Through Generative Adversarial Networks Under Stock Constraints in Large-Scale Retail. Electronics. 2025; 14(2):284. https://doi.org/10.3390/electronics14020284

Chicago/Turabian Style

Tkachuk, Sergiy, Szymon Łukasik, and Anna Wróblewska. 2025. "Consumer Transactions Simulation Through Generative Adversarial Networks Under Stock Constraints in Large-Scale Retail" Electronics 14, no. 2: 284. https://doi.org/10.3390/electronics14020284

APA Style

Tkachuk, S., Łukasik, S., & Wróblewska, A. (2025). Consumer Transactions Simulation Through Generative Adversarial Networks Under Stock Constraints in Large-Scale Retail. Electronics, 14(2), 284. https://doi.org/10.3390/electronics14020284

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop