A data generation method, related apparatus, device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2025-01-03
- Publication Date
- 2026-07-03
Smart Images

Figure CN122332945A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a data generation method, related apparatus, device, and storage medium. Background Technology
[0002] In the financial sector, risk assessment is a crucial task, and accurate risk assessment relies heavily on a large amount of representative sample data, especially non-performing financial samples. These non-performing financial samples play a key role in areas such as risk assessment model training, stress testing, and fraud detection, and their quality and quantity directly impact a financial institution's ability to identify, assess, and manage risk.
[0003] However, existing technologies have many shortcomings in generating financial non-performing loan (NPL) samples. Currently, the generation of NPL samples mainly relies on manual collection and labeling, or simple random generation methods. Manual operation is prone to errors and biases, affecting the accuracy and reliability of the samples, and the quantity and quality of the generated samples are relatively limited. Randomly generated NPL samples often differ significantly from real data, resulting in poor authenticity and representativeness, and failing to accurately reflect the actual situation of financial risk. Therefore, an effective method is urgently needed to address these issues. Summary of the Invention
[0004] This application provides a data generation method, related apparatus, equipment, and storage medium to solve the problems of poor accuracy, low reliability, and small number of financial bad debt samples generated in the current technology.
[0005] This application provides a data generation method, including:
[0006] Obtain random noise;
[0007] Random noise is input into the data generation model in the target generative adversarial network, and h candidate data are generated according to the data generation model. The target generative adversarial network is a semi-supervised learning model built based on sample data of the target business, and h is an integer greater than or equal to 1.
[0008] Filter the h candidate data to obtain p target data, where the target data are sample data used to train the prediction model corresponding to the target business, and p is an integer greater than or equal to 1 and less than or equal to h.
[0009] This application also provides a data generation apparatus, comprising:
[0010] The acquisition module is used to acquire random noise;
[0011] The generation module is used to input random noise into the data generation model in the target generative adversarial network and generate h candidate data according to the data generation model. The target generative adversarial network is a semi-supervised learning model built based on sample data of the target business, and h is an integer greater than or equal to 1.
[0012] The filtering module is used to filter h candidate data to obtain p target data, where the target data are sample data used to train the prediction model corresponding to the target business, and p is an integer greater than or equal to 1 and less than or equal to h.
[0013] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the data generation apparatus further includes:
[0014] The acquisition module is also used to acquire m sample data of the target business, where m is an integer greater than or equal to 1;
[0015] The analysis module is used to perform principal component analysis on m sample data to obtain m feature data. The data dimension of the feature data is lower than that of the corresponding sample data. The m feature data include m1 labeled feature data and m2 unlabeled feature data. m is an integer greater than or equal to 1, and m1 and m2 are both integers greater than or equal to 1 and less than or equal to m. m = m1 + m2, and m1 ≤ m2.
[0016] The acquisition module is also used to acquire the initial generative adversarial network, which includes a data generation model and a discriminant model. The initial parameters of the data generation model and the initial parameters of the discriminant model are both random values.
[0017] The training module is used to train the initial generative adversarial network based on m feature data, so as to adjust the initial parameters of the data generation model and the initial parameters of the discriminator model to obtain the target generative adversarial network.
[0018] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the analysis module is further configured to:
[0019] Generate a sample data matrix based on m sample data.
[0020] The covariance matrix is calculated based on the sample data matrix.
[0021] The covariance matrix is decomposed into eigenvalues to obtain n eigenvalues and n eigenvectors corresponding to the n eigenvalues;
[0022] Sort the n feature values in descending order, and select the first k feature values from the sorting results, where k is an integer greater than or equal to 1 and less than or equal to n;
[0023] Generate a projection matrix based on the k eigenvectors corresponding to the k eigenvalues;
[0024] Based on the sample data matrix and the projection matrix, the feature data matrix is calculated, where the feature data matrix includes m feature data.
[0025] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module is further configured to:
[0026] Obtain training random sample data;
[0027] The training random sample data is used as the input to the data generation model in the initial generative adversarial network, and the training generated data is obtained according to the data generation model.
[0028] The m feature data and the training generated data are used as inputs to the discriminative model in the initial generative adversarial network. Based on the discriminative model, m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data are generated.
[0029] Based on the m decision results corresponding to m feature data and the decision results corresponding to training random sample data, the data generation model and the discriminant model are trained adversarially to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thus obtaining the target generative adversarial network.
[0030] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module is further configured to:
[0031] Calculate the loss function of the data generation model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data;
[0032] Calculate the gradient of the parameters of the data generation model based on the loss function of the data generation model;
[0033] Adjust the initial parameters of the data generation model based on the gradient of the data generation model's parameters.
[0034] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module is further configured to:
[0035] Calculate the loss function of the discriminant model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data;
[0036] Calculate the gradient of the parameters of the discriminant model based on the loss function of the discriminant model;
[0037] The initial parameters of the discriminant model are adjusted based on the gradient of the discriminant model's parameters.
[0038] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the acquisition module is further configured to:
[0039] Obtain 'a' data points from the target business, where 'a' data points are structured data.
[0040] Data cleaning is performed on 'a' collected data to remove abnormal and erroneous data, resulting in 'b' cleaned data.
[0041] Denoising is performed on b clean data to obtain c denoised data.
[0042] Normalize c denoised data points to obtain m sample data points, where a≥b≥c≥m≥1, and a, b, and c are all integers.
[0043] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the acquisition module is further configured to:
[0044] Obtain a1 first raw data points and a2 second raw data points of the target business, wherein the first raw data points are structured data and the second raw data points are unstructured data, and a1 and a2 are both integers greater than or equal to 1, and a = a1 + a2;
[0045] Data structuring is performed on a2 original second data to obtain a2 transformed second data, where the transformed second data is structured data;
[0046] Based on a1 first original data and a1 second transformed data, a collected data are obtained.
[0047] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the filtering module is further configured to:
[0048] Obtain x sample data points for the target business, where x is an integer greater than or equal to 1;
[0049] Based on x sample data and h candidate data, calculate the distance between the h candidate data and the x sample data to obtain h sets of distance data corresponding to the h candidate data, where each set of distance data includes x distance values;
[0050] Based on the h groups of distance data, sort the h candidate data from smallest to largest, and select the top p candidate data from the h candidate data as the target data according to the sorting results.
[0051] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the filtering module is further configured to:
[0052] Obtain y sample data points for the target business, where y is an integer greater than or equal to 1;
[0053] Based on the similarity values between x sample data and h candidate data, classify the x sample data and h candidate data into r clusters, where each cluster includes at least one sample data and at least one candidate data.
[0054] Determine the target cluster from r clusters, where the similarity between the candidate data in the target cluster and the sample data in the target cluster is greater than a threshold;
[0055] p target data points are obtained by filtering the candidate data from the target cluster.
[0056] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module is further configured to:
[0057] The target generative adversarial network is trained based on p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0058] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module is further configured to:
[0059] Based on the stochastic gradient descent algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0060] or,
[0061] Based on the genetic algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0062] or,
[0063] Based on the simulated annealing algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0064] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application,
[0065] The target data is used to characterize the sample data of overdue orders. The training module is also used to: train the first risk assessment model based on p target data, wherein the first risk assessment model is used to predict overdue orders.
[0066] Alternatively, the target data is used to characterize the sample data of risky merchants. The training module is also used to: train the second risk assessment model based on p target data, wherein the second risk assessment model is used to predict the target behavior of merchants.
[0067] In another aspect, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the methods described above.
[0068] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described above.
[0069] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods described above.
[0070] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0071] This application provides a data generation method that generates candidate data by inputting random noise into a data generation model within a semi-supervised learning model (target generative adversarial network) built on target business sample data. This method automates the data generation process, eliminating the need for manual collection and labeling of samples, thus significantly saving manpower and time costs. The data generation model is a semi-supervised learning model built on target business sample data. Semi-supervised learning models can learn using a small amount of labeled data and a large amount of unlabeled data, thereby better capturing the inherent characteristics and distribution patterns of the target business data. Candidate data generated in this way is more likely to reflect the actual situation of the target business, possessing higher authenticity and representativeness. After subsequent screening of target data, this data can be more accurately used to train the prediction model corresponding to the target business, thereby improving the accuracy and reliability of applications such as risk assessment, effectively solving the problem of poor sample quality in existing technologies. Attached Figure Description
[0072] Figure 1 A schematic diagram illustrating the application of the data generation method provided in this application to an e-commerce scenario;
[0073] Figure 2 A schematic diagram illustrating the application scenario of target data in an e-commerce context provided in this application embodiment;
[0074] Figure 3 A schematic diagram illustrating the application of the data generation method provided in this application to a credit scenario;
[0075] Figure 4A schematic diagram illustrating the application scenario of target data in a credit scenario provided in the embodiments of this application;
[0076] Figure 5 An architecture diagram illustrating the application of the data generation method provided in this application to an e-commerce scenario;
[0077] Figure 6 A flowchart illustrating the data generation method provided in this application embodiment;
[0078] Figure 7 A flowchart illustrating another data generation method provided in this application embodiment;
[0079] Figure 8 This is a structural diagram of a generative adversarial network provided in an embodiment of this application;
[0080] Figure 9 A schematic diagram of each round of training of the generative adversarial network provided in the embodiments of this application;
[0081] Figure 10 This is a structural diagram of the data generation apparatus provided in an embodiment of this application. Detailed Implementation
[0082] This application provides a data generation method that generates candidate data through a data generation model in a target generative adversarial network, filters the candidate data to obtain target data, and uses the target data as training samples for a prediction model, thereby improving the efficiency and quality of training sample generation.
[0083] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0084] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0085] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0086] It should be noted that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0087] Before introducing the specific methods of this application, we will first provide an illustrative example of the application scenarios for data generation in this application. It should be understood that the following application scenarios are merely examples and are not limited to these.
[0088] As an optional implementation, the data generation method in this application is applied to e-commerce scenarios. For example... Figure 1 As shown, Figure 1 This diagram illustrates the application of the data generation method in an e-commerce scenario. The application of the data generation method in the e-commerce scenario includes the target generative adversarial network training process 110 and the target data generation process 120. Specifically:
[0089] In the training process of the target generative adversarial network 110:
[0090] First, obtain m sample data 1102 of the target business from the e-commerce scenario target business database 1101. These m sample data 1102 include: order amount, order data, merchant data, user data, user credit rating, etc. It should be noted that these m sample data 1102 are preprocessed sample data. The preprocessing process includes: first, obtaining the raw data of the target business (including structured and unstructured data (e.g., images, text, etc.)), converting the unstructured data in the raw data into structured data; then, sequentially performing data cleaning, noise reduction, and normalization on all structured data, ultimately obtaining the m sample data.
[0091] Next, principal component analysis (PCA) is performed on the m sample data 1102 to obtain m feature data 1104. The main feature components of the m sample data 1102 are extracted to reduce the data dimensionality. For example, multiple features such as order amount, order data, merchant data, user data, and user credit rating can be reduced to a few main feature vectors. The m feature data 1104 include m1 labeled feature data (e.g., a small number of labeled overdue orders) and m2 unlabeled feature data (a large number of unlabeled order data).
[0092] Next, the generative adversarial network 1105 is obtained. The network structures of the data generation model 11051 and the discriminator model 11052 are defined, and their parameters are randomly initialized. The data generation model 11051 typically employs a multi-layer neural network, with input being a random noise vector and output being the generated samples. The discriminator model 11052 also employs a multi-layer neural network, with input being either real data or data generated by the data generation model, and output being the judgment result, representing the probability that the input data is real data.
[0093] Finally, the generative adversarial network 1105 is trained. The generative adversarial network 1105 is trained using m feature data 1104 (including m1 labeled feature data (e.g., a small number of labeled overdue orders) and m2 unlabeled feature data (a large number of unlabeled order data)). This allows the data generation model 11051 to learn the feature distribution of overdue orders, while the discriminator model 11025 is responsible for distinguishing between real overdue orders and orders generated by the data generation model. The training process is repeated until the data generation model 11051 and the discriminator model 11052 reach an equilibrium state, meaning that the samples generated by the data generation model 11051 are similar to the real data distribution, and the discriminator model 11052 cannot accurately distinguish between real data and data generated by the data generation model. By training the generative adversarial network 1105, the parameters of the data generation model 11051 and the discriminator model 11052 are adjusted, resulting in the target generative adversarial network.
[0094] In the target data generation process 120:
[0095] First, obtain random noise 1201.
[0096] Next, random noise 1201 is input into the data generation model 11051 of the target generative adversarial network 11005, and the data generation model 11051 outputs h candidate data 1202. These candidate data 1202 are the overdue and unpaid order samples (bad samples) generated by the data generation model.
[0097] Then, the h candidate data points 1202 are filtered to obtain p target data points 1203. The generated samples are then filtered to remove those that do not conform to the actual situation. The filtering criteria can be set according to specific application scenarios and needs, such as the feature value range of the samples, the category labels of the samples, etc., for example, samples with order amounts that are too high or too low.
[0098] For further details, please refer to Figure 2 , Figure 2 This diagram illustrates the application scenarios of target data in e-commerce.
[0099] In a certain application scenario, the selected p target data 2101 can be used to train the generative adversarial network 2102.
[0100] Alternatively, the optimized Target Generative Adversarial Network 2102 can be deployed to the servers of an e-commerce platform for applications such as risk assessment and fraud detection. For example:
[0101] In a certain application scenario, the selected p target data 2101 are used to train the order delinquency risk assessment model 2103 (used to predict delinquency of overdue orders) to improve the accuracy of the order delinquency risk assessment model in predicting overdue orders.
[0102] In a specific application scenario, the selected p target data points are used in the merchant behavior risk assessment model 2104 (used to predict the target behavior of merchants (such as fraudulent behavior, unfriendly behavior, etc.)) to promptly identify potential target behaviors.
[0103] Applying the methods provided in this application in e-commerce scenarios provides strong support for the stable operation and sustainable development of e-commerce platforms by improving the accuracy of risk assessment, optimizing model performance, enhancing data processing efficiency and resource utilization, and strengthening platform competitiveness, resulting in significant economic and social benefits.
[0104] As an optional implementation, the data generation method in this application is applied to e-commerce scenarios. For example... Figure 3 As shown, Figure 3 This diagram illustrates the application of the data generation method in a credit scenario. The application of the data generation method in the credit scenario includes the target generative adversarial network training process 310 and the target data generation process 320. Specifically:
[0105] In the training process of the target generative adversarial network 310:
[0106] As in step S311, obtain m sample data of the target business (credit scenario related business).
[0107] The m sample data include: the borrower's basic information, loan application information, credit history, and asset and liability status. Some of this data is structured (such as the various entries in the loan application form, numerical indicators in the credit report, etc.), while some may be unstructured (such as textual descriptions in the supporting documents provided by the borrower, interview records during the investigation of the borrower, etc.).
[0108] First, the raw data from the credit business is acquired. For the unstructured data, natural language processing techniques are used to perform data structuring. For example, key information such as amount and source is extracted from supporting documents and transformed into structured data; borrowers' consumption habits and other characteristics are identified from interview records and stored in a structured format. Next, all structured data undergoes data cleaning to remove errors and outliers; noise reduction is performed to eliminate random interference; finally, normalization is performed to unify the value ranges of different features to a specific interval, ultimately yielding m sample data.
[0109] As in step S312, principal component analysis is performed on m sample data to obtain m feature data.
[0110] Principal component analysis (PCA) is performed on m preprocessed sample data. For example, among numerous credit-related features, the original data may contain multiple features related to a borrower's repayment ability and credit risk, such as indicators from multiple different sources, various types of debt information, and credit records from different time dimensions. Through PCA, these complex features are reduced to a few main feature vectors, extracting information that can represent the essential characteristics of a borrower's credit risk, such as comprehensive repayment ability factors and credit stability factors.
[0111] Among the m feature data obtained, there are m1 feature data with labels (e.g., a small number of loan sample feature data that have been clearly classified as default or high risk, these samples have clear labels such as "default" or "high risk") and m2 feature data without labels (a large number of normal loan samples that have not been clearly classified or loan samples with unknown potential risks), and m = m1 + m2.
[0112] As in step S313, obtain the generative adversarial network.
[0113] Define network structures for the data generation and discrimination models suitable for credit scenarios. The data generation model employs a multi-layer neural network architecture, with random noise vectors as input and simulated credit sample data as output. The discrimination model also uses a multi-layer neural network, with real credit sample data or data generated by the data generation model as input, and outputting a judgment result representing the probability that the input data is real credit data. The parameters of the data generation and discrimination models are randomly initialized to prepare for subsequent training.
[0114] As in step S314, train the generative adversarial network.
[0115] The generative adversarial network (GAN) is trained using m feature data sets (m1 labeled default or high-risk sample features and m2 unlabeled normal or unknown risk sample features). During training, the data generation model learns the feature distribution of default or high-risk loan samples, attempting to generate data similar to real default samples; the discriminator model is responsible for distinguishing between real default samples and samples generated by the data generation model, striving to accurately determine the authenticity of the input data.
[0116] The training process is repeated, continuously adjusting the parameters of the data generation model and the discriminator model. In each training round, first, the parameters of the discriminator model are fixed, and the data generation model is trained so that its generated samples can deceive the discriminator model as much as possible, making it difficult for the discriminator model to distinguish between generated and real samples. Then, the parameters of the data generation model are fixed, and the discriminator model is trained so that it can more accurately distinguish between real and generated samples. This adversarial training process continues until the samples generated by the data generation model are similar in distribution to real default or high-risk sample data, and the discriminator model can no longer accurately distinguish between real and generated samples. At this point, an equilibrium state is reached, resulting in the target generative adversarial network.
[0117] As in step S321, obtain random noise.
[0118] A random noise vector conforming to a specific distribution (such as a normal distribution) is obtained from the random number generation model. This random noise vector will serve as the initial input signal for the subsequent generation of bad credit samples (such as defaulted loan samples), driving the data generation model to generate diverse candidate data.
[0119] As in step S322, random noise is input into the data generation model of the target generative adversarial network to generate h candidate data.
[0120] The acquired random noise is input into a pre-trained target generative adversarial network (GAN) data generation model. Based on the learned distribution patterns of default or high-risk sample features, the data generation model transforms and maps the random noise, outputting h candidate data. These candidate data are the simulated defaulted loan sample data. Each candidate data contains a series of characteristic information of the borrower (such as simulated credit history, loan application information, etc.), simulating loan situations that may lead to default risk.
[0121] As in step S323, h candidate data are filtered to obtain p target data.
[0122] Screening criteria are set based on the company's own credit business experience and risk assessment standards. For example, candidate data can be screened based on the common feature ranges in historical defaulted loan samples to remove samples that do not conform to the characteristics of actual defaults, such as samples with perfect credit records but simulated as defaults, or samples with excessively low loan amounts and excellent borrower qualifications but misjudged as defaults by the generation model.
[0123] The specific screening methods can be rule-based (such as setting samples with debt exceeding a certain proportion and credit scores below a certain threshold as potential default samples), or they can be combined with statistical analysis methods (such as calculating the similarity between candidate data and real default samples in key features, and retaining samples with high similarity), ultimately obtaining p target data that better meet the actual default characteristics and risk assessment needs.
[0124] For further details, please refer to Figure 4 , Figure 4 This diagram illustrates the application scenarios of target data in a credit context.
[0125] As in step S331, the selected p target data can be used to train the generative adversarial network.
[0126] The selected p target data points are fed back into the generative adversarial network (GAN) for retraining. This helps to further optimize the performance of the data generation and discrimination models, enabling the data generation model to generate more realistic default samples that better reflect the characteristics of credit risk, while the discrimination model can more accurately distinguish between real default samples and generated samples, thus improving the overall GAN's ability to identify and simulate credit risk.
[0127] As in step S332, the optimized target generative adversarial network is deployed into the credit business system for applications such as risk assessment and early warning. For example:
[0128] As in step S3321, the selected p target data are used to train the credit risk assessment model (used to predict default risk of loan applications), thereby improving the accuracy of the credit risk assessment model in predicting defaulted loans. By using simulated default sample data together with real loan sample data for model training, the credit risk assessment model can learn more comprehensive risk characteristic patterns. This allows it to more accurately assess the borrower's likelihood of default when faced with new loan applications, providing a more scientific and reliable basis for loan approval and reducing the probability of non-performing loans.
[0129] As in step S3322, a credit risk early warning system can be established using the default sample data generated by the optimized target generative adversarial network. This system monitors changes in borrower characteristics within the existing loan portfolio in real time. When a borrower's characteristics are found to be similar to those of the generated default samples, an early warning signal is promptly issued, prompting credit managers to pay attention to the loan account and take corresponding risk prevention measures, such as adjusting loan terms or adding collateral. This effectively prevents the expansion of credit risk, protects asset security, and ensures the sound operation of the credit business.
[0130] By applying the methods provided in this application in credit scenarios, data resources can be utilized more effectively, risk assessment and management capabilities can be improved, the complex and ever-changing credit market environment can be coped with, credit risk can be reduced, and overall operating efficiency can be improved.
[0131] Please see Figure 5 , Figure 5 The diagram illustrates the architecture of the data generation method provided in this application when applied to an e-commerce scenario. This scenario architecture includes a terminal 501, a network 502, a server 503, and a database 504.
[0132] Terminal 501 includes a human-computer interaction screen, a processor, and a memory. The human-computer interaction screen displays the data generation interface and also provides a human-computer interaction interface: the data generation interface receives user operations for data generation. Terminal 501 includes, but is not limited to, mobile phones, tablets, laptops, desktop computers, intelligent voice interaction devices, virtual reality devices, smart home appliances, vehicle terminals, and aircraft.
[0133] Run client 5010 on terminal 501. Taking the data generation client as an example, client 5010 is deployed on terminal 501. Client 5010 can run on terminal 501 through a browser, or as a standalone application (APP) or mini-program, etc.
[0134] Network 502 uses standard communication technologies and / or protocols, typically the Internet, but can also be any network, including but not limited to Bluetooth, local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, private network, or any combination of virtual private network. In some embodiments, custom or dedicated data communication technologies may be used to replace or supplement the aforementioned data communication technologies.
[0135] Server 503 includes a processor for performing storage or retrieval operations on database 504. Server 503 in this application can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence (AI) platforms.
[0136] Database 504 is used to store information such as target business data in e-commerce scenarios.
[0137] The data generation method provided in this application embodiment is specifically as follows:
[0138] As in step S511, obtain m sample data of the target business.
[0139] As in step S512, principal component analysis is performed on m sample data to obtain m feature data.
[0140] As in step S513, obtain the generative adversarial network.
[0141] As in step S514, train the generative adversarial network.
[0142] As in step S515, obtain random noise.
[0143] As in step S516, random noise is input into the data generation model of the target generative adversarial network to generate h candidate data.
[0144] As in step S517, h candidate data are filtered to obtain p target data.
[0145] Please see Figure 6 , Figure 6A flowchart of a data generation method is shown. It should be noted that the data generation method provided in this application embodiment can be applied to a server, and this application embodiment does not impose any limitations. The method includes:
[0146] S610, Obtain random noise.
[0147] Understandably, the first step is to obtain random noise from a suitable random noise source. This random noise source should be able to generate a random noise vector that meets the characteristics required by this method (e.g., a specific distribution, value range, etc.). For example, a random number generation model in a computer system can be used to generate random noise according to a set algorithm and parameters. In subsequent steps, the random noise will serve as the initial signal driving the data generation model to generate candidate data. Its randomness will encourage the generation of diverse sample data to comprehensively cover all possible situations in the target business as comprehensively as possible.
[0148] S620. Input random noise into the data generation model in the target generative adversarial network, and generate h candidate data according to the data generation model.
[0149] Among them, the target generative adversarial network is a semi-supervised learning model built based on sample data of the target business, and h is an integer greater than or equal to 1.
[0150] Understandably, a pre-trained semi-supervised learning model is used to generate candidate data. Random noise is then input into a data generation model (target generative adversarial network), which outputs candidate data. Specifically:
[0151] The acquired random noise is input into the data generation model within the target generative adversarial network (GAN). The GAN is a semi-supervised learning model built upon sample data related to the target business. By learning from a large amount of target business-related data, it can capture latent patterns and feature distributions within the data. Based on its learned knowledge, the data generation model processes the input random noise to generate h candidate data points. Here, h is an integer greater than or equal to 1, representing the number of candidate data points generated. In practical applications, the value of h can be adjusted according to specific needs and computational resources. For example, in the initial exploration phase, a relatively large number of candidate data points (e.g., h = 1000) can be generated to more comprehensively explore the possible sample space; while in subsequent phases, when there is a certain understanding of the model's performance and computational resources are limited, the number of candidate data points can be appropriately reduced (e.g., h = 500) while ensuring that representative samples are still obtained. The generated candidate data will serve as the basis for subsequent screening. They possess a certain degree of randomness but are constrained by the target business feature distribution learned by the data generation model, thus simulating the real data situation in the target business to a certain extent.
[0152] S630. Filter the h candidate data to obtain p target data.
[0153] Wherein, target data refers to sample data used to train the prediction model corresponding to the target business, and p is an integer greater than or equal to 1 and less than or equal to h.
[0154] Understandably, the generated h candidate data are filtered to remove unsuitable samples, resulting in p target data. The filtering criteria can be set according to specific application scenarios and requirements, such as the feature value range of the samples or the category label of the samples.
[0155] The screening process aims to select sample data from the candidate data that best meets the target business needs and is most likely to be used to effectively train the corresponding predictive model. Here, p is an integer greater than or equal to 1 and less than or equal to h, and its specific value depends on the strictness of the screening criteria and a comprehensive consideration of the quantity and quality of the target data. For example, if the screening criteria are stricter, relatively less but higher-quality target data may be obtained (e.g., p = 200); conversely, if more sample data is desired for training, while having a certain tolerance for data quality, the value of p can be relatively larger (e.g., p = 800).
[0156] The specific implementation methods for screening can be varied depending on the characteristics of the target business and actual needs. For example, screening can be based on the statistical characteristics of the data (such as mean, variance, distribution, etc.) to remove candidate data that differs too much from the known statistical characteristics of the target business data; or screening can be based on pre-set business rules, such as excluding candidate data that does not meet the requirements based on the threshold range of certain key indicators in the target business; or screening can be based on distance, such as calculating the distance between the generated sample and the real data and removing samples with excessive distance; or screening can be based on clustering, clustering the generated sample and the real data and removing samples that do not belong to the bad sample cluster.
[0157] The p target data obtained after screening will have higher quality and relevance, and can be better used to train the prediction model corresponding to the target business, thereby improving the accuracy and reliability of the prediction model and providing strong support for decision-making and risk assessment of the target business.
[0158] The method provided in this application, by leveraging the learning capabilities of target generative adversarial networks and the generative capabilities of data generation models, combined with an effective screening mechanism, can efficiently acquire representative and practical sample data in the target business domain, laying a solid foundation for subsequent model training and business applications. Simultaneously, this method possesses a degree of flexibility and scalability, allowing for appropriate adjustments and optimizations based on different target business needs and data characteristics to adapt to various complex application scenarios.
[0159] Please see Figure 7 , Figure 7 A flowchart of a data generation method is shown. In an optional embodiment of the data generation method provided in the above embodiments of this application, the method further includes:
[0160] S710. Obtain m sample data of the target business.
[0161] Where m is an integer greater than or equal to 1.
[0162] Understandably, the process begins with collecting a wide range of data related to the target business (e.g., various business scenarios in the financial sector, taking e-commerce as an example) to obtain m sample data points, where m is an integer greater than or equal to 1. These sample data points come from diverse sources, covering multiple stages and aspects of the business process. For example, in an e-commerce scenario, the data might include order amounts, order data, merchant data, user data, and user credit ratings. Some of this data exists in structured form, such as tabular records in a database; others may be unstructured data, such as text data or image data.
[0163] The collected raw data undergoes preprocessing, including data cleaning, denoising, and normalization. Data cleaning primarily removes outliers and erroneous data, denoising removes noise interference, and normalization standardizes the data values to a specific range to facilitate subsequent analysis and processing.
[0164] Unstructured data requires processing such as text mining and image recognition to transform it into structured data. For example, for text data, natural language processing techniques can be used to extract key information and transform it into numerical data; for image data, image recognition techniques can be used to extract feature vectors and transform it into numerical data.
[0165] Let the original data matrix be X∈R m×n Where m represents the number of sample data points and n represents the number of features in the sample data points. The preprocessed sample data matrix is X′, then X′ = 1. ′ ←f(X), where f represents the preprocessing function.
[0166] S720. Perform principal component analysis on m sample data to obtain m feature data.
[0167] Among them, the data dimension of the feature data is lower than that of the sample data. The m feature data include m1 labeled feature data and m2 unlabeled feature data, where m is an integer greater than or equal to 1, and m1 and m2 are both integers greater than or equal to 1 and less than or equal to m, m = m1 + m2, and m1 ≤ m2.
[0168] Understandably, principal component analysis (PCA) is performed on m samples to extract the main characteristic components of the data and reduce its dimensionality. The basic idea of PCA is to project the original data onto a new coordinate system, maximizing the variance of the projected data in the new coordinate system, thereby extracting the main characteristic components. The specific steps are as follows:
[0169] First, construct a sample data matrix based on these m sample data. Treat each sample data as a row in the matrix, and each feature of the sample data as a column of the matrix, thus forming an m×n matrix (n is the number of features of the sample data).
[0170] Next, the covariance matrix is calculated based on the sample data matrix. The covariance matrix measures the linear relationship and degree of variation among different features. The calculation method is as follows:
[0171]
[0172] Among them, X ′ Let X be the sample data matrix. ′T This is its transpose matrix. By calculating the covariance matrix, we can obtain the covariance values between each feature, thereby understanding the strength of the correlation between the features.
[0173] Then, the covariance matrix C is decomposed into eigenvalues to obtain n eigenvalues (λ1, λ2, ..., λ). n ) and the corresponding n feature vectors (v1, v2, ..., v n Eigenvalues represent the importance or variance contribution of each feature in the data, while eigenvectors determine the orientation of the data in the new coordinate system.
[0174] Next, the feature values are sorted from largest to smallest. The first k feature values are selected (k is an integer greater than or equal to 1 and less than or equal to n). The value of k is determined according to actual needs, generally selecting the number of feature values that can retain most of the data information (such as a cumulative variance contribution rate reaching a certain proportion, for example, above 85%). For example, in the above bank credit data, if the cumulative variance contribution rate of the first 3 feature values reaches 90%, then k=3 is selected.
[0175] Finally, a projection matrix P = (v1, v2, ..., v) is generated based on the k eigenvectors corresponding to the selected k eigenvalues. k ), where k represents the dimension after dimensionality reduction. The sample data matrix X is projected using the projection matrix. ′ Projecting onto the new coordinate system, we obtain the dimensionality-reduced feature data matrix Z = X. ′ P, the matrix contains m feature data.
[0176] Principal component analysis (PCA) reduces the dimensionality of the original high-dimensional sample data into low-dimensional feature data. While preserving the main information of the data, it reduces the complexity and computational load of the data and highlights the main features of the data, making subsequent model training and analysis more efficient and accurate.
[0177] Let the data matrix after dimensionality reduction be Z∈R m×k Then Z = X ′ P, where P = (v1, v2, ..., v k ) is the projection matrix.
[0178] The eigenvalue decomposition of the covariance matrix C can be expressed as C = VΛV T Where, V=(v1,v2,…,v n Let Λ = diag(λ1, λ2, ..., λ) be the eigenvector matrix. n ) is an eigenvalue diagonal matrix.
[0179] S730, Obtain the initial generative adversarial network.
[0180] The initial generative adversarial network includes a data generation model and a discriminant model, and the initial parameters of both the data generation model and the discriminant model are random values.
[0181] Understandably, a semi-supervised learning model is built on the dimensionality-reduced sample data, using a small amount of labeled data and a large amount of unlabeled data for learning. Semi-supervised learning models can employ various algorithms, such as Generative Adversarial Networks (GANs) and autoencoders.
[0182] Generative Adversarial Networks (GANs) are an example whose basic idea is to generate samples similar to the distribution of real data through adversarial training of two neural networks. Figure 8 As shown, Figure 8 The diagram illustrates the structure of a generative adversarial network (GAN). The GAN consists of a data generation model (810) and a discriminant model (820). The data generation model generates samples, and the discriminant model determines whether a sample is real data or data generated by the data generation model. Specifically:
[0183] Define the network structure and parameters of the data generation model and the discriminant model:
[0184] Data generation models (Genertar) 810 typically employ a multi-layer neural network structure, with random noise data 801 as input and generated sample data 802 as output. For example, in e-commerce scenarios, the random noise vector input to the data generation model undergoes multiple transformations through the neural network to ultimately output simulated sample data, including various user feature information.
[0185] The discriminative model also employs a multi-layer neural network. Its input is either real sample data (real data) 803 or sample data generated by the data generation model 802. The output is a judgment result 804, representing the probability that the input data is real data. For example, the discriminative model judges an input sample data and outputs a value between 0 and 1. If the value is close to 1, the discriminative model considers the data to be a real sample; if it is close to 0, it considers it generated data. During the initialization phase, the parameters of both the data generation model and the discriminative model are randomly set to provide an initial state for the subsequent training process.
[0186] S740. Based on m feature data, train the initial generative adversarial network to adjust the initial parameters of the data generation model and the initial parameters of the discrimination model, and obtain the target generative adversarial network.
[0187] Understandably, the initial generative adversarial network is trained using m feature data obtained through principal component analysis (including m1 labeled feature data, such as a small number of orders clearly marked as overdue and overdue, and m2 unlabeled feature data, such as a large number of unlabeled order data, and m = m1 + m2) to adjust the initial parameters of the data generation model and the discriminator model, thereby obtaining the target generative adversarial network.
[0188] The training process is as follows:
[0189] First, obtain random training sample data. This random training sample data can be a portion of the dataset randomly selected from the target business. The purpose is to introduce a certain degree of randomness during training to enhance the model's generalization ability. For example, in an e-commerce scenario, a certain proportion of samples can be randomly selected from historical order datasets as random training sample data.
[0190] Next, the training random sample data is used as input to the data generation model in the initial generative adversarial network, and the training generated data is obtained according to the data generation model. The data generation model processes the input training random sample data based on its current parameter settings to generate simulated sample data.
[0191] Then, m feature data (including labeled and unlabeled feature data) and the generated training data are used as input to the discriminative model in the initial generative adversarial network. The discriminative model uses this data to generate m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data. By comparing the feature differences between the input data and the real sample data, the discriminative model outputs the probability judgment that each data point is a real sample.
[0192] Finally, adversarial training is performed on the data generation model and the discriminant model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data.
[0193] like Figure 9 As shown, Figure 9 The diagram illustrates each round of training for the generative adversarial network. In each round, the parameters of the discriminant model are first fixed, and the data generation model is trained so that the samples generated by the data generation model can fool the discriminant model, i.e., make the discriminant model believe that the generated samples are real data. Then, the parameters of the data generation model are fixed, and the discriminant model is trained so that the discriminant model can accurately distinguish between real data and data generated by the data generation model.
[0194] By repeatedly performing this adversarial training process, until the data generation model and the discriminator model reach an equilibrium state, that is, the samples generated by the data generation model are similar to the distribution of real data, and the discriminator model cannot accurately distinguish between real data and data generated by the data generation model, the optimized target generative adversarial network is obtained. This network can more effectively generate sample data that matches the characteristics of the target business data, providing strong support for subsequent data generation and application.
[0195] The advantage of semi-supervised learning models is that they can use a large amount of unlabeled data for learning, which improves the model's generalization ability and robustness, while reducing the dependence on labeled data and lowering the cost of data labeling.
[0196] The method provided in this application, through principal component analysis (PCA) to process sample data, can accurately extract key features, transforming complex, high-dimensional data into low-dimensional feature data that retains the main information. This simplifies the data structure, avoids problems caused by excessive dimensionality, and improves the efficiency and accuracy of subsequent processing. A generative adversarial network is constructed and trained based on actual sample data to ensure that the generated data closely matches the target business characteristics, improving data relevance. The adversarial training mechanism optimizes model parameters, enabling the generative model to generate high-quality, realistic samples, and the discriminative model to have stronger distinguishing capabilities, thus improving the overall performance of the model.
[0197] In an optional embodiment of the data generation method provided in the above embodiments of this application, principal component analysis is performed on m sample data to obtain m feature data, including:
[0198] Generate a sample data matrix based on m sample data.
[0199] The covariance matrix is calculated based on the sample data matrix.
[0200] The covariance matrix is decomposed into eigenvalues to obtain n eigenvalues and n eigenvectors corresponding to the n eigenvalues;
[0201] Sort the n feature values in descending order, and select the first k feature values from the sorting results, where k is an integer greater than or equal to 1 and less than or equal to n;
[0202] Generate a projection matrix based on the k eigenvectors corresponding to the k eigenvalues;
[0203] Based on the sample data matrix and the projection matrix, the feature data matrix is calculated, where the feature data matrix includes m feature data.
[0204] Understandably, the first step is to generate a sample data matrix based on the m sample data points obtained from the target business. Each sample data point can be viewed as a row vector, and the m sample data points together form a matrix, where n represents the number of features contained in each sample data point. When constructing the matrix, it is crucial to ensure that the corresponding positions of each feature in the matrix for each sample data point are accurate, so that subsequent calculations can accurately reflect the relationships between the data.
[0205] Based on the constructed sample data matrix, its covariance matrix is calculated. The covariance matrix is an important tool for measuring the strength of the linear relationship between different features. The formula for calculating the covariance matrix is:
[0206]
[0207] Among them, X ′ Let X represent the sample data matrix. ′T It is X ′ The transpose of the matrix is given. Using this formula, an n×n covariance matrix C can be obtained. The calculation requires precise calculations of matrix multiplication and mean. The elements on the diagonal of the covariance matrix represent the variance of each feature itself, while the elements off-diagonal represent the covariance between different features. Their sign and magnitude reflect the linear correlation (positive, negative, or no correlation) between features and the strength of the correlation.
[0208] The calculated covariance matrix C is then subjected to eigenvalue decomposition. This step aims to decompose the covariance matrix into eigenvalues and eigenvectors, i.e., C = VΛV. THere, V is an n×n matrix composed of eigenvectors, and Λ is a diagonal matrix composed of eigenvalues. Eigenvalue decomposition reveals the variance distribution of data in different directions. Through eigenvalue decomposition, n eigenvalues (λ1, λ2, ..., λ) are obtained. n ) and the corresponding n feature vectors (v1, v2, ..., v n The magnitude of the eigenvalue represents the variance of the data in the direction pointed to by the corresponding eigenvector. The larger the eigenvalue, the more drastic the change in the data in that direction, and the more important the information contained in the eigenvector.
[0209] Sort the obtained n feature values in descending order. After sorting, select the first k feature values according to actual needs, where k is an integer greater than or equal to 1 and less than or equal to n. The selection is usually based on the desire to retain the main information in the data by selecting larger feature values, while reducing the data dimensionality. In practical applications, the value of k can be determined based on the cumulative variance contribution rate. For example, if the cumulative variance contribution rate of the first k feature values is found to be above 85% when k=3, it means that selecting the first 3 feature values can retain most of the data information, and k=3 can be determined. Choosing an appropriate value of k is a trade-off process, ensuring that enough information is retained to accurately reflect the data characteristics, while avoiding retaining too many features that would lead to excessively high data dimensionality and defeat the purpose of dimensionality reduction.
[0210] Based on the selected first k feature values, the k feature vectors v1, v2, ..., v are used to form the k feature vectors. k Generate the projection matrix P = (v1, v2, ..., v k The projection matrix projects the original high-dimensional sample data into a low-dimensional space. Finally, the sample data matrix X is used... ′ The feature data matrix is calculated using the projection matrix P. The calculation method involves using the sample data matrix X... ′ Multiplying the projection matrix P yields the dimensionality-reduced feature data matrix, which contains m feature data points. This projection operation achieves dimensionality reduction of the original sample data, transforming it from n-feature data into k-feature data.
[0211] The method provided in this application achieves effective dimensionality reduction through Principal Component Analysis (PCA), thereby reducing the burden of data storage and computation. When processing complex datasets such as large-scale financial data, reducing dimensionality can avoid the curse of dimensionality, improve data processing speed and efficiency, and make subsequent analysis and model training more efficient. It accurately extracts the main feature components of the data, focusing on key information. The dimensionality-reduced data helps the model converge faster, reduces the risk of overfitting, improves the model's generalization ability, and enables it to better adapt to new data and complex business scenarios, enhancing prediction accuracy and stability.
[0212] In an optional embodiment of the data generation method provided in the above embodiments of this application, an initial generative adversarial network is trained based on m feature data to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thereby obtaining a target generative adversarial network, including:
[0213] Obtain training random sample data;
[0214] The training random sample data is used as the input to the data generation model in the initial generative adversarial network, and the training generated data is obtained according to the data generation model.
[0215] The m feature data and the training generated data are used as inputs to the discriminative model in the initial generative adversarial network. Based on the discriminative model, m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data are generated.
[0216] Based on the m decision results corresponding to m feature data and the decision results corresponding to training random sample data, the data generation model and the discriminant model are trained adversarially to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thus obtaining the target generative adversarial network.
[0217] Understandably, the first step is to acquire data for training the Generative Adversarial Network (GAN), i.e., training random sample data. This data should be relevant to the target business and possess a certain degree of randomness and representativeness. In the e-commerce field, for example, for risk assessment of overdue orders, a portion of samples can be randomly selected from historical credit datasets as training random sample data. The selection method can employ a combination of random number generators and data indexing to ensure that each sample has an equal probability of being selected, thus guaranteeing the randomness of the samples. The number of samples selected can be determined based on the actual situation. Generally, a sufficient number of samples is needed to ensure the effectiveness of training, but factors such as computing resources and training time must also be considered.
[0218] The acquired training random sample data is used as input to the data generation model in the initial generative adversarial network. The data generation model typically employs a multi-layer neural network structure, which performs a series of complex operations and transformations on the input training random sample data based on existing parameter settings. Internally, through the connections and weights between neurons, operations such as feature extraction, information fusion, and pattern generation are performed on the input data. Finally, the data generation model outputs training generated data, which is simulated sample data generated by the model based on the input data and the patterns it has learned.
[0219] The m feature data obtained through principal component analysis (including m1 labeled feature data and m2 unlabeled feature data) and the training data generated by the data generation model are used as inputs to the discriminative model in the initial generative adversarial network. The discriminative model also employs a multi-layer neural network structure, making judgments based on the feature information of the input data. For each input data sample, the discriminative model calculates the degree of difference between the features of the input data and the real sample data through the forward propagation process of the neural network, thus outputting a judgment result representing the probability that the input data is real data. For example, the discriminative model might output a value between 0 and 1. If the value is close to 1, it indicates that the discriminative model considers the data to be a real sample; if it is close to 0, it indicates that it considers the data to be a simulated sample generated by the data generation model. The discriminative model generates m corresponding judgment results for the m feature data and the training data, as well as a judgment result for the training random sample data.
[0220] Based on the m decision results corresponding to the m feature data generated by the discriminant model and the decision results corresponding to the training random sample data, the data generation model and the discriminant model are subjected to adversarial training to adjust their initial parameters, thereby obtaining the target generative adversarial network.
[0221] Data generation model training:
[0222] First, calculate the loss function of the data generation model. The loss function is an important indicator for measuring the quality of the data generated by the model; it is calculated based on the judgment result of the discriminant model on the generated data. For example, the cross-entropy loss function can be used, which is calculated based on the probability that the discriminant model judges the generated data as real data. If the discriminant model considers the generated data to be real data with a high probability (close to 1), the loss function value is low; conversely, if the discriminant model can easily distinguish the generated data (the probability of judging it as real data is close to 0), the loss function value is high.
[0223] Then, based on the calculated loss function, the gradient of the model parameters is calculated using the backpropagation algorithm. The backpropagation algorithm calculates the gradient of each parameter by starting from the loss function and proceeding along the backpropagation path of the neural network, thus obtaining the gradient of the parameters.
[0224] Finally, based on the calculated parameter gradients, optimization algorithms (such as stochastic gradient descent, Adam optimization, etc.) are used to adjust the initial parameters of the data generation model. The optimization algorithm updates the parameters with a certain step size according to the direction and magnitude of the gradient, gradually reducing the loss function and thus improving the quality of the data generated by the data generation model, making the generated samples more difficult for the discrimination model to distinguish.
[0225] Discriminant model training:
[0226] Similarly, we first calculate the loss function of the discriminant model. The loss function of the discriminant model is related to the loss function of the data generation model, but the calculation method is slightly different. It needs to consider both the correct judgment of real sample data (hoping that the probability of the discriminant model judging real samples as real data is close to 1) and the correct distinction of generated data (hoping that the probability of the discriminant model judging generated data as real data is close to 0).
[0227] Next, the gradients of the discriminant model parameters are calculated based on the loss function. This is done using the backpropagation algorithm, which calculates the effect of each parameter on the loss function from the loss function itself, thus obtaining the gradients of the parameters.
[0228] Finally, based on the parameter gradient, the initial parameters of the discriminant model are adjusted using an optimization algorithm, so that the discriminant model can better distinguish between real data and generated data, thereby improving the accuracy of its judgment.
[0229] By repeatedly performing the adversarial training process described above, and continuously adjusting the parameters of the data generation model and the discriminator model, the samples generated by the data generation model gradually become similar to the distribution of real data. The discriminator model's ability to distinguish between real and generated data continuously improves until an equilibrium is reached. At this point, the samples generated by the data generation model can deceive the discriminator model with a high probability, while the discriminator model can accurately distinguish between real and generated data to a certain extent. The resulting target generative adversarial network can then effectively generate sample data that conforms to the characteristics of the target business, providing strong support for subsequent data generation and application.
[0230] The method provided in this application increases data diversity by introducing training random sample data, enabling the model to access a wider range of sample patterns. By combining feature data from principal component analysis (including labeled and unlabeled data), it fully utilizes the information from both limited labeled data and a large amount of unlabeled data, improving data utilization, reducing reliance on large-scale labeled data, and lowering data collection and labeling costs. The data generation model continuously learns to generate more realistic samples, better simulating the distribution of target business data and improving the quality and realism of the generated samples. The discriminative model continuously improves its discriminative ability in distinguishing between real and generated data, thereby more accurately identifying abnormal or risky samples. The resulting target generative adversarial network has stronger generalization capabilities, better adapting to complex and ever-changing target business scenarios, and providing more reliable support for subsequent data generation and risk assessment tasks.
[0231] In an optional embodiment of the data generation method provided in the above embodiments of this application, adversarial training is performed on the data generation model and the discriminant model based on the m decision results corresponding to m feature data and the decision results corresponding to training random sample data, so as to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thereby obtaining the target generative adversarial network, including:
[0232] Calculate the loss function of the data generation model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data;
[0233] Calculate the gradient of the parameters of the data generation model based on the loss function of the data generation model;
[0234] Adjust the initial parameters of the data generation model based on the gradient of the data generation model's parameters.
[0235] Understandably, based on the objectives of the data generation model, its loss function aims to measure the degree of difference between the generated data and the real data distribution, in order to guide the model to generate more realistic samples. In this embodiment, the loss function is calculated based on the judgment result of the discriminant model on the data generated by the data generation model. Specifically, the loss function used is as follows:
[0236]
[0237] in, This represents the expectation that the model correctly identifies real data as real data. p represents the expectation that the generated data was misclassified as real data by the discrimination model. data (x) represents the distribution of the real data, p z(z) represents the distribution of random noise, G(z) represents the sample generated by the generator, and D(x) represents the judgment result of the discriminator on the input data x.
[0238] The calculation process is as follows:
[0239] for From the real data distribution p data A sample x is drawn from (x), and input into the discriminant model D to obtain the probability D(x) that the discriminant model classifies the real sample as real data. Then, the value of logD(x) is calculated. The average value of logD(x) is calculated for a large number of such real samples to obtain the expected estimate of this part.
[0240] for From random noise distribution p z Random noise is extracted from (z) and input into the data generation model G to obtain generated data G(z). The generated data is then input into the discrimination model D to obtain the probability (G(z)) that the discrimination model classifies the generated data as real data. The value of log(1-D(G(z))) is calculated. Similarly, the average value of log(1-D(G(z))) is calculated for a large number of randomly extracted noise samples to obtain the expected estimate of this part.
[0241] Adding the expectations of the two parts above yields the value of the loss function V(G,D) for the data generation model. This loss function reflects the degree of difference between the data generated by the data generation model and the real data in the eyes of the discriminator model. The smaller the loss function value, the closer the data generated by the model is to the real data distribution, and the better the model performance.
[0242] After calculating the loss function V(G,D) of the data generation model, in order to adjust the model parameters and optimize model performance, it is necessary to calculate the gradient of the loss function with respect to the data generation model parameters. This process is achieved through the backpropagation algorithm.
[0243] The backpropagation algorithm is based on the chain rule. Starting from the loss function, it propagates the error back along the neural network structure of the data generation model, calculating the contribution of each parameter to the loss function, thereby obtaining the gradient of the parameter. The specific calculation steps are as follows:
[0244] First, calculate the gradient of the loss function V(G,D) with respect to the output G(z) of the data generation model:
[0245] Based on the definition and differentiation rule of the loss function, respectively... and Differentiate both parts. For For this part, its derivative is 0 because this term does not involve the output G(z) of the data generation model; for In part, the derivative is calculated using the chain rule for composite functions, resulting in...
[0246] Then, the gradient of the data-generated model output G(z) with respect to the parameters of each layer within the model (such as the weights ω and biases b of the neural network) is calculated. and This needs to be calculated based on the specific neural network structure and activation function of the data generation model. For example, for a simple fully connected neural network layer, the gradient of its output G(z) with respect to the weights ω can be calculated using matrix multiplication and the derivative of the activation function, while the gradient with respect to the bias b is relatively simple and can be calculated using the rules of differentiation.
[0247] Finally, according to the chain rule, the gradient of the loss function with respect to the output of the data generation model is calculated. Gradient of output with respect to parameters of each layer and Multiplying these yields the gradient of the loss function with respect to the parameters of each layer in the data generation model. and These parameter gradients represent the direction and extent of each parameter's influence on the loss function value, and are an important basis for subsequent parameter updates.
[0248] The gradients of the model parameters are generated based on the calculated data, and the model parameters are adjusted using an optimization algorithm. In this embodiment, stochastic gradient descent (SGD) or its variants (such as Adagrad, Adadelta, Adam, etc.) can be used for parameter updates. Taking stochastic gradient descent as an example, its parameter update formula is as follows: Where θ t This represents the model parameters generated from the data at the current moment, where α is the learning rate, a pre-set positive number used to control the step size of parameter updates. This indicates that the loss function is in the parameter θ t The gradient at (i.e., the gradient calculated earlier) and wait).
[0249] In practical applications, for each batch of training data (including random noise and corresponding real or feature data), the loss function and parameter gradients are calculated following the steps described above, and the parameters of the data generation model are adjusted according to the parameter update formula. With continuous iterative training, the parameters of the data generation model are gradually updated, making the generated data increasingly closer to the real data distribution, and the loss function value gradually decreases. By repeating this process multiple times, the data generation model is continuously optimized, eventually generating high-quality sample data to meet the needs of the target business. Simultaneously, by adjusting hyperparameters such as the learning rate α, the speed and stability of model training can be controlled, avoiding problems such as the model failing to converge or getting trapped in local optima due to excessive parameter updates. In the early stages of training, a larger learning rate can be set to accelerate training; as training progresses, the learning rate is gradually decreased, allowing the model to converge more stably to better parameter values.
[0250] The process of calculating the loss function, gradient, and parameter tuning described above is an iterative process. In each iteration, the above steps are repeated based on new training data (random noise and feature data, etc.), continuously adjusting the parameters of the data generation model. As the number of iterations increases, the data generation model gradually learns the characteristics and distribution patterns of the target business data, and the quality of the generated data continuously improves. Simultaneously, through adversarial training with the discriminative model, the data generation model continuously adapts to the improved discriminative capabilities of the discriminative model; both mutually promote and optimize each other. In practical applications, a maximum number of iterations is usually set, or training is stopped based on the model's performance on the validation set (such as evaluation metrics for the authenticity of generated samples, similarity to the real data distribution, etc.). When the stopping condition is met, the training process ends, resulting in the optimized data generation model in the target generative adversarial network, which can generate high-quality sample data that meets the target business needs, providing strong support for subsequent data generation and application.
[0251] The method provided in this application, through loss function calculation, can accurately measure the difference between generated data and real data, providing a clear direction for model optimization. The loss function, constructed in the form of expectation, fully considers the performance of real data and generated data in the discriminative model, enabling the model to better learn the distribution characteristics of real data during training, generating more realistic and representative sample data, thereby improving the quality of the model-generated samples.
[0252] In an optional embodiment of the data generation method provided in the above embodiments of this application, adversarial training is performed on the discriminant model and the discriminant network based on the m decision results corresponding to m feature data and the decision results corresponding to training random sample data, so as to adjust the initial parameters of the discriminant model and the discriminant network to obtain the target generative adversarial network, including:
[0253] Calculate the loss function of the discriminant model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data;
[0254] Calculate the gradient of the parameters of the discriminant model based on the loss function of the discriminant model;
[0255] The initial parameters of the discriminant model are adjusted based on the gradient of the discriminant model's parameters.
[0256] Understandably, the goal of a discriminative model is to accurately distinguish between real data and data generated by a data generation model, and its loss function is designed based on this goal. The loss function we use is as follows: in, The expected value represents the value of real data that the discrimination model correctly identifies as real data. This represents the expectation that the generated data is correctly judged by the discrimination model as non-real data (i.e., generated by the generative model).
[0257] The specific calculation process is as follows:
[0258] for Partially, from the real data distribution p data A large number of samples x are drawn from (x), and these samples are input into the discriminant model D to obtain the probability D(x) that the discriminant model classifies each sample as real data. Then, logD(x) is calculated. The average of these logD(x) values is used to estimate the expectation of this part.
[0259] for Partially, starting with the random noise distribution p z Random noise z is extracted from z and input into the data generation model G to obtain generated data G(z). This generated data is then input into the discriminant model D to obtain the probability D(G(z)) that the discriminant model classifies the generated data as real data. Next, log(1-D(G(z))) is calculated. Similarly, the average of a large number of log(1-D(G(z))) values is taken to obtain an estimate of this expected value. The larger this expected value is, the more accurately the discriminant model can identify the generated data, i.e., the stronger its ability to distinguish between real and generated data.
[0260] Adding these two expected values together yields the loss function V(D) of the discriminant model. The smaller the loss function value, the better the discriminant model performs in distinguishing between real and generated data.
[0261] After obtaining the loss function V(D) of the discriminant model, in order to adjust the model parameters to optimize its performance, we use the backpropagation algorithm to calculate the gradient of the loss function with respect to the discriminant model parameters.
[0262] The backpropagation algorithm is based on the chain rule. Starting with the loss function, it iterates backward through the neural network structure of the discriminant model, calculating the contribution of each parameter to the loss function, thereby obtaining the gradient of the parameters. The specific steps are as follows:
[0263] First, calculate the gradient of the loss function V(D) with respect to the outputs D(x) and D(G(z)) of the discriminant model. According to the definition and differentiation rules of the loss function, for... Taking the derivative, we get For differentiation achievable
[0264] Next, the gradients of the discriminant model outputs D(x) and D(G(z)) with respect to the parameters of each layer within the model (such as weights ω and biases b) are calculated. This requires calculation based on the specific neural network structure and activation function of the discriminant model. For example, for a simple fully connected neural network layer, the gradient of its output D(x) with respect to the weights ω can be obtained through matrix multiplication and the derivative of the activation function, while the gradient with respect to the bias b is relatively simple and can be calculated using the rules of differentiation.
[0265] Finally, according to the chain rule, the gradient of the loss function with respect to the output of the discriminant model is multiplied by the gradient of the output with respect to the parameters of each layer to obtain the gradient of the loss function with respect to the parameters of each layer of the discriminant model. and These parameter gradients represent the direction and extent of each parameter's influence on the loss function value, and are an important basis for subsequent parameter updates.
[0266] Based on the calculated gradients of the discriminant model parameters, we use optimization algorithms to adjust the model parameters. Stochastic gradient descent (SGD) or its variants (such as Adagrad, Adadelta, Adam, etc.) can be used for parameter updates. Taking stochastic gradient descent as an example, its parameter update formula is as follows: Where θ t This represents the discriminant model parameters at the current time step, where α is the learning rate, a pre-set positive number used to control the step size of parameter updates. This represents the gradient of the loss function at the parameters (i.e., the gradient calculated earlier). and wait).
[0267] In practical applications, for each batch of training data (including real data, random noise, and corresponding generated data), the loss function and parameter gradients are calculated following the steps described above, and the parameters of the discriminant model are adjusted according to the parameter update formula. With continuous iterative training, the parameters of the discriminant model are gradually updated, continuously improving its ability to distinguish between real and generated data. Simultaneously, by adjusting hyperparameters such as the learning rate, the speed and stability of model training can be controlled, avoiding problems such as the model failing to converge or getting trapped in local optima due to excessive parameter updates. In the early stages of training, a larger learning rate α can be set to accelerate the training speed. As training progresses, the learning rate is gradually reduced, allowing the model to converge more stably to better parameter values, thereby improving the performance of the discriminant model. This enables it to more accurately identify the authenticity of data in actual business applications, such as in financial risk detection, more precisely determining whether transaction data is abnormal and reducing the likelihood of risk occurrence.
[0268] The method provided in this application, through a loss function, comprehensively considers the judgment expectation of the discrimination model on real and generated data, prompting the model to accurately capture the difference between the two, greatly improving the accuracy of data authenticity judgment, and effectively ensuring that real data can be reliably identified in various business scenarios.
[0269] In an optional embodiment of the data generation method provided in the above embodiments of this application, obtaining m sample data of the target service includes:
[0270] Obtain 'a' data points from the target business, where 'a' data points are structured data.
[0271] Data cleaning is performed on 'a' collected data to remove abnormal and erroneous data, resulting in 'b' cleaned data.
[0272] Denoising is performed on b clean data to obtain c denoised data.
[0273] Normalize c denoised data points to obtain m sample data points, where a≥b≥c≥m≥1, and a, b, and c are all integers.
[0274] Understandably, the first step is to initiate multi-channel data collection for the target business. Taking e-commerce as an example, on the one hand, after extracting 'a' data points from the e-commerce platform's transaction database, these data points need to be cleaned to remove abnormal and erroneous data. In e-commerce order data, if the transaction amount of an order deviates significantly from the normal price range of the product, it needs to be removed; or if the order time is illogical, such as being earlier than the e-commerce platform's online time, it is also judged as abnormal data and removed. After careful screening, 'b' cleaned data points are obtained, satisfying b ≤ a, and b is an integer.
[0275] Next, the b cleaned data sets are denoised. In e-commerce scenarios, if the collected customer credit record data contains noise such as duplicate records or garbled data fragments caused by temporary system failures or network fluctuations, data smoothing algorithms, such as the moving average method, are used to remove fluctuation noise, or data rule-based verification algorithms are used to identify and correct garbled data to ensure data purity. After processing, c denoised data sets are obtained, where c ≤ b and c is an integer.
[0276] Finally, the c denoised data points are normalized to obtain m sample data. The value ranges of different features often vary greatly; for example, e-commerce order amounts can range from a few yuan to tens of thousands of yuan, while the number of items in an order is usually in the single digits. To ensure that each feature has equal influence in subsequent model training, a normalization method is used. A common method is Min-Max normalization, which maps the value of each feature to the interval between 0 and 1. i New value This process ensures that all data is standardized and uniform, ultimately yielding m sample data suitable for subsequent analysis and model building, where m ≤ c and m is an integer.
[0277] The method provided in this application lays a solid foundation for data generation and model training based on target business through a data preprocessing process, ensuring data quality and availability.
[0278] In an optional embodiment of the data generation method provided in the above embodiments of this application, obtaining a collection data points of the target service includes:
[0279] Obtain a1 first raw data points and a2 second raw data points of the target business, wherein the first raw data points are structured data and the second raw data points are unstructured data, and a1 and a2 are both integers greater than or equal to 1, and a = a1 + a2;
[0280] Data structuring is performed on a2 original second data to obtain a2 transformed second data, where the transformed second data is structured data;
[0281] Based on a1 first original data and a1 second transformed data, a collected data are obtained.
[0282] Understandably, the first step is to initiate multi-channel data collection for the target business. Taking e-commerce as an example, on the one hand, structured order information, such as order number, order time, transaction amount, product category, and shipping address, is extracted from the e-commerce platform's transaction database. This constitutes a1, the first set of raw data. On the other hand, unstructured data, such as user review texts and after-sales records, is collected, which constitutes a2, the second set of raw data. Here, a1 and a2 are both integers greater than or equal to 1, and a = a1 + a2.
[0283] The collected a2 sets of second-level raw data need to be transformed to facilitate subsequent analysis due to their unstructured nature. Taking unstructured text data as an example, natural language processing techniques are used for structuring. If it is user review text, a text classification model is used to first divide the reviews into categories such as positive, neutral, and negative reviews. Then, key information is extracted for different categories, such as keywords related to product quality issues mentioned in negative reviews and statements related to delayed logistics and delivery. This information is organized into a table format, transforming it into a2 sets of second-level transformed data, making it structured data, ensuring that it is consistent with the format of the previous a1 sets of first-level raw data, and facilitating integration.
[0284] The method provided in this application, through data structure transformation, not only makes full use of the regularity of structured data, but also taps into the value of unstructured data, laying a solid foundation for data application in target businesses.
[0285] In an optional embodiment of the data generation method provided in the above embodiments of this application, filtering h candidate data to obtain p target data includes:
[0286] Obtain x sample data points for the target business, where x is an integer greater than or equal to 1;
[0287] Based on x sample data and h candidate data, calculate the distance between the h candidate data and the x sample data to obtain h sets of distance data corresponding to the h candidate data, where each set of distance data includes x distance values;
[0288] Based on the h groups of distance data, sort the h candidate data from smallest to largest, and select the top p candidate data from the h candidate data as the target data according to the sorting results.
[0289] Understandably, the first step is to collect x sample data points from the relevant data repository or data source, based on the characteristics and needs of the target business. Taking e-commerce product recommendation as an example, data is extracted from the e-commerce platform's historical transaction records, user browsing logs, and product detail databases. This sample data covers information about products purchased by the user (such as product category, brand, price, etc.), details of products browsed but not purchased, and user characteristic information (such as age, gender, region, etc.), totaling x data points, where x is an integer greater than or equal to 1. This data constitutes the benchmark reference set for subsequent filtering operations.
[0290] Simultaneously, h candidate data points are acquired from the data generation model in the target generative adversarial network. These candidate data points are also generated based on the target business knowledge and possess certain business characteristic representations.
[0291] Next, the distances between the h candidate data points and the x sample data points are calculated to measure their similarity. The distance metric method can be chosen based on the data type and business requirements. Distance-based filtering can be represented as X′. bad ={x∈X bad |dist(x,X real )≤∈}, where X bad X represents candidate data. real Let X′ represent the sample data. bad This represents the target data to be filtered out, dist(x,X) real ) represents the difference between sample x and real data X. real The distance between them, ∈ is the filtering threshold.
[0292] After obtaining h sets of distance data, the h candidate data are sorted in ascending order based on their distance values. Common and efficient sorting algorithms such as bubble sort and quicksort can be used. Taking bubble sort as an example, it repeatedly visits the sequence to be sorted, comparing two data elements at a time. If the order is incorrect, they are swapped. After multiple rounds of comparisons and swaps, the sequence is finally sorted. After sorting, the top p candidate data are selected from the h candidate data as target data. Because these target data are closer to the existing sample data, they are more consistent with the real business data in terms of feature distribution and business logic. Therefore, they are more suitable as sample data for training the prediction model corresponding to the target business, effectively expanding the training data scale, improving model performance, and helping the target business achieve better results.
[0293] The method provided in this application measures similarity by calculating the distance between candidate data and sample data. It employs a scientifically sound distance metric algorithm, adapting different methods to different data types, to accurately quantify the strong correlation between the two, making the screening process more objective and accurate, and avoiding blindly selecting candidate data. This provides higher-quality training samples for the target business, helping to improve the practical effectiveness of business applications.
[0294] In an optional embodiment of the data generation method provided in the above embodiments of this application, filtering h candidate data to obtain p target data includes:
[0295] Obtain y sample data points for the target business, where y is an integer greater than or equal to 1;
[0296] Based on the similarity values between x sample data and h candidate data, classify the x sample data and h candidate data into r clusters, where each cluster includes at least one sample data and at least one candidate data.
[0297] Determine the target cluster from r clusters, where the similarity between the candidate data in the target cluster and the sample data in the target cluster is greater than a threshold;
[0298] p target data points are obtained by filtering the candidate data from the target cluster.
[0299] Understandably, firstly, x sample data points are collected from relevant databases, log files, or business record systems for the target business. Simultaneously, using the aforementioned data generation methods, h candidate data points are obtained from the data generation model in the target generative adversarial network. These candidate data points are also generated based on an understanding of the target business.
[0300] Next, we need to calculate the similarity values between x sample data and h candidate data to measure their similarity. Cluster-based screening can be represented as X ′ bad ={x∈X bad |x∈C bad}, where X bad Let X′ represent candidate data. bad C represents the selected target data. bad The target cluster.
[0301] After clustering is completed, a target cluster is determined from the r clusters. The criterion is that the similarity between the candidate data in the target cluster and the sample data in that target cluster is greater than a threshold. This threshold is determined based on business experience and multiple experiments to ensure that the selected candidate data has a sufficiently high degree of similarity to the real sample data. For example, in social media behavior analysis, if the threshold is set to 0.6, only clusters whose average similarity between the candidate data and the sample data exceeds 0.6 will be selected as the target cluster. Finally, p target data are selected from the candidate data in the target cluster. These target data, due to their close clustering with the real sample data during the clustering process, exhibit high similarity and better reflect the inherent patterns of the target business. As sample data for training the prediction model corresponding to the target business, they can effectively improve the model's learning performance, thus providing strong support for the target business (such as more accurately predicting social media user behavior trends and optimizing content recommendation strategies).
[0302] The method provided in this application, through cluster analysis, groups data based on similarity to identify target clusters closely related to the samples, and then filters target data from these clusters. This target data contains key features and patterns of the target business, and as training samples for the predictive model, it enriches sample diversity, enhances sample representativeness, and helps the model efficiently learn business patterns.
[0303] In an optional embodiment of the data generation method provided in the above embodiments of this application, after obtaining p target data, the method further includes:
[0304] The target generative adversarial network is trained based on p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0305] Understandably, evaluating p target data points involves assessing metrics such as sample authenticity, representativeness, and diversity, as well as model accuracy, recall, and F1 score. Based on the evaluation results, the semi-supervised learning model is optimized. Optimization methods may include adjusting model parameters, increasing model complexity, and improving model structure.
[0306] Furthermore, the target generative adversarial network is trained based on p target data to adjust the parameters of the data generation model and the discriminator model within the target generative adversarial network, including:
[0307] Based on the stochastic gradient descent algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0308] or,
[0309] Based on the genetic algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0310] or,
[0311] Based on the simulated annealing algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0312] Various optimization algorithms can be used, such as stochastic gradient descent, genetic algorithm, simulated annealing, etc.
[0313] Stochastic gradient descent is an iterative optimization algorithm that aims to gradually reduce the error between the model's predicted output and the true value by continuously adjusting the model parameters.
[0314] For the data generation model in a target generative adversarial network, p target data points are input sequentially. For each input data point, the loss function value between the current model's prediction for that data point and the true target value (the known ideal output corresponding to that target data, such as the accurate sales figure) is calculated. Let the loss function of the semi-supervised learning model be L(θ). t), where θ represents the model parameters. The update formula for stochastic gradient descent is: Where α represents the learning rate, This indicates that the loss function is in the parameter θ t The gradient at each point is calculated. Based on the calculated loss function value, the backpropagation algorithm is used to calculate the gradient of the loss function with respect to the parameters of each layer of the data generation model. The backpropagation algorithm is based on the chain rule, starting from the loss function and deriving the influence of each parameter on the loss function layer by layer in reverse, thus obtaining the accurate gradient value. By continuously repeating this process, as more and more target data is input, the parameters of the data generation model are gradually optimized, making the generated data more consistent with the actual situation of the target business. The same steps are repeated for the discriminative model in the target generative adversarial network. Real target business sample data (such as real samples in historical sales data) is mixed with the data generated by the data generation model and input into the discriminative model. The discriminative model outputs the probability judgment of each data point as real data. Based on these judgment results, the loss function of the discriminative model is constructed, the gradient is calculated again through backpropagation, and finally the parameters of the discriminative model are updated according to the stochastic gradient descent algorithm, making its discrimination ability increasingly accurate and able to better distinguish between real data and generated data.
[0315] Genetic algorithms are optimization algorithms based on the principles of biological evolution. They find optimal model parameters by simulating the processes of natural selection and genetic variation. First, the parameters of the data generation and discriminator models in the target generative adversarial network are encoded into a gene sequence-like representation for subsequent operations. For example, for a data generation model with n parameters, each parameter can be converted into a binary code with a certain precision, concatenated to form a binary string of length n, serving as a "gene individual" of the model. A population containing multiple such "gene individuals" is initialized, representing models with different initial parameter settings. The population size is determined based on actual computing resources and problem complexity, typically between tens and hundreds. The fitness value of the model corresponding to each individual on p target data points is calculated. The fitness function is designed closely around the target business requirements. Taking e-commerce sales prediction as an example, if the data generated by a data generation model enables a prediction model trained on this data to achieve higher prediction accuracy on the validation set, then the fitness of the individual corresponding to that model is high. For discriminator models, fitness can be measured by their accuracy in distinguishing between real and generated data. Through selection, individuals with high fitness are chosen from the current population, prioritizing those with superior model parameter combinations to increase their chances of participating in subsequent evolutionary processes. For example, a roulette wheel selection algorithm can be used, where the probability of an individual being selected is proportional to its fitness value. Crossover is then performed on the selected individuals, simulating the crossover of biological genes. Two individuals are randomly selected, and crossover points are chosen on their encoding strings according to a certain probability (the crossover probability, pre-set), exchanging some encoding segments to generate new individuals, aiming to create better model parameters. Next, mutation is performed, with a certain mutation probability (also pre-set) inverting or randomly changing certain bits in the individual's encoding string, introducing new parameter variation possibilities and preventing the algorithm from getting trapped in local optima. This selection, crossover, and mutation process is repeated multiple times, with fitness recalculated based on the newly generated population in each round. As iterations proceed, individuals in the population gradually evolve, representing the continuous optimization of the parameters of the data generation and discrimination models, ultimately resulting in a high-performance target generative adversarial network that better serves the target business. The optimization process of the genetic algorithm can be represented as P... t+1 =G(P t ), where P t Let G represent the population of generation t, and let G represent the genetic operation function.
[0316] Simulated annealing is an optimization algorithm based on the physical annealing process. It searches for optimal model parameters by simulating the annealing process of solid materials. The parameters of the data generation and discriminator models of the target generative adversarial network (GAN) are initialized, and an initial temperature is set. This temperature value affects the breadth of the parameter space explored in the early stages of the algorithm and is generally set based on experience and problem size. For the data generation model, p target data points are input, and the loss function value under the current model parameters is calculated as the current energy state. Similarly, for the discriminator model, after mixing real samples with generated data input, the corresponding loss function value is obtained based on its judgment result, which is also its current energy state. In the initial high-temperature stage, the algorithm has a high probability of accepting parameter changes that increase the loss function value, in order to escape local optima and explore the parameter space extensively. As the temperature gradually decreases, the probability of accepting inferior solutions decreases, tending to converge to the vicinity of the global optimum. The temperature is reduced according to a predetermined cooling strategy; common cooling strategies include linear cooling. The above steps of accepting new parameters and cooling are repeated multiple times. In this process, the parameters of the data generation and discrimination models are gradually optimized through continuous trial and adjustment until the temperature drops to a very low level, the algorithm converges, and finally the optimized target generative adversarial network is obtained, providing solid model support for target businesses (such as accurate e-commerce sales prediction, efficient risk identification, etc.). The optimization process of the simulated annealing algorithm can be represented as θ t+1 =θ t +Δ, where Δθ represents a random perturbation, and the probability of accepting the new parameter is:
[0317] Where T represents temperature.
[0318] By using these three different training methods, the appropriate algorithm can be flexibly selected based on the actual business scenario, computing resources, and requirements for model performance, thereby comprehensively improving the performance of the target generative adversarial network and helping the target business achieve better results.
[0319] The method provided in this application offers a variety of advanced training algorithms, such as stochastic gradient descent, genetic algorithms, and simulated annealing, which can be flexibly adapted to different business scenarios, data characteristics, and computing resources. These algorithms optimize the parameters of the data generation model and the discrimination model in the target generative adversarial network from multiple dimensions, enabling the model to accurately capture the target business patterns and enhance the model's generalization ability and prediction accuracy.
[0320] In an optional embodiment of the data generation method provided in the above embodiments of this application, the target data is used to characterize sample data of overdue and unpaid orders. After obtaining p target data, the method further includes:
[0321] The first risk assessment model is trained based on p target data, whereby the first risk assessment model is used to predict overdue payments for overdue orders.
[0322] Alternatively, the target data can be used to characterize the sample data of risky merchants. After obtaining p target data points, the data will also include:
[0323] The second risk assessment model is trained based on p target data, whereby the second risk assessment model is used to predict the target behavior of merchants.
[0324] Understandably, in the scenario of overdue order sample data, when the target data is used to characterize overdue order sample data: First, following the data generation and filtering process described in the preceding claims, p overdue order sample data are accurately obtained. This data records detailed information on various characteristics closely related to overdue behavior, such as the order amount, order time, product category, customer's credit rating history, past repayment records, and the repayment cycle stage of the order. This rich and targeted information provides valuable material for training the subsequent risk assessment model. Next, these p overdue order sample data are input into the first risk assessment model for training. The first risk assessment model is typically built based on machine learning algorithms, such as logistic regression, decision tree, or neural network models. Here, we will use logistic regression as an example. In the logistic regression model, the features of each sample data are considered independent variables, while the overdue payment result is the dependent variable (taking values of 0 or 1, representing no overdue payment and overdue payment, respectively). The model learns the potential relationship between each feature and the overdue result based on the sample data, and estimates the model parameters through the maximum likelihood estimation method.
[0325] During training, p sample data points are sequentially input into the model, and the error between the predicted probability and the actual overdue result is calculated. A commonly used error metric is the logarithmic loss function. Using a gradient descent-based optimization algorithm, the model parameters are updated based on error backpropagation, ensuring that the model's predicted probability is as close as possible to the actual overdue situation. After multiple rounds of iterative training, the first risk assessment model gradually grasps the risk characteristics and patterns of order overdue payments, enabling accurate predictions of new overdue orders. This effectively helps financial institutions identify risks in advance and take corresponding measures or risk control strategies to reduce potential losses.
[0326] In the scenario of risky merchant sample data, when the target data is used to characterize risky merchant sample data: First, obtain p precise risky merchant sample data. This data comprehensively covers various risk indicators in the merchant's operation process, including the merchant's registration duration, the stability of the business category, the number of historical transaction disputes, fluctuations in store traffic and conversion rates, and whether there are any records of illegal operations. Then, import these p risky merchant sample data into a second risk assessment model for training. Here, it is assumed that the second risk assessment model is constructed using a neural network model. The neural network model consists of an input layer, multiple hidden layers, and an output layer. The input layer receives various feature values from the merchant sample data. The hidden layers perform non-linear transformations on the input data through neuron activation functions (such as the ReLU function) to uncover deep-seated feature relationships. The output layer outputs the predicted probability of the merchant engaging in the target behavior (such as fraudulent transactions, selling counterfeit goods, etc.).
[0327] In the training phase, p sample data are input into the neural network model in batches. The loss function value between the predicted probability output by the model and the actual risky behavior of merchants is calculated. A common loss function is the cross-entropy loss function. Using the backpropagation algorithm, based on the gradient of the loss function with respect to the parameters of each layer of the model, stochastic gradient descent or its variant optimization algorithm (such as the Adam optimization algorithm) is used to update the parameters, prompting the model to continuously optimize. As training progresses, the second risk assessment model's ability to identify risky merchant behavior continuously improves. It can promptly detect potentially risky merchants in various environments such as e-commerce platforms and offline business scenarios, providing strong early warnings for regulatory authorities and platform operators, ensuring fair and orderly market transactions, and protecting consumer rights. By adopting appropriate model training methods for different types of target data, the value of data is fully explored, effectively serving the risk management needs of different fields.
[0328] The method provided in this application deploys an optimized target generative adversarial network onto the server of an e-commerce platform for applications such as risk assessment and fraud detection. It uses generated samples of overdue orders to train a risk assessment model, improving the model's accuracy in predicting overdue orders; or it uses generated samples of high-risk merchants for fraud detection, promptly identifying potential fraudulent activities.
[0329] Please see Figure 10 , Figure 10 A structural diagram of a data generation device is shown, such as Figure 10 In (A), the data generation device 100 includes:
[0330] Module 1001 is used to acquire random noise;
[0331] The generation module 1002 is used to input random noise into the data generation model in the target generative adversarial network and generate h candidate data according to the data generation model. The target generative adversarial network is a semi-supervised learning model built based on sample data of the target business, and h is an integer greater than or equal to 1.
[0332] The filtering module 1003 is used to filter h candidate data to obtain p target data, where the target data is sample data used to train the prediction model corresponding to the target business, and p is an integer greater than or equal to 1 and less than or equal to h.
[0333] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, such as Figure 10 In (B), the data generation device 100 further includes:
[0334] The acquisition module 1001 is also used to acquire m sample data of the target business, where m is an integer greater than or equal to 1;
[0335] Analysis module 1004 is used to perform principal component analysis on m sample data to obtain m feature data. The data dimension of the feature data is lower than that of the corresponding sample data. The m feature data includes m1 labeled feature data and m2 unlabeled feature data. m is an integer greater than or equal to 1, and m1 and m2 are both integers greater than or equal to 1 and less than or equal to m. m = m1 + m2, and m1 ≤ m2.
[0336] The acquisition module 1001 is also used to acquire an initial generative adversarial network, wherein the initial generative adversarial network includes a data generation model and a discriminant model, and the initial parameters of the data generation model and the initial parameters of the discriminant model are both random values.
[0337] Training module 1005 is used to train the initial generative adversarial network based on m feature data, so as to adjust the initial parameters of the data generation model and the initial parameters of the discrimination model to obtain the target generative adversarial network.
[0338] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the analysis module 1004 is further configured to:
[0339] Generate a sample data matrix based on m sample data.
[0340] The covariance matrix is calculated based on the sample data matrix.
[0341] The covariance matrix is decomposed into eigenvalues to obtain n eigenvalues and n eigenvectors corresponding to the n eigenvalues;
[0342] Sort the n feature values in descending order, and select the first k feature values from the sorting results, where k is an integer greater than or equal to 1 and less than or equal to n;
[0343] Generate a projection matrix based on the k eigenvectors corresponding to the k eigenvalues;
[0344] Based on the sample data matrix and the projection matrix, the feature data matrix is calculated, where the feature data matrix includes m feature data.
[0345] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module 1005 is further configured to:
[0346] Obtain training random sample data;
[0347] The training random sample data is used as the input to the data generation model in the initial generative adversarial network, and the training generated data is obtained according to the data generation model.
[0348] The m feature data and the training generated data are used as inputs to the discriminative model in the initial generative adversarial network. Based on the discriminative model, m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data are generated.
[0349] Based on the m decision results corresponding to m feature data and the decision results corresponding to training random sample data, the data generation model and the discriminant model are trained adversarially to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thus obtaining the target generative adversarial network.
[0350] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module 1005 is further configured to:
[0351] Calculate the loss function of the data generation model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data;
[0352] Calculate the gradient of the parameters of the data generation model based on the loss function of the data generation model;
[0353] Adjust the initial parameters of the data generation model based on the gradient of the data generation model's parameters.
[0354] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module 1005 is further configured to:
[0355] Calculate the loss function of the discriminant model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data;
[0356] Calculate the gradient of the parameters of the discriminant model based on the loss function of the discriminant model;
[0357] The initial parameters of the discriminant model are adjusted based on the gradient of the discriminant model's parameters.
[0358] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the acquisition module 1001 is further configured to:
[0359] Obtain 'a' data points from the target business, where 'a' data points are structured data.
[0360] Data cleaning is performed on 'a' collected data to remove abnormal and erroneous data, resulting in 'b' cleaned data.
[0361] Denoising is performed on b clean data to obtain c denoised data.
[0362] Normalize c denoised data points to obtain m sample data points, where a≥b≥c≥m≥1, and a, b, and c are all integers.
[0363] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the acquisition module 1001 is further configured to:
[0364] Obtain a1 first raw data points and a2 second raw data points of the target business, wherein the first raw data points are structured data and the second raw data points are unstructured data, and a1 and a2 are both integers greater than or equal to 1, and a = a1 + a2;
[0365] Data structuring is performed on a2 original second data to obtain a2 transformed second data, where the transformed second data is structured data;
[0366] Based on a1 first original data and a1 second transformed data, a collected data are obtained.
[0367] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the filtering module 1003 is further configured to:
[0368] Obtain x sample data points for the target business, where x is an integer greater than or equal to 1;
[0369] Based on x sample data and h candidate data, calculate the distance between the h candidate data and the x sample data to obtain h sets of distance data corresponding to the h candidate data, where each set of distance data includes x distance values;
[0370] Based on the h groups of distance data, sort the h candidate data from smallest to largest, and select the top p candidate data from the h candidate data as the target data according to the sorting results.
[0371] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the filtering module 1003 is further configured to:
[0372] Obtain y sample data points for the target business, where y is an integer greater than or equal to 1;
[0373] Based on the similarity values between x sample data and h candidate data, classify the x sample data and h candidate data into r clusters, where each cluster includes at least one sample data and at least one candidate data.
[0374] Determine the target cluster from r clusters, where the similarity between the candidate data in the target cluster and the sample data in the target cluster is greater than a threshold;
[0375] p target data points are obtained by filtering the candidate data from the target cluster.
[0376] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module 1005 is further configured to:
[0377] The target generative adversarial network is trained based on p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0378] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the training module 1005 is further configured to:
[0379] Based on the stochastic gradient descent algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0380] or,
[0381] Based on the genetic algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0382] or,
[0383] Based on the simulated annealing algorithm, the target generative adversarial network is trained with p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
[0384] In an optional embodiment of the data generation apparatus provided in the above embodiments of this application, the target data is used to characterize sample data of overdue orders, and the training module 1005 is further used to: train a first risk assessment model based on p target data, wherein the first risk assessment model is used to predict overdue orders;
[0385] The target data is used to characterize the sample data of risky merchants. The training module 1005 is also used to train the second risk assessment model based on p target data, wherein the second risk assessment model is used to predict the target behavior of merchants.
[0386] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0387] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0388] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0389] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0390] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0391] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a server or terminal device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0392] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A data generation method, characterized in that, include: Obtain random noise; The random noise is input into the data generation model in the target generative adversarial network, and h candidate data are generated according to the data generation model. The target generative adversarial network is a semi-supervised learning model built based on sample data of the target business, and h is an integer greater than or equal to 1. The h candidate data are filtered to obtain p target data, wherein the target data are sample data used to train the prediction model corresponding to the target business, and p is an integer greater than or equal to 1 and less than or equal to h.
2. The data generation method as described in claim 1, characterized in that, The method further includes: Obtain m sample data points for the target business, where m is an integer greater than or equal to 1; Principal component analysis is performed on the m sample data to obtain m feature data, wherein the data dimension of the feature data is lower than the data dimension of the sample data. The m feature data include m1 labeled feature data and m2 unlabeled feature data, where m is an integer greater than or equal to 1, m1 and m2 are both integers greater than or equal to 1 and less than or equal to m, m = m1 + m2, and m1 ≤ m2. Obtain an initial generative adversarial network, wherein the initial generative adversarial network includes a data generation model and a discriminant model, and the initial parameters of the data generation model and the initial parameters of the discriminant model are both random values; Based on the m feature data, the initial generative adversarial network is trained to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thereby obtaining the target generative adversarial network.
3. The data generation method as described in claim 2, characterized in that, The principal component analysis of the m sample data yields m feature data, including: Generate a sample data matrix based on the m sample data; The covariance matrix is calculated based on the sample data matrix. The covariance matrix is decomposed into eigenvalues to obtain n eigenvalues and n eigenvectors corresponding to the n eigenvalues; The n feature values are sorted in descending order, and the top k feature values are selected from the sorting results, where k is an integer greater than or equal to 1 and less than or equal to n. A projection matrix is generated based on the k eigenvectors corresponding to the k eigenvalues; Based on the sample data matrix and the projection matrix, a feature data matrix is calculated, wherein the feature data matrix includes the m feature data.
4. The data generation method as described in claim 2 or 3, characterized in that, The step of training the initial generative adversarial network based on the m feature data to adjust the initial parameters of the data generation model and the initial parameters of the discriminative model to obtain the target generative adversarial network includes: Obtain training random sample data; The training random sample data is used as input to the data generation model in the initial generative adversarial network, and training generated data is obtained according to the data generation model. The m feature data and the training generated data are used as inputs to the discriminant model in the initial generative adversarial network. Based on the discriminant model, m decision results corresponding to the m feature data and decision results corresponding to the training random sample data are generated. Based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data, the data generation model and the discriminant model are subjected to adversarial training to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, thereby obtaining the target generative adversarial network.
5. The data generation method as described in claim 4, characterized in that, The step of performing adversarial training on the data generation model and the discriminant model based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data, to adjust the initial parameters of the data generation model and the initial parameters of the discriminant model, to obtain the target generative adversarial network, includes: The loss function of the data generation model is calculated based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data. Calculate the gradient of the parameters of the data generation model based on the loss function of the data generation model; The initial parameters of the data generation model are adjusted according to the gradient of the parameters of the data generation model.
6. The data generation method as described in claim 4 or 5, characterized in that, The step of performing adversarial training on the discriminant model and the discriminant network based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data, to adjust the initial parameters of the discriminant model and the discriminant network to obtain the target generative adversarial network, includes: The loss function of the discrimination model is calculated based on the m decision results corresponding to the m feature data and the decision results corresponding to the training random sample data. Calculate the gradient of the parameters of the discriminant model based on the loss function of the discriminant model; The initial parameters of the discriminant model are adjusted based on the gradient of the parameters of the discriminant model.
7. The data generation method according to any one of claims 2-6, characterized in that, The acquisition of m sample data of the target service includes: Acquire a data points from the target business, wherein the a data points are structured data; Data cleaning is performed on the a collected data to remove abnormal and erroneous data, resulting in b cleaned data. The b cleaned data are denoised to obtain c denoised data. The c denoised data are normalized to obtain m sample data, where a≥b≥c≥m≥1, and a, b, and c are all integers.
8. The data generation method as described in claim 7, characterized in that, The acquisition of a data points from the target service includes: Obtain a1 first raw data points and a2 second raw data points of the target business, wherein the first raw data points are structured data and the second raw data points are unstructured data, a1 and a2 are both integers greater than or equal to 1, and a = a1 + a2; The a2 original second data are subjected to data structuring processing to obtain a2 transformed second data, wherein the transformed second data is structured data; Based on the a1 first original data and a1 second transformed data, a collected data are obtained.
9. The data generation method according to any one of claims 1-8, characterized in that, The process of filtering the h candidate data to obtain p target data includes: Obtain x sample data points of the target service, where x is an integer greater than or equal to 1; Based on the x sample data and the h candidate data, calculate the distance between the h candidate data and the x sample data to obtain h sets of distance data corresponding to the h candidate data, wherein each set of distance data includes x distance values; Based on the h sets of distance data, the h candidate data are sorted from smallest to largest, and the top p candidate data are selected as target data from the h candidate data according to the sorting results.
10. The data generation method according to any one of claims 1-8, characterized in that, The process of filtering the h candidate data to obtain p target data includes: Obtain y sample data of the target service, where y is an integer greater than or equal to 1; Based on the similarity values between the x sample data and the h candidate data, the x sample data and the h candidate data are classified into r clusters, wherein each cluster includes at least one sample data and at least one candidate data. A target cluster is determined from the r clusters, wherein the similarity between the candidate data in the target cluster and the sample data in the target cluster is greater than a threshold. p target data are obtained by filtering the candidate data in the target cluster.
11. The data generation method according to any one of claims 1-8, characterized in that, After obtaining p target data points, the process also includes: The target generative adversarial network is trained based on the p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
12. The data generation method as described in claim 11, characterized in that, The step of training the target generative adversarial network based on the p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network includes: Based on the stochastic gradient descent algorithm, the target generative adversarial network is trained according to the p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network; or, Based on a genetic algorithm, the target generative adversarial network is trained using the p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network. or, Based on the simulated annealing algorithm, the target generative adversarial network is trained using the p target data to adjust the parameters of the data generation model and the discrimination model in the target generative adversarial network.
13. The data generation method as described in claim 11, characterized in that, The target data is used to characterize the sample data of overdue and unpaid orders. After obtaining p target data points, the process further includes: The first risk assessment model is trained based on the p target data, wherein the first risk assessment model is used to predict overdue payments for overdue orders. Alternatively, the target data is used to characterize the sample data of risky merchants, and after obtaining p target data, the process further includes: The second risk assessment model is trained based on the p target data, wherein the second risk assessment model is used to predict the target behavior of merchants.
14. A data generation apparatus, characterized in that, include: The acquisition module is used to acquire random noise; The generation module is used to input the random noise into the data generation model in the target generative adversarial network, and generate h candidate data according to the data generation model, wherein the target generative adversarial network is a semi-supervised learning model built based on sample data of the target business, and h is an integer greater than or equal to 1; The filtering module is used to filter the h candidate data to obtain p target data, wherein the target data is sample data used to train the prediction model corresponding to the target business, and p is an integer greater than or equal to 1 and less than or equal to h.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the data generation method according to any one of claims 1 to 13.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data generation method according to any one of claims 1 to 13.
17. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the data generation method according to any one of claims 1 to 13.