Method, apparatus, medium, and program product for generating synthetic data
By combining multiple generative adversarial networks and discriminator networks, synthetic data with conditional annotations is generated and fine-grained classification is performed. This solves the problems of uneven data distribution and lack of personalized annotations in synthetic data models, and improves the comprehensiveness and accuracy of model training and testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIONPAY
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-29
AI Technical Summary
Existing synthetic data models in the financial payment field suffer from uneven data distribution and a lack of personalized annotations, resulting in insufficient coverage for model training and testing, making it difficult to meet the needs of multiple scenarios.
By combining multiple generative adversarial networks and a discriminator network, the generative adversarial network is trained to generate initial synthetic data with conditional labels. This data is then divided into multiple synthetic data sets, and the discriminator network is used for fine-grained classification and adjustment to finally generate balanced synthetic data.
It improves the coverage and interpretability of synthetic data, ensures the classification accuracy of synthetic data, solves the problem of uneven data distribution, and enhances the comprehensiveness of model training and product testing.
Smart Images

Figure CN122114060A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more specifically, to methods, apparatus, computer-readable storage media, and computer program products for generating synthetic data. Background Technology
[0002] In the financial payments sector, synthetic data is frequently used for testing, training, and similar purposes due to privacy and compliance concerns, data scale, and data availability. Specifically, synthetic data refers to artificially generated data (generated through algorithms, such as artificial intelligence algorithms) that shares similar statistical characteristics and distribution patterns with the original data but does not contain any information about real individuals or entities. Synthetic data retains the value of the original data (e.g., statistical value) while mitigating issues such as privacy breaches, data scarcity, and compliance risks.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] This application provides methods, apparatus, media, and program products for generating synthetic data. The methods enable the extraction of low-frequency and outlier data from the original data, thus improving the problem of imbalanced data distribution in synthetic data. Furthermore, in addition to training on the dataset, the methods introduce conditional inputs. These conditions can be personalized labels such as scene, type, etc. This transforms the synthetic data model from an unsupervised learning model into a classifiable and predictable model, thereby improving the comprehensiveness, interpretability, and accuracy of model training and product testing.
[0005] According to a first aspect of this application, a method for generating synthetic data is provided, the method comprising: acquiring raw data and a condition set; training a generative adversarial network based on the raw data and the condition set to generate initial synthetic data with conditional annotations; dividing the initial synthetic data with conditional annotations into multiple synthetic data sets; and adjusting the generative adversarial network using one or more of the multiple synthetic data sets to generate final synthetic data.
[0006] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the original data includes transaction messages, and the condition set includes a set of transaction types.
[0007] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the generative adversarial network includes two generative adversarial subnetworks, wherein each generative adversarial subnetwork includes a generator and a discriminator.
[0008] As an alternative or supplement to the above solution, in a method according to an embodiment of this application, the first generative adversarial network of the two generative adversarial subnetworks is trained to generate initial synthetic data based on the original data, and the second generative adversarial network of the two generative adversarial subnetworks is trained to generate initial synthetic data with conditional annotations based on the initial synthetic data and the condition set.
[0009] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the first generative adversarial network includes a first generator and a first discriminator. The first generator is trained to generate initial synthetic data based on the original data, and the first discriminator is trained to determine the authenticity of the initial synthetic data generated by the first generator.
[0010] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the second generative adversarial network includes a second generator and a second discriminator. The second generator is trained to generate initial synthetic data with conditional annotations based on initial synthetic data that the first discriminator judges to be true and a set of conditions. The second discriminator is trained to determine whether the initial synthetic data matches the annotated conditions.
[0011] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, dividing the initial synthetic data with conditional annotations into multiple synthetic data sets includes: dividing the initial synthetic data with conditional annotations into multiple synthetic data sets through a discriminator network.
[0012] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the discriminator network includes a third discriminator, a fourth discriminator, and a fifth discriminator; wherein the third discriminator is configured to perform a yes / no judgment, the fourth discriminator is configured to perform a first classification judgment based on the third discriminator's judgment of yes, and the fifth discriminator is configured to perform a second classification judgment based on the third discriminator's judgment of no.
[0013] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the yes / no determination includes: whether the initial synthetic data with conditional annotations is data under normal scenario conditions.
[0014] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the yes / no determination includes: whether the initial synthetic data with conditional annotations is data that passed the comparison during the parallel split test.
[0015] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, the multiple synthetic data sets include multiple classification data sets obtained by a first classification judgment, a data set that the first classification judgment failed to identify, multiple classification data sets obtained by a second classification judgment, and a data set that the second classification judgment failed to identify.
[0016] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, one or more of the plurality of synthetic data sets include a data set that was not identified by the first classification judgment and / or a data set that was not identified by the second classification judgment.
[0017] As an alternative or supplement to the above solutions, in a method according to an embodiment of this application, adjusting the generative adversarial network using one or more of a plurality of synthetic data sets includes: iteratively training the generative adversarial network using one or more of a plurality of synthetic data sets; and using the iteratively trained generative adversarial network to generate final synthetic data.
[0018] According to a second aspect of this application, an apparatus for generating synthetic data is provided, the apparatus comprising: a memory; a processor; and a computer program stored in the memory and executable on the processor, the execution of the computer program causing the following operations: acquiring raw data and a set of conditions; training a generative adversarial network based on the raw data and the set of conditions to generate initial synthetic data with conditional annotations; dividing the initial synthetic data with conditional annotations into multiple sets of synthetic data; and adjusting the generative adversarial network using one or more of the multiple sets of synthetic data to generate final synthetic data.
[0019] According to a third aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed, perform any of the methods described according to a first aspect of this application.
[0020] According to a fourth aspect of this application, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements any one of the methods described according to a first aspect of this application. Attached Figure Description
[0021] The above and / or other aspects and advantages of this application will become clearer and more readily understood from the following description taken in conjunction with the accompanying drawings, in which the same or similar elements are denoted by the same reference numerals. In the drawings: Figure 1 This is a flowchart of a method 100 for generating synthetic data according to an embodiment of this application; Figure 2This is a schematic diagram of a generative adversarial network 200 according to an embodiment of this application; Figure 3 This is a schematic diagram of a discriminator network 300 according to an embodiment of this application; Figure 4 This is a block diagram of an apparatus 40 for generating synthetic data according to an embodiment of this application. Detailed Implementation
[0022] The following detailed description is merely exemplary in nature and is not intended to limit the disclosed technology or its application and use. Furthermore, it is not intended to be bound by any express or implied theory presented in the foregoing technical fields, background art, or the following detailed description.
[0023] In the following detailed description of the embodiments, numerous specific details are set forth in order to provide a more thorough understanding of the disclosed technology. However, it will be apparent to those skilled in the art that the disclosed technology can be practiced without these specific details. In other instances, well-known features have not been described in detail to avoid unnecessarily complicating the description.
[0024] Terms such as "possessing" and "comprising" indicate that, in addition to the units (modules) and steps directly and explicitly stated in the specification and claims, the technical solution of this application does not exclude the presence of other units (modules) and steps not directly or explicitly stated. Terms such as "first" and "second" do not indicate the order of the units in terms of time, space, size, etc., but are merely used to distinguish the units. Furthermore, the steps in this document are not limited to being performed in the order they are written; a step written later may be performed simultaneously with or before a step written earlier.
[0025] Generally, to generate synthetic data, it is necessary to acquire real-world data from actual operations and use this real data as raw data to train an AI model. This allows the AI model to learn various patterns from a small amount of real raw data, thereby generating synthetic data similar to the original data. Synthetic data can exhibit similar statistical characteristics and distribution patterns to the original data and can replace the original data in processes such as product testing and model training. This is particularly advantageous when the scale of the original data is limited or the process of obtaining the original data is complex, because compared to original data, synthetic data can be generated at any time and at any scale without having to undergo complete licensing, data anonymization, or similar operations.
[0026] Generative Adversarial Networks (GANs) are one of the mainstream techniques for generating synthetic data. They consist of a generator and a discriminator that compete against each other and iteratively optimize. Specifically, the generator produces synthetic data based on the original data, aiming to make the discriminator unable to distinguish between the generated synthetic data and the real original data. The discriminator, on the other hand, aims to accurately distinguish between the real original data and the synthetic data. The two compete against each other and eventually reach a Nash equilibrium through training iterations. That is, the synthetic data generated by the generator is indistinguishable from the real original data, and the discriminator can only randomly guess the authenticity of the input data with a 50% probability.
[0027] As mentioned above, since synthetic data is obtained based on raw data, it will exhibit the same distribution pattern as the raw data. However, with product iteration and upgrades, it may be desired that the product covers a wider range of scenarios or performs well in more scenarios, not just the main ones. In this case, low-frequency or outlier data in the raw data may be more valuable for the testing process. For example, in the raw data of financial payments, more than 90% of the raw data may belong to consumer data, and the remaining 10% may also mainly consist of several types of data. Correspondingly, synthetic data may be larger in scale, but it still exhibits this distribution pattern. That is, the amount of synthetic data is sufficient, but the richness of data types is still low, and there is an imbalance in data distribution.
[0028] Furthermore, most synthetic data models are unsupervised learning models, so the generated synthetic data lacks personalized labels such as scene and type, making it difficult for users to manually adjust the model using corresponding low-frequency data. Moreover, in generative adversarial networks, the discriminator is only responsible for determining whether the data is true or false, and cannot achieve classification and prediction effects.
[0029] Therefore, this application provides a method for generating synthetic data, which can be applied to system data testing or other scenarios requiring synthetic data. The method can specifically present low-frequency and outlier data in the synthetic data as a dedicated dataset for automatic or manual adjustment of the generator, thereby changing the distribution of the synthetic data generated by the generator (e.g., increasing the richness of the synthetic data). The synthetic data generated by this method can improve the coverage of test scenarios and has stronger interpretability, while ensuring the classification accuracy of the synthetic data without affecting the performance of the generator and discriminator.
[0030] In the following, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings.
[0031] refer to Figure 1 , Figure 1 This is a flowchart of a method 100 for generating synthetic data according to an embodiment of this application. In step 102, raw data and a set of conditions are obtained. For example, the raw data may be the original production message in a financial payment product, such as a transaction message; while the set of conditions may be a set of transaction types, such as consumption type, transfer type, or pre-authorization type, etc. In some embodiments, for product or system testing, the corresponding raw data and set of conditions can be obtained in response to the operation of the tester. Specifically, the tester can input the test requirements to be performed (e.g., regression test requirements, parallel flow test requirements, and functional test requirements). Based on these test requirements, the required data format and data quantity can be determined, a corresponding test strategy can be formulated, and a data model can be initialized. Furthermore, the corresponding raw data and set of conditions can be obtained according to the required data format and data quantity.
[0032] In some embodiments, the raw data also needs to be preprocessed to remove invalid or obviously erroneous raw data.
[0033] In step 104, a generative adversarial network can be trained based on the original data and the condition set to generate initial synthetic data with conditional annotations. (See reference) Figure 2 , Figure 2 This is a schematic diagram of a generative adversarial network 200 according to an embodiment of this application. Figure 2 As illustrated in the diagram, the Generative Adversarial Network 200 includes two generative adversarial subnetworks, each comprising a generator and a discriminator. The first generative adversarial subnetwork is trained to generate initial synthetic data X1 based on the original data, while the second generative adversarial subnetwork is trained to generate initial synthetic data (C1, X1) with conditional labels based on the initial synthetic data X1 and a condition set C.
[0034] Specifically, the first generative adversarial network includes a first generator G1 and a first discriminator D1. The first generator G1 is trained to generate initial synthetic data X1 based on the original data X, and the first discriminator D1 is trained to determine whether the initial synthetic data X1 generated by the first generator is true or false. If the synthetic data X1 generated by the first generator G1 is determined to be false by the first discriminator D1, the first discriminator D1 provides feedback information indicating that such synthetic data is false to the first generator G1 for optimization. If the synthetic data X1 generated by the first generator G1 is determined to be true by the first discriminator D1, then X1 is provided to the next step. As described above, the goal of the first generator G1 is to generate synthetic data X1 that is as close as possible to the original data X, so that the first discriminator D1 cannot distinguish between the two, while the goal of the first discriminator D1 is to distinguish between the original data X and the synthetic data X1 as accurately as possible. In this case, both the first generator G1 and the first discriminator D1 perform a single function with a single purpose, thus achieving better performance.
[0035] Similarly, the second generative adversarial network includes a generator G2 and a discriminator D2. The second generator G2 is trained to generate initial synthetic data (C1, X1) with conditional annotations based on initial synthetic data X1 that the first discriminator D1 determines to be true, and a condition set C. The second discriminator D2 is trained to determine whether the initial synthetic data X1 matches the labeled condition C1. If the second discriminator D2 determines that X1 does not match C1, it provides feedback indicating this mismatch to the second generator G2 for optimization. If the second discriminator D2 determines that X1 matches C1, it provides the initial synthetic data (C1, X1) with conditional annotations to the next step. As described above, since the truth or falsehood of the initial synthetic data X1 is ensured by the first generative adversarial network, the purpose of the second generator G2 is only to provide conditional annotations for the initial synthetic data as accurately as possible, without considering the truth or falsehood of the generated data. On the other hand, the second discriminator D2 only needs to determine whether X1 matches C1 in (C1, X1) generated by the second generator G2, without needing to determine the truth or falsehood of the data. In this case, the second generator G2 and the second discriminator D2 perform a single function for a single purpose, thus achieving better performance.
[0036] In fact, training the generator and discriminator in generative adversarial networks (GANs) is a dynamic game. Therefore, attempting to combine multiple tasks (e.g., determining the truth or falsehood of generated data and whether data meets labeling conditions) onto a single discriminator and train a perfect discriminator can actually degrade the generator's performance. Compared to general Conditional Generative Adversarial Networks (CGANs), such as... Figure 2 The generative adversarial network 200 illustrated in the figure has multiple generative adversarial subnetworks (e.g., multiple generators and multiple discriminators) and allows each generator and discriminator to perform only a single task. This can help improve the performance of the generative adversarial network, thereby providing initial synthetic data that is closer to the original data and has more accurate conditional annotations.
[0037] In some embodiments, the following steps may be used for implementation and training. Figure 2 The generative adversarial network 200 shown in the diagram is as follows: S1 Initializes the generative adversarial network (e.g., first generator G1, second generator G2, first discriminator D1, and second discriminator D2); S2 Generates the first batch of synthetic data using the first generator G1 and continuously trains the first generator G1; S3 Inputs the synthetic data and real data into the first discriminator D1 and trains the first discriminator D1; S4 Performs correlation scoring based on the loss function and optimization algorithm, and uses the first discriminator D1 to determine whether the synthetic data is real. If the synthetic data is determined to be unreal, return to step S2; if the synthetic data is determined to be real, proceed to S5: Save the synthetic data X1 that is determined to be real. S6 Input the condition C (e.g., the condition set) and the synthetic data X1 into the second generator G2 and train the second generator G2; S7 Input the real data (C, X) with condition labels and the synthetic data (C1, X1) generated by the second generator G2 into the second discriminator D2 and train the second discriminator D2; S8 Perform correlation scoring based on the conditional loss function, Monte Carlo algorithm and gradient descent algorithm, and use the second discriminator D2 to determine whether X1 and C1 match. If X1 and C1 do not match, return to S6. If X1 and C1 match, proceed to S9 and save the synthetic data (C1, X1) with condition labels that are judged to be matched.
[0038] As an example, the original data X can be the original transaction message in a financial payment product. The first generator G1 generates a synthetic transaction message that closely resembles the original transaction message, excluding user privacy information such as card number and user identity. The first discriminator D1 determines the authenticity of the synthetic transaction message and provides the synthetic transaction message X1, which is determined to be genuine, to the second generator G2. A synthetic transaction message determined to be fake may be an unreasonable synthetic transaction message, for example, the generated transaction message is not within the scope of transactions currently known in the system, and invalid data of this type does not exist in reality. The second generator G2 can receive the synthetic transaction message X1 and the condition set C from the first discriminator D1. For example, the condition set C can be the type of transaction, such as consumption, transfer, pre-authorization, or the like. The second generator G2 can provide a suitable condition label C1 for the transaction message X1 from the condition set C, thereby generating a synthetic transaction message (C1, X1) with condition label. The second discriminator D2 determines whether X1 matches C1. A composite transaction message with conditional annotations that is judged as mismatched may be due to an annotation that does not belong to the condition set C, or the annotation may be incorrect. For example, if the second generator G2 provides a transfer annotation for a consumption-type transaction message, the second discriminator D2 can determine this type of mismatch.
[0039] By following the above process or steps, initial synthetic data with accurate conditional annotations that closely resemble the original data can be generated. Next, continue to refer to... Figure 1 In step 106, the initial synthetic data with conditional annotations is divided into multiple synthetic data sets. As mentioned above, due to the imbalanced distribution of the original data, the initial synthetic data generated by the generative adversarial network is often also imbalanced. This may be sufficient in the early stages of model training or product testing. However, as the model iterates and the product is upgraded, it may be necessary to pay more attention to the types of data that account for a smaller proportion, so that the model or product can perform well for various scenarios, not just the main scenarios. This requires a more refined division of the synthetic data so that one or more types of synthetic data can be used for further iterative training, or the generative adversarial network can be manually adjusted based on one or more types of synthetic data.
[0040] In some embodiments, the initial synthetic data with conditional annotations can be divided into multiple synthetic data sets by a discriminator network, wherein the discriminator network may include multiple discriminators. (See reference) Figure 3 , Figure 3 This is a schematic diagram of a discriminator network 300 according to an embodiment of this application.
[0041] like Figure 3As illustrated in the diagram, the discriminator network may include a third discriminator D3, a fourth discriminator D4, and a fifth discriminator D5. The third discriminator D3 is configured to perform a yes / no judgment, the fourth discriminator D4 is configured to perform a first classification judgment based on the third discriminator's yes judgment, and the fifth discriminator D5 is configured to perform a second classification judgment based on the third discriminator's no judgment. Specifically, the third discriminator D3 performs coarse-grained task classification, while the fourth and fifth discriminators D4 and D5 further perform fine-grained task classification based on the judgment of the third discriminator D3. For example, the third discriminator D3 can classify initially synthesized data with labels (e.g., from...). Figure 2 The generative adversarial network 200 performs binary judgments on (C1, X1) and performs preliminary classification (e.g., to generate (C2, X2) and (C3, X3)). The judgment conditions for the binary judgments can change depending on the usage scenario or user input. Accordingly, the fourth discriminator D4 and the fifth discriminator D5 can perform first classification judgments and second classification judgments on the initially labeled initial synthetic data after the initial classification, and the categories of these classification judgments can also change depending on the usage scenario or user input.
[0042] In some embodiments, the use cases for synthetic data can include regression testing, parallel traffic splitting testing, and similar scenarios. Specifically, regression testing refers to conducting comprehensive testing on a new version using numerous case studies when a new version needs to be released, ensuring that modifications or additions made to the new version do not introduce new anomalies. Parallel traffic splitting testing involves sending the same packet data traffic to two versions of the system before and after the update, and comparing the test results of the two versions processing the same batch of data. The test results are categorized as consistent or inconsistent. Inconsistent results are further divided into expected inconsistencies and unexpected inconsistencies. Expected inconsistencies refer to inconsistencies caused by version upgrades, while unexpected inconsistencies are the part that requires special attention and are results that this method fails to identify. The following will describe in detail the settings of the discriminator network 300 in the above two use cases through examples. It should be understood that in other embodiments, the use cases for synthetic data are not limited to testing and training, but can include any scenario requiring synthetic data.
[0043] On the one hand, in the example where the original data X is a transaction message, for a regression test scenario, the third discriminator D3 in the discriminator network can be derived from a generative adversarial network (e.g., Figure 2The generative adversarial network (GAN200) receives initial synthesized data (C1, X1) with conditional annotations and determines whether (C1, X1) is a transaction message under normal circumstances (e.g., a message indicating a successful transaction). Based on this yes / no binary judgment, the initial synthesized message (C1, X1) with conditional annotations can be divided into normal messages (C2, X2) and abnormal messages (C3, X3). Normal messages (C2, X2) can be messages indicating successful transactions, while abnormal messages (C3, X3) can be messages indicating failed transactions.
[0044] Next, the fourth discriminator D4 can classify and judge normal messages (C2, X2), while the fifth discriminator D5 can classify and judge abnormal messages (C3, X3). For example, the fourth discriminator D4 can divide normal messages (C2, X2) into multiple message sets (e.g., in the form of data sets) according to transaction type. These transaction types can include: consumption, pre-authorization, transfer, withdrawal, credit, contract, etc. Furthermore, for some messages within the normal messages (C2, X2), the fourth discriminator D4 may not be able to classify them into any known or existing type. For such messages, they can be separately classified into a message set that the fourth discriminator D4 cannot identify. Similarly, the fifth discriminator D5 can divide abnormal messages (C3, X3) into multiple message sets according to the reason for transaction failure. Reasons for transaction failure can include a rejection header, an exception before requesting database modification, timeout without response, late response, request MAC error, response unpacking exception, etc. Furthermore, for some of the abnormal messages (C3, X3), the fifth discriminator D5 may not be able to classify them as any known or existing reason for transaction failure. Such messages can be classified separately as a set of messages that the fifth discriminator D5 failed to recognize.
[0045] In the example of the regression testing scenario above, the yes / no judgment performed by the third discriminator D3 refers to whether the initial synthesized message (C1, X1) with conditional annotations represents data from a normal scenario. The first classification judgment performed by the fourth discriminator D4 refers to determining the transaction type for messages with successful transactions, and the second classification judgment performed by the fifth discriminator D5 refers to determining the reason for the transaction failure for messages with failed transactions. Therefore, as... Figure 3As illustrated in the diagram, the discriminator network 300 can divide the initial synthesized message with conditional annotations into sets of synthesized data of various types: N1, N2, N3... representing successful transactions (i.e., normal); N* representing successful transactions whose type could not be identified; A1, A2, A3... representing synthesized data of transactions that failed for various reasons (i.e., abnormal); and A* representing data whose failure reason could not be identified. In this case, the distribution of synthesized data can be intuitively understood from the amount of data in each set, and it is convenient to select one or more sets of data to adjust the generative adversarial network so that it can generate synthesized data with a balanced distribution.
[0046] As an example, in the synthetic messages of successful transactions, over 90% of the initial synthetic messages are consumer transaction synthetic messages (e.g., possibly corresponding to synthetic data set N1), while credit transaction synthetic messages (e.g., possibly corresponding to synthetic data set N3) may account for less than 5%. Therefore, based on the data volume of the multiple synthetic data sets output by the discriminator network 300, this data distribution imbalance can be intuitively understood. When testing for credit transaction scenarios, the corresponding synthetic data sets (e.g., N3) can be saved, and the generator can be iteratively trained using these synthetic data sets to solve the problem of the uneven distribution of the original data X. Additionally, the characteristics of other low-frequency data can be determined by analyzing messages whose type could not be identified (e.g., data in data set N*), and the generator can be iteratively trained using synthetic data with these characteristics, thereby adjusting the data distribution in the synthetic data.
[0047] Through the adversarial generative networks described above (e.g., Figure 2 Generative Adversarial Networks (GANs) and Discriminator Networks (e.g., Generative Adversarial Networks 20 ... Figure 3 The synthetic data generated by the discriminator network 300 not only has accurate conditional labels, but can also be divided into synthetic datasets with multiple fine-grained classifications. Furthermore, these synthetic datasets also include unidentified datasets, which can be particularly advantageous for coverage regression testing. This is because the unidentified datasets can be used to further expand the coverage of the product or system under test.
[0048] On the other hand, in the example where the original data X is a transaction message, the yes / no judgment, first classification judgment, and second classification judgment performed in the discriminator network may differ for the parallel traffic splitting test scenario. The operation of the discriminator network 300 in the parallel traffic splitting test scenario will be described in detail below.
[0049] In parallel splitting test scenarios, data from generative adversarial networks (e.g., Figure 2In the generative adversarial network (GAN), the conditionally labeled initial synthesized message (C1, X1) is not directly provided to the discriminator network. Instead, it undergoes parallel splitting testing, and the test results of the conditionally labeled initial synthesized message (C1, X1) in the parallel splitting test are obtained. Next, the third discriminator D3 in the discriminator network determines whether the conditionally labeled initial synthesized message (C1, X1) passed the test result comparison during the parallel splitting test. Through this binary yes / no judgment, the conditionally labeled initial synthesized message (C1, X1) can be divided into messages that passed the comparison (C2, X2) and messages that failed the comparison (C3, X3). Messages that passed the comparison (C2, X2) can be messages that produce the same output result in multiple parallel versions of the system, while messages that failed the comparison (C3, X3) can be messages that produce different output results in multiple parallel versions of the system. In some respects, comparing the failed packets (C3, X3) may be more valuable for parallel traffic splitting test scenarios.
[0050] Next, the fourth discriminator D4 can classify the messages that pass the comparison (C2, X2), while the fifth discriminator D5 can classify the messages that fail the comparison (C3, X3). For example, the fourth discriminator D4 can divide the messages that pass the comparison (C2, X2) into multiple message sets (e.g., in the form of a dataset) according to transaction attributes. These transaction attributes can include: second and third-class account transactions, reversal transactions, manual error transactions, foreign card transactions, etc. Furthermore, for some messages in the messages that pass the comparison (C2, X2), the fourth discriminator D4 may not be able to classify them into any known or existing transaction attributes. For such messages, they can be separately classified into a message set that the fourth discriminator D4 cannot identify. Similarly, the fifth discriminator D5 can divide the messages that fail the comparison (C3, X3) into multiple message sets according to the reason for the failure. Reasons for failure can include exceeding the credit limit, abnormal API call, institution timeout without response, etc. Furthermore, for some of the messages that fail the comparison (C3, X3), the fifth discriminator D5 may not be able to classify them for any known or existing reason. Such messages can be classified separately as a set of messages that the fifth discriminator D5 failed to recognize.
[0051] In some embodiments, the set of packets that such a fourth discriminator D4 and / or fifth discriminator D5 fails to identify can be the focus of investigation in parallel traffic splitting tests, and thus the generative adversarial network can be adjusted based on these unidentified packet sets to generate more targeted final synthetic data.
[0052] In the example of the parallel traffic splitting test scenario above, the yes / no judgment performed by the third discriminator D3 refers to whether the initial synthesized message (C1, X1) with conditional annotations is data that passes the test comparison. The first classification judgment performed by the fourth discriminator D4 refers to judging the transaction attributes of messages that pass the comparison, and the second classification judgment performed by the fifth discriminator D5 refers to judging the reason for the failure of messages that fail the comparison. Therefore, as Figure 3 As illustrated in the diagram, the discriminator network 300 can divide the initial synthesized message (C1, X1) with conditional annotations into synthesized data sets N1, N2, N3... that pass the comparison for various transaction attributes, N* that fail the comparison for transaction attributes, A1, A2, A3... that fail the comparison for various reasons, and A* for which the reason for failure cannot be identified. In this case, the distribution of synthesized data can be intuitively understood from the amount of data in each data set, and it is convenient to select one or more data sets to adjust the generative adversarial network so that it can generate synthesized data with a balanced distribution.
[0053] As an example, in the synthesized messages that pass the comparison, over 90% of the initial synthesized messages are likely consumer transaction synthesized messages (e.g., possibly corresponding to synthesized data set N1), while credit transaction synthesized messages (e.g., possibly corresponding to synthesized data set N3) may account for less than 5%. Therefore, based on the data volume of the multiple synthesized data sets (e.g., N1 and N3) output by the discriminator network 300, this data imbalance can be intuitively understood. When conducting parallel traffic splitting tests for credit transaction scenarios, the corresponding synthesized data sets (e.g., N3) can be saved, and the generator can be iteratively trained using these synthesized data to solve the problem of the uneven distribution of the original data X. Additionally, the characteristics of other low-frequency data can be determined by analyzing messages whose transaction attributes were not identified (e.g., data in data set N*), and the generator can be iteratively trained using synthesized data with such characteristics, thereby adjusting the data distribution in the synthesized data.
[0054] Figure 3 The discriminator network 300 can divide the initial message data (C1, X1) with conditional annotations into multiple synthetic data sets with fine granularity, making the initial synthetic data more interpretable. Compared with the general mass production of synthetic data that lacks annotation and clustering, the initial synthetic data presented in this application, which is presented as multiple synthetic data sets, can more clearly show the distribution of synthetic data and currently unknown boundary data. Such initial synthetic data has higher use value and reference value.
[0055] return Figure 1In step 108, the generative adversarial network is adjusted using one or more of a plurality of synthetic data sets to generate the final synthetic data. Specifically, in some embodiments, one or more of the plurality of synthetic data sets include data sets that the first classification decision failed to identify (e.g., Figure 3 The unidentified data set N*) and / or the data set that the second classification judgment failed to identify (e.g., Figure 3 The unidentified data set A*).
[0056] In some embodiments, adjusting the generative adversarial network using one or more of the plurality of synthetic datasets includes: iteratively training the generative adversarial network using one or more of the plurality of synthetic datasets; and using the iteratively trained generative adversarial network to generate final synthetic data.
[0057] By adjusting in step 108, the generative adversarial network (GAN) can obtain more low-frequency data or anomalous data that were previously less frequent in the original data X as input. Therefore, the final synthetic data output by the GAN will exhibit a more balanced distribution. This avoids the imbalanced distribution of the final synthetic data caused by the uneven distribution of the original data, and consequently avoids incomplete testing or training due to the imbalanced distribution of the final synthetic data.
[0058] The final synthetic data obtained through method 100 exhibits high interpretability and completeness, as well as good distribution balance. This is particularly advantageous for scenarios requiring the batch use of synthetic data.
[0059] refer to Figure 4 , Figure 4 This is a block diagram of an apparatus 40 for generating synthetic data according to an embodiment of this application. The apparatus 40 includes a memory 410, a processor 420, and a computer program 430 stored in the memory 410 and executable on the processor 420, the execution of which causes the method 100 described above to be performed.
[0060] Furthermore, as described above, this application can also be implemented as a computer-readable storage medium storing a program for executing the method 100 described above. Here, various types of computer-readable storage media can be used, such as disks (e.g., magnetic disks, optical disks, etc.), cards (e.g., memory cards, optical cards, etc.), semiconductor memories (e.g., ROM, non-volatile memory, etc.), and tapes (e.g., magnetic tape, cassette tape, etc.).
[0061] This application can also be implemented as a computer program product comprising a computer program that, when executed by a processor, performs the steps of method 10 as described above.
[0062] Where applicable, the various embodiments provided in this application may be implemented using hardware, software, or a combination of hardware and software. Furthermore, where applicable, without departing from the scope of this application, the various hardware and / or software components described herein may be combined into composite components comprising software, hardware, and / or both. Where applicable, without departing from the scope of this application, the various hardware and / or software components described herein may be divided into sub-components comprising software, hardware, or both. Additionally, where applicable, it is contemplated that software components may be implemented as hardware components, and vice versa.
[0063] The software (such as program code and / or data) according to this application can be stored on one or more computer storage media. It is also contemplated that the software identified herein can be implemented using one or more networked and / or otherwise general-purpose or special-purpose computers and / or computer systems. Where applicable, the order of the various steps described herein can be changed, combined into compound steps, and / or divided into sub-steps to provide the features described herein.
[0064] The embodiments and examples presented herein are provided to best illustrate embodiments of this application and its particular applications, thereby enabling those skilled in the art to implement and use this application. However, those skilled in the art will understand that the above description and examples are provided for ease of illustration and example only. The descriptions presented are not intended to cover all aspects of this application or to limit this application to the precise forms disclosed.
Claims
1. A method for generating synthetic data, characterized in that, The method includes: Obtain the raw data and the set of conditions; A generative adversarial network is trained based on the original data and the condition set to generate initial synthetic data with conditional annotations. The initial synthetic data with conditional annotations is divided into multiple synthetic data sets; The generative adversarial network is adjusted using one or more of the plurality of synthetic data sets to generate the final synthetic data.
2. The method as described in claim 1, wherein, The raw data includes transaction messages, and the condition set includes a set of transaction types.
3. The method as described in claim 1, wherein, The generative adversarial network includes two generative adversarial subnetworks, and each generative adversarial subnetwork includes a generator and a discriminator.
4. The method of claim 3, wherein, The first generative adversarial network of the two generative adversarial networks is trained to generate initial synthetic data based on the original data, and the second generative adversarial network of the two generative adversarial networks is trained to generate initial synthetic data with conditional labels based on the initial synthetic data and the condition set.
5. The method of claim 4, wherein, The first generative adversarial subnetwork includes a first generator and a first discriminator. The first generator is trained to generate initial synthetic data based on the original data, and the first discriminator is trained to determine the authenticity of the initial synthetic data generated by the first generator.
6. The method of claim 5, wherein, The second generative adversarial subnetwork includes a second generator and a second discriminator. The second generator is trained to generate initial synthetic data with conditional annotations based on the initial synthetic data that the first discriminator judges to be true and the condition set. The second discriminator is trained to determine whether the initial synthetic data matches the labeled conditions.
7. The method of claim 1, wherein, Dividing initial synthetic data with conditional labels into multiple synthetic data sets includes: dividing the initial synthetic data with conditional labels into multiple synthetic data sets using a discriminator network.
8. The method of claim 7, wherein, The discriminator network includes a third discriminator, a fourth discriminator, and a fifth discriminator; wherein the third discriminator is configured to perform a yes / no judgment, the fourth discriminator is configured to perform a first classification judgment based on the third discriminator's judgment of yes, and the fifth discriminator is configured to perform a second classification judgment based on the third discriminator's judgment of no.
9. The method of claim 8, wherein, The yes / no judgment includes: whether the initial synthetic data with conditional annotations is data under normal scenario conditions.
10. The method of claim 8, wherein, The yes / no judgment includes whether the initial synthetic data with conditional annotations is the data that passed the comparison during the parallel split test.
11. The method of claim 8, wherein, The plurality of synthetic datasets include a plurality of categorized datasets derived from the first classification judgment, a dataset that the first classification judgment failed to identify, a plurality of categorized datasets derived from the second classification judgment, and a dataset that the second classification judgment failed to identify.
12. The method of claim 11, wherein, One or more of the plurality of synthetic datasets include the datasets that the first classification judgment failed to identify and / or the datasets that the second classification judgment failed to identify.
13. The method of claim 1, wherein, Adjusting the generative adversarial network using one or more of the plurality of synthetic datasets includes: The generative adversarial network is iteratively trained using one or more of the plurality of synthetic datasets; and The final synthetic data is generated using a generative adversarial network that has been trained iteratively.
14. An apparatus for generating synthetic data, characterized in that, The device includes: a memory; a processor; and a computer program stored in the memory and executable on the processor, the execution of which causes the following operations: Obtain the raw data and the set of conditions; A generative adversarial network is trained based on the original data and the condition set to generate initial synthetic data with conditional annotations. The initial synthetic data with conditional annotations is divided into multiple synthetic data sets; The generative adversarial network is adjusted using one or more of the plurality of synthetic data sets to generate the final synthetic data.
15. The apparatus of claim 14, wherein, The raw data includes transaction messages, and the condition set includes a set of transaction types.
16. The apparatus of claim 14, wherein, The generative adversarial network includes two generative adversarial subnetworks, and each generative adversarial subnetwork includes a generator and a discriminator.
17. The apparatus of claim 16, wherein, The first generative adversarial network of the two generative adversarial networks is trained to generate initial synthetic data based on the original data, and the second generative adversarial network of the two generative adversarial networks is trained to generate initial synthetic data with conditional labels based on the initial synthetic data and the condition set.
18. The apparatus of claim 17, wherein, The first generative adversarial subnetwork includes a first generator and a first discriminator. The first generator is trained to generate initial synthetic data based on the original data, and the first discriminator is trained to determine the authenticity of the initial synthetic data generated by the first generator.
19. The apparatus of claim 18, wherein, The second generative adversarial subnetwork includes a second generator and a second discriminator. The second generator is trained to generate initial synthetic data with conditional annotations based on the initial synthetic data that the first discriminator judges to be true and the condition set. The second discriminator is trained to determine whether the initial synthetic data matches the labeled conditions.
20. The apparatus of claim 14, wherein, Dividing initial synthetic data with conditional labels into multiple synthetic data sets includes: dividing the initial synthetic data with conditional labels into multiple synthetic data sets using a discriminator network.
21. The apparatus of claim 20, wherein, The discriminator network includes a third discriminator, a fourth discriminator, and a fifth discriminator; wherein the third discriminator is configured to perform a yes / no judgment, the fourth discriminator is configured to perform a first classification judgment based on the third discriminator's judgment of yes, and the fifth discriminator is configured to perform a second classification judgment based on the third discriminator's judgment of no.
22. The apparatus of claim 21, wherein, The yes / no judgment includes: whether the initial synthetic data with conditional annotations is data under normal scenario conditions.
23. The apparatus of claim 21, wherein, The yes / no judgment includes whether the initial synthetic data with conditional annotations is the data that passed the comparison during the parallel split test.
24. The apparatus of claim 21, wherein, The plurality of synthetic datasets include a plurality of categorized datasets derived from the first classification judgment, a dataset that the first classification judgment failed to identify, a plurality of categorized datasets derived from the second classification judgment, and a dataset that the second classification judgment failed to identify.
25. The apparatus of claim 24, wherein, One or more of the plurality of synthetic datasets include the datasets that the first classification judgment failed to identify and / or the datasets that the second classification judgment failed to identify.
26. The apparatus of claim 14, wherein, Adjusting the generative adversarial network using one or more of the plurality of synthetic datasets includes: The generative adversarial network is iteratively trained using one or more of the plurality of synthetic datasets; and The final synthetic data is generated using a generative adversarial network that has been trained iteratively.
27. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed, perform the method according to any one of claims 1-13.
28. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-13.