Financial abnormal behavior detection method and system based on federated learning privacy protection
Through the combination of federated learning architecture and encryption algorithms, pseudo-samples are generated for model training, which solves the problem of insufficient privacy protection of financial data and improves the accuracy and system security of cross-institutional abnormal behavior detection.
Patent Information
- Application Number
- CN202510815074.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-06-18
AI Technical Summary
In the prior art, financial data is scattered and has high privacy requirements, resulting in insufficient cross-institutional abnormal behavior detection samples and weak generalization capabilities, which affects identification accuracy and efficiency.
Through the federated learning architecture, the symmetric encryption algorithm AES is used to combine with the asymmetric encryption algorithm RSA to generate pseudo-samples and perform model training to ensure safe sharing of data, and to combine convolutional neural networks for local training and global model updates until the performance indicators are stable.
Without exchanging original data, the model's learning ability of abnormal patterns is improved, and the accuracy and system security of cross-institutional financial abnormal behavior detection is enhanced.
Smart Images

Figure CN120354313B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of financial technology and artificial intelligence technology, and in particular to a method and system for detecting financial abnormal behavior based on federated learning privacy protection. Background Art
[0002] With the digital development of financial services, abnormal behaviors such as financial fraud and account theft are becoming increasingly complex. It is difficult for a single financial institution to cover cross-platform abnormal behaviors by relying on its own data training models.
[0003] In recent years, federated learning, a new distributed machine learning architecture, has emerged as a collaborative training mechanism that enables "data storage within the local machine, and model sharing and upgrading." This approach improves model performance while protecting data privacy. It has found initial application in fields such as healthcare and communications. However, there remains a lack of a systematic and practical methodology for effectively applying federated learning to detect financial anomalies.
[0004] Chinese patent application CN117874597A discloses a federated learning system for identifying and processing financial sensitive data. This system utilizes a large financial federated learning model in conjunction with a BERT-based NER model to classify and refine the acquired data, and intelligently recommends the best desensitization algorithm to ensure data compliance and accuracy. This patented solution is innovative in terms of data privacy protection, automated sensitive information identification, and desensitization, but it still faces problems such as uneven data distribution, high computational overhead, insufficient privacy protection, rule matching limitations, and a high need for manual intervention. Therefore, the prior art requires a method that can address the problem of insufficient privacy protection, while improving the accuracy of identifying abnormal data and reducing the security risks brought about by data sharing, thereby enhancing the compliance of financial data and the ability to detect anomalies. Summary of the Invention
[0005] This application provides a method and system for detecting financial abnormal behavior based on federated learning privacy protection, which solves the problem of insufficient privacy protection, while improving the accuracy of identifying abnormal data and reducing the security risks brought by data sharing, thereby enhancing the compliance of financial data and the technical problem of anomaly detection capabilities.
[0006] In view of the above problems, this application provides a method and system for detecting financial abnormal behavior based on federated learning privacy protection.
[0007] On the one hand, the present application provides a method for detecting financial anomaly based on privacy protection of federated learning. The method for detecting financial anomaly based on privacy protection of federated learning collects local financial data, constructs a public data generator based on a base model, generates pseudo samples similar to local anomaly data by adjusting the prompt text, merges the candidate samples with the original data, and uses a convolutional neural network in the local node to perform local training on the merged data, calculates the loss of the base model in real time, and optimizes the parameters according to the loss. After the training is completed, the updated parameters of the local base model are output; the local updated parameters are encrypted by combining a symmetric encryption algorithm with an asymmetric encryption algorithm. The encrypted local base model weight parameters are encrypted and sent to the central node for secure aggregation; the encrypted base model update weights from each local node are decrypted using the private key held by the central node, and the decrypted update weights are used to calculate the update parameters of the global model. The symmetric encryption algorithm is combined with the asymmetric encryption algorithm to re-encrypt the global model and return it to the local node. The local node decrypts the global model and compares it with the local model accuracy to perform parameter update; the S2-S4 process is repeatedly executed in a loop until the performance indicators of the global model tend to be stable and the preset convergence conditions are met.
[0008] In a second aspect, the present application further provides a financial anomaly behavior detection system based on federated learning privacy protection, which is used to execute the financial anomaly behavior detection method based on federated learning privacy protection as described in the first aspect, wherein the financial anomaly behavior detection system based on federated learning privacy protection includes: a candidate sample acquisition module, the candidate sample acquisition module is used to collect local financial data, construct a public data generator based on a base model, and generate pseudo samples similar to the local anomaly data by adjusting the prompt text, and use the pseudo samples as candidate samples;
[0009] A local model parameter update module is used to merge the candidate samples with the original data. The local node uses a convolutional neural network to perform local training on the merged data, calculate the loss of the base model in real time, and optimize the parameters based on the loss. After the training is completed, the updated parameters of the local base model are output;
[0010] A local model update parameter encryption module, which is used to encrypt the locally updated local base model weight parameters using a combination of a symmetric encryption algorithm and an asymmetric encryption algorithm, and send the encrypted local base model weight parameters to the central node for secure aggregation;
[0011] A local node parameter update module is used to decrypt the encrypted base model update weights from each local node using the private key held by the central node. The decrypted update weights are used to calculate the update parameters of the global model. The global model is re-encrypted using a combination of symmetric and asymmetric encryption algorithms and returned to the local node. The local node decrypts the global model, compares it with the local model accuracy, and performs parameter updates.
[0012] A loop iteration module is used to repeatedly execute the loop iteration of the local model parameter update module-the local model parameter update encryption module-the local node parameter update module until the performance indicators of the global model tend to be stable and meet the preset convergence conditions.
[0013] One or more technical solutions provided in this application have at least the following beneficial effects:
[0014] By collecting local financial data, a public data generator based on the base model is constructed. By adjusting the prompt text, pseudo samples similar to local abnormal data are generated, and the pseudo samples are used as candidate samples; the candidate samples are merged with the original data, and the local node uses a convolutional neural network to locally train the merged data, calculates the loss of the base model in real time, and optimizes the parameters based on the loss. After the training is completed, the updated parameters of the local base model are output; the locally updated local base model weight parameters are encrypted by combining a symmetric encryption algorithm with an asymmetric encryption algorithm, and the encrypted local base model weight parameters are sent to the central node for secure aggregation; the encrypted model update weights from each local node are decrypted using the private key held by the central node. The decrypted update weights will be used to calculate the update parameters of the global model. The global model is re-encrypted using a symmetric encryption algorithm combined with an asymmetric encryption algorithm and returned to the local node. The local node decrypts the global model, compares it with the local model accuracy, and performs parameter update; the S2-S4 process is repeatedly executed in a loop until the performance indicators of the global model tend to be stable and meet the preset convergence conditions. Through the federated learning architecture, financial institutions collaborate on model training without exchanging original data. AES symmetric encryption + RSA asymmetric encryption is introduced to ensure data security during the model update process. By building prompt templates, the base model is guided to generate pseudo-abnormal samples similar to local abnormal data, and the generated samples are integrated with real data to improve the coverage and diversity of the training set, solve the problem of scarcity of abnormal data, and enhance the model's ability to learn abnormal patterns.
[0015] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, which can be implemented in accordance with the contents of the description, and to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are specifically listed below. It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easy to understand through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in this application or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and a person of ordinary skill in the art can obtain other drawings based on the provided drawings without creative work.
[0017] Figure 1 This is a flowchart of the financial abnormal behavior detection method based on federated learning privacy protection in this application.
[0018] Figure 2 Generate an augmented abnormal financial data flow chart for the pre-trained base model of the financial abnormal behavior detection method based on federated learning privacy protection in this application.
[0019] Figure 3 This is a flow chart of the performance indicators of the Resnet18 residual network generation model for the financial anomaly behavior detection method based on federated learning privacy protection in this application.
[0020] Figure 4 This is a flow chart of parameter updates for the encryption and decryption model combining symmetric and asymmetric algorithms for the local node of the financial abnormal behavior detection method based on federated learning privacy protection in this application.
[0021] Figure 5 This is a flow chart of parameter updates for the encryption and decryption model combining symmetric and asymmetric algorithms for the central node of the financial abnormal behavior detection method based on federated learning privacy protection in this application.
[0022] Figure 6 This is the federated learning structure diagram of the financial abnormal behavior detection method based on federated learning privacy protection in this application.
[0023] Figure 7 This is a structural diagram of the financial abnormal behavior detection method system based on federated learning privacy protection in this application.
[0024] Explanation of the reference numerals: candidate sample obtaining module 11, local model updating parameter module 12, local model updating parameter encryption module 13, local node parameter updating module 14, loop iteration module 15. DETAILED DESCRIPTION
[0025] This application provides a method and system for detecting financial anomaly based on privacy protection through federated learning. This invention addresses the existing technical issues of limited cross-institutional anomaly detection model training, poor model generalization, and low anomaly recognition accuracy, caused by the high sensitivity and difficulty of sharing financial data. Through innovative design of a large-scale model pseudo-sample generation method based on prompts, a local enhancement training mechanism, and an encrypted federated aggregation strategy, the problems of scarce anomaly data, the inability to share private data, and unstable model fusion are overcome, thereby improving the accuracy of cross-institutional financial anomaly detection and the overall security and robustness of the system.
[0026] Below, the technical solutions in this application will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, rather than all the embodiments of this application. It should be understood that this application is not limited to the example embodiments described herein. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. It should also be noted that, for the convenience of description, only the parts related to this application, rather than all of them, are shown in the accompanying drawings.
[0027] For example, see the attached Figure 1 The present application provides a method for detecting financial abnormal behavior based on federated learning privacy protection, wherein the method for detecting financial abnormal behavior based on federated learning privacy protection is executed by a financial abnormal behavior detection system based on federated learning privacy protection, and the method for detecting financial abnormal behavior based on federated learning privacy protection specifically includes the following steps:
[0028] S1. Collect local financial data, construct a public data generator based on the base model, and generate pseudo samples that are close to local abnormal data by adjusting the prompt text. The pseudo samples are used as candidate samples.
[0029] Furthermore, this application S1 includes:
[0030] Participants connect to their core financial systems through standardized API interfaces to collect and structure local financial transaction behavior data in real time. The data is unified into a cross-domain time-series structured format.
[0031] Design prompt templates and unified prompt text for different types of financial data to induce the base model to learn the characteristics of financial time series structured data and generate abnormal samples. The base model is DeepSeek LLM.
[0032] The collected local abnormal behavior samples are organized into a candidate sample set. The prompt template is used as input to call the base generation model to generate a large number of pseudo samples with similar features to the candidate samples, thereby constructing a public abnormal behavior dataset that does not contain real user data.
[0033] Specifically, local nodes connect to the core systems of financial institutions via APIs to collect cross-domain financial time-series structured data, such as transaction flows, in real time. Participants are entities participating in federated learning. For example, if multiple banks are jointly building a federated learning system, the participating parties are multiple banks. Financial data, as local datasets, includes basic transaction information: transaction timestamp, transaction amount, transaction currency / location; cardholder and anonymized merchant information: encrypted cardholder ID, merchant category code (MCC), merchant location; and transaction behavior characteristics: time interval with previous transactions, historical consumption frequency / amount patterns, and whether the transaction was conducted online. Collected data includes, but is not limited to, transaction amount, transaction time, transaction location, and transaction frequency. After data collection, data cleaning is performed to remove noise and missing values to ensure data integrity and accuracy.
[0034] The cleaned data is input into the pre-trained open source base model DeepSeek to independently find abnormal transaction data and learn its internal rules. The features found are used to generate augmented abnormal financial data. Figure 2 As shown in the figure, the specific steps are as follows: First, input the raw financial data into the pre-trained base model. Assume that each data item contains information such as transaction amount, transaction time, and transaction location. To guide the large model to extract features of abnormal data, we use the following fixed paragraph template as input:
[0035] Please analyze the following financial transaction data and extract the characteristics of abnormal transactions. The transaction data is as follows:
[0036] - Transaction amount: [Amount]
[0037] - Transaction time: [Time]
[0038] - Transaction Location: [Location]
[0039] - Transaction frequency: [Frequency]"
[0040] in:
[0041] [Amount] is replaced with the actual transaction amount;
[0042] [Time] is replaced with the actual transaction time;
[0043] [Location] is replaced with the actual transaction location;
[0044] [Frequency] is replaced with the actual transaction frequency.
[0045] Secondly, feature extraction: After filling the above fixed paragraph template with actual data, it is input into the pre-trained base model. The model will extract the features of the abnormal data based on the paragraph prompt. For example, the model may output the following features:
[0046] a) High-value transactions (abnormal transaction amounts);
[0047] b) High-frequency trading (abnormal trading frequency);
[0048] c) Off-site transactions (abnormal transaction location).
[0049] Next, data augmentation generates augmented abnormal financial data based on the extracted features. To guide the large model to generate augmented abnormal data, we use the following fixed paragraph template as input:
[0050] Please generate augmented abnormal transaction data based on the extracted abnormal features.
[0051] For example, generate an augmented abnormal transaction data:
[0052] - Transaction amount: 15,000 yuan
[0053] - Trading Time: 2023-10-01 15:00
[0054] - Trading location: Shanghai
[0055] - Transaction frequency: 10 times / hour.
[0056] Obtain augmented financial data. Augmented financial data is generated by adjusting the prompt text in step S1 to create pseudo samples similar to the local anomaly data. This process of augmenting anomaly financial data using a pretrained base model addresses the data scarcity and class imbalance issues in federated learning in financial scenarios.
[0057] S2. Merge the candidate samples with the original data. The local node uses a convolutional neural network to perform local training on the merged data, calculates the loss of the base model in real time, and optimizes the parameters based on the loss. After the training is completed, the updated parameters of the local base model are output.
[0058] Furthermore, this application S2 includes:
[0059] Merge the abnormal data of the candidate samples with the original financial data, and use the convolutional neural network (CNN) to perform local training on the merged data;
[0060] During the training of the local base model, a convolutional neural network (CNN) is used as the basic structure. The CNN network includes multiple convolutional layers, pooling layers, and fully connected layers to automatically extract local and global features from financial behavior data.
[0061] The base model parameters are continuously optimized through the back-propagation algorithm. During the training process, the performance indicators of the base model are monitored in real time, and the learning rate and network structure are dynamically adjusted based on the indicator results to optimize the base model. The performance indicators include loss function, accuracy, and AUC;
[0062] After the training is completed, the weight parameters of the local base model are output as the local base model update result to participate in the subsequent global model aggregation.
[0063] Specifically, the abnormal data of the candidate samples With the original data Merge to form a new dataset .like Figure 3 As shown in the figure, the ResNet residual network is used to perform local training on the merged data, showing the process of extracting financial features using the ResNet18 residual network. The model structure is as follows:
[0064] This paper uses an improved residual neural network model, ResNet18, as the underlying architecture for feature extraction and classification. The merged financial data undergoes a process called convolutional layer 1, convolutional layer 2_x, convolutional layer 3_x, convolutional layer 4_x, convolutional layer 5_x, global average pooling, fully connected layer, softmax operation, fully connected layer, and finally, model performance metrics. The convolutional layer consists of five sequentially connected stages: convolutional layer 1, convolutional layer 2_x, convolutional layer 3_x, convolutional layer 4_x, and convolutional layer 5_x. Convolutional layer 1 is used for initial feature extraction and takes as input a two-dimensional structured financial feature map of size H × W, where H represents the time step and W represents the financial behavior feature dimension corresponding to each time step. Convolutional layer 1 uses a 7×7 convolution kernel with a sliding operation and a stride of 2, resulting in an output size of H × W. For example, H = 24 represents a 24-hour transaction sequence, and W = 12 represents 12 features, such as amount, IP address, and device type.
[0065] The Convolutional Layer 2_x module is the first residual module group in the network. Its input is H×W, which is the same size as the output of Convolutional Layer 1. In the task of detecting financial anomaly behavior, H represents the time window length, and W represents the multidimensional financial behavior features contained in each time step, such as transaction amount, transaction method, account type, device fingerprint, and operation location. It contains two residual blocks and a pooling layer. Each residual block contains two convolutional layers with three convolution kernel sizes of 1×1, 3×3, and 1×1, respectively. Each convolution layer is followed by batch normalization and the nonlinear activation function ReLU. The pooling layer uses a 2×2 maximum pooling operation, and the output size is H / 2×W / 2. That is, while maintaining the semantic expressiveness of the features, the original feature map is compressed by introducing a spatial downsampling mechanism. The first residual block in the Convolutional Layer 2_x module uses a 3×3 convolution operation with a stride of 2 to achieve simultaneous downsampling of the input feature map in both the temporal and feature dimensions.
[0066] The input of the convolutional layer 3_x is a two-dimensional feature map of H / 2×W / 2, which includes two residual blocks and one pooling layer connected in sequence. Each residual block contains two 3×3 convolutional layers and an identity mapping structure, which ensures the semantic coherence of the features while achieving in-depth extraction and expression of local features. Each residual block is followed by Batch Normalization and ReLU activation function to improve the stability and nonlinear expression ability of the training process. After the residual module, the pooling layer preferably uses a Max Pooling operation with a stride of 2 to further compress the spatial dimension of the feature map and enhance the model's perception of local extreme value anomalies. With this structure, the output feature map size of the convolutional layer 3_x module is H / 4×W / 4;
[0067] The input of the convolutional layer 4_x is H / 4×W / 4, which includes two residual blocks and one pooling layer connected in sequence. Each residual block still uses a dual 3×3 convolution structure and is skipped through identity mapping or channel-aligned 1×1 convolution to ensure the integrity of feature transfer and information fidelity. After the two residual blocks, the pooling layer uses a maximum pooling operation with a stride of 2 to achieve further downsampling of the feature map, and the output size is H / 8×W / 8;
[0068] The convolutional layer 5_x takes an input feature map of size H / 8 × W / 8 and consists of two sequentially connected residual blocks and a pooling layer. The residual blocks still use a standard dual 3×3 convolutional structure, with ReLU nonlinear activations and batch normalization introduced between the convolutions to enhance the nonlinear expressiveness and training stability of the deep network. The skip connections can choose between identity mapping or 1×1 convolution to match the channel dimensions, depending on whether the number of input and output channels matches. The pooling layer continues to use max pooling with a stride of 2, with an output size of H / 16 × W / 16.
[0069] After performing global average pooling on the feature maps output by the convolutional layer 5_x, a full connection operation is performed in the fully connected layer to convert the output feature map into a one-dimensional vector. Finally, a Softmax operation is performed on the one-dimensional vector, and a full connection operation is performed again in the fully connected layer to generate model performance indicators.
[0070] During the training process, the cross-entropy loss function is used to measure the difference between the model prediction result and the true label. Assume that the true label is , the probability distribution predicted by the model is , then the loss function is:
[0071] ;
[0072] in, For the The true labels of the categories, The model predicts The probability of each category. The loss function is calculated by the backpropagation algorithm Backpropagation Model parameters The gradient of , and use the gradient descent method to update the model parameters. The specific steps are as follows:
[0073] Calculate gradients: Calculate loss function using the chain rule Model parameters Gradient:
[0074] ;
[0075] in, Represents the loss function for parameters gradient.
[0076] Parameter update: Update model parameters using gradient descent ;
[0077] ;
[0078] in, is the learning rate, which controls the step size of parameter updates.
[0079] S3. Encrypt the locally updated local base model weight parameters by combining a symmetric encryption algorithm with an asymmetric encryption algorithm, and send the encrypted local base model weight parameters to the central node for secure aggregation.
[0080] Furthermore, this application S3 includes:
[0081] Use the AES symmetric encryption algorithm to encrypt the weight parameters of the locally updated base model, and use the RSA asymmetric encryption algorithm to encrypt the AES key used;
[0082] The encrypted weight of the updated base model and the encrypted symmetric key are sent to the central node together. After receiving the encrypted data, the central node uses the private key to decrypt the symmetric key, and then uses the decrypted symmetric key to decrypt the weight parameters of the base model.
[0083] Specifically, as Figure 4 shown, the mechanism of using the hybrid encryption algorithm RSA+AES to protect the transmission of model parameters takes into account both privacy security and computational efficiency. The local node generates model update parameters , and encrypts the model update parameters by combining the symmetric encryption algorithm and the asymmetric encryption algorithm. The specific steps are as follows: First, symmetric encryption: Use the AES symmetric encryption algorithm to encrypt the model update parameters , generating the encrypted parameters . The AES encryption method is as follows:
[0084] ;
[0085] Among them, is the plaintext, is the ciphertext, is the encryption function, is the key.
[0086] Secondly, asymmetric encryption: Use the RSA asymmetric encryption algorithm to encrypt the symmetric key , generating the encrypted key . Regarding how to calculate the RSA key, first, select two large prime numbers p and q, and p and q are usually 1024 bits;
[0087] Calculate n = p×q and z = (p-1)×(q-1); Select a number d that is prime to z; Find an e such that e×d = 1 (modz); The public key is (e, n), and the private key is (d, n).
[0088] The RSA encryption method is as follows:
[0089] ;
[0090] Among them, P represents the plaintext block obtained by dividing the plaintext into k-bit segments, where k is the largest integer satisfying 2×k<n, C represents the ciphertext block obtained by encryption, and n represents the value of the Euler totient function.
[0091] Finally, data transmission: update the parameters of the encrypted model and the encrypted symmetric key Send to the central node.
[0092] S4 is used to decrypt the encrypted base model update weights from each local node using the private key held by the central node. The decrypted update weights will be used to calculate the update parameters of the global model. The symmetric encryption algorithm is combined with the asymmetric encryption algorithm to re-encrypt the global model and return it to the local node. The local node decrypts the global model and compares it with the local model accuracy to perform parameter updates.
[0093] Furthermore, the present application S4 includes:
[0094] The central node decrypts the encrypted base model update weights from the multiple local nodes using the private key held by the central node to decrypt the encrypted base model update weights from each local node;
[0095] The decrypted update weights are used to calculate the update parameters of the global model. The decrypted base model update weights are weighted averaged using federated averaging to generate the global model update weights.
[0096] Encrypt the global model parameters using a new AES symmetric key, which is encrypted using the target node's RSA public key.
[0097] Return the encrypted global model parameters and key ciphertext to the corresponding local node;
[0098] Use the RSA private key held by the local node to decrypt the encrypted symmetric key, use the decrypted symmetric key to decrypt the encrypted global model update parameters, and load the decrypted global model parameters into the local system;
[0099] The local node fuses the decrypted global model parameters with the current local base model parameters to generate a new local base model;
[0100] The local node evaluates the accuracy of the fused base model on the local data. If the accuracy of the global model is better than that of the local base model, the local node accepts the global model update and replaces the local base model.
[0101] If the accuracy of the global model is not as good as that of the local base model, the local node will refuse to update and retain the existing local base model, while recording the reason for the update rejection.
[0102] Specifically, if Figure 5 As shown, the central node receives the encrypted model update parameters and the encrypted symmetric key , decrypt the symmetric key using its private key , and then use the decrypted symmetric key to decrypt the model update parameters The decryption process is as follows: The central node uses the RSA private key to decrypt the symmetric key , obtaining :
[0103] ;
[0104] where is the plaintext, is the ciphertext, is the decryption function, is the key.
[0105] Regarding how to calculate the RSA key, two large prime numbers p and q (usually 1024 bits) need to be selected; calculate n = p×q and z = (p - 1)×(q - 1); select a number d that is prime to z; find an e such that e×d = 1 (mod z); the public key is (e, n), and the private key is (d, n). The RSA decryption method is as follows:
[0106] ;
[0107] where P represents the plaintext block obtained by dividing the plaintext into k-bit segments, where k is the largest integer satisfying 2×k < n. C represents the ciphertext block obtained by encryption, and n represents the value of the Euler totient function.
[0108] Then, use the symmetric key to decrypt the model update parameters, obtaining ;
[0109] ;
[0110] where represents the plaintext, represents the ciphertext, is the decryption function, is the key.
[0111] Then, for secure aggregation, the central node uses the Federated Averaging algorithm to perform weighted averaging on the model update parameters from multiple local nodes to generate the global model update parameters :
[0112] ;
[0113] where N is the number of local nodes participating in the aggregation.
[0114] The central node uses the AES symmetric encryption algorithm to update the parameters of the global model The encrypted data is encrypted and the symmetric key is encrypted using the RSA asymmetric encryption algorithm. The encrypted global model update parameters and the encrypted symmetric key are returned to the local node. After receiving the encrypted data, the local node first uses its private key to decrypt the symmetric key, and then uses the decrypted symmetric key to decrypt the global model update parameters. The specific steps are as follows:
[0115] First, the decryption process: the local node uses the RSA private key Decrypt the symmetric key:
[0116] ;
[0117] in, For plain text, is the ciphertext, is the decryption function, is the key.
[0118] Then, using the symmetric key Decrypt the global model update parameters:
[0119] ;
[0120] in, Indicates plain text, Represents ciphertext, represents the decryption function, is the key.
[0121] Third, model fusion: local nodes update the parameters of the global model The global model is then fused with the local model and the accuracy of the fused model is evaluated. If the global model is more accurate than the local model, the update is accepted and the local model is replaced; otherwise, the local model is retained and the reason for the update rejection is recorded.
[0122] S5. Repeat the S2-S4 process until the performance indicators of the global model tend to be stable and meet the preset convergence conditions.
[0123] Furthermore, S5 of this application includes:
[0124] S5-1. After receiving each global model update, the local node re-uses local data to train the global model, generates new local model update parameters, and sends them to the central node via encrypted transmission. The local data includes the original data and the augmented simulated data.
[0125] S5-2, the central node performs security aggregation again, calculates the new global model update parameters and returns them to the local node;
[0126] S5-3. The central node executes the secure aggregation algorithm to calculate the global model update parameters and transmits the updated global model weights back to each local node through an encryption mechanism for use in the next round of local training.
[0127] S5-4, repeatedly execute the S2-S4 process cycle iteration until the performance indicators of the global model tend to be stable and meet the preset convergence conditions.
[0128] Specifically, if Figure 6 The following diagram illustrates the federated learning architecture workflow, enabling cross-institutional collaborative detection through global coordination and dual privacy protection. The resulting global model is used to detect financial anomalies. Local nodes, as data holders, retrain the model using local data (including original data and augmented simulated data) after each global model update, performing local computations and generating new model update parameters. These parameters are then sent to the central node on the central server via encrypted transmission for centralized aggregation. The central node then performs secure aggregation again, calculating new global model update parameters and returning them to the local nodes. This process iterates until the global model's performance indicators stabilize and meet the pre-defined convergence criteria. Once the global model converges, the resulting global model can be used to detect financial anomalies. Specific application scenarios include, but are not limited to, fraudulent transaction detection and account theft warnings.
[0129] Furthermore, in S5-2 of the present application, the central node performs security aggregation again, calculates new global model update parameters and returns them to the local node, and further includes:
[0130] The central node securely aggregates the encrypted model update parameters returned by multiple local nodes in each iteration and calculates the new global model update parameters. ;
[0131] =SecureAgg ;
[0132] in, is the model update generated by the i-th local node in the t-th round of training, For encryption operations, For decryption operation, is the set of local nodes participating in the aggregation, SecureAgg A secure aggregation algorithm executed by the central node to weight the decrypted model updates. The aggregated global model parameters will be synchronized back to the shared model of each local node in the new round;
[0133] The local node updates the global model parameters after receiving the global model parameters returned by the central node. Then, update the parameters With the current parameters of the local model Perform fusion to generate a new round of local model parameters , the fusion process algorithm is:
[0134] = × + ;
[0135] in, For the local node The model parameters of the wheel, is returned by the central node Wheel global model parameters, is the fusion coefficient;
[0136] The fusion coefficient is used to control the degree of acceptance of the local model to the global parameters and is dynamically adjusted according to the model accuracy;
[0137] The local node will perform an evaluation after fusion. If the fusion model is more accurate than the original model, the update will be accepted. Otherwise, the original model will be retained and the reason for rejection will be recorded.
[0138] The implementation method of the present invention has been described in detail above. By building a privacy-preserving financial anomaly detection method based on federated learning, the present invention can, on the one hand, assist multiple parties in jointly learning an accurate and universal financial anomaly detection model without having to publicly disclose or share their local user datasets. On the other hand, by leveraging the prior knowledge of a pre-trained base model, it can automatically and unsupervisedly learn patterns among financial anomaly data, effectively improving training efficiency. Furthermore, a dual encryption mechanism combining symmetric and asymmetric encryption algorithms ensures the security of data transmission and storage.
[0139] In Example 2, based on the same inventive concept as the method for detecting financial abnormal behavior based on privacy protection of federated learning in Example 1, this application also provides a system for detecting financial abnormal behavior based on privacy protection of federated learning. Figure 7 The financial abnormal behavior detection system based on federated learning privacy protection includes:
[0140] A candidate sample acquisition module 11 is used to collect local financial data, construct a public data generator based on a base model, and generate pseudo samples similar to local abnormal data by adjusting prompt text, and use the pseudo samples as candidate samples;
[0141] A local model parameter update module 12 is used to merge the candidate samples with the original data, and the local node uses a convolutional neural network to perform local training on the merged data, calculate the performance indicators of the base model in real time, and optimize the parameters according to the performance indicators. After the training is completed, the updated parameters of the local base model are output;
[0142] A local model update parameter encryption module 13 is used to encrypt the locally updated local base model weight parameters using a combination of a symmetric encryption algorithm and an asymmetric encryption algorithm, and send the encrypted local base model update to the central node for secure aggregation;
[0143] A local node parameter update module 14 is used to decrypt the encrypted base model update weights from each local node using the private key held by the central node. The decrypted update weights are used to calculate the update parameters of the global model. The global model is re-encrypted using a combination of symmetric and asymmetric encryption algorithms and returned to the local node. The local node decrypts the global model, compares it with the local model accuracy, and performs parameter updates.
[0144] The loop iteration module 15 is used to repeatedly execute the loop iteration of the local model parameter update module 12 - the local model parameter update encryption module 13 - the local node parameter update module 14 until the performance index of the global model tends to be stable and meets the preset convergence conditions.
[0145] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. Figure 1 The financial abnormal behavior detection method based on federated learning privacy protection and the specific examples of the embodiment are also applicable to the financial abnormal behavior detection system based on federated learning privacy protection in this embodiment. Through the above detailed description of the financial abnormal behavior detection method based on federated learning privacy protection, those skilled in the art can clearly understand the financial abnormal behavior detection system based on federated learning privacy protection in this embodiment, so for the sake of brevity of the specification, it will not be described in detail here.
[0146] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
[0147] Obviously, for those skilled in the art, several improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A method for detecting financial abnormal behavior based on federated learning privacy protection, characterized in that: The method comprises: S1. Collect local financial data, construct a public data generator based on the base model, and generate pseudo samples similar to local abnormal data by adjusting the prompt text. The pseudo samples are used as candidate samples. S2. Merge the candidate sample with the original data. The local node uses a convolutional neural network to perform local training on the merged data, calculates the loss of the base model in real time, and optimizes the parameters based on the loss. After the training is completed, the updated parameters of the local base model are output; S3. Encrypt the locally updated local base model weight parameters using a combination of a symmetric encryption algorithm and an asymmetric encryption algorithm, and send the encrypted local base model weight parameters to the central node for secure aggregation; S4. Decrypt the encrypted local base model weight parameters from each local node using the private key held by the central node. The decrypted local base model weight parameters will be used to calculate the updated parameters of the global model. The global model is re-encrypted using a combination of symmetric and asymmetric encryption algorithms and returned to the local node. The local node decrypts the global model and compares it with the local model accuracy to perform parameter updates. S5, repeatedly executing S2-S4 process loop iteration until the performance index of the global model tends to be stable and meets the preset convergence conditions, wherein, The central node securely aggregates the encrypted model update parameters returned by multiple local nodes in each iteration and calculates the new global model update parameters. ; =SecureAgg ; in, is the model update generated by the i-th local node in the t-th round of training, For encryption operations, For decryption operation, is the set of local nodes participating in the aggregation, SecureAgg A secure aggregation algorithm executed by the central node to weight the decrypted model updates. The aggregated global model update parameters will be synchronized back to each local node as the global model update parameters in a new round; The local node updates the global model parameters after receiving the global model parameters returned by the central node. Then, the global model update parameters With the current parameters of the local model Perform fusion to generate a new round of local model parameters , the fusion process algorithm is: = × + ; in, For the local node The model parameters of the wheel, is returned by the central node Round global model update parameters, is the fusion coefficient; The fusion coefficient controls the degree of acceptance of the local model to the global model update parameters and is dynamically adjusted according to the accuracy of the local model; The local node will perform an evaluation after fusion. If the accuracy of the fused model is better than the original model, the update will be accepted. Otherwise, the original model will be retained and the reason for rejection will be recorded.
2. A method for detecting financial abnormal behavior based on privacy protection through federated learning as claimed in claim 1, characterized in that: The method of collecting local financial data, constructing a public data generator based on a base model, and generating pseudo samples close to local abnormal data by adjusting prompt text, and using the pseudo samples as candidate samples, includes: Participants connect to their core financial systems through standardized API interfaces to collect and structure local financial transaction behavior data in real time. The data is unified into a cross-domain time-series structured format. Design prompt templates and uniform prompt text for different types of financial data to induce the public data generator based on the base model to learn the characteristics of financial time series structured data and generate abnormal behavior samples. The public data generator of the base model uses the publicly available large-scale pre-trained language model DeepSeekLLM. The collected local abnormal behavior samples are formed into a candidate sample set, and the prompt template is used as input to call the public data generator of the base model to generate a large number of pseudo samples with similar features to the candidate samples, thereby constructing a public abnormal behavior dataset that does not contain real user data.
3. The method for detecting financial abnormal behavior based on privacy protection through federated learning according to claim 1, characterized in that: The candidate samples are merged with the original data, and the local node uses a convolutional neural network to perform local training on the merged data, calculates the loss of the base model in real time, and optimizes the parameters according to the loss. After the training is completed, the updated parameters of the local base model are output, including: Merge the abnormal data of the candidate samples with the original financial data, and use the convolutional neural network (CNN) to perform local training on the merged data; During the training of the local base model, a convolutional neural network (CNN) is used as the basic structure. The CNN network includes multiple convolutional layers, pooling layers, and fully connected layers to automatically extract local and global features from financial behavior data. The base model parameters are continuously optimized through the back-propagation algorithm. During the training process, the performance indicators of the base model are monitored in real time, and the learning rate and network structure are dynamically adjusted based on the indicator results to optimize the base model. The performance indicators include loss function, accuracy, and AUC; After the training is completed, the weight parameters of the local base model are output as the local base model update result to participate in the subsequent global model aggregation.
4. The method for detecting financial abnormal behavior based on privacy protection through federated learning according to claim 1, wherein: The method of encrypting the locally updated local base model weight parameters by combining a symmetric encryption algorithm with an asymmetric encryption algorithm, and sending the encrypted local base model weight parameters to the central node for secure aggregation includes: Use the AES symmetric encryption algorithm to encrypt the locally updated base model weight parameters, and use the RSA asymmetric encryption algorithm to encrypt the AES key used; The encrypted base model update weight and the encrypted symmetric key are sent to the central node together. After receiving the encrypted data, the central node uses the private key to decrypt the symmetric key, and then uses the decrypted symmetric key to decrypt the base model weight parameters.
5. The method for detecting financial abnormal behavior based on privacy protection through federated learning according to claim 1, wherein: The encrypted local base model weight parameters from each local node are decrypted using the private key held by the central node. The decrypted local base model weight parameters are used to calculate the updated parameters of the global model. The global model is re-encrypted using a combination of a symmetric encryption algorithm and an asymmetric encryption algorithm and returned to the local node. The local node decrypts the global model and compares it with the local model accuracy to perform parameter updates, including: The central node decrypts the encrypted local base model weight parameters from the multiple local nodes, and decrypts the encrypted local base model weight parameters from each local node using a private key held by the central node; The decrypted local base model weight parameters are used to calculate the update parameters of the global model. The decrypted local base model weight parameters are weighted averaged using federated averaging to generate the global model update weights. Encrypt the global model update weights using a new AES symmetric key, which is encrypted using the target node's RSA public key. Return the encrypted global model update weights and key ciphertext to the corresponding local node; Use the RSA private key held by the local node to decrypt the encrypted symmetric key, use the decrypted symmetric key to decrypt the encrypted global model update weights, and load the decrypted global model parameters into the local system; The local node fuses the decrypted global model parameters with the current local base model parameters to generate a new local base model; The local node evaluates the accuracy of the fused new local base model on the local data. If the accuracy of the global model is better than the new local base model, the local node accepts the global model update and replaces the new local base model. If the accuracy of the global model is not as good as that of the local base model, the local node will refuse to update and retain the existing local base model, while recording the reason for the update rejection.
6. The method for detecting financial abnormal behavior based on privacy protection through federated learning according to claim 1, characterized in that: The steps S2-S4 are iterated repeatedly until the performance indicators of the global model tend to be stable and meet the preset convergence conditions, including: After receiving the global model update each time, the local node re-uses the local data to train the global model, generates new local model update parameters, and sends them to the central node via encrypted transmission. The local data includes the original data and the augmented simulated data. The central node executes the secure aggregation algorithm again to calculate the global model update parameters, and transmits the updated global model update parameters back to each local node through an encrypted mechanism for use in the next round of local training; The S2-S4 process is iterated repeatedly until the performance indicators of the global model tend to be stable and meet the preset convergence conditions.
7. A financial abnormal behavior detection system based on federated learning privacy protection, characterized by: The system is applied to the financial abnormal behavior detection based on federated learning privacy protection as described in claim 1, and the system includes: A candidate sample acquisition module, which is used to collect local financial data, construct a public data generator based on the base model, and generate pseudo samples similar to local abnormal data by adjusting the prompt text, and use the pseudo samples as candidate samples; A local model parameter update module is used to merge the candidate samples with the original data. The local node uses a convolutional neural network to perform local training on the merged data, calculate the loss of the base model in real time, and optimize the parameters based on the loss. After the training is completed, the updated parameters of the local base model are output; A local model update parameter encryption module, which is used to encrypt the locally updated local base model weight parameters using a combination of a symmetric encryption algorithm and an asymmetric encryption algorithm, and send the encrypted local base model weight parameters to the central node for secure aggregation; A local node parameter update module uses the private key held by the central node to decrypt the encrypted local base model weight parameters from each local node. The decrypted local base model weight parameters are used to calculate the updated parameters of the global model. The global model is re-encrypted using a combination of symmetric and asymmetric encryption algorithms and returned to the local node. The local node decrypts the global model and compares it with the local model accuracy to perform parameter updates. A loop iteration module is used to repeatedly execute the local model parameter update module-local node parameter update module process loop iteration until the performance indicators of the global model tend to be stable and meet the preset convergence conditions, wherein: The central node securely aggregates the encrypted model update parameters returned by multiple local nodes in each iteration and calculates the new global model update parameters. ; =SecureAgg ; in, is the model update generated by the i-th local node in the t-th round of training, For encryption operations, For decryption operation, is the set of local nodes participating in the aggregation, SecureAgg A secure aggregation algorithm executed by the central node to weight the decrypted model updates. The aggregated global model update parameters will be synchronized back to each local node as the global model update parameters in a new round; The local node updates the global model parameters after receiving the global model parameters returned by the central node. Then, the global model update parameters With the current parameters of the local model Perform fusion to generate a new round of local model parameters , the fusion process algorithm is: = × + ; in, For the local node The model parameters of the wheel, is returned by the central node Round global model update parameters, is the fusion coefficient; The fusion coefficient controls the degree of acceptance of the local model to the global model update parameters and is dynamically adjusted according to the accuracy of the local model; The local node will perform an evaluation after fusion. If the accuracy of the fused model is better than the original model, the update will be accepted. Otherwise, the original model will be retained and the reason for rejection will be recorded.
Citation Information
Patent Citations
Federal learning financial sensitive data identification and processing system
CN117874597A
Abnormal financial account detection method and device based on federated learning privacy protection
CN117592096A
Supply chain financial credit risk assessment method and system based on federated learning and privacy protection, and storage medium
CN118864087A