Transaction detection method, model training method, device and computer-readable storage medium
By adopting the transaction detection model training method in financial risk control business scenarios and using the feature reconstruction network and classification network for end-to-end training, the problem of poor feature fusion in transaction detection is solved and the detection effect and features of the model are improved. quality.
Patent Information
- Application Number
- CN202110334121.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-03-29
AI Technical Summary
In financial risk control business scenarios, the feature fusion effect during the transaction detection process is poor, resulting in poor model detection results and feature redundancy.
Using the transaction detection model training method, artificial features and deep features are constructed by obtaining transaction sample sets, and the feature reconstruction network and classification network are used for end-to-end training to optimize the feature fusion process and automatically extract features that are beneficial to the classification network.
It improves the detection effect of downstream task models, slows down the impact of feature fusion on the generalization ability of the model, and improves the quality of the classification network.
Smart Images

Figure CN113011979B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine learning, and specifically relates to a transaction detection method, a model training method, a device and a computer-readable storage medium. Background Art
[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] In the era of big data and artificial intelligence, the construction of data-driven financial risk prevention and control models is one of the hot topics in the field of financial risk control. In actual financial risk control business scenarios, feature engineering, as a key step in processing and analyzing data in risk control modeling, directly affects the subsequent model building effect.
[0004] In a transaction scenario, a large number of transaction relationships between accounts can form a large-scale complex transaction network. In order to effectively use data to build a robust and high-precision model, artificial features are usually constructed based on business experience, and deep features are automatically extracted using machine learning methods. These two types of features are simply spliced and fused as input to the downstream task model. However, this will lead to poor detection results of the downstream task model and cause a certain degree of feature redundancy.
[0005] Therefore, in the transaction detection process, how to effectively and quickly fuse features is an urgent problem to be solved. Summary of the invention
[0006] In view of the problems existing in the above-mentioned prior art, a transaction detection model training method, a transaction detection method, a device and a computer-readable storage medium are proposed. The above-mentioned problems can be solved by using this method, the device and the computer-readable storage medium.
[0007] The present invention provides the following solutions.
[0008] In a first aspect, a training method for a transaction detection model is provided, comprising: obtaining a transaction sample set, the transaction sample set comprising a plurality of transaction samples carrying sample labels, the sample labels being used to indicate abnormal conditions of the transaction samples; constructing artificial features and extracting deep features according to the transaction sample set to obtain artificial features and deep features of the transaction sample set to form a training sample set; constructing a model to be trained, the model to be trained comprising at least a feature reconstruction network and a classification network to be trained, and iteratively performing end-to-end training on the model to be trained based on the training sample set to obtain a transaction detection model.
[0009] In one possible implementation, constructing a model to be trained further includes: constructing a feature reconstruction network based on an autoencoder, wherein the autoencoder includes an encoder for performing feature encoding and a decoder for performing feature reconstruction, and determining input data of the classification network based on output data of the encoder.
[0010] In a possible implementation, constructing the model to be trained further includes: constructing a classifier network based on a multi-layer perceptron MLP, wherein the last layer of the multi-layer perceptron MLP is a softmax layer.
[0011] In one possible implementation, end-to-end training is iteratively performed on a model to be trained based on a training sample set, including: inputting artificial features and deep features of transaction samples into a feature reconstruction network to be trained, wherein the feature reconstruction network includes at least a first autoencoder and a second autoencoder to be trained, the feature reconstruction network fuses the artificial features and the deep features into comprehensive features, and inputs the comprehensive features and the artificial features into the first autoencoder, and inputs the comprehensive features and the deep features into the second autoencoder, the first autoencoder sequentially generates a first coding feature and a first reconstruction feature according to the comprehensive features and the artificial features, the second autoencoder sequentially generates a second coding feature and a second reconstruction feature according to the comprehensive features and the deep features, and the feature reconstruction network generates a comprehensive coding feature of the transaction sample according to the first coding feature and the second coding feature.
[0012] In a possible implementation, end-to-end training is iteratively performed on the model to be trained based on the training sample set, and also includes: inputting the comprehensive coding features of the transaction samples generated by the feature reconstruction network into the classification network to be trained to obtain sample detection results of the transaction samples; adjusting various parameters of the model to be trained according to the difference between the first reconstructed features and the artificial features, the difference between the second reconstructed features and the deep features, and the difference between the sample detection results and the sample labels, until a preset convergence condition is reached.
[0013] In a possible implementation, adjusting various parameters of the model to be trained also includes: determining a first loss function based on the degree of difference between the first reconstructed feature and the artificial feature; determining a second loss function based on the degree of difference between the second reconstructed feature and the deep feature; determining a third loss function based on the degree of difference between the sample detection result and the sample label; determining a comprehensive loss function based on the first loss function, the second loss function and the third loss function; and jointly adjusting various parameters in the first autoencoder, the second autoencoder and the classification network based on the comprehensive loss function.
[0014] In a possible implementation, adjusting various parameters of the model to be trained further includes: optimizing various parameters of the model to be trained using a back propagation algorithm of stochastic gradient descent.
[0015] In a possible implementation, constructing artificial features also includes: constructing artificial features based on preset transaction information of transaction samples; the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, and bank card reserved mobile phone number location.
[0016] In a possible implementation, constructing the artificial features further includes: performing one-hot encoding on non-numeric data.
[0017] In a possible implementation, constructing deep features further includes: extracting graph structural features in a transaction network graph as deep features based on transaction samples; wherein the transaction network graph includes multiple account nodes set according to multiple transaction accounts, and transaction edges and edge weights between account nodes are set according to transaction records between the multiple transaction accounts; the graph structural features include one or more of the following: the out-degree and in-degree of the account node corresponding to the transaction sample, wherein the out-degree is the number of account nodes pointed to by the account node, and the in-degree is the number of account nodes pointing to the account node.
[0018] In a possible implementation, extracting graph structural features in a transaction network graph further includes: extracting graph structural features in the transaction network graph using a graph embedding method (node2vec) and / or a graph convolutional network.
[0019] In a possible implementation, the method further includes: calculating the first loss function using the following formula:
[0020] Where N is the number of transaction samples, is the artificial feature of the i-th transaction sample, is the first reconstructed feature of the i-th transaction sample, is the transformation matrix of the encoder of the first autoencoder, is the optimizable transformation matrix of the decoder of the first autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample The first encoded feature of the i-th transaction sample The first reconstructed feature of the i-th transaction sample
[0021] And / or, calculate the second loss function using the following formula
[0022] Where N is the number of transaction samples, is the deep feature of the i-th transaction sample, is the second reconstruction feature of the i-th transaction sample, is the transformation matrix of the encoder of the second autoencoder, is the optimizable transformation matrix of the decoder of the second autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample The second encoded feature of the i-th transaction sample The second reconstruction feature of the i-th transaction sample
[0023] In one possible implementation, the classification network uses a cross entropy loss function.
[0024] In a possible implementation, the method further includes: calculating the third loss function L using the following formula: M :
[0025] Where N is the number of transaction samples, K is the number of sample labels, is the sample label of the i-th transaction sample; only when i=j, is equal to 1, otherwise it is 0; comprehensive coding characteristics of the i-th transaction sample is the first encoding feature of the i-th transaction sample, is the second encoding feature of the i-th transaction sample, is the i-th feature x input to the fully connected layer of the classification network i The weight of .
[0026] In a possible implementation, the method further includes: determining a comprehensive loss function L as: in, is the first loss function, is the second loss function, L M is the third loss function, α 1 and α 2 The value is between 0 and 1.
[0027] In a second aspect, a transaction detection method is provided, comprising: receiving original transaction data of a transaction to be detected, constructing artificial features based on the original transaction data and extracting deep features; inputting the artificial features and deep features into a trained transaction detection model to obtain detection results of the transaction to be detected; wherein the transaction detection model is trained using the method of the first aspect.
[0028] In a possible implementation, constructing artificial features also includes: constructing artificial features based on preset transaction information of original transaction data; the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, and bank card reserved mobile phone number location.
[0029] In a possible implementation, constructing the artificial features further includes: performing one-hot encoding on non-numeric data.
[0030] In a possible implementation, it also includes: extracting graph structure features in a transaction network graph based on the original transaction data as deep features; wherein the transaction network graph includes multiple account nodes set according to multiple transaction accounts, and the transaction edges and edge weights between the account nodes are set according to the transaction records between the multiple transaction accounts; the graph structure features include one or more of the following: the out-degree and in-degree of the account node corresponding to the original transaction data; wherein the out-degree is the number of account nodes pointed to by the account node, and the in-degree is the number of account nodes pointing to the account node.
[0031] In a possible implementation, extracting graph structural features in a transaction network graph further includes: extracting graph structural features in the transaction network graph using a graph embedding method (node2vec) and / or a graph convolutional network.
[0032] In a third aspect, a training device for a transaction detection model is provided, which is configured to execute the method as in the first aspect, and the device includes: an acquisition module, used to acquire a transaction sample set, the transaction sample set includes multiple transaction samples carrying sample labels, and the sample labels are used to indicate abnormal conditions of the transaction samples; a feature module, used to construct artificial features and extract deep features based on the transaction sample set, to obtain artificial features and deep features of the transaction sample set, and to form a training sample set; a training module, used to construct a model to be trained, the model to be trained includes at least a feature reconstruction network and a classification network to be trained, and end-to-end training is iteratively performed on the model to be trained based on the training sample set to obtain a transaction detection model.
[0033] In a fourth aspect, a transaction detection device is provided, which is configured to execute the method according to the second aspect, the device comprising: a receiving module, configured to receive raw transaction data of a transaction to be detected, construct artificial features based on the raw transaction data, and extract deep features;
[0034] The detection module is used to input artificial features and deep features into a trained transaction detection model to obtain a detection result of the transaction to be detected, wherein the transaction detection model is trained using the method of the first aspect.
[0035] In a fifth aspect, a training device for a transaction detection model is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute: the method of the first aspect.
[0036] In a sixth aspect, a transaction detection device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute: the method of the second aspect.
[0037] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a multi-core processor, the multi-core processor executes: the method of the first aspect, and / or the method of the second aspect.
[0038] Use the back propagation algorithm of stochastic gradient descent to optimize the parameters of the model to be trained
[0039] At least one of the above-mentioned technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: In this embodiment, the upstream feature reconstruction network and the downstream classification network are optimized end-to-end together, and the supervision signal generated during the learning process of the downstream classification network is used to guide the learning of the feature reconstruction network, optimize the feature fusion process, and automatically extract features that are beneficial to improving the quality of the downstream classification network from artificial features and deep features.
[0040] It should be understood that the above description is only an overview of the technical solution of the present invention, so that the technical means of the present invention can be more clearly understood and implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described below by way of example. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The advantages and benefits described herein and other advantages and benefits will be apparent to those of ordinary skill in the art by reading the detailed description of the exemplary embodiments below. The accompanying drawings are only used for the purpose of illustrating exemplary embodiments and are not to be considered as limiting the present invention. Moreover, the same reference numerals are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0042] Figure 1 A schematic diagram of a flow chart of a method for training a transaction detection model according to an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a flow chart of a method for training a transaction detection model according to another embodiment of the present invention;
[0044] Figure 3 is a schematic diagram of a transaction detection model according to an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a process of a transaction detection method according to an embodiment of the present invention;
[0046] Figure 5 4 is a schematic diagram of the structure of a training device for a transaction detection model according to an embodiment of the present invention.
[0047] Figure 6 A schematic diagram of the structure of a transaction detection device according to an embodiment of the present invention;
[0048] Figure 7 4 is a schematic diagram of the structure of a training device for a transaction detection model according to another embodiment of the present invention.
[0049] Figure 8 FIG. 4 is a schematic diagram of the structure of a transaction detection device according to another embodiment of the present invention.
[0050] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0051] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0052] In the description of the embodiments of the present application, it should be understood that terms such as "including" or "having" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in this specification, and are not intended to exclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof.
[0053] Unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in this article is merely a way to describe the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0054] The terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0055] All codes in this application are exemplary, and those skilled in the art may think of various modifications based on the programming language used, specific needs, personal habits and other factors without departing from the concept of this application.
[0056] It should also be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0057] Figure 1 It is a flow chart of a method for training a transaction detection model according to an embodiment of the present application, which is used to train a transaction detection model. In this flow, from the device perspective, the execution subject can be one or more electronic devices; from the program perspective, the execution subject can correspondingly be the program installed on these electronic devices.
[0058] like Figure 1 As shown, the method provided in this embodiment may include the following steps S101-S103:
[0059] S101. Obtain a transaction sample set, where the transaction sample set includes a plurality of transaction samples carrying sample labels.
[0060] The transaction sample set may include several positive transaction samples and several negative transaction samples, and the sample labels are used to indicate the abnormality of the transaction samples, which may correspond to sample labels of 1 and 0, respectively. The positive transaction samples may correspond to non-abnormal transactions, and the negative transaction samples may correspond to abnormal transactions.
[0061] S102: constructing artificial features and extracting deep features according to the transaction sample set, obtaining the artificial features and deep features of the transaction sample set, and forming a training sample set.
[0062] Artificial features of positive and negative transaction samples can be constructed based on business experience. For example, artificial features can include: multiple transaction features and attribute features related to the transaction card (such as number of transactions, amount, transaction time distribution, transaction industry distribution, transaction code distribution, card brand, gender, age, region, consumption cycle, etc.) determined based on the transaction card account information, transaction flow, and card tag table.
[0063] In some possible implementations, in the above S102, in order to construct artificial features, artificial features can also be constructed based on preset transaction information of the transaction sample; the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, and bank card reserved mobile phone number location.
[0064] In some possible implementations, in the above S102, in order to construct artificial features, non-numeric data may also be one-hot encoded, which can effectively identify non-numeric data. The one-hot encoding, also known as one-bit effective encoding, mainly uses an N-bit state register to encode N states, each state consists of an independent register bit, and only one bit is valid at any time.
[0065] The deep features of positive / negative transaction samples can be extracted through machine learning methods / deep learning methods. Deep features refer to the latent features that can characterize positive / negative transaction samples obtained through deep networks. For example, the transfer relationship between a large number of transaction cards can constitute a large-scale complex transaction network. In order to effectively use data to build a robust and high-precision model, machine learning methods can be used to automatically extract the deep features related to the positive / negative transaction samples from the complex transaction network.
[0066] In some possible implementations, in the above S102, in order to extract the deep feature, the graph structure features in the transaction network graph may also be extracted based on the transaction samples to serve as the deep feature.
[0067] Specifically, the transaction network diagram may include multiple account nodes set according to multiple transaction accounts, and the account nodes may be any one or more of user nodes, merchant nodes, or device nodes. There may be a node relationship between two nodes in the transaction network diagram. For example, there may be a transfer relationship between node 2 and node 3, and there may be a transfer relationship between node 1 and node 3. In other words, the transaction edges and edge weights between account nodes can be set according to the transaction records between multiple transaction accounts. For example, in the gambling transaction card detection scenario, it can be based on a large number of QR code payment card number, from Get the QR code data table The user's historical transaction flow and related transaction information. If there is more than one transaction between different accounts, then the corresponding transaction edges are constructed. The edge attributes can be, for example, the transaction amount, number of transactions, transaction time interval, etc. in a day. By traversing tens of thousands of accounts, a transaction network graph can be constructed.
[0068] In the specific implementation process, the historical transaction information can be obtained first, and the transaction network diagram can be determined according to the transaction relationship path of the historical transaction information. Optionally, the historical transaction information can be understood as the historical transaction information counted within a preset period of time, and the preset period of time can be set according to experience, such as one month, one week, etc. The historical transaction information can be multiple, and each historical transaction information corresponds to at least two nodes. For example, historical transaction information 1 is "account 2 transfers to account 3", involving account node 2 and account node 3, then the transaction relationship path of historical transaction information 1 is the path composed of account node 2 and account node 3. According to the transaction relationship path in the historical transaction information, the transaction network diagram composed of account nodes can be determined.
[0069] In some possible implementations, in order to extract graph structural features in the transaction network graph, a graph embedding method (node2vec) and / or a graph convolutional network may be used to extract graph structural features in the transaction network graph.
[0070] Of course, other graph structure feature extraction algorithms may also be used, such as LINE (Large-scale Information Network Embedding), TransE (Translating Embedding), etc., and this application does not make specific limitations on this.
[0071] In some possible implementations, based on the above-mentioned transaction structure graph, the extracted graph structure features may include one or more of the following: the out-degree, in-degree, and node degree of the account node corresponding to the transaction sample, wherein the out-degree is the number of account nodes pointed to by the account node in the transaction network graph, and the in-degree is the number of account nodes pointing to the account node.
[0072] S103: construct a model to be trained, where the model to be trained at least includes a feature reconstruction network and a classification network to be trained, and iteratively perform end-to-end training on the model to be trained based on the training sample set to obtain a transaction detection model.
[0073] Among them, the feature reconstruction network is a network used to fuse artificial features and deep features, and the classification network is a network used to specifically perform the downstream task of detecting abnormal transactions.
[0074] The model to be trained in the embodiment of the present invention is an end-to-end learning model, which refers to the use of a single model to model and solve a task that can be solved by multiple steps / modules. It can be understood that when using multiple steps / modules to solve a complex task, an obvious disadvantage is that the training objectives of each module are inconsistent, and the objective function of a single module may deviate from the overall macro-goal. In this way, it is difficult for the trained system to ultimately achieve optimal performance. Another problem is the accumulation of errors, and the deviation generated by the previous module may affect the next module. The end-to-end model uses only one model to avoid the inherent defects of the previous multiple modules. In addition, this can also reduce the complexity of training.
[0075] In this embodiment, the upstream feature reconstruction network and the downstream classification network are optimized end-to-end together. During the training of the entire model, the parameters of the feature reconstruction and classification networks are updated simultaneously to ensure that the encoding features have good adaptability to the classification task. The supervision signal generated during the learning process of the downstream classification network is used to guide the learning of the feature reconstruction network, which can optimize the feature fusion process and automatically extract features that are beneficial to the quality improvement of the downstream classification network from artificial features and graph structure features.
[0076] In some possible implementations, constructing the model to be trained in S103 may also include: constructing a feature reconstruction network based on an autoencoder (AE), wherein the autoencoder includes an encoder for performing feature encoding and a decoder for performing feature reconstruction, and determining input data of the classification network based on output data of the encoder.
[0077] Specifically, an autoencoder is a type of artificial neural network (ANN) used in semi-supervised learning and unsupervised learning. Its function is to perform representation learning on the input information by taking the input information as the learning target. The autoencoder consists of two parts: an encoder and a decoder. The learning process of the autoencoder can be as follows: the initial data is input into the encoder, and the encoder extracts the features of the initial data to obtain the data features, and then reconstructs the data based on the data features, and then calculates the difference between the reconstructed data and the initial data, and adjusts the network parameters of the encoder based on the difference.
[0078] In this embodiment, by adopting the autoencoder technology, key features can be extracted from artificial features and deep features, thereby mitigating the impact of feature fusion on the generalization ability of the model.
[0079] In some possible implementations, the model to be trained in S103 may also be constructed by constructing a classifier network based on a multi-layer perceptron (Multi-Layer Perception, MLP for short), wherein the last layer of the multi-layer perceptron MLP may be a softmax layer, and the probability value of the category may be generated by the softmax function.
[0080] Figure 2 is a flow chart of a method for training a transaction detection model according to another exemplary embodiment of the present invention. Figure 1 Based on the illustrated embodiment, the model training process is further described in detail.
[0081] In some possible implementations, in the above S103, end-to-end training is iteratively performed on the to-be-trained model based on the training sample set, such as Figure 2 As shown, S201 may also be included:
[0082] S201. Inputting the artificial features and graph structure features of the transaction samples into the feature reconstruction network to be trained.
[0083] refer to Figure 3 , the feature reconstruction network includes at least the first autoencoder and the second autoencoder to be trained, and the feature reconstruction network fuses the artificial features and the graph structure features into comprehensive features. For example, for any transaction sample, the constructed artificial features and deep features Perform splicing to obtain the fused comprehensive feature x s =[x m ;x g ] and the comprehensive feature x s Input the first autoencoder and the second autoencoder respectively, and the first autoencoder is based on the comprehensive feature x s and artificial features x m And use the first encoder to generate the first encoding feature h m , according to the first coding feature h m And use the first decoder to generate the first reconstruction feature The second autoencoder is based on the comprehensive feature x s and the deep features x g And use the second encoder to generate the second encoding feature h g , then according to the second encoding feature h g And use the second decoder to generate the second reconstruction feature The feature reconstruction network is based on the first encoding feature h m and the second encoding feature h g Generate comprehensive encoding features of transaction samples
[0084] In some possible implementations, after S201, end-to-end training is iteratively performed on the to-be-trained model based on the training sample set, such as Figure 2 As shown, it may also include S202-S203:
[0085] S202. Input the comprehensive coding features of the transaction samples generated by the feature reconstruction network into the classification network to be trained to obtain sample detection results of the transaction samples.
[0086] Among them, the comprehensive coding feature h s =[h m ;h g ] is input into a single-layer neural network for supervised learning, and the probability value of the category is generated through the softmax function.
[0087] S203. According to the difference between the first reconstructed feature and the artificial feature, the difference between the second reconstructed feature and the deep feature, and the difference between the sample detection result and the sample label, adjust various parameters of the model to be trained until a preset convergence condition is reached.
[0088] In this embodiment, by setting up autoencoders for feature reconstruction for artificial features and deep features respectively, and taking the comprehensive features as the input of the autoencoder, it is possible to reduce the redundant information of the fused features and speed up the model construction of downstream tasks without losing the main information.
[0089] In some possible implementations, in the above S203, in order to adjust the various parameters of the model to be trained, it can also include: step a, determining the first loss function according to the degree of difference between the first reconstructed feature and the artificial feature. Step b, determining the second loss function according to the degree of difference between the second reconstructed feature and the deep feature; step c, determining the third loss function according to the degree of difference between the sample detection result and the sample label; step d, determining the comprehensive loss function according to the first loss function, the second loss function and the third loss function; and jointly adjusting the various parameters in the first autoencoder, the second autoencoder and the classification network according to the comprehensive loss function. In other words, in the process of training the entire model, the parameters of the feature reconstruction and classification networks are updated at the same time to ensure that the encoding features have good adaptability to the classification tasks.
[0090] In some possible implementations, in the above S203, in order to adjust various parameters of the model to be trained, it also includes: using a back propagation algorithm of stochastic gradient descent to optimize various parameters of the model to be trained.
[0091] In some possible implementations, in order to adjust various parameters of the model to be trained, it also includes: using the following formula (1) to calculate the first loss function
[0092]
[0093] Where N is the number of transaction samples, is the artificial feature of the i-th transaction sample, is the first reconstructed feature of the i-th transaction sample, is the transformation matrix of the encoder of the first autoencoder, is the optimizable transformation matrix of the decoder of the first autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample The first encoded feature of the i-th transaction sample The first reconstructed feature of the i-th transaction sample
[0094] In some possible implementations, in order to adjust various parameters of the model to be trained, the second loss function is calculated using the following formula (2):
[0095]
[0096] Where N is the number of transaction samples, is the deep feature of the i-th transaction sample, is the second reconstruction feature of the i-th transaction sample, is the transformation matrix of the encoder of the second autoencoder, is the optimizable transformation matrix of the decoder of the second autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample The second encoded feature of the i-th transaction sample The second reconstruction feature of the i-th transaction sample
[0097] In some possible implementations, in order to adjust various parameters of the model to be trained, the classification network may adopt a cross entropy loss function.
[0098] In some possible implementations, in order to adjust various parameters of the model to be trained, it also includes: using the following formula (3) to calculate the third loss function L M :
[0099]
[0100] Where N is the number of transaction samples, K is the number of sample labels, is the sample label of the i-th transaction sample; only when i=j, is equal to 1, otherwise it is 0; comprehensive coding characteristics of the i-th transaction sample is the first encoding feature of the i-th transaction sample, is the second encoding feature of the i-th transaction sample, W s is the weight matrix, is the weight vector corresponding to the k-th class label.
[0101] In some possible implementations, in order to adjust various parameters of the model to be trained, the following is further included:
[0102] The comprehensive loss function L is determined using the following formula (4):
[0103]
[0104] in, is the first loss function, is the second loss function, L M is the third loss function.
[0105] In the embodiment of the present application, the above formulas (1), (2), (3), and (4) are used to obtain the minimum comprehensive loss function L. and W s Perform joint optimization.
[0106] Optionally, α 1 and α 2 The value of is between 0 and 1. In other embodiments, it can also be set to other value intervals, and this application does not make specific restrictions on this.
[0107] In the description of this specification, the description with reference to the terms "some possible implementations", "some embodiments", "examples", "specific examples", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0108] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0109] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0110] About the method flow chart of the embodiment of the present application, some operations are described as different steps performed in a certain order.Such flow chart belongs to illustrative and non-restrictive.Some steps described in this article can be grouped together and performed in a single operation, some steps can be divided into multiple sub-steps, and some steps can be performed in an order different from that shown in this article.The various steps shown in the flow chart can be realized in any way by any circuit structure and / or tangible mechanism (for example, by software, hardware (for example, the logical function realized by processor or chip) etc. running on computer equipment and / or any combination thereof).
[0111] The embodiment of the present invention also provides a transaction detection method.
[0112] Figure 4 It is a flow chart of a transaction detection method according to an embodiment of the present application, which is used to detect abnormal transactions by training a transaction detection model according to the above embodiment. In this flow, from the device perspective, the execution subject can be one or more electronic devices; from the program perspective, the execution subject can correspondingly be the program installed on these electronic devices.
[0113] like Figure 4 As shown, the method provided in this embodiment may include the following steps:
[0114] S401, receiving original transaction data of a transaction to be detected, constructing artificial features based on the original transaction data, and extracting deep features;
[0115] S402, inputting the artificial features and the deep features into the trained transaction detection model to obtain the detection result of the transaction to be detected;
[0116] The transaction detection model is obtained by using the model training method in the above embodiment.
[0117] In some possible implementations, in the above S401, in order to construct artificial features, artificial features can also be constructed based on preset transaction information of the original transaction data; the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, and bank card reserved mobile phone number location.
[0118] In some possible implementations, in the above S401, in order to construct artificial features, non-numeric data may also be one-hot encoded, which can effectively identify non-numeric data. The one-hot encoding, also known as one-bit effective encoding, mainly uses an N-bit state register to encode N states, each state consists of an independent register bit, and only one bit is valid at any time.
[0119] The deep features of the original transaction data can be extracted through machine learning methods / deep learning methods. Deep features refer to the latent features that can characterize the original transaction data obtained through the deep network. For example, the transfer relationship between a large number of transaction cards can constitute a large-scale complex transaction network. In order to effectively use the data to build a robust and high-precision model, machine learning methods can be used to automatically extract the deep features related to the original transaction data from the complex transaction network.
[0120] In some possible implementations, in the above S401, in order to extract the deep feature, the graph structure features in the transaction network graph may also be extracted based on the original transaction data to serve as the deep feature.
[0121] Specifically, the transaction network diagram may include multiple account nodes set according to multiple transaction accounts, and the account nodes may be any one or more of user nodes, merchant nodes, or device nodes. There may be a node relationship between two nodes in the transaction network diagram. For example, there may be a transfer relationship between node 2 and node 3, and there may be a transfer relationship between node 1 and node 3. In other words, the transaction edges and edge weights between account nodes can be set according to the transaction records between multiple transaction accounts. For example, in the gambling transaction card detection scenario, it can be based on a large number of QR code payment card number, from Get the QR code data table The user's historical transaction flow and related transaction information. If there is more than one transaction between different accounts, then the corresponding transaction edges are constructed. The edge attributes can be, for example, the transaction amount, number of transactions, transaction time interval, etc. in a day. By traversing tens of thousands of accounts, a transaction network graph can be constructed.
[0122] In the specific implementation process, the historical transaction information can be obtained first, and the transaction network diagram can be determined according to the transaction relationship path of the historical transaction information. Optionally, the historical transaction information can be understood as the historical transaction information counted within a preset period of time, and the preset period of time can be set according to experience, such as one month, one week, etc. The historical transaction information can be multiple, and each historical transaction information corresponds to at least two nodes. For example, historical transaction information 1 is "account 2 transfers to account 3", involving account node 2 and account node 3, then the transaction relationship path of historical transaction information 1 is the path composed of account node 2 and account node 3. According to the transaction relationship path in the historical transaction information, the transaction network diagram composed of account nodes can be determined.
[0123] In some possible implementations, in order to extract graph structural features in the transaction network graph, a graph embedding method (node2vec) and / or a graph convolutional network may be used to extract graph structural features in the transaction network graph.
[0124] Of course, other graph structure feature extraction algorithms may also be used, such as LINE (Large-scale Information Network Embedding), TransE (Translating Embedding), etc., and this application does not make specific limitations on this.
[0125] In some possible implementations, based on the above-mentioned transaction structure graph, the extracted graph structure features may include one or more of the following: the out-degree, in-degree, and node degree of the account node corresponding to the original transaction data, wherein the out-degree is the number of account nodes pointed to by the account node in the transaction network graph, and the in-degree is the number of account nodes pointing to the account node.
[0126] According to various aspects of the embodiments of the present invention, the transaction detection method can extract important information from the original transaction data and mitigate the impact of feature fusion on the generalization ability of the model. In addition, by performing end-to-end optimization on the upstream feature reconstruction network and the downstream classification network, the supervision signal generated during the learning process of the downstream classification network is used to guide the learning of the feature reconstruction network, optimize the feature fusion process, and automatically extract features that are beneficial to the quality improvement of the downstream classification network from artificial features and graph structure features, thereby obtaining a transaction detection model with better detection effect and obtaining a better detection effect.
[0127] It should be noted that the transaction detection method in the embodiment of the present application is executed by training a transaction detection model based on the various processes of the embodiment of the aforementioned transaction detection training method. Therefore, the transaction detection method can achieve similar effects and functions as the aforementioned transaction detection training method, which will not be repeated here.
[0128] Based on the same technical concept, an embodiment of the present invention further provides a training device for a transaction detection model, which is used to execute the training method for a transaction detection model provided in any of the above embodiments. Figure 5 A schematic diagram of the structure of a training device for a transaction detection model provided by an embodiment of the present invention.
[0129] like Figure 5 As shown, the device 500 includes:
[0130] An acquisition module 501 is used to acquire a transaction sample set, where the transaction sample set includes a plurality of transaction samples carrying sample labels, where the sample labels are used to indicate abnormal conditions of the transaction samples;
[0131] A feature module 502 is used to construct artificial features and extract deep features according to the transaction sample set, obtain the artificial features and deep features of the transaction sample set, and form a training sample set;
[0132] The training module 503 is used to construct a model to be trained, which at least includes a feature reconstruction network and a classification network to be trained. The model to be trained is iteratively end-to-end trained based on a training sample set to obtain a transaction detection model.
[0133] In one possible implementation, the training module is further used to: construct a feature reconstruction network based on an autoencoder, wherein the autoencoder includes an encoder for performing feature encoding and a decoder for performing feature reconstruction, and determine input data of the classification network based on output data of the encoder.
[0134] In a possible implementation, the training module is further used to: construct a classifier network based on a multi-layer perceptron MLP, wherein the last layer of the multi-layer perceptron MLP is a softmax layer.
[0135] In a possible implementation, the training module is further used to: input the artificial features and deep features of the transaction samples into a feature reconstruction network to be trained, wherein the feature reconstruction network includes at least a first autoencoder and a second autoencoder to be trained, the feature reconstruction network fuses the artificial features and the deep features into comprehensive features, and inputs the comprehensive features into the first autoencoder and the second autoencoder respectively, the first autoencoder generates a first coding feature and a first reconstruction feature according to the comprehensive features, the second autoencoder generates a second coding feature and a second reconstruction feature according to the comprehensive features, and the feature reconstruction network generates a comprehensive coding feature of the transaction sample according to the first coding feature and the second coding feature;
[0136] The comprehensive coding features of the transaction samples generated by the feature reconstruction network are input into the classification network to be trained to obtain the sample detection results of the transaction samples;
[0137] According to the difference between the first reconstructed feature and the artificial feature, the difference between the second reconstructed feature and the deep feature, and the difference between the sample detection result and the sample label, various parameters of the model to be trained are adjusted until a preset convergence condition is reached.
[0138] In a possible implementation, the training module is also used to: determine a first loss function based on the degree of difference between the first reconstructed feature and the artificial feature; determine a second loss function based on the degree of difference between the second reconstructed feature and the deep feature; determine a third loss function based on the degree of difference between the sample detection result and the sample label; determine a comprehensive loss function based on the first loss function, the second loss function and the third loss function; and jointly adjust various parameters in the first autoencoder, the second autoencoder and the classification network based on the comprehensive loss function.
[0139] In a possible implementation, the training module is further used to: adjust various parameters of the model to be trained, and also includes: optimizing various parameters of the model to be trained using a back propagation algorithm of stochastic gradient descent.
[0140] In one possible implementation, the feature module is also used to: construct artificial features based on preset transaction information of transaction samples; the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, bank card reserved mobile phone number location, and may also be statistical characteristics of the transaction (mean, standard deviation, median, etc. of amount / number of transactions), transaction duration, etc.
[0141] In a possible implementation, the feature module is further used to: perform one-hot encoding on non-numeric data.
[0142] In a possible implementation, the feature module is further used to: extract graph structure features in the transaction network graph as deep features based on the transaction samples;
[0143] Among them, the transaction network graph includes multiple account nodes set according to multiple transaction accounts, and the transaction edges and edge weights between the account nodes are set according to the transaction records between the multiple transaction accounts; the graph structure features include one or more of the following: the out-degree, in-degree, and node degree of the account node corresponding to the transaction sample, wherein the out-degree is the number of account nodes pointed to by the account node, and the in-degree is the number of account nodes pointing to the account node.
[0144] In a possible implementation, the feature module is further used to: extract graph structure features in the transaction network graph using a graph embedding method (node2vec) and / or a graph convolutional network.
[0145] In a possible implementation, the training module is further configured to calculate the first loss function using the following formula:
[0146]
[0147] Where N is the number of transaction samples, is the artificial feature of the i-th transaction sample, is the first reconstructed feature of the i-th transaction sample, is the transformation matrix of the encoder of the first autoencoder, is the optimizable transformation matrix of the decoder of the first autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample The first encoded feature of the i-th transaction sample The first reconstructed feature of the i-th transaction sample
[0148] And / or, calculate the second loss function using the following formula
[0149]
[0150] Where N is the number of transaction samples, is the deep feature of the i-th transaction sample, is the second reconstruction feature of the i-th transaction sample, is the transformation matrix of the encoder of the second autoencoder, is the optimizable transformation matrix of the decoder of the second autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample The second encoded feature of the i-th transaction sample The second reconstruction feature of the i-th transaction sample
[0151] In one possible implementation, the classification network may use a cross entropy loss function.
[0152] In a possible implementation, the training module is further configured to calculate the third loss function L using the following formula: M :
[0153] In some possible implementations, in order to adjust various parameters of the model to be trained, it also includes: using the following formula (3) to calculate the third loss function L M :
[0154]
[0155] Where N is the number of transaction samples, K is the number of sample labels, is the sample label of the i-th transaction sample; only when i=j, is equal to 1, otherwise it is 0; comprehensive coding characteristics of the i-th transaction sample is the first encoding feature of the i-th transaction sample, is the second encoding feature of the i-th transaction sample, W s is the weight matrix, is the weight vector corresponding to the k-th class label.
[0156] In a possible implementation, the training module is further used to determine the comprehensive loss function L as: in, is the first loss function, is the second loss function, L M is the third loss function, α 1 and α 2 The value is between 0 and 1.
[0157] Based on the same technical concept, an embodiment of the present invention further provides a transaction detection device, which is used to execute the transaction detection method provided by any of the above embodiments. Figure 6 A schematic diagram of the structure of a transaction detection device provided in an embodiment of the present invention.
[0158] like Figure 6 As shown, the device 600 includes:
[0159] A receiving module 601 is used to receive raw transaction data of a transaction to be detected, construct artificial features based on the raw transaction data, and extract deep features;
[0160] The detection module 602 is used to input the artificial features and the deep features into the trained transaction detection model to obtain the detection result of the transaction to be detected, wherein the transaction detection model is trained using the method as described in any one of claims 1-13.
[0161] In one possible implementation, the receiving module is also used to: construct artificial features based on preset transaction information of the original transaction data; the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, and bank card reserved mobile phone number location.
[0162] In a possible implementation, the receiving module is further configured to: perform one-hot encoding on non-numeric data.
[0163] In a possible implementation, the detection module is further used to: extract graph structure features in a transaction network graph based on the original transaction data as deep features; wherein the transaction network graph includes multiple account nodes set according to multiple transaction accounts, and the transaction edges and edge weights between the account nodes are set according to the transaction records between the multiple transaction accounts; the graph structure features include one or more of the following: the out-degree, in-degree and node degree of the account node corresponding to the original transaction data; wherein the out-degree is the number of account nodes pointed to by the account node, and the in-degree is the number of account nodes pointing to the account node.
[0164] In a possible implementation, the receiving module is further used to: extract graph structure features in the transaction network graph using a graph embedding method (node2vec) and / or a graph convolutional network.
[0165] It should be noted that the device in the embodiment of the present application can implement the various processes of the embodiment of the corresponding method described above and achieve the same effects and functions, which will not be repeated here.
[0166] Figure 7 A training device for a transaction detection model according to an embodiment of the present application, for executing Figure 1 The method shown, Figure 8 A transaction detection device according to an embodiment of the present application is used to execute Figure 4 The method shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of the above embodiment.
[0167] According to some embodiments of the present application, a training method for a transaction detection model and / or a non-volatile computer storage medium for a transaction detection method is provided, on which computer executable instructions are stored, and the computer executable instructions are configured to execute, when executed by a processor: the method of the above embodiment.
[0168] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, their descriptions are simplified, and the relevant parts can be referred to the partial description of the method embodiments.
[0169] The apparatus, device and computer-readable storage medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the apparatus, device and computer-readable storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the apparatus, device and computer-readable storage medium will not be repeated here.
[0170] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0171] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0172] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0174] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0175] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0176] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. In addition, although the operations of the method of the present invention are described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0177] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A training method for a transaction detection model, characterized in that: include: Acquire a transaction sample set, wherein the transaction sample set includes a plurality of transaction samples carrying sample labels, wherein the sample labels are used to indicate abnormal conditions of the transaction samples; Constructing artificial features and extracting deep features according to the transaction sample set, obtaining artificial features and deep features of the transaction sample set, and forming a training sample set; wherein the artificial features are constructed based on preset transaction information of the transaction sample, and the preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, bank card reserved mobile phone number attribution location, and extracting graph structure features in the transaction network graph based on the transaction sample as the deep features; Constructing a model to be trained, wherein the model to be trained at least includes a feature reconstruction network and a classification network to be trained; Iteratively performing end-to-end training on the to-be-trained model based on the training sample set, comprising: Inputting the artificial features and the deep features of the transaction sample into the feature reconstruction network to be trained, wherein the feature reconstruction network at least includes a first autoencoder and a second autoencoder to be trained; The feature reconstruction network fuses the artificial features and the deep features into comprehensive features, inputs the comprehensive features and the artificial features into the first autoencoder, and inputs the comprehensive features and the deep features into the second autoencoder; The first autoencoder generates a first encoding feature and a first reconstruction feature in sequence according to the comprehensive feature and the artificial feature, the second autoencoder generates a second encoding feature and a second reconstruction feature in sequence according to the comprehensive feature and the deep feature, and the feature reconstruction network generates a comprehensive encoding feature of the transaction sample according to the first encoding feature and the second encoding feature; Inputting the comprehensive coding features of the transaction samples generated by the feature reconstruction network into the classification network to be trained to obtain sample detection results of the transaction samples; According to the degree of difference between the first reconstructed feature and the artificial feature, the degree of difference between the second reconstructed feature and the deep feature, and the degree of difference between the sample detection result and the sample label, the various parameters of the model to be trained are adjusted until a preset convergence condition is reached to obtain a transaction detection model.
2. The method according to claim 1, characterized in that: Building the model to be trained also includes: The feature reconstruction network is constructed based on an autoencoder, wherein the autoencoder includes an encoder for performing feature encoding and a decoder for performing feature reconstruction, and input data of the classification network is determined according to output data of the encoder.
3. The method according to claim 1, characterized in that Building the model to be trained also includes: The classification network is constructed based on a multi-layer perceptron MLP, wherein the last layer of the multi-layer perceptron MLP is a softmax layer.
4. The method according to claim 1, characterized in that: Adjusting various parameters of the model to be trained also includes: Determining a first loss function according to the degree of difference between the first reconstructed feature and the artificial feature; Determine a second loss function according to the degree of difference between the second reconstructed feature and the depth feature; Determine a third loss function according to the degree of difference between the sample detection result and the sample label; Determine a comprehensive loss function according to the first loss function, the second loss function and the third loss function; The first autoencoder, the second autoencoder and each parameter in the classification network are jointly adjusted according to the comprehensive loss function.
5. The method according to claim 1, characterized in that Adjusting various parameters of the model to be trained also includes: The back propagation algorithm of stochastic gradient descent is used to optimize the parameters of the model to be trained.
6. The method according to claim 1, characterized in that The constructing artificial features further comprises: One-hot encoding of non-numeric data.
7. The method according to claim 1, characterized in that The transaction network graph includes multiple account nodes set according to multiple transaction accounts, and the transaction edges and edge weights between the account nodes are set according to the transaction records between the multiple transaction accounts; the graph structure features include one or more of the following: the out-degree and in-degree of the account node corresponding to the transaction sample, wherein the out-degree is the number of account nodes pointed to by the account node, and the in-degree is the number of account nodes pointing to the account node.
8. The method according to claim 7, characterized in that The extracting of graph structure features in the transaction network graph also includes: A graph embedding method and / or a graph convolutional network is used to extract the graph structure features in the transaction network graph.
9. The method according to claim 4, characterized in that The method further comprises: The first loss function is calculated using the following formula: Wherein, N is the number of transaction samples, is the artificial feature of the i-th transaction sample, is the first reconstructed feature of the i-th transaction sample, the W e m is the transformation matrix of the encoder of the first autoencoder, is the optimizable transformation matrix of the decoder of the first autoencoder, the comprehensive features of the i-th transaction sample The first encoding feature of the i-th transaction sample The first reconstructed feature of the i-th transaction sample The σ is a sigmoid activation function; And / or, the second loss function is calculated using the following formula: Wherein, N is the number of transaction samples, is the deep feature of the i-th transaction sample, is the second reconstructed feature of the i-th transaction sample, is the transformation matrix of the encoder of the second autoencoder, is the optimizable transformation matrix of the decoder of the second autoencoder, σ is the sigmoid activation function, and the comprehensive features of the i-th transaction sample are The second encoding feature of the i-th transaction sample The second reconstructed feature of the i-th transaction sample 10. The method according to claim 4, characterized in that The classification network adopts a cross entropy loss function.
11. The method according to claim 4, characterized in that The method further comprises: The third loss function L is calculated using the following formula: M : Wherein, N is the number of transaction samples, K is the number of sample labels, is the sample label of the i-th transaction sample; only when i=j, is equal to 1, otherwise it is 0; Among them, p ij Refers to the probability that the model predicts that the i-th transaction sample belongs to the j-th category label, The comprehensive coding features of the i-th transaction sample Said is the first encoding feature of the i-th transaction sample, is the second encoding feature of the i-th transaction sample, W s is the weight matrix, is the weight vector weight corresponding to the j-th class label.
12. The method according to claim 4, characterized in that Also includes: The comprehensive loss function L is determined as: Among them, the is the first loss function, is the second loss function, the L M is the third loss function, and the values of α1 and α2 are between 0 and 1.
13. A transaction detection method, characterized in that: include: Receiving original transaction data of a transaction to be detected, constructing artificial features based on the original transaction data, and extracting deep features; Inputting the artificial features and the deep features into a trained transaction detection model to obtain a detection result of the transaction to be detected; The transaction detection model is trained using the method described in any one of claims 1-12.
14. The method according to claim 13, characterized in that The preset transaction information includes one or more of the following: transaction account, transaction time, transaction amount, transaction location, device identification, account registration time, and location of the bank card reserved mobile phone number.
15. The method according to claim 13, characterized in that The constructing artificial features further comprises: One-hot encoding of non-numeric data.
16. The method according to claim 13, characterized in that The transaction network graph includes multiple account nodes set according to multiple transaction accounts, and the transaction edges and edge weights between the account nodes are set according to the transaction records between the multiple transaction accounts; the graph structure features include one or more of the following: the out-degree and in-degree of the account node corresponding to the original transaction data; wherein the out-degree is the number of account nodes pointed to by the account node, and the in-degree is the number of account nodes pointing to the account node.
17. The method according to claim 14, characterized in that The extracting of graph structure features in the transaction network graph also includes: A graph embedding method and / or a graph convolutional network is used to extract the graph structure features in the transaction network graph.
18. A training device for a transaction detection model, characterized in that: The device is configured to perform the method according to any one of claims 1 to 12, comprising: An acquisition module, used to acquire a transaction sample set, wherein the transaction sample set includes a plurality of transaction samples carrying sample labels, wherein the sample labels are used to indicate abnormal conditions of the transaction samples; A feature module, used to construct artificial features and extract deep features according to the transaction sample set, obtain the artificial features and deep features of the transaction sample set, and form a training sample set; The training module is used to construct a model to be trained, wherein the model to be trained includes at least a feature reconstruction network and a classification network to be trained, and iteratively performs end-to-end training on the model to be trained based on the training sample set to obtain a transaction detection model.
19. A transaction detection device, characterized in that: The device is configured to perform the method according to any one of claims 13 to 17, comprising: A receiving module, used for receiving raw transaction data of a transaction to be detected, constructing artificial features based on the raw transaction data, and extracting deep features; A detection module is used to input the artificial features and the deep features into a trained transaction detection model to obtain a detection result of the transaction to be detected, wherein the transaction detection model is trained using the method described in any one of claims 1-12.
20. A training device for a transaction detection model, characterized in that: include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to execute: a method as described in any one of claims 1-12.
21. A transaction detection device, characterized in that: include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to execute: a method as described in any one of claims 13-17.
22. A computer-readable storage medium storing a program, which, when executed by a multi-core processor, causes the multi-core processor to execute: the method according to any one of claims 1 to 12, and / or the method according to any one of claims 13 to 17.
