Table data generation method and device, equipment, medium and product

By employing targeted preprocessing and multi-loss function training, the generative adversarial network model addresses the issue of poor tabular data generation performance in existing technologies, achieving high-quality data generation and stable training.

CN121503449APending Publication Date: 2026-02-10CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511553248.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing tabular data generation methods suffer from poor feature processing performance, low-quality generated data, unstable model training, and poorly designed loss functions when dealing with continuous, discrete, and mixed features.

Method used

A Gaussian mixture model is used to encode and normalize continuous feature columns, and one-hot encoding is used to decompose and encode discrete feature columns separately. A generative adversarial network model with dual conditional discriminator, auxiliary classifier and generator is constructed, and training is designed by combining multiple loss functions.

Benefits of technology

It improves the completeness and accuracy of feature processing, enhances the discriminator's sensitivity to data differences, avoids gradient explosion, ensures the authenticity of generated data and the consistency of class distribution, and generates high-quality synthetic tabular data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503449A_ABST
    Figure CN121503449A_ABST
Patent Text Reader

Abstract

The invention provides a table data generation method and device, equipment, a medium and a product, and relates to the technical field of data processing. According to the method, the table data containing multiple types of features are processed through the differential preprocessing strategy, and the integrity and accuracy of feature processing are improved; the sensitivity to data difference is improved through a dual-condition discriminator; gradient penalty loss is introduced into the first total loss function, a discriminator gradient norm is constrained, and gradient explosion is avoided; the parameter updating process can be smoothed by introducing near-end optimization loss; the second total loss function adopts a pessimistic input mechanism, and compels the generator to learn robust features by adding conditional vector disturbance, thereby effectively avoiding mode collapse. The feature level difference between the synthetic data and the real data is measured through information loss, and the information integrity is ensured; the classification loss ensures that the category distribution of the synthetic data is consistent with the real data through an auxiliary classifier, and the category imbalance is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, medium and product for generating tabular data. Background Technology

[0002] Currently, tabular data, as a common form of data storage and presentation, is widely used in various fields such as finance, healthcare, and e-commerce. However, in practical applications, tabular data often faces problems such as insufficient data volume, high data privacy requirements, and uneven data distribution. Existing technologies have proposed some methods for generating tabular data, such as methods based on traditional generative models, like some basic variants of Generative Adversarial Networks (GANs). Although these methods can learn the distribution characteristics of data to some extent, they suffer from poor feature processing performance, low-quality generated data, and unstable model training when dealing with tabular data containing multiple features, including continuous, discrete, and mixed features. Summary of the Invention

[0003] This application provides a method, apparatus, device, medium, and product for generating tabular data, which addresses the problems of poor feature processing, low quality of generated data, and unstable model training in existing tabular data generation methods.

[0004] Firstly, this application provides a method for generating tabular data, including:

[0005] Obtain initial table data, which includes continuous feature columns, discrete feature columns, and mixed feature columns;

[0006] The initial table data is preprocessed to obtain preprocessed training data. The preprocessing includes encoding and normalizing continuous feature columns based on Gaussian mixture model, one-hot encoding of discrete feature columns, and decomposing the mixture feature columns into continuous and discrete parts and encoding them separately.

[0007] Construct a generative adversarial network (GAN) model; wherein the GAN model includes at least a dual-condition discriminator, an auxiliary classifier, and a generator;

[0008] The generative adversarial network model is trained adversarially based on the preprocessed training data. Specifically, the dual-conditional discriminator is trained based on the first total loss function, which combines the first mean loss, gradient penalty loss, and proximal optimization loss. The generator is trained based on the second total loss function, which combines the discriminator adversarial loss based on the pessimistic input mechanism, information loss, and classification loss.

[0009] The noise vector and the condition vector are input into a convergent generator to obtain the initial synthetic data; the condition vector is formed by concatenating the representation vectors of the preprocessed discrete feature columns and the representation vectors of the mixed feature columns, and the noise vector follows a standard normal distribution.

[0010] Perform inverse preprocessing on the initial synthetic data to obtain the target synthetic tabular data.

[0011] In one possible design, the step of determining the first mean loss includes: calculating the negative of the output mean of the dual conditional discriminator for the combination of real data and conditional vectors, and the output mean of the dual conditional discriminator for the combination of synthetic data and conditional vectors, and adding the negative of the output mean of the combination of real data and conditional vectors to the output mean of the combination of synthetic data and conditional vectors to obtain the first mean loss;

[0012] Among them, real data is the training data obtained after preprocessing; synthetic data is the data output by the generator based on noise vector and condition vector.

[0013] The steps for determining the gradient penalty loss include: calculating the squared mean of the gradient norm of the dual conditional discriminator for the input of the combination of synthetic data and conditional vector, and multiplying it by the regularization coefficient to obtain the gradient penalty loss.

[0014] The first total loss function is the sum of the first mean loss, the gradient penalty loss, and the near-end optimization loss.

[0015] In one possible design, the steps for determining the proximal optimization loss include:

[0016] For the combination of real data and conditional vectors, calculate the ratio of the output probability of the current dual conditional discriminator to that of the previous generation dual conditional discriminator for real data, and construct the first loss term based on the discrimination penalty term of real data;

[0017] For the combination of synthetic data and conditional vectors, calculate the ratio of the output probability of the current dual conditional discriminator to that of the previous generation dual conditional discriminator for synthetic data, and construct a second loss term based on the discrimination penalty term of the synthetic data;

[0018] The near-end optimization loss is determined based on the first loss term, the second loss term, and the regularization term of the KL divergence between the output distributions of the current dual-conditional discriminator and the previous generation dual-conditional discriminator.

[0019] In one possible design, the steps for determining the adversarial loss of the discriminator based on a pessimistic input mechanism include:

[0020] The product of the gradient value of the combination of synthetic data and conditional vector by the dual conditional discriminator and the preset adjustment coefficient is summed with the combination of synthetic data and conditional vector to obtain the pessimistic input.

[0021] Calculate the negative logarithm of the output value of the dual-conditional discriminator for the pessimistic input to obtain the discriminator adversarial loss based on the pessimistic input mechanism.

[0022] In one possible design, the information loss is the sum of the second mean loss and the variance loss, where:

[0023] The second mean loss is the mean difference between the output of the dual conditional discriminator after removing the last two layers of the true data and the conditional vector combination, and the output of the synthetic data and the conditional vector combination.

[0024] The variance loss is the norm difference between the output of the dual conditional discriminator after removing the last two layers and the output of the synthetic data and the conditional vector combination.

[0025] In one possible design, the generator is trained based on a second total loss function, including:

[0026] Optimize the discriminator based on a pessimistic input mechanism to mitigate adversarial loss and information loss;

[0027] The classification loss is optimized using the output of the auxiliary classifier; whereby the classification loss is obtained by calculating the average cross-entropy between the labels of the synthetic data and the predicted probabilities of the synthetic data by the auxiliary classifier.

[0028] In one possible design, the preprocessing also includes: performing a logarithmic transformation on the target feature column that has a long-tailed distribution; wherein the target feature column is a continuous feature column or a continuous part of a mixed feature column;

[0029] Logarithmic transformation includes: if the lower limit value of the target feature column is positive, then take the logarithm of the data value; if the lower limit value of the target feature column is not positive, then sum the difference between the data value and the lower limit value with a preset positive number and then take the logarithm.

[0030] Secondly, this application provides a tabular data generation apparatus, comprising:

[0031] The acquisition module is used to acquire initial table data, which includes continuous feature columns, discrete feature columns, and mixed feature columns.

[0032] The preprocessing module is used to preprocess the initial table data to obtain preprocessed training data. The preprocessing includes encoding and normalizing continuous feature columns based on Gaussian mixture model, performing one-hot encoding on discrete feature columns, and decomposing the mixture feature columns into continuous and discrete parts and encoding them separately.

[0033] The building blocks are used to construct generative adversarial network (GAN) models; wherein the GAN model includes at least a dual-condition discriminator, an auxiliary classifier, and a generator;

[0034] The training module is used to perform adversarial training on the generative adversarial network model based on preprocessed training data. Specifically, the dual-conditional discriminator is trained based on a first total loss function, which combines the first mean loss, gradient penalty loss, and proximal optimization loss. The generator is trained based on a second total loss function, which combines the discriminator adversarial loss based on a pessimistic input mechanism, information loss, and classification loss.

[0035] The generation module is used to input the noise vector and the condition vector into the convergent generator to obtain the initial synthetic data; wherein, the condition vector is formed by concatenating the representation vector of the preprocessed discrete feature column and the representation vector of the mixed feature column, and the noise vector follows a standard normal distribution;

[0036] The generation module is also used to perform inverse preprocessing on the initial synthetic data to obtain the target synthetic table data.

[0037] Thirdly, this application provides an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method as described in any of the first aspects.

[0038] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0039] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.

[0040] This application provides a method, apparatus, device, medium, and product for generating tabular data. It captures complex data distributions by using Gaussian mixture model encoding and normalization to process continuous features; it avoids misclassification of category order by using one-hot encoding to process discrete features; and it fully preserves information from both types of sub-features by decomposing and separately encoding mixed features. A differentiated preprocessing strategy is used to process complex tabular data containing multiple types of features, improving the completeness and accuracy of feature processing. A dual-conditional discriminator judges the authenticity of data from both global distribution and local details, improving the discriminator's sensitivity to data differences. The first total loss function introduces gradient penalty loss to constrain the discriminator's gradient norm and avoid gradient explosion; the introduction of proximal optimization loss smooths the parameter update process; the second total loss function adopts a pessimistic input mechanism, forcing the generator to learn robust features by adding conditional vector perturbations, effectively avoiding mode collapse. Information loss directly measures the feature-level differences between synthetic data and real data, ensuring information integrity; classification loss, through an auxiliary classifier, forces the category distribution of synthetic data to be consistent with that of real data, avoiding class imbalance. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0042] Figure 1 An application scenario diagram corresponding to a tabular data generation method provided in an embodiment of this application;

[0043] Figure 2 A flowchart illustrating a method for generating tabular data according to an embodiment of this application;

[0044] Figure 3 A schematic diagram of a tabular data generation device provided in an embodiment of this application;

[0045] Figure 4 This is a structural example diagram of an electronic device provided in an embodiment of this application.

[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0048] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.

[0049] Currently, tabular data, as a common data storage and presentation format, is widely used in various fields such as finance, healthcare, and e-commerce. For example, in financial risk control scenarios, tabular data can record users' credit information, transaction records, etc., providing a basis for risk assessment. However, in practical applications, tabular data often faces problems such as insufficient data volume, high data privacy requirements, and uneven data distribution. On the one hand, in some scenarios, the difficulty and cost of data collection result in a limited amount of usable tabular data, making it difficult to meet the needs of subsequent machine learning model training, data analysis, and other tasks. On the other hand, much tabular data contains sensitive personal information, such as ID card numbers, bank card numbers, and medical record details, and directly using the raw data poses a risk of privacy leakage.

[0050] To address the aforementioned issues, existing technologies have proposed several methods for generating tabular data, such as those based on traditional generative models like some basic variants of Generative Adversarial Networks (GANs). While these methods can learn the distribution characteristics of data to some extent, they suffer from problems such as poor feature processing performance, low-quality generated data, and unstable model training when handling tabular data containing multiple features, including continuous, discrete, and mixed features. For example, when encoding different types of features, it is difficult to take into account the characteristics of each type of feature, resulting in encoded features that cannot accurately reflect the information of the original data. During model training, mode collapse is prone to occur, meaning the generator can only generate a limited number of data types, failing to cover the full distribution of real data. Furthermore, traditional generative models lack effective loss function design during training, making it difficult to simultaneously guarantee the authenticity, diversity, and consistency with conditional information in the generated data.

[0051] Therefore, in the face of the technical problems of the existing technology, in order to avoid the problems of poor feature processing effect, unstable model training and poor loss function design during training when the existing traditional generative model processes tabular data containing continuous, discrete and mixed features, a tabular data generation method is conceived. First, the initial tabular data is preprocessed according to the feature type. For example, continuous data is normalized by Gaussian mixture model encoding, discrete data is one-hot encoded, and mixed data is decomposed and encoded separately. Then, a generative adversarial network model containing a dual conditional discriminator, an auxiliary classifier and a generator is constructed. The dual conditional discriminator and the generator are trained separately by combining multiple loss functions. Finally, the noise vector and the conditional vector concatenated by the preprocessed discrete and mixed feature column representation vectors are input into the trained generator. After inverse preprocessing, the target synthetic tabular data is obtained.

[0052] Figure 1 An application scenario diagram corresponding to a table data generation method provided in an embodiment of this application is shown, such as... Figure 1 As shown, the application scenario provided in this embodiment includes: a user terminal 11 and a table generation device 12, with the user terminal 11 and the table generation device 12 being communicatively connected.

[0053] Specifically, when a user needs to generate tabular data, the original tabular data is sent to the table generation device 12 through the user terminal 11. The original tabular data includes continuous feature columns, discrete feature columns, and mixed feature columns. The table generation device 12 preprocesses the original tabular data to obtain preprocessed training data. The preprocessing includes encoding and normalizing the continuous feature columns based on a Gaussian mixture model, performing one-hot encoding on the discrete feature columns, and decomposing the mixed feature columns into continuous and discrete parts and encoding them separately. Next, a generative adversarial network (GAN) model is constructed. The GAN model includes at least a dual-conditional discriminator, an auxiliary classifier, and a generator. Then, adversarial training is performed on the GAN model based on the preprocessed training data. The dual-conditional discriminator is trained based on a first total loss function, which combines a first mean loss, gradient penalty loss, and proximal optimization loss. The generator is trained based on a second total loss function, which combines a discriminator adversarial loss based on a pessimistic input mechanism, information loss, and classification loss. Next, the noise vector and condition vector are input into a converged generator to obtain initial synthetic data. The condition vector is formed by concatenating the representation vectors of the preprocessed discrete feature columns and the representation vectors of the mixed feature columns, while the noise vector follows a standard normal distribution. Finally, inverse preprocessing is performed on the initial synthetic data to obtain the target synthetic table data. The table generation device 12 sends the target synthetic table data to the user terminal 11.

[0054] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0055] Figure 2 A flowchart of a method for generating tabular data according to an embodiment of this application is shown below. Figure 2 As shown, the execution subject of this embodiment is a tabular data generation device. This device can be implemented by a computer program, or by a medium storing the relevant computer program, such as a USB flash drive and / or optical disc; alternatively, it can be implemented by a physical device integrating or installing the relevant computer program, such as a chip or electronic device. The electronic device may be a computer or a server, etc. The tabular data generation method provided in this embodiment includes the following steps:

[0056] S201. Obtain initial table data, which includes continuous feature columns, discrete feature columns, and mixed feature columns.

[0057] The initial table data is the foundation for subsequent data processing and model training. The initial table data contains various types of feature columns, which can be specifically divided into continuous feature columns, discrete feature columns, and mixed feature columns.

[0058] Among them, continuous feature columns refer to feature columns whose feature values ​​can take any continuous value within a certain range. For example, in tabular data in the financial field, feature columns such as a user's monthly income, total assets, and credit limit usually have continuous values, which can reflect the gradual trend of data in quantity.

[0059] Discrete feature columns refer to feature columns whose feature values ​​can only take a finite number of discrete numerical values ​​or category labels. Examples include user gender (male, female), marital status (single, married, divorced), occupation type (teacher, doctor, engineer, etc.), credit rating (A, B, C, D, etc.). The values ​​of discrete feature columns have clear category divisions, and there is usually no numerical relationship or continuous change between different values.

[0060] Hybrid feature columns are those that contain both continuous and discrete feature components. For example, a user's address information column might contain a city code (discrete, such as 1 representing Beijing, 2 representing Shanghai, etc.) and a specific street and house number (continuous, such as 123, 456, etc.). Similarly, a product's sales information column might contain a product category code (discrete) and the product's unit price (continuous). The existence of hybrid feature columns increases the complexity of tabular data, requiring special processing methods to accurately extract the effective information.

[0061] Optionally, in practical applications, initial table data can be obtained through data acquisition devices, database queries, data file imports, etc. For example, in the credit business scenario of financial institutions, initial table data containing user basic information, credit application information, repayment records, etc., can be obtained from the credit business database; in the e-commerce platform scenario, initial table data containing product information, user purchase records, transaction amounts, etc., can be obtained from the platform's transaction database.

[0062] Optionally, after obtaining the initial table data, it can be initially filtered and cleaned, such as removing obviously invalid data, such as data with empty feature values, abnormally large or small values, to ensure the data quality of subsequent processing.

[0063] S202. Preprocess the initial table data to obtain preprocessed training data; wherein, the preprocessing includes encoding and normalizing the continuous feature columns based on the Gaussian mixture model, performing one-hot encoding on the discrete feature columns, and decomposing the mixture feature columns into continuous and discrete parts and encoding them separately.

[0064] It should be noted that the purpose of preprocessing is to convert different types of feature columns in the initial tabular data into a format suitable for training generative adversarial network models, thereby eliminating problems such as differences in scale and class imbalance between data.

[0065] It should be noted that the feature values ​​of continuous feature columns have different ranges and units. For example, a user's monthly income may range from several thousand yuan to hundreds of thousands of yuan, while a user's age may range from 0 to 120 years old. If the raw data is directly input into the model, it will cause the model to be oversensitive to features with large value ranges, affecting the model's training effect and prediction accuracy. In addition, a single distribution assumption is difficult to accurately describe the complex distribution of continuous feature columns.

[0066] Gaussian Mixture Model (GMM) is a probability-based generative model that assumes data is composed of a mixture of multiple Gaussian distribution components. Encoding continuous feature columns using GMM can fully consider the complex distribution characteristics that may exist in continuous feature columns and accurately capture the distribution information of the data.

[0067] Optionally, the process of encoding continuous feature columns based on Gaussian mixture models can be as follows: First, all feature values ​​of the continuous feature column are used as input data to train the Gaussian mixture model, determining parameters such as the number of Gaussian components, the mean, variance, and weight of each Gaussian component. During training, the Expectation-Maximization (EM) algorithm can be used to estimate the model parameters. This algorithm iteratively optimizes the model parameters, enabling the Gaussian mixture model to fit the distribution of the input data to the greatest extent. Then, for each feature value in the continuous feature column, the posterior probability of that feature value belonging to each Gaussian component is calculated, and the vector composed of these posterior probabilities is used as the encoding vector for that feature value. This encoding method converts continuous feature values ​​into vector representations with probabilistic meaning, not only preserving the distribution information of the original feature values ​​but also providing richer feature representations for subsequent model training.

[0068] Optionally, after the continuous feature columns are encoded, the encoded vectors need to be normalized. The purpose of normalization is to map the range of values ​​of the encoded vectors to a uniform interval, such as [0,1] or [-1,1], in order to eliminate the dimensional differences between different features and enable the model to treat each feature more fairly.

[0069] Optionally, the normalization method can be min-max normalization or Z-score normalization, etc. In this embodiment, a suitable normalization method can be selected according to the distribution of the actual data and the model training requirements.

[0070] It should be noted that the feature values ​​of discrete feature columns are usually category labels or discrete numerical values. These values ​​do not have a continuous numerical relationship. If they are directly used as numerical input to the model, the model will incorrectly assume that there is a magnitude relationship between different values, thus affecting the training effect of the model. For example, if the occupation type "teacher" is encoded as 1, "doctor" as 2, and "engineer" as 3, the model may incorrectly assume that "doctor" has a higher priority than "teacher" and "engineer" has a higher priority than "doctor", when in fact there is no such numerical order relationship between these three occupation types.

[0071] One-hot encoding is a method for handling discrete features. The principle of one-hot encoding is to convert each distinct value in a discrete feature column into a binary vector. The length of the vector is equal to the number of distinct values ​​in the discrete feature column, with only the position corresponding to the current feature value being 1, and the rest being 0. Through one-hot encoding, discrete feature values ​​can be converted into vector representations without any order, accurately reflecting the category information of discrete features and avoiding incorrect numerical associations in the model. For example, for the discrete feature column "gender," its possible values ​​are "male" and "female." After one-hot encoding, "male" can be represented as the vector [1,0], and "female" can be represented as the vector [0,1].

[0072] Optionally, when performing one-hot encoding, it is necessary to first count all distinct values ​​in the discrete feature column and assign a unique index to each value.

[0073] It should be noted that hybrid feature columns contain both continuous and discrete feature components. The structure of hybrid feature columns is quite complex, and using a single processing method cannot accurately extract the effective information from the different types of components, thus affecting the subsequent model training performance. Therefore, it is necessary to first decompose the hybrid feature columns into continuous and discrete parts, and then process them separately using encoding methods suitable for each type.

[0074] Optionally, the decomposition of hybrid feature columns can be performed based on the specific content and semantic information of the feature columns. For example, for the hybrid feature column "address information", it can be decomposed into "city number" (discrete part, such as 1 representing Beijing, 2 representing Shanghai, etc.) and "street address" (continuous part, such as 123, 456, etc.) according to the structural characteristics of the address.

[0075] It should be noted that during the decomposition process, it is necessary to ensure that the continuous and discrete parts after decomposition can accurately reflect the information of the original mixed feature columns.

[0076] Optionally, after decomposing the mixed feature columns, the continuous parts obtained from the decomposition can be processed in the same way as the continuous feature columns, i.e., encoded and normalized based on the Gaussian mixture model; the discrete parts obtained from the decomposition can be processed in the same way as the discrete feature columns, i.e., one-hot encoding. By processing them separately, the characteristics of different types of parts in the mixed feature columns can be fully taken into account, the effective information of each part can be accurately extracted, and high-quality feature representations can be provided for subsequent model training.

[0077] It should be noted that after preprocessing the continuous, discrete, and mixed feature columns, the preprocessed feature column data is combined according to the row order of the original table data to obtain the preprocessed training data. Each sample in the preprocessed training data contains all the feature information after encoding and normalization, and can be directly used for training the subsequent generative adversarial network model.

[0078] S203. Construct a generative adversarial network model; wherein the generative adversarial network model includes at least a dual-condition discriminator, an auxiliary classifier, and a generator.

[0079] It should be noted that the generative adversarial network model is the core model for generating tabular data. Through adversarial training between the generator and the discriminator, the generator can learn the distribution characteristics of real tabular data, thereby generating synthetic data that is similar to real data.

[0080] The generator's main function is to receive noise vectors and condition vectors as inputs and generate synthetic data that is similar to the distribution of real tabular data through a series of neural network operations.

[0081] Optionally, the generator typically employs a deep neural network structure, such as a fully connected neural network, a convolutional neural network (CNN), or a recurrent neural network (RNN). The specific structure can be designed according to the characteristics of the tabular data and the generation requirements.

[0082] Optionally, the fully connected neural network of the generator typically includes an input layer, multiple hidden layers, and an output layer. The input layer has the number of neurons equal to the sum of the dimensions of the noise vector and the condition vector. It receives the noise vector and the condition vector, concatenates them, and then passes them to the first hidden layer.

[0083] The number of hidden layers and the number of neurons in each hidden layer can be adjusted according to the actual situation. Each hidden layer typically consists of two parts: a linear transformation and a non-linear activation function. The linear transformation is used to change the dimensionality of the input data and combine features, while the non-linear activation function is used to introduce non-linear factors, enabling the generator to learn complex non-linear relationships in the data. Commonly used non-linear activation functions include ReLU, LeakyReLU, and Tanh functions. In this embodiment, LeakyReLU can be selected as the activation function for the hidden layer, which can effectively alleviate the gradient vanishing problem and improve the training stability of the model.

[0084] The number of neurons in the output layer is equal to the feature dimension of each sample in the preprocessed training data, and is used to output the initial synthetic data. The activation function of the output layer needs to be selected according to the value range of the preprocessed training data. For example, if the feature values ​​of the preprocessed training data are all in the range [0,1], the Sigmoid function can be selected as the activation function of the output layer, which can map the output value to the range [0,1].

[0085] It should be noted that the main function of the discriminator is to discriminate the input data, distinguishing whether the data comes from real training data or synthetic data from the generator. Unlike the single discriminator in traditional generative adversarial networks, the dual-condition discriminator in this embodiment can combine conditional vector information for discrimination, judging the authenticity of the data from different perspectives, thereby improving the discriminator's discrimination ability and the model's training effect.

[0086] The dual conditional discriminator includes a first discriminator and a second discriminator. Both adopt a fully connected neural network structure and receive data samples and corresponding conditional vectors as inputs, but they differ in network structure details (such as the number of hidden layers, the number of neurons, the selection of activation functions, etc.) and discriminative focus.

[0087] Optionally, the first discriminator focuses primarily on judging from the overall distribution and global features of the data, determining whether the input data sample conforms to the overall distribution pattern of the real data. Its network structure design can be relatively complex, with an appropriate increase in the number of hidden layers and neurons to improve the ability to capture global features of the data.

[0088] Optionally, the second discriminator focuses primarily on judging from the local features and details of the data, determining whether the input data sample is consistent with the real data in terms of local features and details. Its network structure design can be relatively simple, with an appropriate reduction in the number of hidden layers and neurons. At the same time, some structures that can enhance the ability to extract local features, such as local response normalization layers, can be added to the network.

[0089] Optionally, the input to the dual-condition discriminator is a concatenated vector of data samples and condition vectors, where the condition vectors are formed by concatenating the representation vectors of preprocessed discrete feature columns and mixed feature columns. By inputting the condition vectors along with the data samples into the dual-condition discriminator, the discriminator can determine the authenticity of the data while considering the condition information, thereby guiding the generator to generate synthetic data that matches the condition information.

[0090] For example, in a financial lending scenario, if the condition vector contains the information "credit rating is A", the dual-condition discriminator will check whether the data sample conforms to the characteristic pattern of "credit rating A user" when judging the authenticity of the data, and then guide the generator to generate synthetic data that matches "credit rating A", so as to ensure the consistency between the generated data and the condition information.

[0091] Optionally, the output layer of the dual-condition discriminator uses the Sigmoid activation function, outputting a probability value between 0 and 1 to represent the probability that the input data sample is real data. If the probability value is close to 1, the data sample is determined to be real data; if the probability value is close to 0, the data sample is determined to be synthetic data generated by the generator.

[0092] The auxiliary classifier is used to predict the category information of data samples. By introducing category prediction loss, the training process of the generator is further constrained, the consistency between the generated data and the real data in terms of category distribution is improved, and the generative adversarial network model's ability to learn data category features is enhanced.

[0093] The auxiliary classifier employs a fully connected neural network structure. Its input is data samples (real or synthetic data samples), and its output is the probability distribution of each data sample belonging to a given category. Optionally, the network structure of the auxiliary classifier can be adjusted according to the complexity of the data categories. It typically includes an input layer, one or two hidden layers, and an output layer. The number of neurons in the input layer equals the feature dimension of the data samples, and it receives the data samples and passes them to the hidden layers. The hidden layers extract category-related features from the data samples, and the number of neurons in the hidden layers can be flexibly set according to the input feature dimension and the number of categories. The number of neurons in the output layer equals the number of data categories. A softmax activation function can be used to convert the output into a probability distribution, satisfying the constraint that the sum of the probabilities of all categories is 1.

[0094] It should be noted that during model training, the auxiliary classifier calculates the cross-entropy loss between the predicted and true classes and backpropagates this loss to the generator, guiding it to produce data consistent with the true class distribution. For example, if the "default" class accounts for 10% and the "normal" class accounts for 90% in the real data, the auxiliary classifier's classification loss will ensure that the proportion of the two classes in the generated synthetic data is close to this ratio, avoiding the problem of class distribution imbalance in the generated data.

[0095] S204. Perform adversarial training on the generative adversarial network model based on the preprocessed training data; wherein, the dual-conditional discriminator is trained based on the first total loss function, and the first total loss function combines the first mean loss, gradient penalty loss and proximal optimization loss; the generator is trained based on the second total loss function, and the second total loss function combines the discriminator adversarial loss based on the pessimistic input mechanism, information loss and classification loss.

[0096] Among them, adversarial training is the core training link of generative adversarial network model. Through the adversarial game between the generator and the discriminator, the generator gradually learns the distribution characteristics of real data and is eventually able to generate synthetic data that is highly similar to real data.

[0097] The first total loss function is used to measure the discrimination error of the dual-conditional discriminator on real and synthetic data. The first total loss function combines the first mean loss, gradient penalty loss and proximal optimization loss. Through multi-dimensional loss constraints, it ensures that the discriminator can learn stably and avoids problems such as gradient explosion or mode collapse.

[0098] The first mean loss measures the difference between the discriminator's judgment result for real and synthetic data and the ideal judgment result. For real data, the ideal judgment result is 1; for synthetic data, the ideal judgment result is 0.

[0099] The gradient penalty loss constrains the gradient norm of the discriminator, preventing gradient explosion during training and ensuring a smooth change in the discriminator's output with respect to the input, thus ensuring stable training of the generative adversarial network model. The gradient penalty loss calculates the gradient of the discriminator with respect to the interpolated samples by randomly sampling interpolated samples between real and synthetic data samples, and forces the gradient norm to be close to 1. It should be noted that for a dual-conditional discriminator, the gradient penalty loss requires calculating the gradient penalties for the first and second discriminators separately before summing them.

[0100] The proximal optimization loss is used to smooth out the parameter update process of the dual-conditional discriminator, avoiding drastic fluctuations in parameters during training and improving the stability of model training. The proximal optimization loss constrains the difference between the parameters and those of the previous iteration by introducing an L2 regularization term for the parameters.

[0101] It should be noted that when training the dual-condition discriminator, the parameters of the dual-condition discriminator are continuously adjusted by minimizing the first total loss function, so that the dual-condition discriminator can more accurately distinguish between real data and synthetic data, while maintaining the stability of the training process.

[0102] The second total loss function is used to measure the difference between the synthetic data generated by the generator and the real data. The second total loss function combines discriminator adversarial loss based on pessimistic input mechanism, information loss and classification loss, and constrains the generator from three dimensions: authenticity, information integrity and class consistency, to ensure the high quality of the generated data.

[0103] It should be noted that traditional generator adversarial loss relies solely on the discriminator's judgment of the synthetic data, which can easily lead to the generator overly catering to the discriminator and causing mode collapse. In this embodiment, a pessimistic input mechanism is introduced, which simulates input noise that may occur in real-world scenarios by adding random perturbations to the conditional vector. This allows the generator to learn more robust features during training and avoids mode collapse.

[0104] Information loss is used to measure the difference in information between generated data and real data at the feature level, ensuring that generated data retains the key feature information of real data and avoiding the generation of meaningless data. Information loss can be calculated using mean squared error or cosine similarity loss.

[0105] The classification loss is the cross-entropy loss output by the auxiliary classifier, used to ensure that the class distribution of the generated data is consistent with that of the real data. The calculation of the classification loss is based on the difference between the auxiliary classifier's prediction of the class of the generated data and the class of the real data.

[0106] It should be noted that during the training of the generator, the parameters of the generator are continuously adjusted by minimizing the second total loss function, so that the synthetic data generated by the generator is close to real data in terms of authenticity, information completeness and category consistency.

[0107] Optionally, the adversarial training of the generative adversarial network model can be carried out in an alternating iterative manner. The specific process is as follows: First, initialize the network parameters (such as weights and biases) of the generator, dual conditional discriminator and auxiliary classifier. Usually, the initialization method of random normal distribution is used.

[0108] Next, set a fixed number of iterations (e.g., 10,000 rounds), with each iteration including the following steps:

[0109] First, a batch of samples is randomly selected from the preprocessed training data, and a batch of noise vectors and corresponding conditional vectors are generated simultaneously. The real data samples and conditional vectors are then input into a dual-conditional discriminator to obtain the discrimination result. Next, the noise vectors and conditional vectors are input into a generator to obtain synthetic data samples, which are then input into the dual-conditional discriminator again to obtain the discrimination result. The loss value of the dual-conditional discriminator is calculated based on the first total loss function, and the parameters of the dual-conditional discriminator are updated using the backpropagation algorithm. To ensure sufficient training of the dual-conditional discriminator, it can be trained 2-5 times in each iteration.

[0110] Secondly, synthetic data samples are generated using the same noise vector and condition vector as those used to train the dual conditional discriminator. The synthetic data samples and condition vectors are then input into the discriminator and the auxiliary classifier to obtain the discrimination results and class prediction results. The loss values ​​of the generator and the auxiliary classifier are calculated based on the second total loss function, and the parameters of the generator and the auxiliary classifier are updated through the backpropagation algorithm.

[0111] Finally, after each iteration, two metrics can be used to determine whether the model has converged: first, whether the generator's second total loss function value tends to stabilize, for example, whether the loss value fluctuates less than a threshold for several consecutive iterations; second, whether the statistical characteristics of the generated data are similar to those of the real data, which can be the mean, variance, or feature correlation. When the generative adversarial network model converges, training is stopped, and the generator's parameters are saved at this point.

[0112] S205. Input the noise vector and the condition vector into the convergent generator to obtain the initial synthetic data; wherein, the condition vector is formed by concatenating the representation vector of the preprocessed discrete feature column and the representation vector of the mixed feature column, and the noise vector follows a standard normal distribution.

[0113] It should be noted that once the generative adversarial network model has converged during training, the generator has the ability to learn the distribution of real data. At this point, initial synthetic data can be generated by inputting noise vectors and conditional vectors.

[0114] The noise vector is a key source of diversity in the generator's generated data, and it follows a standard normal distribution. The dimension of the noise vector can be set according to the complexity of the generated data and the performance requirements of the model, typically taking values ​​of 64, 128, or 256.

[0115] Optionally, when generating the initial synthetic data, a corresponding number of independent noise vectors can be generated based on the required number of synthetic data points. For example, if 1000 synthetic data points need to be generated, 1000 independent noise vectors can be generated, each with the same dimension.

[0116] The condition vector controls the category and key attributes of the generated data, ensuring that the generated data meets specific business requirements. The condition vector is formed by concatenating the representation vectors of the preprocessed discrete feature columns and the representation vectors of the mixed feature columns. The representation vector of the discrete feature columns is the vector obtained after one-hot encoding of the discrete feature columns, while the representation vector of the mixed feature columns is the concatenation of the one-hot encoded vector of the discrete part after decomposition of the mixed feature columns and the normalized encoded vector of the continuous part.

[0117] The dimension of the condition vector is equal to the sum of the dimensions of all discrete feature column representation vectors and the dimensions of all mixed feature column representation vectors. When constructing the condition vector, feature values ​​can be specified according to business requirements.

[0118] Optionally, the generated noise vector and the constructed conditional vector are concatenated to form the input vector, and then the input vector is fed in batches into the converged generator for training. The generator operates through a neural network and outputs vectors with the same format as the preprocessed training data; these vectors are the initial synthetic data.

[0119] For example, if the preprocessed training data samples are 100-dimensional vectors and the generator's output layer has 100 neurons, then each input vector corresponds to an output of a 100-dimensional initial synthetic data vector; if 1000 input vectors are input in batches, then 1000 100-dimensional initial synthetic data vectors are generated, forming the initial synthetic dataset.

[0120] S206. Perform inverse preprocessing on the initial synthetic data to obtain the target synthetic table data.

[0121] The initial synthetic data consists of vectors output by the generator, consistent with the format of the preprocessed training data. However, the feature values ​​of this initial synthetic data, after encoding and normalization, cannot directly correspond to the actual meaning of the original tabular data. For example, the encoded vectors of continuous features cannot be directly interpreted as specific income or age values. Therefore, a reverse preprocessing operation is needed to transform the initial synthetic data into target synthetic tabular data with actual business meaning. The preprocessing operation employs differentiated encoding and normalization methods for different types of feature columns; therefore, the reverse preprocessing also needs to specifically restore the original data format according to the feature column type.

[0122] In S202, continuous feature columns are processed by first encoding with a Gaussian mixture model and then normalizing. The reverse preprocessing must be performed in the order of normalization followed by inverse Gaussian mixture model encoding.

[0123] It should be noted that the inverse normalization yields a posterior probability vector of the feature value belonging to each Gaussian component. This vector needs to be restored to the original continuous feature value using the "maximum a posteriori probability criterion". Then, for the inverse normalized posterior probability vector, the Gaussian component with the highest probability is selected as the estimate of the original continuous feature value. For example, in a financial scenario, the continuous feature column of "user's monthly income" is encoded by a Gaussian mixture model to obtain a posterior probability vector [0.02, 0.03, 0.95]. After inverse normalization, keeping the probability distribution unchanged, the third Gaussian component with the highest probability is selected, with a mean of 15,000 yuan. The restored feature value of "user's monthly income" is then 15,000 yuan.

[0124] In S202, discrete feature columns are encoded using one-hot encoding. The inverse preprocessing requires restoring the one-hot encoded vector to the original category label: First, extract the one-hot encoded vector of the discrete feature column in the initial synthetic data and find the index position with a value of 1 in the vector; then, according to the "index-category label" mapping table, convert the index into the corresponding original category label.

[0125] For example, the one-hot encoding mapping table for the discrete feature column of "credit rating" is: index 0 → A, index 1 → B, index 2 → C, index 3 → D. If the one-hot encoding vector in the initial synthetic data is [0, 1, 0, 0], then find index 1 with a value of 1, which corresponds to the category label "B".

[0126] In S202, the hybrid feature column is decomposed into a continuous part and a discrete part and encoded separately. The inverse preprocessing requires first splitting the hybrid feature representation vector in the initial synthetic data, then performing inverse processing on the two parts respectively, and finally merging them into the original hybrid feature value.

[0127] Optionally, after completing the inverse preprocessing of all feature columns, the feature values ​​of each feature column are combined into row data according to the column order of the initial table data, and finally the target synthetic table data with actual business meaning and the same format as the original table data is formed.

[0128] This application provides a method for generating tabular data. It captures complex data distributions by using Gaussian mixture model encoding and normalization to process continuous features; it avoids misjudgment of category order by using one-hot encoding to process discrete features; and it fully preserves information from both types of sub-features by decomposing and encoding mixed features separately. Through differentiated preprocessing strategies, it processes complex tabular data containing multiple types of features, improving the completeness and accuracy of feature processing.

[0129] This application embodiment uses a dual-condition discriminator to determine the authenticity of data from both global distribution and local details, thereby improving the discriminator's sensitivity to data differences. The first total loss function introduces gradient penalty loss to constrain the discriminator's gradient norm and avoid gradient explosion. The introduction of proximal optimization loss can smooth the parameter update process. The second total loss function adopts a pessimistic input mechanism, which forces the generator to learn robust features by adding conditional vector perturbation, effectively avoiding mode collapse.

[0130] This application's embodiments directly measure the feature-level differences between synthetic data and real data through information loss, ensuring information integrity; classification loss uses an auxiliary classifier to force the category distribution of synthetic data to be consistent with real data, avoiding category imbalance; a dual-condition discriminator combined with conditional vector discrimination ensures a high degree of matching between synthetic data and specified conditions. Furthermore, it should be noted that this application uses generated synthetic data to replace original data for model training and data analysis. While the synthetic data retains the distribution characteristics of the original data, it does not correspond to real individuals, effectively preventing the leakage of sensitive information. The encoding operation during preprocessing further desensitizes the original data, providing double protection for data privacy and security.

[0131] As an optional implementation, based on any of the above embodiments, the step of determining the first mean loss includes:

[0132] Calculate the negative of the output mean of the dual-conditional discriminator for the combination of real data and conditional vectors, and the output mean of the dual-conditional discriminator for the combination of synthetic data and conditional vectors. Then add the negative of the output mean of the combination of real data and conditional vectors to the output mean of the combination of synthetic data and conditional vectors to obtain the first mean loss.

[0133] The real data is the training data obtained after preprocessing; the synthetic data is the data output by the generator based on the noise vector and the condition vector.

[0134] The real data refers to the preprocessed training data samples in S202, denoted as real data X={x1,x2,...,x...} N}, where N is the number of samples. The condition vector is a concatenated vector of preprocessed discrete feature representation vectors and mixed feature representation vectors that correspond one-to-one with the real data samples. The condition vector is denoted as V={v1,v2,...,v...} N}

[0135] Among them, synthetic data The data generated by the generator is based on a noise vector and a conditional vector V, where the noise vector is denoted as Z={z1,z2,...,z...}. N Specifically, the first mean loss. The formula for calculation is:

[0136]

[0137] in, It is the expectation operator, representing the mean of a certain distribution; Represents the conditional distribution of real data The sample obtained in the middle , It is a combination of features and condition vectors of real data. This indicates that the dual-condition discriminator applies the real data. The output, This represents a sample obtained from the conditional distribution of synthetic data. , For dual-condition discriminator on synthetic data The output.

[0138] The first mean loss quantifies the difference in output between the dual conditional discriminator and real / synthetic data. It consists of two components: the negative mean output of the real data and the average output of the synthetic data. The first mean loss reflects the dual conditional discriminator's ability to distinguish between real and synthetic samples. Due to its simplicity and computational efficiency, this loss function is advantageous for model training.

[0139] Specifically, the steps for determining the gradient penalty loss include: calculating the squared mean of the gradient norms of the dual conditional discriminator for the input of the combination of synthetic data and conditional vectors, and multiplying it by a regularization coefficient to obtain the gradient penalty loss. Optionally, the gradient penalty loss... The formula for calculation is:

[0140]

[0141] in, It is a key hyperparameter used to balance the importance of gradient penalty, controlling the weight of the gradient penalty term in the total loss. It is the expectation operator, indicating the expectation of composite data ( The average value on the distribution of ,v). This refers to the dual-condition discriminator with respect to its input ( The gradient of v) measures the sensitivity of the dual-conditional discriminator output to changes in the input. It is the gradient The L2 norm is used to measure the magnitude of the gradient.

[0142] Specifically, the first total loss function is the sum of the first mean loss, the gradient penalty loss, and the proximal optimization loss.

[0143] It should be noted that, inspired by the Proximal Policy Optimization (PPO) algorithm, this embodiment further proposes a Proximal Optimization (PO) loss. A proximal optimization loss term is added on top of the traditional mean loss, enhancing the sample efficiency and performance of the dual-conditional discriminator.

[0144] As an optional implementation, based on any of the above embodiments, the step of determining the proximal optimization loss includes:

[0145] For the combination of real data and conditional vectors, calculate the ratio of the output probability of the current dual-conditional discriminator to that of the previous generation dual-conditional discriminator for real data, and construct the first loss term based on the discrimination penalty term of the real data; for the combination of synthetic data and conditional vectors, calculate the ratio of the output probability of the current dual-conditional discriminator to that of the previous generation dual-conditional discriminator for synthetic data, and construct the second loss term based on the discrimination penalty term of the synthetic data.

[0146] The near-end optimization loss is determined based on the first loss term, the second loss term, and the regularization term of the KL divergence between the output distributions of the current dual-conditional discriminator and the previous generation dual-conditional discriminator.

[0147] It should be noted that in the proximal optimization loss, real data and synthetic data are labeled as 1 and 0, respectively. This indicates the actual data after the parameters are updated. In the condition vector The chance of being marked as 1. (Terminology) The penalty term designed for the discrimination of real data in this embodiment means that a lower value implies It has a better ability to distinguish between real data. Function limitations The parameter update is performed by Within the set range. For synthetic data marked as 0, a similar method is used. KL divergence is used to stabilize training. A proximal optimization loss function is used to train the dual-conditional discriminator. The formula is as follows:

[0148]

[0149] in, This represents the current dual-condition discriminator. Representing the previous generation of dual-condition discriminators, It is a hyperparameter. and It's a penalty term; the `clip` function is used to limit the value to 1- and 1+ Between; the min function is used to take the smaller of the two values. β is a weighting coefficient, and KL represents the Kullback-Leibler divergence, used to measure the difference between two distributions. This represents the evaluation of the input by the dual-condition discriminator under given conditions (X,V) or (X′,V).

[0150] It should be noted that, in order to measure the information content of the input data, The last two layers were removed to form This information helps the generator improve the quality of the generated data.

[0151]

[0152] in, Through The information obtained after processing the real data X and its condition vector V. Specifically, The purpose is to measure the information content of the input data. It represents the result of real data X under this information measurement, reflecting the specific information characteristics contained in the real data. yes Synthetic data generated by the generator The information obtained after processing the condition vector V and its corresponding condition vector is used to... By comparing the two, such as the difference in mean and variance, we can measure how closely the generated data is close to the real data in terms of information content. This helps the generator adjust its parameters, improve the quality of the generated data, and make the generated data closer to the real data in terms of information.

[0153] As an optional implementation, based on any of the above embodiments, the step of determining the adversarial loss of the discriminator based on the pessimistic input mechanism includes:

[0154] The product of the gradient value of the dual-conditional discriminator on the combination of synthetic data and conditional vector and the preset adjustment coefficient is summed with the combination of synthetic data and conditional vector to obtain the pessimistic input; the negative logarithm of the output value of the dual-conditional discriminator on the pessimistic input is calculated to obtain the discriminator adversarial loss based on the pessimistic input mechanism.

[0155]

[0156] in, The modified input is used to give the generator a more challenging signal; The value of the pessimistic input is the preset adjustment coefficient, which is usually a small value, such as 0.1. This represents the gradient value of the dual-conditional discriminator for the combination of synthetic data and conditional vectors.

[0157]

[0158] As shown in the above equation, the log probability of the modified input under the dual-conditional discriminator is no less than the log probability of the original input. Therefore, the discriminator based on the pessimistic input mechanism resists loss. The specific expression is as follows:

[0159]

[0160] As an optional implementation, based on any of the above embodiments, the information loss is the sum of the second mean loss and the variance loss, wherein:

[0161] The second mean loss is the mean difference between the output of the dual conditional discriminator after removing the last two layers and the output of the combined real data and conditional vectors, and the output of the combined synthetic data and conditional vectors; the variance loss is the norm difference between the output of the dual conditional discriminator after removing the last two layers and the output of the combined synthetic data and conditional vectors.

[0162] Specifically, the second mean loss The expression is:

[0163]

[0164] Specifically, variance loss The expression is:

[0165]

[0166] Specifically, the second total loss function The expression is:

[0167]

[0168] It should be noted that combining discriminator adversarial loss, second mean loss, and variance loss based on a pessimistic input mechanism can help the generator overcome the overestimation problem of the dual-condition discriminator and produce higher quality synthetic data.

[0169] As an optional implementation, based on any of the above embodiments, the generator is trained using a second total loss function, including:

[0170] The discriminator based on a pessimistic input mechanism is used to optimize the adversarial loss and information loss; the classification loss is also optimized using the output of the auxiliary classifier; the classification loss is obtained by calculating the average cross-entropy between the label of the synthetic data and the predicted probability of the synthetic data by the auxiliary classifier.

[0171] Specifically, in this embodiment, the generator is trained based on the second total loss function, which includes two stages. The first stage uses a discriminator based on a pessimistic input mechanism to optimize the adversarial loss and information loss, and the second stage uses the classification loss output by the auxiliary classifier to optimize the generator.

[0172] By focusing on different optimization objectives in stages, the "basic quality" of the generated data is first optimized through adversarial loss and information loss in a coordinated manner. Then, the "class matching degree" of the generated data is optimized separately through classification loss, ensuring that the constraints of each dimension are fully effective. In addition, the classification loss is explicitly calculated by averaging the cross-entropy of the synthetic data labels and the predicted probabilities of the auxiliary classifier, avoiding optimization bias caused by improper label matching or probability processing.

[0173] It should be noted that the auxiliary classifier's role is to contribute to the loss of the generator's classification labels during subsequent training. (Using real data) Tags corresponding to real data To train the auxiliary classifier, the training objective is... , It is a multi-class cross-entropy loss:

[0174]

[0175] in, This represents the total number of items across multiple categories. It is a hyperparameter. Labels indicating predictions and They represent the first Predicted values ​​and predicted labels for each category.

[0176] Specifically, in the second stage, the generator uses a classification loss. To refine the generator, add more class features, and adjust the classification loss. The expression is:

[0177]

[0178] in, Labels representing synthetic data, and It is the predicted value of the auxiliary classifier.

[0179] As an optional implementation, based on any of the above embodiments, the preprocessing further includes:

[0180] Logarithmic transformation is performed on the target feature column with a long tail distribution; wherein the target feature column is a continuous feature column or a continuous part of a mixed feature column; the logarithmic transformation includes: if the lower limit value of the target feature column is positive, then take the logarithm of the data value; if the lower limit value of the target feature column is not positive, then sum the difference between the data value and the lower limit value with a preset positive number and then take the logarithm.

[0181] Specifically, to handle skewed columns exhibiting long tails, a logarithmic transformation can be used. For variables with a specific lower bound, we perform the transformation according to the following formula:

[0182]

[0183] in, The original data, for The converted data; It is the lower limit, a preset value. To adjust the parameters, which are positive numbers, add... The purpose is to avoid The result is 0 or a negative number.

[0184] By effectively reducing the difference between the tail data and the main data through the logarithmic method, the probability density Gaussian mixture distribution can efficiently encode all values, including the tail values.

[0185] Figure 3 This is a schematic diagram of the structure of a tabular data generation device provided in an embodiment of this application, as shown below. Figure 3 As shown, the tabular data generation device provided in this embodiment is located in an electronic device. The tabular data generation device 30 provided in this embodiment includes: an acquisition module 31, a preprocessing module 32, a construction module 33, a training module 34, and a generation module 35.

[0186] Specifically, the acquisition module 31 is used to acquire initial table data, which includes continuous feature columns, discrete feature columns, and mixed feature columns; the preprocessing module 32 is used to preprocess the initial table data to obtain preprocessed training data; the preprocessing includes encoding and normalizing the continuous feature columns based on a Gaussian mixture model, performing one-hot encoding on the discrete feature columns, and decomposing the mixed feature columns into continuous and discrete parts and encoding them separately; the construction module 33 is used to construct a generative adversarial network model; the generative adversarial network model includes at least a dual-condition discriminator, an auxiliary classifier, and a generator; and the training module 34 is used to train the generative adversarial network model based on the preprocessed training data. Adversarial training is performed, wherein a dual-conditional discriminator is trained based on a first total loss function, which combines a first mean loss, gradient penalty loss, and proximal optimization loss; a generator is trained based on a second total loss function, which combines a discriminator adversarial loss based on a pessimistic input mechanism, information loss, and classification loss; a generation module 35 is used to input noise vectors and conditional vectors into a converged generator to obtain initial synthetic data; wherein the conditional vectors are formed by concatenating the representation vectors of preprocessed discrete feature columns and the representation vectors of mixed feature columns, and the noise vectors follow a standard normal distribution; the generation module 35 is also used to perform inverse preprocessing on the initial synthetic data to obtain target synthetic table data.

[0187] Optionally, a tabular data generation apparatus may further include a determining module.

[0188] Optionally, the determining module, when determining the first mean loss, is specifically used for: calculating the negative value of the output mean of the dual conditional discriminator for the combination of real data and conditional vectors, and the output mean of the dual conditional discriminator for the combination of synthetic data and conditional vectors, and adding the negative value of the output mean of the combination of real data and conditional vectors to the output mean of the combination of synthetic data and conditional vectors to obtain the first mean loss; wherein, the real data is the training data obtained after preprocessing; the synthetic data is the data output by the generator based on the noise vector and conditional vector; the step of determining the gradient penalty loss includes: calculating the squared mean of the gradient norm of the input of the dual conditional discriminator for the combination of synthetic data and conditional vectors, and multiplying it by a regularization coefficient to obtain the gradient penalty loss; the first total loss function is the sum of the first mean loss, the gradient penalty loss, and the proximal optimization loss.

[0189] Optionally, the determining module, when determining the proximal optimization loss, is specifically used for: for the combination of real data and conditional vectors, calculating the ratio of the output probability of the current dual-conditional discriminator to that of the previous generation dual-conditional discriminator for real data, and constructing a first loss term based on the discrimination penalty term of the real data; for the combination of synthetic data and conditional vectors, calculating the ratio of the output probability of the current dual-conditional discriminator to that of the previous generation dual-conditional discriminator for synthetic data, and constructing a second loss term based on the discrimination penalty term of the synthetic data; and determining the proximal optimization loss based on the first loss term, the second loss term, and the regularization term of the KL divergence between the output distributions of the current dual-conditional discriminator and the previous generation dual-conditional discriminator.

[0190] Optionally, the determining module, when determining the discriminator adversarial loss based on the pessimistic input mechanism, is specifically used to: sum the product of the gradient value of the dual-conditional discriminator on the combination of synthetic data and conditional vector and the preset adjustment coefficient, with the combination of synthetic data and conditional vector, to obtain the pessimistic input; and calculate the negative logarithm of the output value of the dual-conditional discriminator on the pessimistic input to obtain the discriminator adversarial loss based on the pessimistic input mechanism.

[0191] Optionally, the information loss is the sum of the second mean loss and the variance loss, where: the second mean loss is the mean difference between the output of the dual conditional discriminator after removing the last two layers for the combination of real data and conditional vectors and the output for the combination of synthetic data and conditional vectors; the variance loss is the norm difference between the output of the dual conditional discriminator after removing the last two layers for the combination of real data and conditional vectors and the output for the combination of synthetic data and conditional vectors.

[0192] Optionally, when training the generator based on the second total loss function, the training module 34 is specifically used to: optimize the adversarial loss and information loss using a discriminator based on a pessimistic input mechanism; optimize the classification loss using the output of the auxiliary classifier; wherein the classification loss is obtained by calculating the average cross-entropy between the label of the synthetic data and the predicted probability of the synthetic data by the auxiliary classifier.

[0193] Optionally, the preprocessing module 32 is further configured to: perform a logarithmic transformation on the target feature column with a long-tail distribution; wherein the target feature column is a continuous feature column or a continuous part of a mixed feature column; the logarithmic transformation includes: if the lower limit value of the target feature column is positive, then taking the logarithm of the data value; if the lower limit value of the target feature column is not positive, then summing the difference between the data value and the lower limit value with a preset positive number and then taking the logarithm.

[0194] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, as shown below. Figure 4 As shown, the electronic device 40 provided in this embodiment includes a processor 41 and a memory 42 communicatively connected to the processor 41.

[0195] The memory 42 stores computer execution instructions; the processor 41 executes the computer execution instructions stored in the memory 42 to implement the method provided in any of the above embodiments.

[0196] The program may include program code, which includes computer-executable instructions. Memory 42 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0197] In this embodiment, the memory 42 and the processor 41 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single straight line, but this does not mean that there is only one bus or one type of bus.

[0198] This application also provides a computer-readable storage medium, which stores computer-executable instructions that, when executed by a processor, are used to implement the method provided in any of the above embodiments.

[0199] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in any of the above embodiments.

[0200] Furthermore, the functional modules in the various embodiments of this application can be integrated into a single processing unit, or each module can exist physically separately, or two or more modules can be integrated into a single unit. The aforementioned modular unit can be implemented in hardware or in a combination of hardware and software functional units. The integrated modules implemented as software functional modules can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods in the various embodiments of this application.

[0201] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The memory may include high-speed RAM, and may also include non-volatile memory (NVM), such as at least one disk drive, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.

[0202] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0203] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for generating tabular data, characterized in that, include: Obtain initial table data, wherein the initial table data includes continuous feature columns, discrete feature columns, and mixed feature columns; The initial table data is preprocessed to obtain preprocessed training data; wherein, the preprocessing includes encoding and normalizing the continuous feature columns based on a Gaussian mixture model, performing one-hot encoding on the discrete feature columns, and decomposing the mixture feature columns into continuous and discrete parts and encoding them respectively; Construct a generative adversarial network (GAN) model; wherein the GAN model includes at least a dual-condition discriminator, an auxiliary classifier, and a generator; The generative adversarial network model is trained adversarially based on the preprocessed training data; wherein, the dual-conditional discriminator is trained based on a first total loss function, and the first total loss function combines a first mean loss, gradient penalty loss, and proximal optimization loss; the generator is trained based on a second total loss function, and the second total loss function combines discriminator adversarial loss based on a pessimistic input mechanism, information loss, and classification loss; The noise vector and the condition vector are input into a convergent generator to obtain the initial synthetic data; wherein the condition vector is formed by concatenating the representation vectors of the preprocessed discrete feature columns and the representation vectors of the mixed feature columns, and the noise vector follows a standard normal distribution; The initial synthetic data is subjected to inverse preprocessing to obtain the target synthetic table data.

2. The method according to claim 1, characterized in that, The step of determining the first mean loss includes: calculating the negative value of the output mean of the dual conditional discriminator for the combination of real data and conditional vector, and the output mean of the dual conditional discriminator for the combination of synthetic data and conditional vector, and adding the negative value of the output mean of the combination of real data and conditional vector to the output mean of the combination of synthetic data and conditional vector to obtain the first mean loss; The real data is the training data obtained after preprocessing; the synthetic data is the data output by the generator based on the noise vector and the condition vector. The step of determining the gradient penalty loss includes: calculating the squared mean of the gradient norm of the dual conditional discriminator for the input of the combination of synthetic data and conditional vector, and multiplying it by a regularization coefficient to obtain the gradient penalty loss. The first total loss function is the sum of the first mean loss, the gradient penalty loss, and the proximal optimization loss.

3. The method according to claim 2, characterized in that, The steps for determining the proximal optimization loss include: For the combination of real data and conditional vectors, calculate the ratio of the output probability of the current dual-conditional discriminator to that of the previous generation dual-conditional discriminator for the real data, and construct a first loss term based on the discrimination penalty term of the real data; For the combination of synthetic data and conditional vectors, calculate the ratio of the output probability of the current dual conditional discriminator to that of the previous generation dual conditional discriminator for the synthetic data, and construct a second loss term based on the discrimination penalty term of the synthetic data; The near-end optimization loss is determined based on the first loss term, the second loss term, and the regularization term of the KL divergence between the output distribution of the current dual-condition discriminator and the previous generation dual-condition discriminator.

4. The method according to claim 1, characterized in that, The steps for determining the adversarial loss of the discriminator based on the pessimistic input mechanism include: The product of the gradient value of the combination of synthetic data and conditional vector by the dual-conditional discriminator and the preset adjustment coefficient is summed with the combination of synthetic data and conditional vector to obtain the pessimistic input. Calculate the negative logarithm of the output value of the dual-condition discriminator for the pessimistic input to obtain the discriminator adversarial loss based on the pessimistic input mechanism.

5. The method according to claim 1, characterized in that, The information loss is the sum of the second mean loss and the variance loss, where: The second mean loss is the mean difference between the output of the dual-condition discriminator after removing the last two layers and the output of the synthetic data and the condition vector combination. The variance loss is the norm difference between the output of the dual conditional discriminator after removing the last two layers and the output of the synthetic data and the conditional vector combination.

6. The method according to claim 1, characterized in that, The training of the generator based on the second total loss function includes: The discriminator based on the pessimistic input mechanism is used to optimize the adversarial loss and the information loss; The classification loss output by the auxiliary classifier is used for optimization; wherein the classification loss is obtained by calculating the average cross-entropy between the label of the synthetic data and the predicted probability of the synthetic data by the auxiliary classifier.

7. The method according to claim 1, characterized in that, The preprocessing also includes: A logarithmic transformation is performed on the target feature column that exhibits a long-tail distribution; wherein the target feature column is the continuous portion of the continuous feature column or the mixed feature column; The logarithmic transformation includes: if the lower limit value of the target feature column is positive, then taking the logarithm of the data value; if the lower limit value of the target feature column is not positive, then summing the difference between the data value and the lower limit value with a preset positive number and then taking the logarithm.

8. A tabular data generation device, characterized in that, include: The acquisition module is used to acquire initial table data, wherein the initial table data includes continuous feature columns, discrete feature columns, and mixed feature columns; A preprocessing module is used to preprocess the initial table data to obtain preprocessed training data; wherein, the preprocessing includes encoding and normalizing the continuous feature columns based on a Gaussian mixture model, performing one-hot encoding on the discrete feature columns, and decomposing the mixture feature columns into continuous and discrete parts and encoding them respectively; A building module is used to construct a generative adversarial network model; wherein the generative adversarial network model includes at least a dual-condition discriminator, an auxiliary classifier, and a generator; The training module is used to perform adversarial training on the generative adversarial network model based on the preprocessed training data; wherein, the dual-conditional discriminator is trained based on a first total loss function, and the first total loss function combines a first mean loss, gradient penalty loss, and proximal optimization loss; the generator is trained based on a second total loss function, and the second total loss function combines a discriminator adversarial loss based on a pessimistic input mechanism, information loss, and classification loss; The generation module is used to input the noise vector and the condition vector into the convergent generator to obtain the initial synthetic data; wherein, the condition vector is formed by concatenating the representation vector of the preprocessed discrete feature column and the representation vector of the mixed feature column, and the noise vector follows a standard normal distribution; The generation module is also used to perform inverse preprocessing on the initial synthetic data to obtain target synthetic table data.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.

11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-7.