Abstract
As E-commerce platforms face surging transactions during major shopping events like Black Friday, stress testing with synthesized data is crucial for resource planning. Most recent studies use Generative Adversarial Networks (GANs) to generate tabular data while ensuring privacy and machine learning utility. However, these methods overlook the computational demands of processing GAN-generated data, making them unsuitable for E-commerce stress testing. This thesis introduces a novel GAN-based approach incorporating query selectivity constraints, a key factor in database transaction processing. We integrate a pre-trained deep neural network to maintain selectivity consistency between real and synthetic data. Our method, tested on five real-world datasets, outperforms three state-of-the-art GANs and a VAE model, improving selectivity estimation accuracy by up to 20% and machine learning utility by up to 6%.
Introduction
In modern data-driven industries, particularly E-commerce, synthetic data serves as a vital tool for stress-testing systems without compromising user privacy. For instance, preparing for high-traffic events like Black Friday requires engineers to estimate the computational resources (CPU, memory, I/O) required for specific database queries.
The critical metric for this estimation is query selectivity: the proportion of rows in a table that satisfy a specific query predicate (e.g., "How many users aged 20-30 spent over $100?"). While state-of-the-art GANs like CTGAN excel at preserving general statistical distributions and privacy, they often fail to capture the complex, multi-dimensional correlations necessary to satisfy these database-specific constraints. If the synthetic data’s selectivity deviates significantly from the ground truth, the resulting stress tests fail to accurately predict real-world resource requirements.
Methodology: The SelGAN Framework
This research introduces SelGAN, a selectivity-enhanced framework designed to be integrated into existing GAN architectures. While primarily implemented atop CTGAN, the approach is base-model agnostic. The framework consists of three core innovations:
1. Modified Reversible Data Transforms (mRDT)
Standard tabular models often rely on one-hot encoding for all categorical data. However, for ordinal data (e.g., "Small, Medium, Large"), one-hot encoding discards the inherent natural order. SelGAN introduces Ordinal Encoding for these features, allowing the GAN to better understand the mathematical relationships and distances between values, which is essential for range-based queries.
2. Pre-trained Selectivity Model
To provide the GAN with a sense of query behavior, the framework utilizes a simplified version of Selnet, a deep neural network optimized for selectivity estimation in high-dimensional spaces. This model is pre-trained on the ground-truth dataset to learn how various query objects and thresholds map to specific selectivity scores.
3. Selectivity-Aware Loss Function
The defining feature of SelGAN is the integration of selectivity into the training loop. During the generation phase, synthetic data is passed through the pre-trained Selnet to calculate a Selectivity Loss ($L_{Sel}$). This loss is combined with the standard GAN loss:
$$L^*_G = L_G + \alpha \cdot L_{Sel}$$
By minimizing this combined loss, the Generator is forced to produce data that not only looks realistic to the Discriminator but also behaves realistically when subjected to database queries.
Experimental Evaluation
The performance of SelGAN was evaluated against five diverse real-world datasets: Adult (census data), Covertype (forest characteristics), Ticket (airline data), News (online popularity), and CreditCard (fraud detection). These datasets represent a mix of continuous and categorical features with varying dimensionality.
Key Findings
- Selectivity Accuracy: SelGAN achieved a significant reduction in Mean Squared Error (MSE) for selectivity estimation, outperforming baselines like CTGAN, OCTGAN, and VAEs by an average of 20%.
- Machine Learning Utility: Beyond database queries, the synthetic data proved robust for downstream machine learning tasks. SelGAN improved performance in classification and regression tasks by up to 6% compared to standard synthetic data generators.
- Correlation Preservation: Visual analysis using Pearson correlation heatmaps indicated that SelGAN more accurately replicated the internal correlation structures of the original data, whereas competing models often produced "noisy" or overly simplified correlation matrices.
Conclusion and Future Work
SelGAN demonstrates that treating database query results as a supervision signal allows GANs to learn finer-grained correlations often missed by standard discriminators. While the current framework focuses on Selection operators (filtering), future research will aim to address more complex database operations such as Joins and Projections, which require modeling joint constraints across multiple tables. Additionally, exploring dynamic training methods to handle the rapidly changing data environments typical of E-commerce remains a priority for future development.
Summary updated