Transaction data detection and model training method, device and equipment applied to bank

By collecting and labeling bank transaction data, and using the generative adversarial network to generate adversarial sample training model, the problem of low accuracy of bank transaction data detection is solved, and more efficient transaction data classification and abnormal detection are achieved.

CN120494956APending Publication Date: 2025-08-15AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510623078.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, the accuracy of bank transaction data detection is low, and existing methods cannot effectively distinguish between legal transactions and potential suspicious or illegal transactions.

Method used

Collect historical transaction data of the target bank and mark the transaction status. Use the generative adversarial network to generate adversarial samples. Through adversarial training, improve the detection ability of the model, generate the initial transaction detection model and perform update training. Combining adversarial samples and normal sample training models, define the transaction decision boundaries.

Benefits of technology

It improves the accuracy of bank transaction data detection, reduces false alarms and missed reports, and enhances the model's detection ability of complex and unknown transaction data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120494956A_ABST
    Figure CN120494956A_ABST
Patent Text Reader

Abstract

The invention provides a transaction data detection and model training method, device and equipment applied to a bank, and relates to the technical field of financial security. The method comprises the steps of determining collected historical transaction data of a target bank and a first transaction state of the historical transaction data as training data, and performing model training according to the training data to obtain an initial transaction detection model; and then, obtaining a first adversarial sample and a second adversarial sample generated by the target generative adversarial network, and adding the first adversarial sample and the second transaction state thereof, and the second adversarial sample and the third transaction state thereof to training data. And performing updating training on the initial transaction detection model based on the updated training data to obtain a trained transaction detection model. And further, inputting to-be-detected transaction data of the target bank into the transaction detection model, and determining a transaction detection result output by the transaction detection model. The transaction detection model can improve the accuracy of bank transaction data detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial security technology, and in particular to a transaction data detection and model training method, device and equipment applied to banks. Background Art

[0002] In banking, normal transactions refer to legitimate transactions that conform to historical user behavior patterns and the bank's expectations, while abnormal transactions typically refer to those that significantly deviate from normal transaction patterns. The distinction between normal and abnormal transactions can be used to distinguish legitimate transactions from potentially suspicious or illegal ones. Therefore, it is necessary to monitor transaction data in banks to protect the security of banking systems.

[0003] In the existing technology, the following four methods are mainly relied upon to detect bank transaction data: (1) rule engine method, which detects bank transaction data based on predefined rules and thresholds; (2) statistical analysis method, which uses statistical methods to analyze bank transaction data; (3) using supervised learning algorithms or unsupervised learning algorithms to learn patterns of abnormal transactions from bank transaction data; (4) using deep neural networks to perform deep feature extraction and pattern recognition on bank transaction data.

[0004] However, the existing technology has a technical problem of low accuracy in detecting bank transaction data. Summary of the Invention

[0005] The present application provides a transaction data detection and model training method, device and equipment for use in banks, which is used to solve the technical problem of low accuracy in bank transaction data detection in the prior art.

[0006] In a first aspect, the present application provides a model training method for bank transaction data detection, comprising:

[0007] Collecting historical transaction data of a target bank and marking the historical transaction data with a first transaction status; wherein the first transaction status includes a normal transaction or an abnormal transaction;

[0008] Determining the historical transaction data and the first transaction status as training data; performing model training based on the training data to generate a corresponding initial transaction detection model;

[0009] Obtain a first adversarial sample and a second adversarial sample generated by a target generative adversarial network, and label the first adversarial sample with a second transaction state, and label the second adversarial sample with a third transaction state; wherein the first adversarial sample represents transaction data obtained by adding a first perturbation to normal transaction data in the historical transaction data through the target generative adversarial network; and the second adversarial sample represents transaction data obtained by adding a second perturbation to abnormal transaction data in the historical transaction data through the target generative adversarial network;

[0010] The first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state are added to the training data; the initial transaction detection model is updated and trained based on the updated training data to obtain a trained transaction detection model; wherein the transaction detection model is used to detect the transaction data of the target bank, and the detection results of the transaction detection model include normal transactions or abnormal transactions.

[0011] In one possible design, obtaining a first adversarial example generated by a target generative adversarial network includes:

[0012] adding a first disturbance to normal transaction data in the historical transaction data based on the target generative adversarial network to obtain modified normal transaction data;

[0013] Inputting the modified normal transaction data into the initial transaction detection model, and obtaining a first detection result output by the initial transaction detection model; wherein the first detection result includes a normal transaction or an abnormal transaction;

[0014] Based on the first detection result, adjusting the first disturbance until the first detection result meets a first preset requirement;

[0015] Determine a first target perturbation corresponding to the first detection result that meets the first preset requirement, and determine the normal transaction data with the first target perturbation added as the first adversarial sample.

[0016] In one possible design, obtaining a second adversarial example generated by a target generative adversarial network includes:

[0017] adding a second disturbance to the abnormal transaction data in the historical transaction data based on the target generative adversarial network to obtain modified abnormal transaction data;

[0018] Inputting the modified abnormal transaction data into the initial transaction detection model, and obtaining a second detection result output by the initial transaction detection model; wherein the second detection result includes a normal transaction or an abnormal transaction;

[0019] Based on the second detection result, adjusting the second disturbance until the second detection result meets a second preset requirement;

[0020] Determine a second target perturbation corresponding to the second detection result that meets the second preset requirement, and determine the abnormal transaction data with the second target perturbation added as the second adversarial sample.

[0021] In one possible design, model training is performed based on the training data to generate a corresponding initial transaction detection model, including:

[0022] Initialize model parameters based on the preset machine learning algorithm to obtain an untrained model prototype;

[0023] Inputting the training data into the model prototype to train the model prototype to obtain a trained model;

[0024] The trained model is cross-validated, and model parameters of the trained model are adjusted according to the cross-validation result to obtain the initial transaction detection model.

[0025] In one possible design, updating and training the initial transaction detection model based on the updated training data to obtain a trained transaction detection model includes:

[0026] Iteratively updating and training the initial transaction detection model based on the updated training data, and obtaining a third detection result generated by the initial transaction detection model in each iteration;

[0027] Comparing the third detection result with the corresponding transaction status, and minimizing the loss function of the initial transaction detection model according to the comparison result to optimize the initial transaction detection model;

[0028] The optimized initial transaction detection model is cross-validated, and according to the cross-validation results, the model parameters of the optimized initial transaction detection model are adjusted to obtain a trained transaction detection model.

[0029] In one possible design, before determining the historical transaction data and the first transaction status as training data, the method further includes:

[0030] Calculating the median and standard deviation of the historical transaction data;

[0031] Cleaning the historical transaction data based on the median and the standard deviation to remove outliers in the historical transaction data;

[0032] Normalize the cleaned historical transaction data.

[0033] In a second aspect, the present application provides a transaction data detection method applied to a bank, comprising:

[0034] Obtaining the target bank's transaction data to be tested, and inputting the transaction data to be tested into a transaction detection model; wherein the transaction detection model is the transaction detection model described in the first aspect above;

[0035] Determine a transaction detection result output by the transaction detection model; if the transaction detection result indicates that the transaction data to be detected is an abnormal transaction, send an alarm signal to a target staff member through the transaction system of the target bank; wherein the transaction detection result includes a normal transaction or an abnormal transaction.

[0036] In a third aspect, the present application provides a model training device for bank transaction data detection, comprising:

[0037] A first processing module is configured to collect historical transaction data of a target bank and label the historical transaction data with a first transaction status; wherein the first transaction status includes a normal transaction or an abnormal transaction;

[0038] a first determining module, configured to determine the historical transaction data and the first transaction status as training data;

[0039] A training module, configured to perform model training based on the training data and generate a corresponding initial transaction detection model;

[0040] The first processing module is further configured to obtain a first adversarial sample and a second adversarial sample generated by the target generative adversarial network, and to label the first adversarial sample with a second transaction state, and to label the second adversarial sample with a third transaction state; wherein the first adversarial sample represents transaction data obtained by adding a first perturbation to normal transaction data in the historical transaction data through the target generative adversarial network; and the second adversarial sample represents transaction data obtained by adding a second perturbation to abnormal transaction data in the historical transaction data through the target generative adversarial network.

[0041] The training module is further used to add the first adversarial sample, the second adversarial sample, the second transaction state and the third transaction state to the training data; update and train the initial transaction detection model based on the updated training data to obtain a trained transaction detection model; wherein, the transaction detection model is used to detect the transaction data of the target bank, and the detection results of the transaction detection model include normal transactions or abnormal transactions.

[0042] In a possible design, the first processing module further includes: an adding module, an input module, an acquiring module, and an adjusting module.

[0043] The adding module is configured to add a first disturbance to the normal transaction data in the historical transaction data based on the target-generating adversarial network to obtain modified normal transaction data;

[0044] The input module is used to input the modified normal transaction data into the initial transaction detection model;

[0045] The acquisition module is configured to acquire a first detection result output by the initial transaction detection model; wherein the first detection result includes a normal transaction or an abnormal transaction;

[0046] The adjustment module is configured to adjust the first disturbance based on the first detection result until the first detection result meets a first preset requirement;

[0047] The first determination module is further configured to determine a first target perturbation corresponding to the first detection result that meets the first preset requirement, and determine the normal transaction data to which the first target perturbation is added as the first adversarial sample.

[0048] In one possible design, the adding module is further configured to add a second perturbation to the abnormal transaction data in the historical transaction data based on the target generative adversarial network to obtain modified abnormal transaction data;

[0049] The input module is further configured to input the modified abnormal transaction data into the initial transaction detection model;

[0050] The acquisition module is further configured to acquire a second detection result output by the initial transaction detection model; wherein the second detection result includes a normal transaction or an abnormal transaction;

[0051] The adjustment module is further configured to adjust the second disturbance based on the second detection result until the second detection result meets a second preset requirement;

[0052] The first determination module is further configured to determine a second target perturbation corresponding to a second detection result that meets the second preset requirement, and determine the abnormal transaction data to which the second target perturbation is added as the second adversarial sample.

[0053] The training module is further used to:

[0054] Initialize model parameters based on the preset machine learning algorithm to obtain an untrained model prototype;

[0055] Inputting the training data into the model prototype to train the model prototype to obtain a trained model;

[0056] The adjustment module is further configured to perform cross-validation on the trained model and adjust the model parameters of the trained model according to the cross-validation result to obtain the initial transaction detection model.

[0057] In one possible design, the training module is further configured to iteratively update the initial transaction detection model based on the updated training data;

[0058] The acquisition module is further configured to acquire a third detection result generated by the initial transaction detection model in each iteration;

[0059] The training module further includes: an optimization module configured to compare the third detection result with the corresponding transaction status, and minimize the loss function of the initial transaction detection model based on the comparison result to optimize the initial transaction detection model;

[0060] The adjustment module is further used to cross-validate the optimized initial transaction detection model and adjust the model parameters of the optimized initial transaction detection model according to the cross-validation results to obtain a trained transaction detection model.

[0061] In a possible design, the model training device for bank transaction data detection further includes: a calculation module, a cleaning module,

[0062] The calculation module is used to calculate the median and standard deviation of the historical transaction data;

[0063] The cleaning module is configured to clean the historical transaction data based on the median and the standard deviation to remove outliers in the historical transaction data;

[0064] The first processing module is further configured to perform normalization processing on the cleaned historical transaction data.

[0065] In a fourth aspect, the present application provides a transaction data detection device for use in a bank, comprising:

[0066] a second processing module, configured to obtain the target bank's transaction data to be detected and input the transaction data to be detected into a transaction detection model; wherein the transaction detection model is the transaction detection model described in the first aspect above;

[0067] A second determination module, configured to determine a transaction detection result output by the transaction detection model;

[0068] An alarm module is configured to send an alarm signal to a target staff member through the transaction system of the target bank if the transaction detection result indicates that the transaction data to be detected is an abnormal transaction; wherein the transaction detection result includes a normal transaction or an abnormal transaction.

[0069] In a fifth aspect, the present application provides an electronic device, including:

[0070] memory and processor;

[0071] wherein the memory stores computer-executable instructions;

[0072] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the first aspect, the second aspect and various possible implementation methods.

[0073] In a sixth aspect, the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the methods described in the first aspect, the second aspect, and various possible implementation methods mentioned above.

[0074] In a seventh aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the method described in the first aspect, the second aspect and various possible implementation methods mentioned above.

[0075] The transaction data detection and model training method, apparatus, and device provided in this application for banks first collect historical transaction data from a target bank and label the historical transaction data with a first transaction status. The first transaction status can include normal transactions or abnormal transactions. Subsequently, the historical transaction data and the first transaction status are determined as training data, and a model is trained based on the training data to generate a corresponding initial transaction detection model. Secondly, first and second adversarial examples generated by a target generative adversarial network are obtained, and the first adversarial example is labeled with a second transaction status, and the second adversarial example is labeled with a third transaction status. The first adversarial example represents transaction data obtained by adding a first perturbation to normal transaction data in the historical transaction data through the target generative adversarial network; the second adversarial example represents transaction data obtained by adding a second perturbation to abnormal transaction data in the historical transaction data through the target generative adversarial network. Therefore, the first adversarial example simulates potential abnormal transaction patterns, while the second adversarial example simulates potential normal transaction patterns. This means that the first and second adversarial examples can help the initial transaction detection model more accurately define the decision boundary between normal and abnormal transactions, thereby better distinguishing normal and abnormal transactions and reducing false positives and false negatives. Finally, the first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state are added to the training data. The initial transaction detection model is then updated and trained based on the updated training data, yielding a trained transaction detection model. By combining the first and second adversarial samples to train the initial transaction detection model, the resulting transaction detection model exhibits strong robustness. This robustness enables the transaction detection model to better cope with complex and uncertain transaction data, particularly when faced with new or unknown transaction data. Next, the target bank's transaction data to be tested is obtained and input into the transaction detection model, resulting in a transaction detection result output by the transaction detection model. The transaction detection result may include either a normal transaction or an abnormal transaction. If the transaction detection result indicates that the transaction data to be tested is an abnormal transaction, an alert signal is sent to the target staff member via the target bank's transaction system. Therefore, the transaction detection model of this application can improve the accuracy of bank transaction data detection. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0077] Figure 1 Schematic diagram of the process of the model training method for bank transaction data detection provided in the embodiment of the present application Figure 1 ;

[0078] Figure 2 Schematic diagram of the process of the model training method for bank transaction data detection provided in the embodiment of the present application Figure 2 ;

[0079] Figure 3 A flow chart of a transaction data detection method applied to a bank provided in an embodiment of the present application;

[0080] Figure 4 A schematic diagram of the structure of a model training device for bank transaction data detection provided in an embodiment of the present application;

[0081] Figure 5 A schematic diagram of the structure of a transaction data detection device for a bank provided in an embodiment of the present application;

[0082] Figure 6 This is a hardware structure diagram of the electronic device provided in an embodiment of the present application.

[0083] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0084] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0085] The terms "first," "second," "third," "fourth," and so forth (if any) in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can, for example, be implemented in sequences other than those illustrated or described herein.

[0086] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0087] By distinguishing between normal and abnormal transactions, banks can identify legitimate transactions from potentially suspicious or illegal ones, helping to protect customer funds and prevent banking systems from being used for illegal activities. Therefore, it is crucial to detect transaction data in banks.

[0088] First, let’s explain the terms involved in this application:

[0089] Generative Adversarial Networks (GANs): These networks consist of a generator (a machine learning algorithm) that generates realistic-looking fake samples and a discriminator (a machine learning algorithm) that distinguishes between fake and real samples. These two models compete with each other through adversarial training, a process that forces the generator to continuously improve and ultimately produce more realistic data.

[0090] In existing technologies, bank transaction data is mainly detected by the following four methods:

[0091] (1) The rule engine method detects bank transaction data based on predefined rules and thresholds. These rules and thresholds are usually set by experts based on experience. The implementation process is relatively simple and easy to understand, such as transaction amounts exceeding a certain threshold, frequent transfers, etc.

[0092] Because the rule engine approach relies on static rules and thresholds, it lacks flexibility and adaptability, making it unable to cope with emerging or complex banking transaction data. Furthermore, predefined rules and thresholds can lead to high false positive rates (normal transactions are mistakenly identified as abnormal) or false negative rates (abnormal transactions go undetected).

[0093] (2) Statistical analysis methods: Analyze bank transaction data using statistical methods such as mean, standard deviation, and regression analysis. For example, detect abnormal transactions based on the standard deviation or mean of the transaction amount.

[0094] Statistical methods typically assume that data follows a certain distribution. This assumption may not hold true in complex banking transaction data. Consequently, statistical analysis methods may not be able to capture nonlinear relationships and complex patterns in banking transaction data.

[0095] (3) Use supervised learning algorithms or unsupervised learning algorithms to learn patterns of abnormal transactions from bank transaction data. Supervised learning algorithms train models by labeling data, while unsupervised learning algorithms try to find anomalies in unlabeled data.

[0096] However, in bank transaction data, the number of normal transaction data is far greater than the number of abnormal transaction data. This imbalance may lead to a tendency to predict the majority class (normal transactions) during model training, thereby ignoring the minority class (abnormal transactions).

[0097] Therefore, whether using supervised learning algorithms or unsupervised learning algorithms, if there are systematic biases during model training, the model may learn these biases, thereby affecting the model's detection ability.

[0098] (4) Use deep neural networks to perform deep feature extraction and pattern recognition on bank transaction data. Deep neural networks typically require a large amount of data for model training and are computationally expensive. In addition, when processing complex and high-dimensional bank transaction data, models generated based on deep neural networks may overfit to the noise and details in the training data rather than learning generalizable patterns.

[0099] Therefore, the existing technology has a technical problem of low accuracy in bank transaction data detection.

[0100] To address the above technical issues, the inventors considered that the existing technology's shortcomings in detection accuracy are primarily due to the model's limited ability to detect bank transaction data. Therefore, it is necessary to improve the model's detection capabilities for bank transaction data and help it better generalize to unseen bank transaction data. Based on this, the inventors conceived of using adversarial examples to simulate complex and difficult-to-detect bank transaction data, forcing the model to learn a wider range of features during training. By introducing adversarial examples during training, the model can more accurately define the decision boundary between normal and abnormal transactions. It also helps the model identify and ignore noise and bias in bank transaction data, focusing on learning truly meaningful patterns, thereby improving the accuracy of bank transaction data detection.

[0101] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0102] An embodiment of the present application provides a model training method for bank transaction data detection. Figure 1 Schematic diagram of the process of the model training method for bank transaction data detection provided in the embodiment of the present application Figure 1 ,like Figure 1 As shown, the model training method applied to bank transaction data detection includes:

[0103] S101. Collect historical transaction data of a target bank and mark the historical transaction data with a first transaction status.

[0104] Understandably, during the annotation process, each historical transaction data will be classified as either a normal transaction or an abnormal transaction, i.e., the first transaction status. A normal transaction refers to a transaction that complies with the bank's regular business processes and rules, while an abnormal transaction refers to a transaction that does not conform to the normal pattern.

[0105] Furthermore, based on the collected historical transaction data and the corresponding first transaction status, a data set D is constructed. n ={(x1,y1),(x2,y2),…,(x n ,y n )}. Among them, x n Indicates the nth historical transaction data, y n Indicates the first transaction status of the nth historical transaction data, where n is a positive integer greater than or equal to 1.

[0106] It's important to note that due to human input errors, system errors, or inherent data anomalies, the collected historical transaction data may contain outliers. Therefore, before analyzing historical transaction data, it's necessary to cleanse it to remove outliers. Specifically, you can calculate the median and standard deviation of the historical transaction data and cleanse the historical data based on these values.

[0107] The median is the middle value of historical trading data and can effectively reflect the central trend of historical trading data, especially when there are extreme values. The standard deviation is used to measure the dispersion of historical trading data, reflecting the degree of deviation of each historical trading data from the mean.

[0108] In one possible implementation, assuming that the median of historical transaction data is defined as μ and the standard deviation is defined as σ, a normal range of μ-3σ to μ+3σ can be defined based on the median and standard deviation. All historical transaction data outside the normal range are considered outliers and removed from all historical transaction data. The cleaned historical transaction data x n 'Satisfy μ-3σ≤x n '≤μ+3σ.

[0109] It should be understood that cleaned historical transaction data still includes various types of features that can provide detailed information about each historical transaction. However, different features may have different dimensions and ranges. Features with significantly different dimensions and ranges may have a disproportionate impact on subsequent model training. Therefore, by normalizing the cleaned historical transaction data, we ensure that all features are on the same scale, thereby preventing certain features from dominating the subsequent model training process. For example, normalization can be used to map each cleaned historical transaction data to the range [0, 1].

[0110] Among them, the normalization process is defined as:

[0111] x n ”=(x n '-min(x n ')) / (max(x n ')-min(x n '))

[0112] Among them, x n " represents normalized historical transaction data.

[0113] S102: Determine the historical transaction data and the first transaction status as training data; perform model training based on the training data to generate a corresponding initial transaction detection model.

[0114] Explanation: During model training, the features of historical transaction data are typically used, rather than the original historical transaction data itself. Therefore, identifying historical transaction data and the first transaction state as training data actually refers to identifying the data features of the historical transaction data and the first transaction state as training data.

[0115] Therefore, before model training, the data feature extraction process is also involved. It should be noted that historical transaction data contains a large number of data features, which will lead to a long model training time, and the trained model will be too complex, and may even lead to overfitting.

[0116] To avoid the above situation, we can select data features that are useful to the model (such as transaction amount, transaction frequency, transaction time, account balance changes, etc.) from all the data features contained in the historical transaction data, and remove redundant or irrelevant data features to reduce the complexity of the model and improve the performance of the model.

[0117] For example, the principal component analysis (PCA) technique can be used to analyze all the data features f=(f1, f2, ..., f m ) performs dimensionality reduction processing to map the high-dimensional data feature f to a low-dimensional space composed of data features useful to the model, and obtains the low-dimensional data feature f':

[0118] f'=Wf

[0119] Where W is the projection matrix of PCA.

[0120] Next, model training can begin. Specifically, model parameters are initialized based on a preset machine learning algorithm to obtain an untrained model prototype. The preset machine learning algorithm includes, but is not limited to, a random forest algorithm, a support vector machine, or a neural network. Training data is then input into the model prototype to train the model prototype, resulting in a trained model. The training data includes data features from historical transaction data that are useful to the model, as well as the first transaction state. Finally, the trained model is cross-validated, and based on the cross-validation results, the model parameters of the trained model are adjusted to obtain an initial transaction verification model.

[0121] S103: Obtain a first adversarial sample and a second adversarial sample generated by the target generative adversarial network, and label the first adversarial sample with a second transaction state, and label the second adversarial sample with a third transaction state.

[0122] The first adversarial example represents transaction data obtained by adding a first perturbation to normal transaction data in historical transaction data using a target-generated adversarial network. The second adversarial example represents transaction data obtained by adding a second perturbation to abnormal transaction data in historical transaction data using a target-generated adversarial network. The second transaction state of the first adversarial example and the third transaction state of the second adversarial example both include normal transactions or abnormal transactions.

[0123] Explanation: Adversarial examples are generated by adding carefully designed perturbations to the original historical transaction data, designed to challenge the model's detection capabilities and cause it to produce incorrect detection results. For example, if a model detects that the original input image includes element A with a confidence level of 74.7%, then a carefully designed perturbation that only changes the brightness of certain pixels is added to the original input image. The model then uses the perturbation to detect the image again. The model will mistakenly detect element A as element B with a confidence level of 99.3%. Generally speaking, the added perturbation is subtle and imperceptible to human observers, but sufficient to cause significant misjudgments for the model.

[0124] Specifically, the steps for obtaining the first adversarial sample generated by the target generative adversarial network are as follows:

[0125] Step a1: Based on the target-generated adversarial network, a first disturbance is added to the normal transaction data in the historical transaction data to obtain modified normal transaction data.

[0126] By adding the first perturbation to the normal transaction data, the original normal transaction data is made to behave more like abnormal transaction data in the feature space. It should be noted that because the modified normal transaction data is generated based on the normal transaction data, it merely simulates the characteristics of the abnormal transaction data; its actual transaction state (the second transaction state) remains normal.

[0127] Step a2: input the modified normal transaction data into the initial transaction detection model, and obtain the first detection result output by the initial transaction detection model.

[0128] Step a3: Based on the first detection result, adjust the first disturbance until the first detection result meets the first preset requirement.

[0129] The first detection result includes a normal transaction or an abnormal transaction, and the first preset requirement means that the first detection result is an abnormal transaction.

[0130] Since the modified normal transaction data is generated based on the normal transaction data in the historical transaction data, when the modified normal transaction data is input into the initial transaction detection model, the initial transaction detection model may still detect it as a normal transaction, because the initial first disturbance may not be sufficient to change the decision of the initial transaction detection model.

[0131] To make the initial transaction detection model detect the modified normal transaction data as abnormal transactions, the first perturbation needs to be further adjusted. Adjusting the first perturbation is typically an iterative process, involving gradually increasing or changing the magnitude and direction of the first perturbation to find the first target perturbation that can confuse the initial transaction detection model.

[0132] For example, the goal of adjusting the first disturbance can be set to minimize the distance between the modified normal transaction data and the original normal transaction data, while preventing the modified normal transaction data from being detected as normal transactions by the initial transaction detection model. Specifically, the objective function for adjusting the first disturbance is defined as:

[0133] min||D adv -D" T ||,stF(D adv )≠t

[0134] Among them, D T Refers to the original normal transaction data in the historical transaction data, D adv Refers to the modified normal transaction data obtained by adding the first disturbance to the original normal transaction data, and t refers to the normal transaction.

[0135] When the modified normal transaction data is input into the initial transaction detection model, F(Dadv )=t, which means that the initial transaction detection model at this time still detects the modified normal transaction data as normal transactions. By adjusting the first disturbance until F(D adv )≠t, at this time D adv This is the first adversarial example.

[0136] Step a4: Determine a first target perturbation corresponding to a first detection result that meets a first preset requirement, and determine the normal transaction data with the first target perturbation added as a first adversarial sample.

[0137] Once the first disturbance is adjusted into place, that is, the first target disturbance is found, the initial transaction detection model will begin to mistakenly detect the modified normal transaction data as abnormal transactions, which indicates that the modified normal transaction data at this time successfully simulates the characteristics of abnormal transaction data.

[0138] Furthermore, the steps for obtaining the second adversarial sample generated by the target generative adversarial network are as follows:

[0139] Step b1: Based on the target-generated adversarial network, a second disturbance is added to the abnormal transaction data in the historical transaction data to obtain modified abnormal transaction data.

[0140] Among them, by adding the second disturbance to the abnormal transaction data, the original abnormal transaction data is made to behave more like normal transaction data in the feature space, while the real transaction state (the third transaction state) of the modified abnormal transaction data is still an abnormal transaction.

[0141] Step b2: input the modified abnormal transaction data into the initial transaction detection model, and obtain a second detection result output by the initial transaction detection model.

[0142] Step b3: Based on the second detection result, adjust the second disturbance until the second detection result meets the second preset requirement.

[0143] The second detection result includes a normal transaction or an abnormal transaction, and the second preset requirement means that the second detection result is a normal transaction.

[0144] For example, the goal of adjusting the second disturbance can be set to minimize the distance between the modified abnormal transaction data and the original abnormal transaction data, while preventing the modified abnormal transaction data from being detected as abnormal transactions by the initial transaction detection model. Specifically, the objective function for adjusting the second disturbance is defined as:

[0145] min||D' adv -D" F ||,stF(D' adv )≠t'

[0146] Among them, D F Refers to the original abnormal transaction data in the historical transaction data, D' adv It refers to the modified abnormal transaction data obtained by adding the second disturbance to the original abnormal transaction data, and t' refers to the abnormal transaction.

[0147] When the modified abnormal transaction data is input into the initial transaction detection model, F(D' adv )=t', which means that the initial transaction detection model at this time still detects the modified abnormal transaction data as abnormal transactions. By adjusting the second disturbance until F(D' adv )≠t', at this time D' adv This is the second adversarial example.

[0148] Step b4: Determine the second target perturbation corresponding to the second detection result that meets the second preset requirement, and determine the abnormal transaction data with the second target perturbation added as the second adversarial sample.

[0149] S104: Add the first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state to the training data; update and train the initial transaction detection model based on the updated training data to obtain a trained transaction detection model.

[0150] Specifically, the first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state are defined as D” adv . D" adv Compared with the original training data (defined as D n ) to form new updated training data D = D" adv ∪D” n Furthermore, based on the updated training data D, the initial transaction detection model is iteratively updated and trained, and a third detection result generated by the initial transaction detection model in each iteration is obtained.

[0151] Compare the third detection result with the corresponding transaction status, and minimize the loss function of the initial transaction detection model based on the comparison result to optimize the initial transaction detection model:

[0152] Loss=∑ i=1 n [Loss(F(x” i ),y” i )+α·(F(x advi ),y advi )]

[0153] Where α is the known weight coefficient. x” i for D” nThe i-th historical transaction data in y” i is the transaction status of the i-th historical transaction data. advi is the i-th adversarial sample, y advi is the transaction status of the i-th adversarial sample. advi It may be the first adversarial sample or the second adversarial sample.

[0154] The optimized initial transaction detection model is then cross-validated. Based on the cross-validation results, the model parameters of the optimized initial transaction detection model are adjusted to obtain a trained transaction detection model. The transaction detection model is used to detect transaction data from the target bank, and the detection results of the transaction detection model include normal transactions and abnormal transactions.

[0155] Next, a summary of the overall process of the model training method applied to bank transaction data detection is given. Figure 2 Schematic diagram of the process of the model training method for bank transaction data detection provided in the embodiment of the present application Figure 2 ,like Figure 2 As shown in Figure 2, the overall process of the model training method applied to bank transaction data detection is as follows:

[0156] S201. Collect historical transaction data of the target bank.

[0157] S202: Clean and normalize historical transaction data.

[0158] S203: Extract features from the processed historical transaction data.

[0159] S204: Initialize model parameters based on a preset machine learning algorithm to obtain an untrained model prototype.

[0160] S205: Use the processed first transaction status of the historical transaction data and the data features extracted from the historical transaction data as training data, and train the model prototype according to the training data to obtain a trained model.

[0161] S206: Cross-validate the trained model and adjust model parameters to obtain an initial transaction detection model.

[0162] S207: Obtain a first adversarial sample and a second adversarial sample generated by the target generative adversarial network, and label the first adversarial sample with a second transaction state, and label the second adversarial sample with a third transaction state.

[0163] S208: Add the first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state to the training data, and iteratively update the initial transaction detection model based on the updated training data.

[0164] S209: Obtain the detection results generated by the initial transaction detection model in each iteration, and compare the detection results with the corresponding transaction status.

[0165] S210 : Minimize the loss function of the initial transaction detection model according to the comparison result to optimize the initial transaction detection model.

[0166] S211. Cross-validate the optimized initial transaction detection model and adjust model parameters to obtain a transaction detection model.

[0167] exist Figure 1 Based on the model training method for bank transaction data detection provided in the illustrated embodiment, the present application also provides a transaction data detection method for banks. Figure 3 A flow chart of a transaction data detection method for a bank provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the transaction data detection method applied to a bank includes:

[0168] S301. Obtain the transaction data to be detected of the target bank, and input the transaction data to be detected into the transaction detection model.

[0169] Among them, according to Figure 1 The model training method for bank transaction data detection provided in the illustrated embodiment can be used to train the transaction detection model used in this step. The transaction detection model detects the normality and abnormality of each transaction data to be detected based on the trained and set decision boundary between normal and abnormal transactions.

[0170] S302. Determine the transaction detection result output by the transaction detection model; if the transaction detection result indicates that the transaction data to be detected is an abnormal transaction, send an alarm signal to the target staff through the transaction system of the target bank.

[0171] Transaction detection results include both normal and abnormal transactions. When the transaction detection model detects an abnormal transaction, the target bank's transaction system automatically generates and sends an alert signal. This alert typically includes detailed transaction data and the cause of the abnormality, allowing staff to further investigate and address the issue.

[0172] The transaction data detection and model training method provided in this application for banks collects historical transaction data of a target bank and labels the historical transaction data with a first transaction status. The first transaction status includes normal transactions or abnormal transactions. Subsequently, the historical transaction data and the first transaction status are determined as training data, and an untrained model prototype is trained based on the training data to generate a corresponding initial transaction detection model. Furthermore, a first adversarial sample is obtained by adding a first perturbation to the normal transaction data based on the normal transaction data in the historical transaction data by the target generative adversarial network, and a second adversarial sample is obtained by adding a second perturbation to the abnormal transaction data based on the abnormal transaction data in the historical transaction data by the target generative adversarial network. The first adversarial sample simulates the potential abnormal transaction pattern, while the second adversarial sample simulates the potential normal transaction pattern. This means that the first adversarial sample and the second adversarial sample can help the initial transaction detection model to more accurately define the decision boundary between normal transactions and abnormal transactions, thereby better distinguishing normal transactions from abnormal transactions and reducing false positives and false negatives. Next, the first adversarial example, the second adversarial example, the second transaction state, and the third transaction state are added to the training data. The initial transaction detection model is iteratively updated and trained based on the updated training data, and the detection results generated by the initial transaction detection model in each iteration are obtained. These detection results are then compared with the corresponding transaction states, and the initial transaction detection model's loss function is minimized based on the comparison results to generate a trained transaction detection model. Training the initial transaction detection model with the first and second adversarial examples yields a highly robust transaction detection model. This robustness enables the transaction detection model to better cope with complex and uncertain transaction data, especially when faced with new or unknown transaction data, maintaining accurate detection capabilities. Once the trained transaction detection model is obtained, the target bank's transaction data to be tested is obtained and input into the transaction detection model, resulting in a transaction detection result. The transaction detection result can be either a normal transaction or an abnormal transaction. If the transaction detection result indicates that the transaction data to be tested is abnormal, an alert is sent to the target staff member via the target bank's transaction system. Therefore, the transaction detection model of the present application can improve the accuracy of bank transaction data detection.

[0173] Figure 4 A schematic diagram of the structure of a model training device for bank transaction data detection provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the model training device 400 applied to bank transaction data detection includes: a first processing module 401, a first determination module 402, and a training module 403;

[0174] The first processing module 401 is configured to collect historical transaction data of a target bank and mark the historical transaction data with a first transaction status; wherein the first transaction status includes a normal transaction or an abnormal transaction;

[0175] A first determining module 402 is configured to determine the historical transaction data and the first transaction status as training data;

[0176] A training module 403 is used to perform model training based on training data and generate a corresponding initial transaction detection model;

[0177] The first processing module 401 is further configured to obtain a first adversarial sample and a second adversarial sample generated by the target generative adversarial network, and label the first adversarial sample with a second transaction state, and label the second adversarial sample with a third transaction state; wherein the first adversarial sample represents transaction data obtained by adding a first perturbation to normal transaction data in the historical transaction data using the target generative adversarial network; and the second adversarial sample represents transaction data obtained by adding a second perturbation to abnormal transaction data in the historical transaction data using the target generative adversarial network.

[0178] The training module 403 is further used to add the first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state to the training data; update and train the initial transaction detection model based on the updated training data to obtain a trained transaction detection model; wherein the transaction detection model is used to detect the transaction data of the target bank, and the detection results of the transaction detection model include normal transactions or abnormal transactions.

[0179] In a possible design, the first processing module 401 further includes: an adding module 404, an input module 405, an acquiring module 406, and an adjusting module 407.

[0180] An adding module 404 is configured to add a first perturbation to the normal transaction data in the historical transaction data based on a target-generated adversarial network to obtain modified normal transaction data;

[0181] An input module 405 is used to input the modified normal transaction data into the initial transaction detection model;

[0182] An acquisition module 406 is configured to acquire a first detection result output by the initial transaction detection model; wherein the first detection result includes a normal transaction or an abnormal transaction;

[0183] An adjustment module 407 is configured to adjust the first disturbance based on the first detection result until the first detection result meets a first preset requirement;

[0184] The first determination module 402 is further configured to determine a first target perturbation corresponding to a first detection result that meets a first preset requirement, and determine the normal transaction data with the first target perturbation added thereto as a first adversarial sample.

[0185] In one possible design, the additional module 404 is further configured to add a second perturbation to the abnormal transaction data in the historical transaction data based on the target-generated adversarial network to obtain modified abnormal transaction data;

[0186] The input module 405 is further used to input the modified abnormal transaction data into the initial transaction detection model;

[0187] The acquisition module 406 is further configured to acquire a second detection result output by the initial transaction detection model; wherein the second detection result includes a normal transaction or an abnormal transaction;

[0188] The adjustment module 407 is further configured to adjust the second disturbance based on the second detection result until the second detection result meets a second preset requirement;

[0189] The first determination module 402 is further configured to determine a second target perturbation corresponding to a second detection result that meets a second preset requirement, and determine the abnormal transaction data with the second target perturbation added thereto as a second adversarial sample.

[0190] The training module 403 is further configured to:

[0191] Initialize model parameters based on the preset machine learning algorithm to obtain an untrained model prototype;

[0192] Inputting the training data into the model prototype to train the model prototype and obtain a trained model;

[0193] The adjustment module 407 is further configured to perform cross-validation on the trained model and adjust the model parameters of the trained model according to the cross-validation result to obtain an initial transaction detection model.

[0194] In one possible design, the training module 403 is further configured to iteratively update the initial transaction detection model based on the updated training data;

[0195] The acquisition module 406 is further configured to acquire a third detection result generated by the initial transaction detection model in each iteration;

[0196] The training module 403 further includes: an optimization module 408 for comparing the third detection result with the corresponding transaction status, and minimizing the loss function of the initial transaction detection model based on the comparison result to optimize the initial transaction detection model;

[0197] The adjustment module 407 is further configured to perform cross-validation on the optimized initial transaction detection model and adjust the model parameters of the optimized initial transaction detection model according to the cross-validation result to obtain a trained transaction detection model.

[0198] In a possible design, the model training device 400 for bank transaction data detection further includes: a calculation module 409, a cleaning module 410,

[0199] Calculation module 409, used to calculate the median and standard deviation of historical transaction data;

[0200] A cleaning module 410 is used to clean the historical transaction data based on the median and standard deviation to remove outliers in the historical transaction data;

[0201] The first processing module 401 is further configured to perform normalization processing on the cleaned historical transaction data.

[0202] The model training device for bank transaction data detection provided in the embodiment of the present application can be used to execute the model training method for bank transaction data detection in any of the above embodiments. Its implementation principles and technical effects are similar and will not be repeated here.

[0203] Figure 5 This is a schematic diagram of the structure of the transaction data detection device for banks provided in an embodiment of the present application, as shown in FIG. Figure 5 As shown, the transaction data detection device 500 applied to a bank includes: a second processing module 501, a second determination module 502, and an alarm module 503;

[0204] The second processing module 501 is configured to obtain the target bank's transaction data to be detected and input the transaction data to be detected into a transaction detection model; wherein the transaction detection model is the transaction detection model of the first aspect above;

[0205] A second determination module 502 is used to determine the transaction detection result output by the transaction detection model;

[0206] The alarm module 503 is configured to send an alarm signal to a target staff member through the transaction system of the target bank if the transaction detection result indicates that the transaction data to be detected is an abnormal transaction; wherein the transaction detection result includes a normal transaction or an abnormal transaction.

[0207] The transaction data detection device for banks provided in the embodiments of the present application can be used to execute the transaction data detection method for banks in any of the above embodiments. The implementation principles and technical effects are similar and will not be repeated here.

[0208] It should be noted that it should be understood that the division of the various modules of the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, these modules can all be implemented in the form of software called by processing elements; they can also all be implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. In addition, these modules can be fully or partially integrated together or implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit in the processor element or by instructions in the form of software.

[0209] Figure 6 This is the hardware structure diagram of the electronic device provided in this application. Figure 6 As shown, the electronic device 600 includes:

[0210] Processor 601 and memory 602;

[0211] Memory stores computer-executable instructions;

[0212] The processor executes the computer-executable instructions stored in the memory 602 , so that the electronic device executes the above-mentioned method.

[0213] It should be understood that the processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor. The memory 602 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.

[0214] The electronic device provided in the embodiments of the present application can be used to execute the method provided in any of the above method embodiments. Its implementation principles and technical effects are similar and will not be repeated here.

[0215] The embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the method as described above.

[0216] The embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it is used to implement the method as described above.

[0217] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.

[0218] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0219] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0220] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.

[0221] If the integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.

[0222] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0223] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0224] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0225] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A model training method for bank transaction data detection, characterized in that: include: Collecting historical transaction data of a target bank and marking the historical transaction data with a first transaction status; wherein the first transaction status includes a normal transaction or an abnormal transaction; Determining the historical transaction data and the first transaction status as training data; performing model training based on the training data to generate a corresponding initial transaction detection model; Obtain a first adversarial sample and a second adversarial sample generated by a target generative adversarial network, and label the first adversarial sample with a second transaction state, and label the second adversarial sample with a third transaction state; wherein the first adversarial sample represents transaction data obtained by adding a first perturbation to normal transaction data in the historical transaction data through the target generative adversarial network; and the second adversarial sample represents transaction data obtained by adding a second perturbation to abnormal transaction data in the historical transaction data through the target generative adversarial network; The first adversarial sample, the second adversarial sample, the second transaction state, and the third transaction state are added to the training data; the initial transaction detection model is updated and trained based on the updated training data to obtain a trained transaction detection model; wherein the transaction detection model is used to detect the transaction data of the target bank, and the detection results of the transaction detection model include normal transactions or abnormal transactions.

2. The method according to claim 1, characterized in that Obtain the first adversarial example generated by the target generative adversarial network, including: adding a first disturbance to normal transaction data in the historical transaction data based on the target generative adversarial network to obtain modified normal transaction data; Inputting the modified normal transaction data into the initial transaction detection model, and obtaining a first detection result output by the initial transaction detection model; wherein the first detection result includes a normal transaction or an abnormal transaction; Based on the first detection result, adjusting the first disturbance until the first detection result meets a first preset requirement; Determine a first target perturbation corresponding to the first detection result that meets the first preset requirement, and determine the normal transaction data with the first target perturbation added as the first adversarial sample.

3. The method according to claim 1, characterized in that Obtaining a second adversarial example generated by the target generative adversarial network includes: adding a second disturbance to the abnormal transaction data in the historical transaction data based on the target generative adversarial network to obtain modified abnormal transaction data; Inputting the modified abnormal transaction data into the initial transaction detection model, and obtaining a second detection result output by the initial transaction detection model; wherein the second detection result includes a normal transaction or an abnormal transaction; Based on the second detection result, adjusting the second disturbance until the second detection result meets a second preset requirement; Determine a second target perturbation corresponding to the second detection result that meets the second preset requirement, and determine the abnormal transaction data with the second target perturbation added as the second adversarial sample.

4. The method according to claim 1, wherein Model training is performed based on the training data to generate a corresponding initial transaction detection model, including: Initialize model parameters based on the preset machine learning algorithm to obtain an untrained model prototype; Inputting the training data into the model prototype to train the model prototype to obtain a trained model; The trained model is cross-validated, and model parameters of the trained model are adjusted according to the cross-validation result to obtain the initial transaction detection model.

5. The method according to claim 1, wherein The initial transaction detection model is updated and trained based on the updated training data to obtain a trained transaction detection model, including: Iteratively updating and training the initial transaction detection model based on the updated training data, and obtaining a third detection result generated by the initial transaction detection model in each iteration; Comparing the third detection result with the corresponding transaction status, and minimizing the loss function of the initial transaction detection model according to the comparison result to optimize the initial transaction detection model; The optimized initial transaction detection model is cross-validated, and according to the cross-validation results, the model parameters of the optimized initial transaction detection model are adjusted to obtain a trained transaction detection model.

6. The method according to any one of claims 1 to 5, characterized in that Before determining the historical transaction data and the first transaction status as training data, the method further includes: Calculating the median and standard deviation of the historical transaction data; Cleaning the historical transaction data based on the median and the standard deviation to remove outliers in the historical transaction data; Normalize the cleaned historical transaction data.

7. A transaction data detection method applied to a bank, characterized in that: include: Obtaining the transaction data to be detected of the target bank, and inputting the transaction data to be detected into a transaction detection model; wherein the transaction detection model is the transaction detection model according to any one of claims 1 to 6; Determine a transaction detection result output by the transaction detection model; if the transaction detection result indicates that the transaction data to be detected is an abnormal transaction, send an alarm signal to a target staff member through the transaction system of the target bank; wherein the transaction detection result includes a normal transaction or an abnormal transaction.

8. A model training device for bank transaction data detection, characterized in that: include: A first processing module is configured to collect historical transaction data of a target bank and label the historical transaction data with a first transaction status; wherein the first transaction status includes a normal transaction or an abnormal transaction; a first determining module, configured to determine the historical transaction data and the first transaction status as training data; A training module, configured to perform model training based on the training data and generate a corresponding initial transaction detection model; The first processing module is further configured to obtain a first adversarial sample and a second adversarial sample generated by the target generative adversarial network, and to label the first adversarial sample with a second transaction state, and to label the second adversarial sample with a third transaction state; wherein the first adversarial sample represents transaction data obtained by adding a first perturbation to normal transaction data in the historical transaction data through the target generative adversarial network; and the second adversarial sample represents transaction data obtained by adding a second perturbation to abnormal transaction data in the historical transaction data through the target generative adversarial network. The training module is further used to add the first adversarial sample, the second adversarial sample, the second transaction state and the third transaction state to the training data; update and train the initial transaction detection model based on the updated training data to obtain a trained transaction detection model; wherein, the transaction detection model is used to detect the transaction data of the target bank, and the detection results of the transaction detection model include normal transactions or abnormal transactions.

9. A transaction data detection device used in a bank, characterized in that: include: a second processing module, configured to obtain transaction data to be detected of a target bank and input the transaction data to be detected into a transaction detection model; wherein the transaction detection model is the transaction detection model according to any one of claims 1 to 6; a second determining module, configured to determine a transaction detection result output by the transaction detection model; An alarm module is configured to send an alarm signal to a target staff member through the transaction system of the target bank if the transaction detection result indicates that the transaction data to be detected is an abnormal transaction; wherein the transaction detection result includes a normal transaction or an abnormal transaction.

10. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.