Training method of financial transaction protection model and financial transaction protection method
Through client self-training and server-aggregated extractor encryption technology, combined with horizontal and vertical federated learning, the problem of balancing model performance and privacy protection in the federated learning framework in the financial transaction protection model is solved, and safe and efficient data analysis and model training are achieved.
Patent Information
- Application Number
- CN202411011798.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Existing federated learning frameworks have difficulty balancing model performance and privacy protection in financial transaction protection models, especially under the privacy and security requirements of distributed financial data, making them difficult to train and apply effectively.
Through client self-training extractors, server aggregation extractors, combined with encryption and noise injection technologies, the training of financial transaction protection models is achieved, including self-training of encoders and decoders, processing of encryption features and noise features, and data collaboration using horizontal and vertical federated learning.
It achieves a balance between model performance and privacy protection, improves the model's generalization ability and data security, reduces the risk of data leakage, and promotes multi-party data cooperation and analysis.
Smart Images

Figure CN119006154B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a training method of a financial transaction protection model and a financial transaction protection method. BACKGROUND
[0002] Federated learning (FL) is a distributed machine learning method that allows multiple participants to collaborate to train a model while maintaining the localization and privacy of data. The data of each participant is kept locally and does not disclose local private data, achieving data usability and invisibility. Therefore, federated learning is applied to multiple scenarios in the financial field. For example, federated learning is applied to the training of a financial transaction protection model, which protects financial transactions by identifying dangerous behaviors in financial transactions. The financial transaction protection model requires deep cooperation of multiple financial institutions. However, due to the privacy and security requirements of distributed financial data, training a financial transaction protection model not only requires secure transaction data, but also needs to obtain private account activities of the person involved in each transaction from the corresponding financial system. The vertical relationship between account clients and transaction clients and the horizontal relationship between different financial institutions coexist, and this mixed nature makes it difficult for the current federated learning framework to take into account model performance and privacy protection. SUMMARY
[0003] The main purpose of the embodiments of the present application is to propose a training method of a financial transaction protection model and a financial transaction protection method, which can balance between model performance and privacy protection.
[0004] To achieve the above-mentioned purpose, the first aspect of the embodiments of the present application proposes a training method of a financial transaction protection model, comprising:
[0005] The first client extracts features of account data through an extractor, and trains the extractor according to the features of the account data;
[0006] The server aggregates the trained extractor to obtain an aggregated extractor;
[0007] The first client determines first target account data from the account data according to a first account identifier sent by the second client, extracts first aggregated features of the first target account data through the aggregated extractor, and encrypts the first aggregated features to obtain first encrypted features;
[0008] The second client decrypts the first encrypted features to obtain the first aggregated features, adds noise to the first aggregated features to obtain noise features, trains a classifier for judging financial transaction dangerous behaviors according to the noise features, and obtains a trained financial transaction protection model.
[0009] In some embodiments, the extractor comprises an encoder and a decoder; the self-training of the extractor according to the features of the account data comprises:
[0010] the self-training of the extractor according to the features of the account data comprises:
[0011] the first formula is:
[0012] wherein, k i represents the i-th sample of the account data, N n represents the total number of samples of the account data; a φ represents the encoder, a′ φ′ represents the decoder, φ n represents the parameters of the n-th encoder, φ′ n represents the parameters of the n-th decoder.
[0013] In some embodiments, the extractor comprises an encoder and a decoder; the server aggregates the self-trained extractors to obtain an aggregated extractor, comprising:
[0014] the server aggregates the self-trained extractors according to a second formula to obtain an aggregated extractor;
[0015] the second formula is:
[0016] wherein, φ represents the parameters of the encoder of the aggregated extractor, φ n represents the parameters of the encoder of the n-th extractor, M represents the total number of encoders of the extractors, φ′ represents the parameters of the decoder of the aggregated extractor, φ′ n represents the parameters of the decoder of the n-th extractor, N represents the total number of decoders of the extractors.
[0017] In some embodiments, the account data comprises account metadata, and the account metadata is stored in the first client.
[0018] In some embodiments, the account data comprises account transaction data, and the account transaction data is stored in the second client.
[0019] In some embodiments, the account data comprises first data with the same feature dimension; the first client extracts the features of the account data by an extractor, self-trains the extractor according to the features of the account data, and the server aggregates the self-trained extractors to obtain an aggregated extractor, comprising:
[0020] the first client extracts the features of the first data by an extractor, self-trains the extractor according to the features of the first data, and the server aggregates the self-trained extractors to obtain a new extractor;
[0021] The server distributes the new extractor to the first client, the first client updates the extractor to the new extractor, the first client extracts features of the first data through the new extractor, the new extractor is self-trained according to the features of the first data, and the server aggregates the self-trained new extractor to obtain an aggregated extractor.
[0022] In some embodiments, the account data includes second data with different feature dimensions; the first client determines first target account data from the account data according to a first account identifier sent by the second client, extracts first aggregated features of the first target account data through the aggregated extractor, and encrypts the first aggregated features to obtain first encrypted features; the second client decrypts the first encrypted features to obtain the first aggregated features, adds noise to the first aggregated features to obtain noise features, and includes:
[0023] The first client and the second client interact with the second data and align the second data to obtain aligned data;
[0024] The first client determines first target account data from the aligned data according to a first account identifier sent by the second client, extracts first aggregated features of the first target account data through the aggregated extractor, and encrypts the first aggregated features to obtain first encrypted features;
[0025] The second client decrypts the first encrypted features to obtain the first aggregated features, aggregates the first aggregated features of the first client to obtain aggregated features, and adds noise to the aggregated features to obtain noise features;
[0026] The first client removes the noise in the noise features to obtain the aggregated features, and updates the aggregated extractor according to the aggregated features.
[0027] To achieve the above object, a second aspect of the embodiment of the present application proposes a financial transaction protection method, comprising:
[0028] The second client sends a second account identifier to the first client;
[0029] The first client determines second target account data from the account data according to the second account identifier, extracts second aggregated features of the second target account data through the extractor in the trained financial transaction protection model, and encrypts the second aggregated features to obtain second encrypted features;
[0030] The second client decrypts the second encrypted features to obtain the second aggregated features, judges the financial transaction risk behavior according to the second aggregated features through the classifier in the trained financial transaction protection model, and obtains a judgment result.
[0031] The trained financial transaction protection model is trained according to the training method of the financial transaction protection model according to the first aspect of the embodiments of the present application.
[0032] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the training method of the financial transaction protection model according to the first aspect of the embodiments of the present application and the financial transaction protection method according to the second aspect of the embodiments of the present application when executing the computer program.
[0033] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is characterized in that the computer program is executed by a processor to implement the training method of the financial transaction protection model according to the first aspect of the embodiments of the present application and the financial transaction protection method according to the second aspect of the embodiments of the present application.
[0034] The training method of the financial transaction protection model and the financial transaction protection method provided by the embodiments of the present application extract the features of the account data by the first client using the extractor, and train the extractor according to the features of the account data; the server aggregates the trained extractor to obtain an aggregated extractor; the first client determines the first target account data from the account data according to the first account identifier sent by the second client, extracts the first aggregated features of the first target account data by the aggregated extractor, encrypts the first aggregated features to obtain the first encrypted features; the second client decrypts the first encrypted features to obtain the first aggregated features, adds noise to the first aggregated features to obtain the noise features, trains the classifier for judging the financial transaction dangerous behavior according to the noise features, and obtains the trained financial transaction protection model; thereby balancing between model performance and privacy protection; a variety of security technologies are used, including noise injection, local feature extraction and encryption technology, etc., to protect data privacy, effectively cope with security risks and related attacks, and improve the generalization ability of the model; safe and private cooperative data analysis can be provided; by fusing horizontal federated learning and vertical federated learning, multiple clients can be safely allowed to cooperate in data analysis, and the distribution of sample features and privacy protection problems in the existing federated learning are solved. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is a step diagram of the training method of the financial transaction protection model provided by the embodiments of the present application;
[0036] Figure 2 is a horizontal federated learning step diagram of the financial transaction protection model provided by the embodiments of the present application;
[0037] Figure 3 is a vertical federated learning step diagram of a financial transaction protection model provided by an embodiment of the present application;
[0038] Figure 4 is a step diagram of a financial transaction protection method provided by an embodiment of the present application;
[0039] Figure 5 is a structural diagram of a financial system provided by an embodiment of the present application;
[0040] Figure 6 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0042] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and above-described drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0044] Federated learning (FL) is a distributed machine learning method that allows multiple participants to collaboratively train a model while maintaining the localization and privacy of data. The data of each participant is kept locally and does not disclose local private data, achieving the use of data without visibility. Therefore, federated learning is applied to multiple scenarios in the financial field. For example, federated learning is applied to the training of a financial transaction protection model, which protects financial transactions by identifying dangerous behaviors in financial transactions. The financial transaction protection model requires deep cooperation of multiple financial institutions, however, due to the privacy and security requirements of distributed financial data, training a financial transaction protection model not only needs secure transaction data, but also needs to obtain private account activities of the person participating in each transaction from the corresponding financial system. The vertical relationship between account clients and transaction clients and the horizontal relationship between different financial institutions coexist, and this mixed nature makes it difficult for the current federated learning framework to take into account model performance and privacy protection.
[0045] To solve the above problems, the embodiments of the present application provide a training method of a financial transaction protection model and a financial transaction protection method, aiming to balance between model performance and privacy protection.
[0046] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (AI) is to use digital computers or computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0047] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The software technology of artificial intelligence mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0048] The training method of the financial transaction protection model and the financial transaction protection method provided by the embodiments of the present application relate to the technical field of artificial intelligence. The training method of the financial transaction protection model and the financial transaction protection method provided by the embodiments of the present application can be applied in a terminal, can also be applied in a server end, and can also be software running in the terminal or the server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server end can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform; and the software can be an application for implementing the training method of the financial transaction protection model and the financial transaction protection method, etc., but is not limited to the above forms.
[0049] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0050] It should be noted that in each specific embodiment of the present application, when relevant processing needs to be performed on data related to the identity or characteristics of the user, such as user information, user behavior data, user history data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant regulations. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or by jumping to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to function normally will be obtained.
[0051] The training method of the financial transaction protection model and the financial transaction protection method are provided. The training method of the financial transaction protection model is described as follows. First, the training method of the financial transaction protection model in the embodiments of the present application is described.
[0052] The training method of the financial transaction protection model is applied to a financial system. Referring to Figure 5 , the financial system includes a first client 802, a second client 803, and a server 801.
[0053] The first client 802 is an account client (Ac client), and the first client 802 includes account activity information and corresponding account metadata.
[0054] The account metadata includes account markers and the like. Specifically, the account metadata includes business metadata, technical metadata, and operation metadata, and the like. The business metadata usually includes definitions and descriptions of report indicators, business rules, data standards, and the like; these information helps to understand the meaning and purpose of data in the business environment. The technical metadata covers the tables and fields of the physical database of the first client 802, the ETL (extraction, transformation, and loading) job information of the database; the technical metadata is data about data storage, structure, and processing. The operation metadata includes audit results, error logs, scheduling exception logs, and the like, and relates to the management and maintenance of data.
[0055] The second client 803 is a transaction client (Tx client), and the second client 803 includes account transaction information describing transactions. The account transaction information includes account transaction time, account transaction object, transaction type (such as deposit, withdrawal, transfer, payment, and the like), account transaction amount, and transaction currency type, and the like.
[0056] The financial transaction protection model adopts a vanilla framework as the core. The vanilla framework refers to a simple, undetached, or additional function-added native framework. It represents the most basic and purest form of a framework, without integrating any third-party libraries or tools. It usually provides the core functions and tools required for building an application, but without additional modifications or complex integrations. It has the advantages of indirectness, flexibility, lightweight, and transparency. Since there is no predefined additional function, the financial transaction protection function can be customized more freely according to the business needs.
[0057] Referring to Figure 1 , the training method of the financial transaction protection model includes the following steps:
[0058] In step S100, the first client extracts the features of the account data through an extractor, and trains the extractor according to the features of the account data;
[0059] Step S200, the server aggregates the extractor after self-training to obtain an aggregated extractor;
[0060] Step S300, the first client determines first target account data from the account data according to the first account identifier sent by the second client, extracts first aggregated features of the first target account data through the aggregated extractor, encrypts the first aggregated features to obtain first encrypted features;
[0061] Step S400, the second client decrypts the first encrypted features to obtain the first aggregated features, adds noise to the first aggregated features to obtain noise features, trains a classifier for judging financial transaction dangerous behaviors according to the noise features, and obtains a trained financial transaction protection model.
[0062] In step S100 of some embodiments, since the account data has no label, the first client 802 trains the extractor using a self-supervised method. The first client 802 extracts features of the account data through the extractor, and trains the extractor according to the features of the account data.
[0063] The extractor includes an encoder and a decoder, and the encoder and the decoder are globally initialized. In the self-training process, the extractor is self-trained according to the following first formula as a target, and the first formula is expressed as: In the formula, k i represents the i-th sample of the account data, N n represents the total number of samples of the account data; a φ represents the encoder, a′ φ′ represents the decoder, φ n represents the parameters of the n-th encoder, φ′ n represents the parameters of the n-th decoder.
[0064] The account metadata is stored in the first client 802, and the first client 802 extracts features of the account metadata of the account data through the extractor. The account metadata includes business metadata, technical metadata, operation metadata, etc. The business metadata usually includes definition and description of report indicators, business rules, data standards, etc.; these information helps to understand the meaning and purpose of the data in the business environment. The technical metadata covers the tables and fields of the physical database of the first client 802, the ETL (extraction, transformation and loading) job information of the database; the technical metadata is the data about data storage, structure and processing. The operation metadata includes audit results, error logs, scheduling exception logs, etc., and involves the management and maintenance of the data.
[0065] The first client 802 extracts the features of the account data through the extractor, and the specific process of training the extractor according to the features of the account data is as follows: the account data is cleaned, including removing special characters, tokenizing, converting to lowercase, masking, etc.; the preprocessed account data is input into the extractor, and is sequentially coded by the encoder and decoded by the decoder, and the features of the account data are extracted according to the designed prediction task; the loss between the features of the account data and the true target is calculated, for example, cross-entropy loss; the parameters of the extractor are updated by back propagation according to the loss function; the above process is repeated until the extractor converges; and self-supervised learning of the extractor is realized.
[0066] In step S200 of some embodiments, the server 801 aggregates the self-trained extractors to obtain an aggregated extractor, and the server 801 distributes the aggregated extractor to the account clients, and the account clients update the extractors to the aggregated extractor.
[0067] The server 801 aggregates the self-trained extractors to obtain an aggregated extractor according to a second formula; the second formula is: In the formula, φ represents the parameters of the encoder of the aggregated extractor, φ n represents the parameters of the encoder of the nth extractor, M represents the total number of the encoders of the extractors, φ' represents the parameters of the decoder of the aggregated extractor, φ' n represents the parameters of the decoder of the nth extractor, and N represents the total number of the decoders of the extractors.
[0068] In some embodiments, when the number of account clients is large, federated learning of the model will cause a large amount of communication overhead. In order to reduce the overhead, the parameters of the autoencoder are only aggregated once on the server 801 after training of each account client. In addition, aggregating only once on the server 801 also helps to reduce the risk of data leakage.
[0069] The account data includes first data with the same feature dimension, and a plurality of account clients containing the first data are regarded as clients of horizontal federated learning (Horizontal Federated Learning). For example, a plurality of similar financial institutions cooperate, that is, they need to learn and predict similar features, but the users and samples are different, for example, different banks in a region each have their own customers, but the account data they need to analyze are all deposit limits, loan limits, etc., which have the same feature dimension.
[0070] Referring to Figure 2For the horizontal federated learning of the financial transaction protection model, the first client 802 extracts features of the account data through the extractor, self-trains the extractor according to the features of the account data, the server 801 aggregates the self-trained extractor to obtain an aggregated extractor, including the following steps:
[0071] Step S510, the first client extracts features of the first data through the extractor, self-trains the extractor according to the features of the first data, and the server aggregates the self-trained extractor to obtain a new extractor;
[0072] Step S520, the server distributes the aggregated new extractor to the first client, the first client updates the extractor to the new extractor, the first client extracts features of the first data through the new extractor, self-trains the new extractor according to the features of the first data, and the server aggregates the self-trained new extractor; repeat this step until the convergence of the extractor reaches a set value or the number of iterations reaches a set value, and obtain an aggregated extractor.
[0073] In this step, the model training is allowed to be performed locally at the first client 802 through the horizontal federated learning, which reduces the risk of data leakage, realizes decentralization, reduces the computing burden of the central server 801, and reduces the risk of single point failure; the client can use its own computing resources for local training, reducing the dependence on external computing resources and improving resource utilization efficiency; promoting data cooperation between different first clients 802, realizing data sharing; by combining the data of multiple first clients 802, it is beneficial to train a more accurate and more generalizable model, which helps to improve the robustness and diversity of the model.
[0074] In step S300 of some embodiments, the first client 802 determines first target account data from the account data according to the first account identifier sent by the second client 803, extracts first aggregated features of the first target account data through the aggregated extractor, and encrypts the first aggregated features to obtain first encrypted features.
[0075] Specifically, the second client 803 sends the first account identifier corresponding to account A to the first client 802. The first client 802 receives the first account identifier corresponding to account A sent by the second client 803, and determines the account data corresponding to account A as the first target account data according to the first account identifier corresponding to account A from the account data in the database. The first client 802 extracts the first aggregated features of the first target account data through the aggregated extractor downloaded from the server 801, and encrypts the first aggregated features to obtain the first encrypted features.
[0076] The first aggregated feature can be encrypted by digital signature, symmetric encryption, asymmetric encryption, etc. The system generates a pair of public key and private key, and the system distributes the public key to the first client 802. The first client 802 receives the public key and encrypts the first aggregated feature by the public key to obtain the first encrypted feature.
[0077] The encryption of the first aggregated feature reduces the risk of data leakage and abuse, and improves the data security. By encrypting the data, unauthorized individuals or entities can be prevented from accessing the information at will, protecting the privacy of the user corresponding to the account data. By encrypting the data, the security of the data during transmission or storage is guaranteed, and even if the data is intercepted during transmission or storage, it is difficult to interpret. Encrypted data is usually combined with integrity checking to ensure that the data has not been tampered with during transmission or storage.
[0078] In step S400 of some embodiments, the second client 803 decrypts the first encrypted feature to obtain the first aggregated feature, adds noise to the first aggregated feature to obtain a noise feature, and trains a classifier for judging financial transaction risky behavior according to the noise feature to obtain a trained financial transaction protection model.
[0079] Specifically, the system generates a pair of public key and private key, and the system distributes the private key to the second client 803. The second client 803 receives the private key, decrypts the first encrypted feature by the private key to obtain the first aggregated feature, adds Gaussian noise to the first aggregated feature to obtain a noise feature, and trains a classifier according to the noise feature. The classifier predicts whether the financial transaction has a risky behavior according to the noise feature.
[0080] The classifier includes an activation layer, a pooling layer, a fully connected layer, and a softmax layer.
[0081] The activation layer performs a nonlinear transformation on the first aggregated feature, so that the network can better learn and process complex data, and improve the expression ability of the model. Nonlinear activation functions enable the network to combine and transform features at multiple levels, thereby capturing complex structures and patterns in the input data. Nonlinear activation functions help the network better propagate gradients during training, which is key to learning through the backpropagation algorithm. For example, the activation layer can use Sigmoid function, Tanh function, ReLU function, etc.
[0082] The first aggregated features are down-sampled by a pooling layer to reduce the dimensionality of the data and the computational load while preserving important feature information. The pooling layer reduces the dimensionality of the data by reducing the width and height of the first aggregated features. This helps to reduce the number of parameters in the subsequent layers, lower the computational complexity, and prevent overfitting. Pooling operations can increase the tolerance of features to small transformations, making the network invariant to small translations, rotations, or deformations of the input image. Commonly used pooling functions include max-pooling and average-pooling. Max-pooling operates by taking the maximum value of every few pixels in the output of the convolutional layer as the output of the pooling layer. Average-pooling takes the average value of every few pixels in the output of the convolutional layer as the output of the pooling layer. The down-sampling operation of the pooling layer can reduce the dimensionality of the data and the computational load while preserving important features, improving the generalization ability of the network.
[0083] The features extracted by the previous layers are integrated by a fully connected layer and mapped to the classification results. The calculation process of the fully connected layer is to multiply the output of the previous layers with the weights of the fully connected layer element by element and sum up the results plus the bias term. Through the weights and biases inside, the fully connected layer can learn the complex nonlinear relationships between input features. For example, the fully connected layer maps the features to the corresponding financial transactions with dangerous behavior and the corresponding financial transactions without dangerous behavior.
[0084] The scores of each class by the fully connected layer are converted to probability distributions by a softmax layer. The probability of the i-th class is represented as: where zi represents the score of the i-th class by the fully connected layer, zj represents the score of the j-th class by the fully connected layer, e zi is the exponential of zi, e zj is the exponential of zj, and y i represents the probability of the i-th class. For example, the probability of the corresponding financial transactions with dangerous behavior is 0.7 and the probability of the corresponding financial transactions without dangerous behavior is 0.3 by the softmax layer.
[0085] The probabilities of each class output by the softmax layer are sorted, and the class with the highest probability is selected as the prediction result of judging whether the financial transaction has dangerous behavior.
[0086] The account transaction data in the account data corresponding to the noise features is set with a true label for identifying whether the financial transaction has dangerous behavior. The loss function value is calculated according to the difference between the prediction result of the classifier and the true label, the parameters of the classifier are adjusted according to the loss function value, and the above process is repeated until the classifier converges or the training times reach a preset training time threshold, and a trained classifier is obtained.
[0087] In other embodiments, the noise can be other types of noise, such as Poisson noise, impulse noise, and multiplicative noise, etc.
[0088] The loss function adopts a cross-entropy loss function in this embodiment; of course, in other embodiments, the loss function can also be other types of loss functions, such as log loss, square loss, etc.
[0089] In some embodiments, the account data includes second data with different feature dimensions; the account client containing the second data and the transaction client containing the second data are regarded as clients of vertical federated learning.
[0090] For the second data with different feature dimensions, the customer groups corresponding to the second data are similar, but the feature dimensions are different. For example, for a bank company and an insurance company in the same city, the customer groups of the bank company and the insurance company are partially coincident, but the account data of the bank is usually the asset information of the user, and the account data of the insurance company is usually the insurance information of the user, both of which have different feature dimensions, and the account data of the bank company and the account data of the insurance company constitute the second data.
[0091] Reference Figure 3 For vertical federated learning of the financial transaction protection model, the first client 802 determines the first target account data from the account data according to the first account identifier sent by the second client 803, extracts the first aggregated feature of the first target account data through the aggregation extractor, encrypts the first aggregated feature to obtain the first encrypted feature, the second client 803 decrypts the first encrypted feature to obtain the first aggregated feature, adds noise to the first aggregated feature to obtain the noise feature, including the following steps:
[0092] Step S610, the plurality of first clients and the second client interact the second data and align the second data to obtain aligned data;
[0093] Step S620, the first client determines the first target account data from the aligned data according to the first account identifier sent by the second client, extracts the first aggregated feature of the first target account data through the aggregation extractor, and encrypts the first aggregated feature to obtain the first encrypted feature;
[0094] Step S630, the second client decrypts the first encrypted feature to obtain the first aggregated feature, aggregates the first aggregated features of the plurality of first clients to obtain the aggregated feature, and adds noise to the aggregated feature to obtain the noise feature;
[0095] Step S640, the first client removes the noise in the noise feature to obtain the aggregated feature, and updates the aggregation extractor according to the aggregated feature.
[0096] Specifically, the same user data in the second data of the different first client 802 and the second client 803 is aligned to obtain aligned data, facilitating subsequent vertical federated learning to train a model according to the aligned same user data.
[0097] The first client 802 contains account activity information and corresponding account metadata; the second client 803 contains account transaction information describing transactions. The account metadata includes account markers, etc. Specifically, the account metadata includes business metadata, technical metadata, and operational metadata, etc. The business metadata usually includes definitions of report indicators, business rules, data standards, etc.; these information helps to understand the meaning and use of data in the business environment. The technical metadata covers the tables and fields of the physical database of the first client 802, the ETL (Extraction, Transformation, and Loading) job information of the database; the technical metadata is about data storage, structure, and processing. The operational metadata includes audit results, error logs, scheduling exception logs, etc., related to the management and maintenance of data. The account transaction information includes account transaction time, account transaction object, transaction type (such as deposit, withdrawal, transfer, payment, etc.), account transaction amount, and transaction currency type, etc.
[0098] The second client 803 sends the first account identifier corresponding to account B to the first client 802. The first client 802 receives the first account identifier corresponding to account B sent by the second client 803, and finds the account data corresponding to the account alignment data from the alignment data according to the first account identifier corresponding to account B, determines the account data corresponding to the account alignment data as the first target account data; the first client 802 extracts the first aggregation feature of the first target account data through the aggregation extractor downloaded from the server 801, and encrypts the first aggregation feature to obtain the first encrypted feature.
[0099] The first aggregation feature can be encrypted by digital signature, symmetric encryption, asymmetric encryption, etc. The system generates a pair of public key and private key, and distributes the public key to the first client 802. The first client 802 receives the public key and encrypts the first aggregation feature through the public key to obtain the first encrypted feature.
[0100] The system distributes the private key to the second client 803. The second client 803 receives the private key, decrypts the first encrypted feature through the private key to obtain the first aggregation feature, aggregates the first aggregation features of multiple first clients 802 to obtain an aggregated feature, adds Gaussian noise to the aggregated feature to obtain a noise feature, and sends the noise feature to the first client 802.
[0101] The first client 802 receives the noise features sent by the second client 803, filters the noise in the noise features through the filter to obtain the summary features; since the summary features summarize the features of the account data with different feature dimensions from multiple first clients 802, the aggregated extractor is updated according to the summary features, and the generality of the aggregated extractor is improved.
[0102] Through longitudinal federated learning, the clients are allowed to utilize each other's data features, enrich the data dimensions, and improve the prediction ability and interpretability of the model; since the clients only share the updates of the model rather than the original data, the personal privacy and data security can be better protected; by combining features from different sources, the model can obtain more comprehensive information, thereby improving the accuracy and generalization ability of the prediction.
[0103] At this point, the entire financial transaction protection model is trained, and a trained financial transaction protection model is obtained.
[0104] The method achieves a balance between model performance and privacy protection; a variety of security technologies are used, including noise injection, local feature extraction, and encryption technology, to protect data privacy, effectively deal with security risks and related attacks, and improve the generalization ability of the model; safe and private collaborative data analysis can be provided; by combining horizontal federated learning and longitudinal federated learning, multiple clients can safely collaborate in data analysis, solving the problems of sample feature distribution and privacy protection in existing federated learning.
[0105] Embodiments of the present application propose a financial transaction protection method.
[0106] Referring to Figure 4 , the financial transaction protection method comprises the following steps:
[0107] Step S700, the second client sends a second account identifier to the first client;
[0108] Step S800, the first client determines second target account data from the account data according to the second account identifier, extracts second aggregated features of the second target account data through the extractor in the trained financial transaction protection model, and encrypts the second aggregated features to obtain second encrypted features;
[0109] Step S900, the second client decrypts the second encrypted features to obtain the second aggregated features, judges the financial transaction risk behavior according to the second aggregated features through the classifier in the trained financial transaction protection model, and obtains a judgment result.
[0110] The trained financial transaction protection model is obtained according to the training method of the financial transaction protection model as described above.
[0111] Specifically, the second client 803 sends the second account identifier corresponding to the account C to the first client 802. The first client 802 receives the second account identifier corresponding to the account C sent by the second client 803, and finds the account data corresponding to the account C from the account data in the database according to the second account identifier corresponding to the account C, determines the account data corresponding to the account C as the second target account data; the first client 802 extracts the second aggregate feature of the second target account data through the extractor in the trained financial transaction protection model, and encrypts the second aggregate feature to obtain the second encrypted feature.
[0112] The first aggregate feature can be encrypted by digital signature, symmetric encryption, asymmetric encryption, etc. The system generates a pair of public key and private key, and the system distributes the public key to the first client 802. The first client 802 receives the public key and encrypts the second aggregate feature through the public key to obtain the first encrypted feature.
[0113] By encrypting the second aggregate feature, the risk of data leakage and abuse is reduced, and the data security is improved. By encrypting the data, unauthorized individuals or entities can be prevented from accessing the information at will, protecting the privacy of the user corresponding to the account data. By encrypting the data, the security of the data during transmission or storage is guaranteed, and even if the data is intercepted during transmission or storage, it is difficult to interpret. Encrypted data is usually combined with integrity checking to ensure that the data has not been tampered with during transmission or storage.
[0114] The system distributes the private key to the second client 803. The second client 803 receives the private key, decrypts the second encrypted feature through the private key to obtain the second aggregate feature, and judges the financial transaction risk behavior according to the second aggregate feature through the classifier in the trained financial transaction protection model to obtain the judgment result.
[0115] The classifier includes an activation layer, a pooling layer, a fully connected layer and a softmax layer.
[0116] The activation layer performs a nonlinear transformation on the second aggregate feature, so that the network can better learn and process complex data and improve the expression ability of the model. Nonlinear activation functions enable the network to combine and transform features at multiple levels, capturing complex structures and patterns in the input data. Nonlinear activation functions help the network better propagate gradients during training, which is crucial for learning through the backpropagation algorithm. For example, the activation layer can use the Sigmoi d function, the Tanh function, the ReLU function, etc.
[0117] The pooling layer downsamples the second aggregated feature, reducing the data dimensionality and computational complexity while preserving important feature information. The pooling layer reduces the data dimensionality by reducing the width and height of the first aggregated feature. This helps reduce the number of parameters in subsequent layers, reduces computational complexity, and prevents overfitting. Pooling increases the feature's tolerance to minor transformations, making the network invariant to small translations, rotations, or deformations of the input image. Common pooling functions include max pooling and average pooling. Max pooling uses the maximum value of every several pixels in the convolutional layer output as the output of the pooling layer. Average pooling uses the average value of every several pixels in the convolutional layer output as the output of the pooling layer. This downsampling operation of the pooling layer reduces the data dimensionality and computational complexity while preserving important features and improving the network's generalization ability.
[0118] The fully connected layer integrates the features extracted by the previous layers and maps them to the classification results. The fully connected layer's computational process involves element-wise multiplication of the outputs of the previous layers with the layer's weights, summing the results and adding a bias term. Through its internal weights and biases, the fully connected layer is able to learn the complex nonlinear relationships between input features. The fully connected layer maps features to indicators of risky and non-risky financial transactions.
[0119] The score of each category in the fully connected layer is converted into a probability distribution through the softmax layer. The probability of the i-th category is expressed as: Among them, zi represents the score of the fully connected layer for the i-th category, zj represents the score of the fully connected layer for the j-th category, and e zi is the exponential of zi, e zj is the exponential of zj, y i represents the probability of the i-th category. For example, the probability of a financial transaction involving risky behavior is 0.6, and the probability of a financial transaction without risky behavior is 0.4, obtained through the softmax layer.
[0120] The probabilities of the various categories output by the softmax layer are sorted, and the category with the highest probability is selected as the result of predicting whether there is dangerous behavior in the financial transaction to obtain the judgment result.
[0121] The judgment result is sent to the operator's operation platform. If the judgment result is that there is dangerous behavior in the financial transaction, the operator will perform relevant safety operations on the financial transaction behavior.
[0122] The financial transaction protection method is based on a financial transaction protection model that fuses horizontal federated learning and vertical federated learning, thereby achieving a balance between model performance and privacy protection; a plurality of security technologies, including noise injection, local feature extraction, and encryption technology, are used to protect data privacy, effectively deal with security risks and related attacks, and improve the generalization ability of the model; safe and private collaborative data analysis can be provided; by fusing horizontal federated learning and vertical federated learning, a plurality of clients can be safely enabled to perform collaborative data analysis, and the distribution of sample features and privacy protection in existing federated learning are solved.
[0123] The embodiments of the present application also provide an electronic device. Referring to Figure 6 , the electronic device includes a memory 902 and a processor 901, the memory 902 stores a computer program, and the processor 901 implements the training method of the financial transaction protection model and the financial transaction protection method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0124] The processor 901 can be implemented in the form of a general-purpose CPU (Central Processing Unit, central processor), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the embodiments of the present application; the memory 902 can be implemented in the form of a read-only memory (ReadOnly Memory, ROM), a static storage device, a dynamic storage device, or a random access memory (Random Access Memory, RAM) etc. The memory 902 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are saved in the memory 902 and called and executed by the processor 901 to implement the training method of the financial transaction protection model and the financial transaction protection method of the embodiments of the present application.
[0125] The input / output interface 903 is used to realize information input and output; the communication interface 904 is used to realize the communication interaction between the device and other devices, which can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WI F I, Bluetooth, etc.); the bus 905 transmits information between various components (such as the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device; the processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are connected to each other through the bus 905 for communication within the device.
[0126] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the training method and the financial transaction protection method of the financial transaction protection model.
[0127] The memory, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0128] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0129] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than the figures shown, or combine certain steps, or different steps.
[0130] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0131] Those skilled in the art can understand that all or some steps in the above disclosed method, the function modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.
[0132] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of orderly or chronological mundane operation, reverse order operation, based on circuitry availability, based on stated preference or the like, and that "default" or other orderings are thus permissible. Further, the terms "comprise", "comprising", "include", "including", and the like, are specifically intended to be open-ended. That is, references to individual steps and the like do not suhstantially exclude the presence of two or more of a given step or its integral presence in the process, method, system, article, or apparatus having been made with a wider scope. The use of notation such as "first", "second", "third", etc. does not generally limit the areas, but is used to connect like elements or to distinguish one claim from another. These terms can be used interchangeably when appropriate. Terms concerning the relative position of elements can be interpreted such that their use adheres to their normal meaning, but they can also be interpreted to mean the opposite according to specific claims.
[0133] It should be understood that, in the application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are only A, only B, and A and B at the same time. Where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and back associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c, can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0134] In several embodiments provided by the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the above-described device embodiments are only illustrative, for example, the division of the above-mentioned units is only a logical functional division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0135] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the application.
[0136] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0137] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.
[0138] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and the scope of the rights of the embodiments of the present application is not limited thereto. Any modification, equivalent replacement and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.
Claims
1. A training method for a financial transaction protection model, characterized in that: include: The first client extracts features of the account data through an extractor, and self-trains the extractor based on the features of the account data; The server aggregates the self-trained extractors to obtain an aggregated extractor; The first client determines first target account data from the account data according to the first account identifier sent by the second client, extracts a first aggregate feature of the first target account data by the aggregate extractor, and encrypts the first aggregate feature to obtain a first encrypted feature; The second client decrypts the first encrypted feature to obtain a first aggregate feature, adds noise to the first aggregate feature to obtain a noise feature, and trains a classifier for determining risky financial transaction behavior based on the noise feature to obtain a trained financial transaction protection model; The extractor includes an encoder and a decoder; the server aggregates the self-trained extractors to obtain an aggregated extractor, including: The server aggregates the self-trained extractors according to the second formula to obtain an aggregated extractor; The second formula is: Where, represents the parameters of the encoder of the aggregation extractor, represents the parameters of the encoder of the nth extractor, M represents the total number of encoders of the extractor, Describes the parameters of the decoder of the aggregation extractor, Represents the parameters of the decoder of the nth extractor, where N represents the total number of decoders of the extractor.
2. The training method of the financial transaction protection model according to claim 1, characterized in that: The extractor includes an encoder and a decoder; The self-training of the extractor according to the features of the account data comprises: self-training the extractor according to a first formula; The first formula is: Where k i represents the i-th sample of account data, N n Indicates the total number of samples of account data; represents the encoder, Represents a decoder.
3. The training method of the financial transaction protection model according to claim 1, characterized in that: The account data includes account metadata, and the account metadata is stored in the first client.
4. The training method for a financial transaction protection model according to claim 1, characterized in that: The account data includes account transaction data, and the account transaction data is stored in the second client.
5. The training method of the financial transaction protection model according to claim 1, characterized in that: The account data includes first data having the same feature dimension; the first client extracts features of the account data using an extractor, self-trains the extractor based on the features of the account data, and the server aggregates the self-trained extractors to obtain an aggregated extractor, including: The first client extracts features of the first data through an extractor, self-trains the extractor according to the features of the first data, and the server aggregates the self-trained extractors to obtain a new extractor; The server distributes the new extractor to the first client, and the first client updates the extractor to the new extractor. The first client extracts features of the first data through the new extractor, and self-trains the new extractor according to the features of the first data. The server aggregates the self-trained new extractors to obtain an aggregated extractor.
6. The training method of the financial transaction protection model according to claim 1, characterized in that: The account data includes second data with different feature dimensions; the first client determines first target account data from the account data based on a first account identifier sent by the second client, extracts a first aggregate feature of the first target account data by the aggregate extractor, encrypts the first aggregate feature to obtain a first encrypted feature, decrypts the first encrypted feature by the second client to obtain a first aggregate feature, and adds noise to the first aggregate feature to obtain a noise feature, including: The plurality of first clients and the second clients exchange the second data and align the second data to obtain aligned data; The first client determines first target account data from the aligned data according to the first account identifier sent by the second client, extracts a first aggregate feature of the first target account data by the aggregate extractor, and encrypts the first aggregate feature to obtain a first encrypted feature; The second client decrypts the first encrypted feature to obtain a first aggregate feature, aggregates the first aggregate features of multiple first clients to obtain an aggregate feature, and adds noise to the aggregate feature to obtain a noise feature; The first client removes noise from the noise feature to obtain a summary feature, and updates the aggregation extractor according to the summary feature.
7. A financial transaction protection method, characterized in that: include: The second client sends a second account identifier to the first client; The first client determines second target account data from the account data based on the second account identifier, extracts a second aggregate feature of the second target account data using an extractor in the trained financial transaction protection model, and encrypts the second aggregate feature to obtain a second encrypted feature; The second client decrypts the second encrypted feature to obtain a second aggregate feature, and uses a classifier in the trained financial transaction protection model to determine a risky financial transaction behavior based on the second aggregate feature to obtain a determination result; The trained financial transaction protection model is obtained by training according to the training method for a financial transaction protection model according to any one of claims 1 to 6.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the training method of the financial transaction protection model according to any one of claims 1 to 6 and the financial transaction protection method according to claim 7.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the training method of the financial transaction protection model according to any one of claims 1 to 6 and the financial transaction protection method according to claim 7 are implemented.
Citation Information
Patent Citations
Encrypted network flow detection method and device and electronic equipment
CN117439763A
Systems, methods and apparatus for data quality assessment and learning for automated devices
US20230244191A1