CN114219003A - Training method and device of sample generation model and electronic equipment - Google Patents

Training method and device of sample generation model and electronic equipment Download PDF

Info

Publication number
CN114219003A
CN114219003A CN202111341268.8A CN202111341268A CN114219003A CN 114219003 A CN114219003 A CN 114219003A CN 202111341268 A CN202111341268 A CN 202111341268A CN 114219003 A CN114219003 A CN 114219003A
Authority
CN
China
Prior art keywords
order
sample
training
generating
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111341268.8A
Other languages
Chinese (zh)
Inventor
廖国翔
刘威
卢颖辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111341268.8A priority Critical patent/CN114219003A/en
Publication of CN114219003A publication Critical patent/CN114219003A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0633Lists, e.g. purchase orders, compilation or processing
    • G06Q30/0635Processing of requisition or of purchase orders

Abstract

The disclosure provides a training method and device for a sample generation model and electronic equipment, wherein the method comprises the following steps: acquiring actual order information and generating a candidate order sample; performing countermeasure training on a generating network and an identification network in a sample generating model based on the candidate order sample, wherein the generating network is used for generating a pseudo order sample, and the identification network is used for identifying a true sample and a false sample; and determining an error matrix of the sample generation model based on the result of the true and false sample identification, and adjusting the sample generation model based on the error matrix to generate the target sample generation model. According to the method and the device, the quality of the pseudo order sample is optimized, and the accuracy of order identification is enhanced, so that the pseudo order sample closer to actual transaction information is obtained.

Description

Training method and device of sample generation model and electronic equipment
Technical Field
The present disclosure relates to the field of artificial intelligence recognition and classification technologies, and in particular, to a training method and apparatus for a sample generation model, and an electronic device.
Background
With the development of technology, the development of e-commerce platforms is mature day by day, more and more people choose to shop on the internet in daily life, so that the malicious competitive behaviors on the e-commerce platforms are increased day by day.
Therefore, how to accurately identify the malicious orders becomes a problem to be solved at present.
Disclosure of Invention
The present disclosure is directed to solving, at least to some extent, one of the technical problems in the related art.
To this end, the present disclosure proposes a training method of a sample generation model in a first aspect.
The second aspect of the present disclosure provides a training method for an order classification model.
The third aspect of the present disclosure further provides a training apparatus for a sample generation model.
The fourth aspect of the present disclosure further provides a training apparatus for an order classification model.
A fifth aspect of the present disclosure provides an electronic device.
A sixth aspect of the present disclosure is directed to a computer-readable storage medium.
A seventh aspect of the present disclosure proposes a computer program product.
The first aspect of the present disclosure provides a training method for a sample generation model, including: acquiring actual order information and generating a candidate order sample; performing countermeasure training on a generating network and an identifying network in a sample generating model based on the candidate order sample, wherein the generating network is used for generating a pseudo order sample, and the identifying network is used for identifying a true sample and a false sample; and determining an error matrix of the sample generation model based on the result of the true and false sample identification, and adjusting the sample generation model based on the error matrix to generate a target sample generation model.
In addition, the training method for the sample generation model proposed by the first aspect of the present disclosure may further have the following additional technical features:
according to one embodiment of the present disclosure, the generating network is configured to generate a pseudo order sample, including: extracting a characteristic value under each characteristic item from the candidate order sample; sampling the characteristic value extracted from the candidate order sample to obtain a sampling characteristic value; and carrying out full connection operation on the sampling characteristic value to generate the pseudo order sample.
According to an embodiment of the present disclosure, the determining an error matrix of a model based on the result of the true and false sample identification includes: determining the true positive rate and the false positive rate of the sample generation model according to the distinguishing label of each order sample; determining the error matrix for the sample generation model based on the true positive rate and the false positive rate.
According to an embodiment of the present disclosure, the collecting actual order information and generating a candidate order sample further includes: and performing label classification, feature coding and missing item filling on the actual order information to generate the candidate order sample.
According to one embodiment of the present disclosure, the collecting actual order information and generating a candidate order sample includes: generating a sample characteristic topological graph based on the collected actual order information; and generating virtual order information based on the sample characteristic topological graph, and generating the candidate order sample for training based on the virtual order information and the actual order information.
According to an embodiment of the present disclosure, the generating a sample feature topological graph based on the actual order information includes: determining each feature item of the actual order information as a vertex of the sample feature topological graph; and determining the incidence relation between each feature item according to the grade of each feature item, and determining the connection relation between the vertexes based on the incidence relation so as to generate the sample feature topological graph.
According to an embodiment of the present disclosure, the generating virtual order information based on the sample feature topological graph includes: and inputting the sample characteristic topological graph into a graph convolution neural network to obtain the virtual order information.
The second aspect of the present disclosure further provides a training method of an order classification model, including: acquiring actual order information on a server, and generating a first order sample based on the actual order information; inputting part of the first order sample into a target sample generation model, and outputting a pseudo order sample as a second order sample; performing order category marking on the first order sample and the second order sample to generate an order sample set for training; and training an order classification model based on the order sample set to generate a target order classification model.
The training method of the order classification model proposed by the second aspect of the present disclosure may further have the following additional technical features:
according to an embodiment of the present disclosure, training an order classification model based on the order sample set to generate a target order classification model includes: inputting the order sample in the order sample set into the order classification model, and outputting the predicted order type of the order sample; determining a loss function of the order classification model based on the predicted order type and the labeled order category of the order sample; and adjusting the parameters of the order classification model according to the loss function, and continuing to train the order classification model after the parameters are adjusted by using the next order sample until the training end condition is met, so as to generate a target order classification model.
According to an embodiment of the present disclosure, the method further comprises: and acquiring an order to be identified, inputting the order to be identified into the target order classification model to identify the order type, and acquiring the target order type of the order to be identified.
According to an embodiment of the present disclosure, the method further comprises: and determining the risk level of the order to be identified according to the type of the target order.
The third aspect of the present disclosure further provides a training apparatus for a sample generation model, including: the generating module is used for acquiring actual order information and generating a candidate order sample; the training module is used for carrying out countermeasure training on a generating network and a recognition network in a sample generating model based on the candidate order sample, wherein the generating network is used for generating a pseudo order sample, and the recognition network is used for carrying out true and false sample recognition; and the adjusting module is used for determining an error matrix of the sample generation model based on the result of the true and false sample identification and adjusting the sample generation model based on the error matrix to generate a target sample generation model.
The training apparatus for a sample generation model according to the third aspect of the present disclosure may further have the following additional technical features:
according to an embodiment of the present disclosure, the training module is further configured to: extracting a characteristic value under each characteristic item from the candidate order sample; sampling the characteristic value extracted from the candidate order sample to obtain a sampling characteristic value; and carrying out full connection operation on the sampling characteristic value to generate the pseudo order sample.
According to an embodiment of the present disclosure, the adjusting module is further configured to: determining the true positive rate and the false positive rate of the sample generation model according to the distinguishing label of each order sample; determining the error matrix for the sample generation model based on the true positive rate and the false positive rate.
According to an embodiment of the disclosure, the generating module is further configured to: and performing label classification, feature coding and missing item filling on the actual order information to generate the candidate order sample.
According to an embodiment of the disclosure, the generating module is further configured to: generating a sample characteristic topological graph based on the collected actual order information; and generating virtual order information based on the sample characteristic topological graph, and generating the candidate order sample for training based on the virtual order information and the actual order information.
According to an embodiment of the disclosure, the generating module is further configured to: determining each feature item of the actual order information as a vertex of the sample feature topological graph; and determining the incidence relation between each feature item according to the grade of each feature item, and determining the connection relation between the vertexes based on the incidence relation so as to generate the sample feature topological graph.
According to an embodiment of the disclosure, the generating module is further configured to: and inputting the sample characteristic topological graph into a graph convolution neural network to obtain the virtual order information.
The fourth aspect of the present disclosure further provides a training apparatus for an order classification model, including: the acquisition module is used for acquiring actual order information on the server and generating a first order sample based on the actual order information; the generating module is used for inputting part of the first order sample into a target sample generating model and outputting a pseudo order sample as a second order sample; the marking module is used for marking the first order sample and the second order sample in order categories to generate an order sample set for training; and the training module is used for training the order classification model based on the order sample set so as to generate a target order classification model.
The training device for the order classification model provided by the fourth aspect of the present disclosure may further have the following additional technical features:
according to an embodiment of the present disclosure, the training module is further configured to: inputting the order sample in the order sample set into the order classification model, and outputting the predicted order type of the order sample; determining a loss function of the order classification model based on the predicted order type and the labeled order category of the order sample; and adjusting the parameters of the order classification model according to the loss function, and continuing to train the order classification model after the parameters are adjusted by using the next order sample until the training end condition is met, so as to generate a target order classification model.
According to an embodiment of the present disclosure, the apparatus further comprises: and the judging module is used for acquiring the order to be identified, inputting the order to be identified into the target order classification model for order type identification, and acquiring the target order type of the order to be identified.
According to an embodiment of the present disclosure, the determining module is further configured to: and determining the risk level of the order to be identified according to the type of the target order.
A fifth aspect of the present disclosure provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for training the sample generation model according to the first aspect or the method for training the order classification model according to the second aspect.
A sixth aspect of the present disclosure proposes a computer-readable storage medium, wherein the computer instructions are configured to cause the computer to execute the training method of the sample generation model proposed by the first aspect or the training method of the order classification model proposed by the second aspect.
A seventh aspect of the present disclosure proposes a computer program product comprising a computer program which, when executed by a processor, implements the method for training a sample generation model proposed according to the first aspect or the method for training an order classification model proposed according to the second aspect.
The training method and device for the sample generation model, provided by the disclosure, are used for acquiring actual order information from a server to generate a candidate order sample for training, inputting the candidate order sample into the sample generation model, and performing countermeasure training on a generation network and an identification network in the sample generation model. The generation network generates a pseudo order sample based on the candidate order sample, the identification network identifies the pseudo order sample and the candidate order sample according to a true order and a false order, and an error matrix of a sample generation model is determined according to an identification result. And if the sample generation model of the current round of training meets the model training end condition, stopping training and generating the target sample generation model. And if the sample generation model of the current round of training does not meet the model training end condition, adjusting the model parameters of the sample generation model according to the error matrix corresponding to the current round of training, returning to use the next candidate order sample to continue the antagonistic training of the sample generation model after the parameter adjustment until the training end condition is met, and generating the target sample generation model. According to the method and the device, the countermeasure training of the generation network and the identification network in the sample generation model is performed, the difference between the pseudo order sample generated by the generation network and the candidate order sample is effectively shortened through the true and false order identification results of the identification network on the pseudo order sample and the candidate order sample, the generation quality of the generation network on the pseudo order sample is optimized, the complexity of the identification network for identifying the true and false order sample is effectively improved based on the mixed input of the pseudo order sample generated by the generation network and the candidate order sample, the accuracy of the identification network is effectively strengthened, and the pseudo order sample closer to actual transaction information can be obtained.
It should be understood that the description herein is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flow chart of a training method of a sample generation model according to a first embodiment of the present disclosure;
FIG. 2 is a schematic flow chart illustrating a training method of a sample generation model according to a second embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of a training method for a sample generation model according to a third embodiment of the present disclosure;
FIG. 4 is a schematic flow chart of a training method of a sample generation model according to a fourth embodiment of the present disclosure;
FIG. 5 is a schematic flow chart of a training method for a sample generation model according to a fifth embodiment of the present disclosure;
FIG. 6 is a schematic flow chart diagram illustrating a training method for a sample generation model according to a sixth embodiment of the present disclosure;
FIG. 7 is a flowchart illustrating a training method of an order classification model according to a seventh embodiment of the disclosure;
fig. 8 is a flowchart illustrating a training method of an order classification model according to an eighth embodiment of the disclosure;
FIG. 9 is a flowchart illustrating a method for training an order classification model according to a ninth embodiment of the disclosure;
FIG. 10 is a schematic structural diagram of a training apparatus for generating a model from a sample according to an exemplary embodiment of the present disclosure;
FIG. 11 is a schematic structural diagram of a training apparatus for generating a model from a sample according to an exemplary embodiment of the present disclosure;
FIG. 12 is a schematic structural diagram of a training apparatus for an order classification model according to an exemplary embodiment of the present disclosure;
FIG. 13 is a schematic structural diagram of an apparatus for training an order classification model according to an exemplary embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present disclosure, and should not be construed as limiting the present disclosure.
A training method, an apparatus, an electronic device, and a storage medium of a sample generation model according to embodiments of the present disclosure are described below with reference to the drawings.
Fig. 1 is a schematic flow chart of a training method of a sample generation model according to a first embodiment of the present disclosure, as shown in fig. 1, the method includes:
s101, collecting actual order information and generating a candidate order sample.
The e-commerce platform has the advantages that a user carries out malicious purchase on part of commodities, and certain loss is caused to daily operation of the e-commerce platform and merchants, so that the e-commerce platform needs to identify malicious orders, and the malicious user is intercepted.
In the implementation, the number of the malicious orders accounts for a relatively small percentage of the number of orders in all the e-commerce platforms, so that in order to accurately identify the malicious orders, the number of the malicious orders needs to be increased for the malicious orders, and therefore the training effect of a malicious order identification model is guaranteed.
Furthermore, the purpose of increasing samples can be achieved by training the sample generation model.
In the embodiment of the disclosure, the e-commerce platform records the browsing, purchasing and other related operations of the user on the platform, so as to generate browsing records, order information and other related data. The recorded browsing records, order information and other related data can be stored in a set location, such as a server.
Accordingly, actual order information generated based on the actual purchase record of the user may be acquired from the server, wherein the order information may include a member name, a purchase commodity name, an order amount, a transaction time, an order number, a shipping address, and the like of the user.
Further, based on the obtained actual order information, corresponding sample data can be used as a candidate order sample for training the sample generation model.
Optionally, the order samples generated by the obtained actual order information may be divided according to a set proportion, some proportion of the order samples are used as candidate order samples for model training, and the remaining order samples are used as test samples for testing the trained target sample generation model, so as to implement performance testing on the trained target sample generation model.
It should be noted that the dividing ratio of the test sample and the candidate order sample may be determined based on actual conditions, and is not limited herein.
S102, performing countermeasure training on a generating network and an identification network in the sample generating model based on the candidate order sample, wherein the generating network is used for generating a pseudo order sample, and the identification network is used for identifying a true sample and a false sample.
In the embodiment of the disclosure, in order to enable the sample generation model to generate order information infinitely close to real information, the sample generation model may be trained through candidate order samples.
Further, the generation network and the recognition network in the sample generation model can be subjected to countermeasure training, and model optimization is realized on the generation network and the recognition network through the countermeasure training.
Alternatively, order information close to the real information may be generated by a generation network, which may be understood as generating order data infinitely close to the candidate order sample, and generating a pseudo order sample based on the portion of order data.
And further, identifying the true and false samples of the order input into the identification network through the identification network, wherein the order sample input into the identification network is generated by the candidate order sample and the false order sample, and identifying the candidate order sample of the true transaction or the false order sample generated by the generation network for the order sample input into the identification network can be realized through the identification network.
Alternatively, the label of the identified order sample belonging to the real information may be determined as a positive label, and the label of the order sample identified as the false information may be determined as a negative label.
The generation network optimizes the generation quality of the pseudo order through accurate identification of the identification network, and the generation network optimizes the generation quality of the pseudo order, so that the identification accuracy of the identification network is improved, and the countertraining of the generation network and the identification network in the sample generation model is realized.
S103, determining an error matrix of the sample generation model based on the result of the true and false sample identification, and adjusting the sample generation model based on the error matrix to generate a target sample generation model.
In the embodiment of the disclosure, an error matrix of the sample generation model can be determined according to the result of the true and false sample identification.
The error matrix can be understood as an error between an order identification label output by the identification network and an actual order label, and model parameter adjustment can be performed on the sample generation model based on the error matrix, so that the difference between a pseudo order sample generated by the generation network and a candidate order sample of real transaction is shortened, and the identification accuracy of the identification network for the order sample input by the identification network is real information or false information is improved.
Further, if the sample generation model after the training of the current round does not meet the condition of the training end, the model parameter adjustment may be performed on the sample generation model after the training of the current round based on the error matrix, and the adjusted sample generation model is continuously trained according to the next set of candidate order samples and the pseudo order samples until the condition of the model training end is met.
Alternatively, training end conditions of the sample generation model may be determined based on the error matrix, and when the error matrix generated by model training of a certain round meets the set training end conditions, it may be determined that the performance of the sample generation model trained in the current round may meet the actual requirement, the training of the sample generation model is stopped, and the sample generation model trained in the current round is determined as the target sample generation model.
Optionally, training end conditions of the sample generation model may be set based on the number of times of training, when performing model training, the number of times of model training may be counted, when the number of times of model training in a certain number of times satisfies the set training end conditions, it may be determined that the performance of the sample generation model in the current number of times of training may satisfy the actual requirement, the training of the sample generation model is stopped, and the sample generation model in which the current number of times of training is ended is determined as the target sample generation model.
The training method of the sample generation model provided by the disclosure comprises the steps of collecting actual order information from a server to generate a candidate order sample for training, inputting the candidate order sample into the sample generation model, and carrying out countermeasure training on a generation network and an identification network in the sample generation model. The generation network generates a pseudo order sample based on the candidate order sample, the identification network identifies the pseudo order sample and the candidate order sample according to a true order and a false order, and an error matrix of a sample generation model is determined according to an identification result. And if the sample generation model of the current round of training meets the model training end condition, stopping training and generating the target sample generation model. And if the sample generation model of the current round of training does not meet the model training end condition, adjusting the model parameters of the sample generation model according to the error matrix corresponding to the current round of training, returning to use the next candidate order sample to continue the antagonistic training of the sample generation model after the parameter adjustment until the training end condition is met, and generating the target sample generation model. According to the method and the device, the countermeasure training of the generation network and the identification network in the sample generation model is performed, the difference between the pseudo order sample generated by the generation network and the candidate order sample is effectively shortened through the true and false order identification results of the identification network on the pseudo order sample and the candidate order sample, the generation quality of the generation network on the pseudo order sample is optimized, the complexity of the identification network for identifying the true and false order sample is effectively improved based on the mixed input of the pseudo order sample generated by the generation network and the candidate order sample, the accuracy of the identification network is effectively strengthened, and the pseudo order sample closer to actual transaction information can be obtained.
In the above embodiment, regarding the generation of the pseudo order sample, as can be further understood in conjunction with fig. 2, fig. 2 is a schematic flow chart of a training method of a sample generation model according to a second embodiment of the present disclosure, as shown in fig. 2, the method includes:
s201, extracting a characteristic value of each characteristic item from the candidate order sample.
In the embodiment of the disclosure, in order to generate the pseudo order sample generated by the network, the order sample generated by the order information in the real trading scenario may be infinitely close, and the generation network may generate the pseudo order sample based on the candidate order sample.
The candidate order sample is generated based on real transaction order information on the e-commerce platform, so that generation of a pseudo order sample can be achieved according to the characteristic items included in the candidate order sample and the characteristic value of each characteristic item.
In an implementation, the candidate order sample includes a plurality of feature items, where the feature items may be understood as data categories constituting order information. Such as membership name, transaction time, order amount, product name, shipping address, etc.
Optionally, a convolutional neural network may be used as a model architecture for generating a network, and a feature value under each feature item is extracted from the candidate order sample through a feature extraction layer in the convolutional neural network, where the extracted feature value may be understood as order data under each feature item in the candidate order sample.
S202, sampling the characteristic value extracted from the candidate order sample to obtain a sampling characteristic value.
In implementation, the candidate order sample includes a plurality of feature items, and therefore, the generation network needs to generate pseudo order data under each feature item, so as to implement generation of the pseudo order sample.
Optionally, after obtaining a feature value under each feature item of the candidate order sample, the extracted feature value may be further sampled, and a sampled feature value under each feature item is obtained based on a sampling process, where the sampled feature value may be understood as pseudo order data under each feature item.
Further, a pseudo order sample is generated based on the sampled feature values under each feature item.
It should be noted that there is a corresponding sampling rule for the feature value of each feature item in the candidate order sample, and the feature value infinitely close to that in the real trading scenario under each feature item can be obtained based on the set sampling rule, so that the pseudo order sample can be infinitely close to that in the real trading scenario.
And S203, carrying out full connection operation on the sampling characteristic values to generate a pseudo order sample.
In the implementation, each characteristic item in the pseudo order sample has a set weight, and the sampling characteristic value under each characteristic item is subjected to full connection operation based on different weights, so that the corresponding pseudo order sample is generated.
Optionally, the generation network takes a convolutional neural network as a main model architecture, so that all feature items and the sampled feature values under each feature item can be integrated through a full connection layer in the model.
The sampling characteristic values can be arranged based on the weight sequence of each characteristic item, and the corresponding characteristic items can be sequenced based on the sequence of each data category in the storage format set for the order by the e-commerce platform, so that the corresponding pseudo order sample is generated.
According to the training method of the sample generation model, the generation network extracts the characteristic value under each characteristic item from the candidate order sample, the sampling characteristic value under each characteristic item is obtained based on sampling of each characteristic value, and further, the sampling characteristic value under each characteristic item is subjected to full connection operation, so that a corresponding pseudo order sample is generated. In the method and the device, the generated pseudo order sample can be infinitely close to the order sample in a real trading scene based on the candidate order sample, and the generation quality of the pseudo order sample by the generation network is effectively improved.
In the above embodiment, regarding the generation of the candidate order sample, as can be further understood in conjunction with fig. 3, fig. 3 is a schematic flow chart of a training method for a sample generation model according to a third embodiment of the present disclosure, and as shown in fig. 3, the method includes:
s301, collecting actual order information from a server.
Step S301 can refer to the above related details, which are not described herein again.
S302, label classification, feature coding and missing item filling are carried out on the actual order information to generate a candidate order sample.
In the implementation, the samples required by the model training need to meet the set standard, for example, data exists under each feature item, and then, for example, the samples carry label information required by the model training.
Therefore, after the actual order information on the server is obtained, the order information in which the feature item data or the tag is missing can be further processed.
Optionally, clustering processing may be performed on the label-free order information, and a corresponding label rule may be set according to each feature item. And performing comparison with the set label rule based on the characteristics of the order information in the generated class cluster, so as to determine the label information corresponding to the order in the class cluster.
And based on the set data processing, each order in the obtained actual order information has a corresponding label, and further, each piece of order information carrying the label is subjected to characteristic coding.
Optionally, each piece of order information in the actual order information may be converted into corresponding encoded information by a one-hot encoding method.
Further, there is a possibility that the feature item data is missing in the actual order information, so for the actual order information with missing data, the missing item in the feature code generated by the actual order information can be subjected to data completion.
Optionally, in each piece of order information, a feature value under the feature item corresponding to the missing item may be obtained, a feature mean under the feature item corresponding to the missing item may be obtained, and the obtained feature mean may be used as supplementary data to perform data supplementation on the missing item.
Further, the actual order information is subjected to set data processing, so that the actual order information meets the set standard of the sample required by model training, and further candidate order samples which can be used for the training of the sample generation model are generated.
According to the training method for the sample generation model, the actual order information can be converted into the corresponding candidate order sample through data processing of the actual order information, the discarding rate of data is effectively reduced, and model training of the sample generation model can be achieved.
In an implementation, based on the candidate order sample, further processing may be performed, so as to increase the complexity of the order sample input into the recognition network for true and false order recognition, where regarding the further processing of the candidate order sample, as can be understood in conjunction with fig. 4, fig. 4 is a schematic flowchart of a training method for a sample generation model according to a fourth embodiment of the present disclosure, and as shown in fig. 4, the method includes:
s401, generating a sample characteristic topological graph based on the collected actual order information.
In the embodiment of the present disclosure, the candidate sample order may be further processed by a graph convolution neural network. In order to enable the candidate order sample to generate an order sample of another dimension based on the graph-convolution neural network, a corresponding topological graph can be generated based on the candidate order sample, and the topological graph is determined as a sample characteristic topological graph.
Optionally, each feature item of the actual order information is determined as a vertex of the sample feature topology.
In order to enable the graph convolution neural network to realize effective processing on each feature item, each feature item in candidate order samples generated by actual order information can be used as a vertex of a sample feature topological graph. And generating the sample feature topological graph through the incidence relation among all the feature items.
Optionally, according to the grade of each feature item, determining an association relationship between each feature item, and determining a connection relationship between the vertices based on the association relationship to generate a sample feature topological graph.
A corresponding grade may be set for each feature item, and optionally, a corresponding grade may be set for each feature item according to an influence degree of the feature item on the judgment of the malicious order. The set level may include a high level, a medium level, and a low level, among others.
For example, for an order which is maliciously purchased and maliciously refunded, since the number of times of refunding can be intuitively determined for the maliciously purchased order under such a situation, the level of the feature item corresponding to the number of times of refunding can be set to a high level.
For another example, still for an order that is maliciously purchased and maliciously returned for refund, since the contact phone of the recipient can intuitively determine the maliciousness order in such a situation, the level of the feature item corresponding to the contact manner can be set to a high level.
Optionally, with the high-level feature items as a reference, determining an association relationship between each high-level feature item and a related middle-level feature item based on the rank ordering, and further determining an association relationship between each middle-level feature item and a related low-level feature item, thereby determining an association relationship between each feature item.
For example, still taking the above-mentioned order for malicious purchase and malicious refund as an example, if the high-level feature item is the number of refund times, the related middle-level feature item is the refund frequency, and the related low-level feature item is the refund time, the association relationship between the three feature items is "number of refund times → refund frequency → refund time", and the connection relationship between the vertices corresponding to the three feature items in the sample feature topological graph can be determined based on the association relationship.
Further, an association relation is determined based on the grade between each feature item, and then a connection relation between each vertex in the sample feature topological graph is determined, so that the corresponding sample feature topological graph is generated.
It should be noted that there is an association between feature items at different levels, and there is no association between feature items at the same level, so there is a connection between vertices corresponding to feature items at different levels in the sample feature topological graph, and there is no connection between vertices corresponding to feature items at the same level.
S402, generating virtual order information based on the sample characteristic topological graph, and generating candidate order samples for training based on the virtual order information and the actual order information.
In the embodiment of the present disclosure, after the sample feature topological graph is generated, virtual order information of another dimension may be generated based on the sample feature topological graph. The virtual order information can be understood as order information of another dimension carrying actual order information, and belongs to order information in a real trading scene.
Optionally, the sample feature topological graph is input into a graph convolution neural network, and virtual order information is obtained.
After the sample feature topological graph is generated, the sample feature topological graph can be input into the graph convolution neural network, and relevant processing such as feature extraction, pooling and the like can be performed on the sample feature topological graph based on the graph convolution neural network, so that virtual order information corresponding to the sample feature topological graph is generated.
Further, in order to improve the training effect of the sample generation model, the obtained virtual order information and the obtained actual order information may be integrated to generate a corresponding candidate order sample, thereby implementing model training for the sample generation model.
According to the training method of the sample generation model, the actual order information is converted into the sample characteristic topological graph, and the virtual order information of another dimension is generated through further processing of the sample characteristic topological graph. And integrating the virtual order information and the actual order information to further obtain a candidate order sample for performing model training on the sample generation model. The complexity of the sample generating model training sample is increased, the training difficulty of the sample generating model is improved, and therefore the training effect of the sample generating model is optimized.
Further, regarding the determination of the error matrix, as can be understood in conjunction with fig. 5, fig. 5 is a schematic flowchart of a training method for a sample generation model according to a fifth embodiment of the present disclosure, as shown in fig. 5, the method includes:
s501, determining the true positive rate and the false positive rate of the sample generation model according to the distinguishing label of each order sample.
In implementation, the identification network may identify the true and false samples of each order sample input therein, and determine the discrimination label of each order sample. The judging label is generated based on the judging result that each order sample of the identifying network is the order sample corresponding to the actual transaction information or the pseudo order sample generated by the generating network.
Alternatively, the order sample judged to correspond to the actual transaction information may be marked as a positive label, and the pseudo order sample judged to be generated by the generation network may be marked as a negative label.
Further, the true-false order determination result of the identification network may be represented by a true-positive rate and a false-positive rate, wherein the true-positive rate represents the proportion of the order sample marked as the positive label in all candidate order samples, and the false-positive rate represents the proportion of the false order sample marked as the positive label in all false order samples.
By determining the true positive rate and the false positive rate output by the training of the sample generation model, the quality of the false order sample generated by the generation network and the accuracy of the identification network for identifying the true and false order samples can be effectively judged.
Alternatively, the True Positive Rate (TPR) may be calculated by the following formula: TPR is TP/(TP + FN)
Alternatively, the False Positive Rate (FPR) may be calculated by the following formula: FPR ═ FP/(FP + TN)
Wherein tp (true positive) represents true positive, the candidate order sample marked as a positive label is a true positive sample, fp (false positive) represents false positive, the pseudo order sample marked as a positive label is a false positive sample, fn (false negative) represents false negative, the candidate order sample marked as a negative label is a false positive sample, tn (true negative) represents true negative, and the pseudo order sample marked as a negative label is a true negative sample.
S502, determining an error matrix of the sample generation model based on the true positive rate and the false positive rate.
In the embodiment of the disclosure, based on the true positive rate and the false positive rate, an error matrix of the sample generation model may be determined, wherein based on the error matrix output by each training round, the model accuracy of the sample generation model trained in the current training round may be determined.
Alternatively, an error matrix for the sample generation model may be determined based on the properties of each acquired order sample. It is understood that the error matrix of the sample generation model is determined based on the number of samples determined as true positive order samples, the number of samples determined as false positive order samples, the number of samples determined as true negative order samples, and the number of samples determined as false negative order samples.
Further, model parameters of the sample generation model are adjusted based on the error matrix output by each round of training, so that the precision of the sample generation model is adjusted until the adjusted sample generation model meets the model training end condition.
According to the training method of the sample generation model, the error matrix of the sample generation model is determined according to the true positive rate and the false positive rate, so that parameter adjustment of the sample generation model is achieved, and performance optimization of the sample generation model is achieved.
To better understand the above embodiments, fig. 6 may be combined with fig. 6, where fig. 6 is a schematic flowchart of a training method for a sample generative model according to a sixth embodiment of the present disclosure, and as shown in fig. 6, the method includes:
and acquiring actual order information from the server, and performing related operations such as label classification, feature coding, missing item supplement and the like on the actual order information to further generate a candidate order sample for model training. Further, a corresponding sample characteristic topological graph is generated based on the actual order information, the virtual order information of another dimension is generated in the graph convolution network and is input to the graph convolution network, a candidate order sample is generated together with the actual order information, and therefore the generation network and the recognition network in the sample generation model are subjected to countermeasure training. The generation network generates a pseudo order sample based on the candidate order sample, integrates the pseudo order sample and the candidate order sample through the data integration module, and inputs the pseudo order sample and the candidate order sample into the recognition network for training.
And further, adjusting model parameters of the sample generation model based on an error matrix output by the sample generation model training until the adjusted sample generation model meets a model training end condition, ending the training and generating the target sample generation model.
The training method for the sample generation model, disclosed by the invention, has the advantages that the generation network and the recognition network in the sample generation model are subjected to antagonistic training, the difference between the pseudo order sample generated by the generation network and the candidate order sample is effectively shortened through the recognition network for the true and false order recognition results of the pseudo order sample and the candidate order sample, the generation quality of the pseudo order sample generated by the generation network is optimized, the complexity of the recognition network for identifying the true and false order sample is effectively improved based on the mixed input of the pseudo order sample generated by the generation network and the candidate order sample, the accuracy of the recognition network is effectively strengthened, and the pseudo order sample closer to actual transaction information can be obtained.
In order to implement the application of the target sample generation model, the present disclosure further provides a training method of an order classification model, which may be combined with fig. 7, where fig. 7 is a flowchart illustrating the training method of the order classification model according to a seventh embodiment of the present disclosure, and as shown in fig. 7, the method includes:
s701, acquiring actual order information on a server, and generating a first order sample based on the actual order information.
In the implementation, the order classification model can realize the identification and monitoring of malicious orders, and because the number of the malicious orders is less based on the total actual order number in the real transaction scene of the e-commerce platform, sufficient samples cannot be provided for the order classification model for training, so that the identification effect of the order classification model on the malicious orders cannot be expected.
Therefore, sufficient order samples can be generated through the target sample generation model, and the pseudo order samples generated by the target sample generation model are integrated with the order samples corresponding to the actual transaction information, so that the increase of the number of the order samples is realized.
In the embodiment of the present disclosure, the actual order information may be acquired from the server, and the first order sample may be generated based on the acquired actual order information.
S702, inputting a part of samples in the first order sample into a target sample generation model, and outputting a pseudo order sample as a second order sample.
In order to enable the pseudo order sample generated by the target sample generation model to be integrated with the first order sample, a partial sample can be obtained from the first order sample and input into the target sample generation model. The target sample generation model generates a pseudo order sample corresponding to the partial first order sample input therein.
And generating a pseudo order sample, wherein the generated pseudo order sample is the same as the characteristic item in the first order sample and is infinitely close to the first order sample.
Further, a pseudo order sample output by the target sample generation model may be determined as the second order sample.
And S703, performing order category marking on the first order sample and the second order sample to generate an order sample set for training.
In the embodiment of the disclosure, the first order sample and the second order sample include a plurality of feature items, wherein for a certain order sample, the category of the certain order sample may be determined based on the feature value of each feature item in the certain order sample.
For example, whether an order sample belongs to a malicious order of a malicious return category may be determined according to the number of return charges in the order sample.
For another example, whether an order sample belongs to a malicious order occupying a merchant inventory category for malicious purchase may be determined according to the quantity of purchased commodities in the order sample.
Further, based on the characteristic value of each characteristic item in the first order sample and the second order sample, performing class marking on the first order sample and the second order sample, and further generating an order sample set trained by the user order classification model.
S704, training the order classification model based on the order sample set to generate a target order classification model.
In the embodiment of the disclosure, the order classification model is trained according to the order samples in the order sample set, and performance optimization of the order classification model is realized based on the training result of each turn.
Optionally, conditions that need to be met when the model training is finished may be set based on the output result of the order classification model, and if the output result of the current round meets the set conditions for finishing the model training, it is determined that the model finished in the current round training can achieve accurate identification of the order category, and meet the requirements of the actual application environment, the model training may be finished, and the target order classification model is generated.
Alternatively, the conditions to be met when the model training is finished may be set based on the number of times of training the order classification model, and the number of training rounds may be counted for each round of model training. And if the training times corresponding to the model training of the current round meet the set model training ending conditions, judging that the model after the training of the current round can accurately identify the order type, and if the training times meet the requirements of the actual application environment, ending the model training and generating a target order classification model.
According to the order classification model training method, the target sample generation model generates the pseudo order samples based on the first order samples, and the number of the samples is increased for order classification model training, so that the order classification model is trained, the order classification model training effect is improved, and the performance of the order classification model is optimized.
In the above embodiment, regarding the adjustment of the order classification model, it can be further understood with reference to fig. 8, fig. 8 is a schematic flowchart of an order classification model training method according to an eighth embodiment of the disclosure, and as shown in fig. 8, the method includes:
s801, inputting the order samples in the order sample set into an order classification model, and outputting the predicted order types of the order samples.
In the embodiment of the present disclosure, one order sample may be selected from the order sample set and used as an order sample for the current round of order classification model training. And inputting the order sample into an order classification model, and performing related operations such as extraction, pooling and the like on the characteristic value of each characteristic item in the order sample based on the order classification model so as to generate an order type corresponding to the order sample.
Optionally, different categories of malicious orders which may appear on the e-commerce platform may be divided, and a corresponding determination rule is set according to the data characteristics of the characteristic value of each characteristic item of each category of malicious orders. When the characteristic value of the characteristic item in the order sample meets the set judgment rule, the judgment of the category to which the order sample belongs can be realized, and the predicted order type of the order sample is output.
S802, determining a loss function of the order classification model based on the predicted order type and the marked order category of the order sample.
In the embodiment of the present disclosure, the predicted order type corresponding to the order sample may be compared with the order category marked by the predicted order type, and a loss function of the order classification model may be determined based on a result of the comparison.
Alternatively, a multi-class cross entropy loss function may be employed.
And S803, adjusting the parameters of the order classification model according to the loss function, and continuing to train the order classification model after the parameters are adjusted by using the next order sample until the training end conditions are met, so as to generate the target order classification model.
Further, whether the order classification model of the current training turn meets the condition of ending or not can be judged based on the loss function.
And if the order classification model does not meet the condition of finishing training, adjusting model parameters of the order classification model based on the loss function output in the current round, returning to perform model training in the next round on the order classification model with the parameters adjusted by using the next order sample in the order sample set, and continuously obtaining the loss function output by model training in the next round.
Further, whether the order classification model after the next round of training is finished meets the model training finishing condition is judged. And ending the training until the adjusted order classification model meets the training ending condition, and generating a target order classification model.
According to the training method of the order classification model, parameter adjustment is carried out on the order classification model through a loss function between the predicted order classification and the marked order classification of the order sample, and therefore performance optimization of the order classification model is achieved.
Further, based on the target order classification model after the training is finished, the order of the e-commerce platform may be subjected to class identification, which can be understood by referring to fig. 9, where fig. 9 is a flowchart of a training method of an order classification model according to a ninth embodiment of the present disclosure, and as shown in fig. 9, the method includes:
and S901, acquiring the order to be identified, inputting the order to be identified into a target order classification model to identify the order type, and acquiring the target order type of the order to be identified.
In the implementation, when the order to be identified appears on the e-commerce platform, the order to be identified can be input into the trained target order classification model to identify the class.
The characteristic value of each characteristic item in the order to be identified can be compared with the set rule, and the category of the order to be identified is determined based on the comparison result.
For example, if the feature value under each feature item of the order to be identified meets the set rule corresponding to normal transaction, it may be determined that the order to be identified is a normal transaction order.
For another example, if the feature values under the partial feature items of the order to be identified satisfy the setting rule corresponding to the malicious order of a certain category, it may be determined that the order to be identified is the malicious order of the corresponding category.
Further, the category to which the order to be identified belongs is determined as the target order type of the order to be identified.
And S902, determining the risk level of the order to be identified according to the type of the target order.
In the implementation, the malicious orders of different categories can be divided into different risk levels, wherein the setting rule corresponding to the risk level of the malicious order can be determined according to the influence degree of the malicious orders of different categories on the e-commerce platform and/or the merchant.
Further, after the target order type of the order to be identified is determined, the target order type may be compared with the target order type based on the setting rules of different risk levels. And determining the risk grade to which the type of the target order belongs based on the comparison result, and further determining the risk grade to which the order to be identified belongs.
According to the order classification model training method, the target order type of the order to be recognized is determined, the risk level of the order to be recognized is determined, effective monitoring and risk judgment of the order to be recognized on the E-commerce platform are achieved, and the purpose of recognizing malicious orders is achieved.
Corresponding to the training methods of the sample generation models proposed by the above-mentioned several embodiments, an embodiment of the present disclosure also proposes a training apparatus of the sample generation models, and since the training apparatus of the sample generation models proposed by the embodiment of the present disclosure corresponds to the training methods of the sample generation models proposed by the above-mentioned several embodiments, the implementation of the training method of the sample generation models is also applicable to the training apparatus of the sample generation models proposed by the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
Fig. 10 is a schematic structural diagram of a training apparatus for a sample generative model according to an exemplary embodiment of the present disclosure, and as shown in fig. 10, the training apparatus 100 for a sample generative model includes a generation module 11, a training module 12, and an adjustment module 13, where:
the generating module 11 is configured to acquire actual order information and generate a candidate order sample;
the training module 12 is configured to perform countermeasure training on a generation network and an identification network in the sample generation model based on the candidate order sample, where the generation network is used to generate a pseudo order sample, and the identification network is used to identify a true or false sample;
and the adjusting module 13 is configured to determine an error matrix of the sample generation model based on the result of the true and false sample identification, and adjust the sample generation model based on the error matrix to generate the target sample generation model.
Fig. 11 is a schematic structural diagram of a training apparatus for a sample generative model according to an exemplary embodiment of the present disclosure, and as shown in fig. 11, the training apparatus 200 for a sample generative model includes a generation module 21, a training module 22, and an adjustment module 23, where:
the generation module 11, the training module 12, and the adjustment module 13 have the same configuration and function as the generation module 21, the training module 22, and the adjustment module 23.
In the embodiment of the present disclosure, the training module 23 is further configured to: extracting a characteristic value under each characteristic item from the candidate order sample; sampling the characteristic value extracted from the candidate order sample to obtain a sampling characteristic value; and carrying out full connection operation on the sampling characteristic values to generate a pseudo order sample.
In the embodiment of the present disclosure, the adjusting module 23 is further configured to: determining the true positive rate and the false positive rate of the sample generation model according to the distinguishing label of each order sample; an error matrix for the sample generation model is determined based on the true positive rate and the false positive rate.
In the embodiment of the present disclosure, the generating module 32 is further configured to: and performing label classification, feature coding and missing item filling on the actual order information to generate a candidate order sample.
In the embodiment of the present disclosure, the generating module 21 is further configured to: generating a sample characteristic topological graph based on the collected actual order information; and generating virtual order information based on the sample characteristic topological graph, and generating a candidate order sample for training based on the virtual order information and the actual order information.
In the embodiment of the present disclosure, the generating module 21 is further configured to: determining each characteristic item of the actual order information as a vertex of the sample characteristic topological graph; and determining the incidence relation between each feature item according to the grade of each feature item, and determining the connection relation between the vertexes based on the incidence relation so as to generate a sample feature topological graph.
In the embodiment of the present disclosure, the generating module 21 is further configured to: and inputting the sample characteristic topological graph into a graph convolution neural network to obtain virtual order information.
The training device for the sample generation model, provided by the disclosure, is used for acquiring actual order information from a server to generate a candidate order sample for training, inputting the candidate order sample into the sample generation model, and performing countermeasure training on a generation network and an identification network in the sample generation model. The generation network generates a pseudo order sample based on the candidate order sample, the identification network identifies the pseudo order sample and the candidate order sample according to a true order and a false order, and an error matrix of a sample generation model is determined according to an identification result. And if the sample generation model of the current round of training meets the model training end condition, stopping training and generating the target sample generation model. And if the sample generation model of the current round of training does not meet the model training end condition, adjusting the model parameters of the sample generation model according to the error matrix corresponding to the current round of training, returning to use the next candidate order sample to continue the antagonistic training of the sample generation model after the parameter adjustment until the training end condition is met, and generating the target sample generation model. According to the method and the device, the countermeasure training of the generation network and the identification network in the sample generation model is performed, the difference between the pseudo order sample generated by the generation network and the candidate order sample is effectively shortened through the true and false order identification results of the identification network on the pseudo order sample and the candidate order sample, the generation quality of the generation network on the pseudo order sample is optimized, the complexity of the identification network for identifying the true and false order sample is effectively improved based on the mixed input of the pseudo order sample generated by the generation network and the candidate order sample, the accuracy of the identification network is effectively strengthened, and the pseudo order sample closer to actual transaction information can be obtained.
Corresponding to the training methods of the order classification models proposed in the above embodiments, an embodiment of the present disclosure also proposes a training device of an order classification model, and since the training device of the order classification model proposed in the embodiment of the present disclosure corresponds to the training methods of the order classification models proposed in the above embodiments, the implementation of the training method of the order classification model is also applicable to the training device of the order classification model proposed in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
Fig. 12 is a schematic structural diagram of a training apparatus for an order classification model according to an exemplary embodiment of the present disclosure, and as shown in fig. 12, the training apparatus 300 for an order classification model includes an obtaining module 31, a generating module 32, a marking module 33, and a training module 34, where:
the obtaining module 31 is configured to obtain actual order information on the server, and generate a first order sample based on the actual order information;
a generating module 32, configured to input a part of the first order sample into a target sample generating model, and output a pseudo order sample as a second order sample;
a marking module 33, configured to mark the first order sample and the second order sample according to order categories to generate an order sample set for training;
and the training module 34 is configured to train the order classification model based on the order sample set to generate a target order classification model.
Fig. 13 is a schematic structural diagram of a training apparatus for an order classification model according to an exemplary embodiment of the present disclosure, and as shown in fig. 13, the training apparatus 400 for an order classification model includes an obtaining module 41, a generating module 42, a marking module 43, a training module 44, and a determining module 45, where:
the acquisition module 31, the generation module 32, the labeling module 33, and the training module 34 have the same configuration and function as the acquisition module 41, the generation module 42, the labeling module 43, and the training module 44.
In the embodiment of the present disclosure, the training module 44 is further configured to: inputting the order samples in the order sample set into an order classification model, and outputting the predicted order types of the order samples; determining a loss function of the order classification model based on the predicted order type and the marked order category of the order sample; and adjusting parameters of the order classification model according to the loss function, and continuing to train the order classification model after the parameters are adjusted by using the next order sample until the training end condition is met, so as to generate the target order classification model.
In the embodiment of the present disclosure, the training apparatus 400 of the order classification model further includes: and the judging module 45 is configured to obtain the order to be identified, input the order to be identified into the target order classification model to identify the order type, and obtain the target order type of the order to be identified.
In the embodiment of the present disclosure, the determining module 45 is further configured to: and determining the risk level of the order to be identified according to the type of the target order.
According to the training device for the order classification model, the target sample generation model generates the pseudo order samples based on the first order samples, and the number of the samples is increased for the order classification model training, so that the order classification model is trained, the order classification model training effect is improved, and the performance of the order classification model is optimized.
To achieve the above embodiments, the present disclosure also proposes an electronic device, a computer-readable storage medium, and a computer program product.
Fig. 14 is a schematic block diagram of an electronic device according to an exemplary embodiment of the present disclosure, and as shown in fig. 14, the electronic device 1400 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 14, the apparatus 1400 includes a memory 141, a processor 142, and a computer program stored on the memory 141 and executable on the processor 142, and when the processor 142 executes the program instructions, the training method of the sample generation model proposed in the above embodiment is implemented.
Acquiring actual order information from a server to generate a candidate order sample for training, inputting the candidate order sample into a sample generation model, and carrying out countermeasure training on a generation network and an identification network in the sample generation model. The generation network generates a pseudo order sample based on the candidate order sample, the identification network identifies the pseudo order sample and the candidate order sample according to a true order and a false order, and an error matrix of a sample generation model is determined according to an identification result. And if the sample generation model of the current round of training meets the model training end condition, stopping training and generating the target sample generation model. And if the sample generation model of the current round of training does not meet the model training end condition, adjusting the model parameters of the sample generation model according to the error matrix corresponding to the current round of training, returning to use the next candidate order sample to continue the antagonistic training of the sample generation model after the parameter adjustment until the training end condition is met, and generating the target sample generation model. According to the method and the device, the countermeasure training of the generation network and the identification network in the sample generation model is performed, the difference between the pseudo order sample generated by the generation network and the candidate order sample is effectively shortened through the true and false order identification results of the identification network on the pseudo order sample and the candidate order sample, the generation quality of the generation network on the pseudo order sample is optimized, the complexity of the identification network for identifying the true and false order sample is effectively improved based on the mixed input of the pseudo order sample generated by the generation network and the candidate order sample, the accuracy of the identification network is effectively strengthened, and the pseudo order sample closer to actual transaction information can be obtained.
As shown in fig. 14, the apparatus 1400 includes a memory 141, a processor 142, and a computer program stored on the memory 141 and executable on the processor 142, and when the processor 142 executes the program instructions, the method for training the order classification model proposed in the above embodiment is implemented.
The target sample generation model generates pseudo order samples based on the first order samples, and the number of the samples is increased for order classification model training, so that the order classification model is trained, the order classification model training effect is improved, and the performance of the order classification model is optimized.
The present disclosure provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by the processor 142, implements the training method for the sample generation model provided in the foregoing embodiments.
Acquiring actual order information from a server to generate a candidate order sample for training, inputting the candidate order sample into a sample generation model, and carrying out countermeasure training on a generation network and an identification network in the sample generation model. The generation network generates a pseudo order sample based on the candidate order sample, the identification network identifies the pseudo order sample and the candidate order sample according to a true order and a false order, and an error matrix of a sample generation model is determined according to an identification result. And if the sample generation model of the current round of training meets the model training end condition, stopping training and generating the target sample generation model. And if the sample generation model of the current round of training does not meet the model training end condition, adjusting the model parameters of the sample generation model according to the error matrix corresponding to the current round of training, returning to use the next candidate order sample to continue the antagonistic training of the sample generation model after the parameter adjustment until the training end condition is met, and generating the target sample generation model. According to the method and the device, the countermeasure training of the generation network and the identification network in the sample generation model is performed, the difference between the pseudo order sample generated by the generation network and the candidate order sample is effectively shortened through the true and false order identification results of the identification network on the pseudo order sample and the candidate order sample, the generation quality of the generation network on the pseudo order sample is optimized, the complexity of the identification network for identifying the true and false order sample is effectively improved based on the mixed input of the pseudo order sample generated by the generation network and the candidate order sample, the accuracy of the identification network is effectively strengthened, and the pseudo order sample closer to actual transaction information can be obtained.
The present disclosure provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by the processor 142, implements the method for training an order classification model provided in the foregoing embodiments.
The target sample generation model generates pseudo order samples based on the first order samples, and the number of the samples is increased for order classification model training, so that the order classification model is trained, the order classification model training effect is improved, and the performance of the order classification model is optimized.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methodologies themselves may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a grid browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication grid). Examples of communication grids include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain grids.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communications grid. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The service end can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service (Virtual Private Server, or VPS for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure, and that changes, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present disclosure.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (25)

1. A method for training a sample generation model, comprising:
acquiring actual order information and generating a candidate order sample;
performing countermeasure training on a generating network and an identifying network in a sample generating model based on the candidate order sample, wherein the generating network is used for generating a pseudo order sample, and the identifying network is used for identifying a true sample and a false sample;
and determining an error matrix of the sample generation model based on the result of the true and false sample identification, and adjusting the sample generation model based on the error matrix to generate a target sample generation model.
2. The method of claim 1, wherein the generating network is configured to generate a pseudo-order sample, comprising:
extracting a characteristic value under each characteristic item from the candidate order sample;
sampling the characteristic value extracted from the candidate order sample to obtain a sampling characteristic value;
and carrying out full connection operation on the sampling characteristic value to generate the pseudo order sample.
3. The method of claim 1, wherein determining an error matrix for the sample generation model based on the results of the true and false sample identification comprises:
determining the true positive rate and the false positive rate of the sample generation model according to the distinguishing label of each order sample;
determining the error matrix for the sample generation model based on the true positive rate and the false positive rate.
4. The method of claim 1, wherein the collecting actual order information and generating candidate order samples further comprises:
and performing label classification, feature coding and missing item filling on the actual order information to generate the candidate order sample.
5. The method of any of claims 1-4, wherein the collecting actual order information and generating candidate order samples comprises:
generating a sample characteristic topological graph based on the collected actual order information;
and generating virtual order information based on the sample characteristic topological graph, and generating the candidate order sample for training based on the virtual order information and the actual order information.
6. The method of claim 5, wherein generating a sample feature topology map based on the actual order information comprises:
determining each feature item of the actual order information as a vertex of the sample feature topological graph;
and determining the incidence relation between each feature item according to the grade of each feature item, and determining the connection relation between the vertexes based on the incidence relation so as to generate the sample feature topological graph.
7. The method of any of claim 6, wherein generating virtual order information based on the sample feature topology map comprises:
and inputting the sample characteristic topological graph into a graph convolution neural network to obtain the virtual order information.
8. A training method of an order classification model is characterized by comprising the following steps:
acquiring actual order information on a server, and generating a first order sample based on the actual order information;
inputting part of the first order sample into a target sample generation model, and outputting a pseudo order sample as a second order sample;
performing order category marking on the first order sample and the second order sample to generate an order sample set for training;
and training an order classification model based on the order sample set to generate a target order classification model.
9. The method of claim 8, wherein training an order classification model based on the sample set of orders to generate a target order classification model comprises:
inputting the order sample in the order sample set into the order classification model, and outputting the predicted order type of the order sample;
determining a loss function of the order classification model based on the predicted order type and the labeled order category of the order sample;
and adjusting the parameters of the order classification model according to the loss function, and continuing to train the order classification model after the parameters are adjusted by using the next order sample until the training end condition is met, so as to generate a target order classification model.
10. The method of claim 9, further comprising:
and acquiring an order to be identified, inputting the order to be identified into the target order classification model to identify the order type, and acquiring the target order type of the order to be identified.
11. The method of claim 10, further comprising:
and determining the risk level of the order to be identified according to the type of the target order.
12. An apparatus for training a sample generation model, comprising:
the generating module is used for acquiring actual order information and generating a candidate order sample;
the training module is used for carrying out countermeasure training on a generating network and a recognition network in a sample generating model based on the candidate order sample, wherein the generating network is used for generating a pseudo order sample, and the recognition network is used for carrying out true and false sample recognition;
and the adjusting module is used for determining an error matrix of the sample generation model based on the result of the true and false sample identification and adjusting the sample generation model based on the error matrix to generate a target sample generation model.
13. The apparatus of claim 12, wherein the training module is further configured to:
extracting a characteristic value under each characteristic item from the candidate order sample;
sampling the characteristic value extracted from the candidate order sample to obtain a sampling characteristic value;
and carrying out full connection operation on the sampling characteristic value to generate the pseudo order sample.
14. The apparatus of claim 12, wherein the adjustment module is further configured to:
determining the true positive rate and the false positive rate of the sample generation model according to the distinguishing label of each order sample;
determining the error matrix for the sample generation model based on the true positive rate and the false positive rate.
15. The apparatus of claim 12, wherein the generating module is further configured to:
and performing label classification, feature coding and missing item filling on the actual order information to generate the candidate order sample.
16. The apparatus according to any one of claims 12-15, wherein the generating module is further configured to:
generating a sample characteristic topological graph based on the collected actual order information;
and generating virtual order information based on the sample characteristic topological graph, and generating the candidate order sample for training based on the virtual order information and the actual order information.
17. The apparatus of claim 16, wherein the generating module is further configured to:
determining each feature item of the actual order information as a vertex of the sample feature topological graph;
and determining the incidence relation between each feature item according to the grade of each feature item, and determining the connection relation between the vertexes based on the incidence relation so as to generate the sample feature topological graph.
18. The apparatus of any of claim 17, wherein the generating module is further configured to:
and inputting the sample characteristic topological graph into a graph convolution neural network to obtain the virtual order information.
19. An apparatus for training an order classification model, comprising:
the acquisition module is used for acquiring actual order information on the server and generating a first order sample based on the actual order information;
the generating module is used for inputting part of the first order sample into a target sample generating model and outputting a pseudo order sample as a second order sample;
the marking module is used for marking the first order sample and the second order sample in order categories to generate an order sample set for training;
and the training module is used for training the order classification model based on the order sample set so as to generate a target order classification model.
20. The apparatus of claim 19, wherein the training module is further configured to:
inputting the order sample in the order sample set into the order classification model, and outputting the predicted order type of the order sample;
determining a loss function of the order classification model based on the predicted order type and the labeled order category of the order sample;
and adjusting the parameters of the order classification model according to the loss function, and continuing to train the order classification model after the parameters are adjusted by using the next order sample until the training end condition is met, so as to generate a target order classification model.
21. The apparatus of claim 20, further comprising:
and the judging module is used for acquiring the order to be identified, inputting the order to be identified into the target order classification model for order type identification, and acquiring the target order type of the order to be identified.
22. The apparatus of claim 21, wherein the discrimination module is further configured to:
and determining the risk level of the order to be identified according to the type of the target order.
23. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7 and 8-11.
24. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any of claims 1-7 and 8-11.
25. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7 and 8-11.
CN202111341268.8A 2021-11-12 2021-11-12 Training method and device of sample generation model and electronic equipment Pending CN114219003A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111341268.8A CN114219003A (en) 2021-11-12 2021-11-12 Training method and device of sample generation model and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111341268.8A CN114219003A (en) 2021-11-12 2021-11-12 Training method and device of sample generation model and electronic equipment

Publications (1)

Publication Number Publication Date
CN114219003A true CN114219003A (en) 2022-03-22

Family

ID=80697150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111341268.8A Pending CN114219003A (en) 2021-11-12 2021-11-12 Training method and device of sample generation model and electronic equipment

Country Status (1)

Country Link
CN (1) CN114219003A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801151A (en) * 2019-01-07 2019-05-24 平安科技(深圳)有限公司 Financial fraud risk monitoring and control method, apparatus, computer equipment and storage medium
CN116468255A (en) * 2023-06-15 2023-07-21 国网信通亿力科技有限责任公司 Configurable main data management system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801151A (en) * 2019-01-07 2019-05-24 平安科技(深圳)有限公司 Financial fraud risk monitoring and control method, apparatus, computer equipment and storage medium
CN116468255A (en) * 2023-06-15 2023-07-21 国网信通亿力科技有限责任公司 Configurable main data management system
CN116468255B (en) * 2023-06-15 2023-09-08 国网信通亿力科技有限责任公司 Configurable main data management system

Similar Documents

Publication Publication Date Title
WO2021017679A1 (en) Address information parsing method and apparatus, system and data acquisition method
CN113657465A (en) Pre-training model generation method and device, electronic equipment and storage medium
CN107679734A (en) It is a kind of to be used for the method and system without label data classification prediction
CN109993627B (en) Recommendation method, recommendation model training device and storage medium
CN114219003A (en) Training method and device of sample generation model and electronic equipment
CN112613569B (en) Image recognition method, training method and device for image classification model
CN110060087B (en) Abnormal data detection method, device and server
CN112329816A (en) Data classification method and device, electronic equipment and readable storage medium
CN115293332A (en) Method, device and equipment for training graph neural network and storage medium
CN113326796B (en) Object detection method, model training method and device and electronic equipment
CN113963197A (en) Image recognition method and device, electronic equipment and readable storage medium
CN111738290A (en) Image detection method, model construction and training method, device, equipment and medium
CN113780666B (en) Missing value prediction method and device and readable storage medium
CN115797005A (en) Prediction model training method, prediction model training device, prediction model commodity recommendation method, prediction model training device, commodity recommendation device, electronic equipment and medium
CN108629506A (en) Modeling method, device, computer equipment and the storage medium of air control model
CN115619245A (en) Portrait construction and classification method and system based on data dimension reduction method
CN113807391A (en) Task model training method and device, electronic equipment and storage medium
CN113327154A (en) E-commerce user message pushing method and system based on big data
CN113010782A (en) Demand amount acquisition method and device, electronic equipment and computer readable medium
CN113220947A (en) Method and device for encoding event characteristics
CN112686312A (en) Data classification method, device and system
CN113849101B (en) Information processing method, information processing device, electronic equipment and computer readable storage medium
CN116883181B (en) Financial service pushing method based on user portrait, storage medium and server
CN112559897B (en) Matching relation identification method, device and equipment
CN114547417A (en) Media resource ordering method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination