Federal learning method, system and device based on prototype and storage medium

By transmitting and aggregating prototypes in federated learning and integrating data features with different distributions, the poor model reasoning caused by data heterogeneity in financial intelligent marketing is solved, and the prediction accuracy and performance of federated models are improved.

CN119129779APending Publication Date: 2024-12-13PING AN TECH (SHENZHEN) CO LTD

Patent Information

Application Number
CN202411293242.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In financial intelligent marketing, due to the large differences in storage devices and degree of dispersion of financial institutions' customer data, the data distribution is non-independent and homogeneous, and the basic assumptions of standard machine learning algorithms cannot meet the model inference performance, resulting in poor model inference performance, and federal model prediction Low accuracy.

Method used

In the last round of iterations of federated learning, the client not only transmits model parameters, but also transmits locally calculated prototypes to the server for prototype aggregation. The server updates parameters and prototypes based on the aggregated model and prototype, and the client is based on local prototypes and global models. The distance is predicted, and the data characteristics of different distributions are integrated through the prototype of the characteristic space to reduce the negative impact of data heterogeneity.

Benefits of technology

It effectively improves the model inference performance on heterogeneous data sets, improves the federal model prediction accuracy in financial intelligent marketing, reduces communication overhead, and enhances the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129779A_ABST
    Figure CN119129779A_ABST
Patent Text Reader

Abstract

The invention discloses a federal learning method, system and device based on a prototype and a storage medium, in the iteration process of the last round, a client transmits model parameters to train a target model, the prototype of the client is transmitted to a server, the server carries out model aggregation and prototype aggregation, and the target model is obtained. Finally, prediction is carried out based on the distance between a local prototype and a global model, on a heterogeneous data set, a prototype which is aggregated as a feature space can effectively integrate feature expressions from data of different distributions, the negative influence of data heterogeneity is reduced, the model reasoning performance is improved under the condition of data heterogeneity of different clients, and the model reasoning efficiency is improved. The technical problems that due to the fact that client data of financial institutions often have large differences in the aspects of storage devices, dispersion degrees and the like, data distribution is not independent and identical due to the differences, the basic assumption of a standard machine learning algorithm cannot be met, the model reasoning performance is poor, and the federation model prediction accuracy is low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a prototype-based federated learning method, system, device and storage medium. Background Art

[0002] Federated learning (FL) is a privacy-preserving machine learning (ML) based on data sets distributed on multiple computing nodes. With the continuous development of artificial intelligence, the concept of FL has been further developed and improved. The basic characteristics of federated learning are: the data of each participant is stored locally, local privacy data will not be leaked, and the data is "available but invisible". As a promising machine learning paradigm, FL has gradually been applied to various fields, among which the application in the financial field involves multiple scenarios, including intelligent marketing, joint risk control, anti-fraud identification, etc.

[0003] As an important application scenario of federated learning, financial intelligent marketing can optimize decision-making models and improve the accuracy and efficiency of marketing strategies by combining local data from different financial institutions, expanding sample size and improving data labels while protecting user privacy.

[0004] In the application of financial intelligent marketing, one of the main challenges faced by federated learning is data heterogeneity. Customer data of financial institutions often have large differences in storage devices, degree of dispersion, etc. These differences lead to non-independent and identically distributed (Non-IID) data distribution, which cannot meet the basic assumptions of standard machine learning algorithms, resulting in poor performance of model reasoning and technical problems that cannot achieve the ideal prediction accuracy of federated models. Summary of the invention

[0005] The present application provides a prototype-based federated learning method, system, device and storage medium to solve the technical problem that in the application of financial intelligent marketing, since the customer data of financial institutions often have large differences in storage devices, degree of dispersion, etc., these differences lead to non-independent and identically distributed data distribution, which cannot meet the basic assumptions of standard machine learning algorithms, resulting in poor model reasoning performance and low prediction accuracy of the federated model.

[0006] In view of this, the first aspect of the present application provides a prototype-based federated learning method, the method comprising:

[0007] In the last round of iterations, several clients transmit the first model parameters of the local target model to the server for model aggregation based on the federated learning algorithm, and at the same time, several of the clients transmit the first prototype calculated locally to the server for prototype aggregation;

[0008] After calculating new second model parameters and second prototype according to the aggregated models and prototypes, the server sends the new second model parameters and second prototype to several clients respectively, and each client performs model inference according to the second model parameters and the second prototype.

[0009] Optionally, it also includes:

[0010] In an iteration other than the last round, a plurality of clients train the target model locally and upload the trained third model parameters to the server;

[0011] The server aggregates the third model parameters uploaded by each of the clients, performs global iteration, and distributes updated fourth model parameters to each of the clients respectively.

[0012] Optionally, the target model includes a feature extraction layer and a decision layer;

[0013] The target model processes input data through the feature extraction layer to generate a feature vector;

[0014] The decision layer of the target model takes the feature vector as input to generate a decision result.

[0015] Optionally, the first prototype calculated locally by the client is specifically:

[0016] The client processes all input data of the target category through the local feature extraction layer of the target model to obtain a feature vector corresponding to the input data;

[0017] An average value of the feature vectors corresponding to all the input data of the target category is calculated to obtain a first prototype of the client corresponding to the target category.

[0018] Optionally, a global category prototype of the target category is obtained by calculating an average value of the first prototypes of all the clients in the target category;

[0019] The global category prototypes of all categories are packaged into a set to form a second prototype.

[0020] Optionally, the client performs model reasoning according to the second model parameter and the second prototype as follows:

[0021] The client updates the parameters of the local target model according to the second model parameters;

[0022] The client obtains a predicted label value by measuring the distance between the target model after parameter update and each of the global category prototypes in the second prototype.

[0023] Optionally, the client obtains the predicted label value by measuring the distance between the target model after parameter update and each of the global category prototypes in the second prototype, specifically including:

[0024] The client passes the new input data through the feature extraction layer to obtain a feature vector;

[0025] The client calculates the Euclidean distances between the feature vector and each of the global category prototypes in the second prototype, and identifies the category corresponding to the global category prototype having the smallest Euclidean distance as the predicted label value.

[0026] The second aspect of the present application provides a prototype-based federated learning system, the system comprising a plurality of clients and a server, wherein the plurality of clients are respectively connected to the server, wherein:

[0027] In the last round of iterations, several of the clients transmit the first model parameters of the local target model to the server for model aggregation based on the federated learning algorithm, and at the same time, several of the clients transmit the first prototype calculated locally to the server for prototype aggregation;

[0028] After calculating new second model parameters and second prototype according to the aggregated models and prototypes, the server sends the new second model parameters and second prototype to several clients respectively, and each client performs model inference according to the second model parameters and the second prototype.

[0029] Optionally, it also includes:

[0030] In an iteration other than the last round, a plurality of clients train the target model locally and upload the trained third model parameters to the server;

[0031] The server aggregates the third model parameters uploaded by each of the clients, performs global iteration, and distributes updated fourth model parameters to each of the clients respectively.

[0032] Optionally, the target model includes a feature extraction layer and a decision layer;

[0033] The target model processes input data through the feature extraction layer to generate a feature vector;

[0034] The decision layer of the target model takes the feature vector as input to generate a decision result.

[0035] Optionally, the first prototype calculated locally by the client is specifically:

[0036] The client processes all input data of the target category through the local feature extraction layer of the target model to obtain a feature vector corresponding to the input data;

[0037] An average value of the feature vectors corresponding to all the input data of the target category is calculated to obtain a first prototype of the client corresponding to the target category.

[0038] Optionally, the server performs prototype aggregation specifically as follows:

[0039] Obtaining a global category prototype of the target category by calculating an average value of the first prototypes of all the clients in the target category;

[0040] The global category prototypes of all categories are packaged into a set to form a second prototype.

[0041] Optionally, the client performs model reasoning according to the second model parameter and the second prototype as follows:

[0042] The client updates the parameters of the local target model according to the second model parameters;

[0043] The client obtains a predicted label value by measuring the distance between the target model after parameter update and each of the global category prototypes in the second prototype.

[0044] Optionally, the client obtains the predicted label value by measuring the distance between the target model after parameter update and each of the global category prototypes in the second prototype, specifically including:

[0045] The client passes the new input data through the feature extraction layer to obtain a feature vector;

[0046] The client calculates the Euclidean distances between the feature vector and each of the global category prototypes in the second prototype, and uses the category corresponding to the global category prototype with the smallest Euclidean distance as the predicted label value.

[0047] A third aspect of the present application provides a prototype-based federated learning device, the device comprising a processor and a memory:

[0048] The memory is used to store program code and transmit the program code to the processor;

[0049] The processor is used to execute the steps of the prototype-based federated learning method as described in the first aspect according to the instructions in the program code.

[0050] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method described in the first aspect above.

[0051] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0052] In the present application, a prototype-based federated learning method, system, device and storage medium are provided. In the last round of iteration, the client not only transmits model parameters to train the target model, but also transmits the prototype of the client to the server, which performs model aggregation and prototype aggregation, and finally makes predictions based on the distance between the local prototype and the global model. On heterogeneous data sets, aggregation as a prototype of the feature space can effectively integrate feature expressions from data with different distributions, reduce the negative impact of data heterogeneity, and improve model reasoning performance in the case of heterogeneous data from different clients. This solves the problem that in the application of financial intelligent marketing, since the customer data of financial institutions often have large differences in storage devices, degree of dispersion, etc., these differences lead to non-independent and identically distributed data distribution, which cannot meet the basic assumptions of standard machine learning algorithms, resulting in poor model reasoning performance and low prediction accuracy of the federated model. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A method flow chart of a prototype-based federated learning method in an embodiment of the present application;

[0054] Figure 2 It is a structural diagram of a prototype-based federated learning system in an embodiment of the present application;

[0055] Figure 3 Schematic diagram of the structure of the prototype-based federated learning device in the embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0057] With the rapid development of artificial intelligence technology, machine learning is increasingly used in various fields. However, traditional centralized machine learning models face problems such as data privacy and security. In order to address these challenges, federated learning has emerged as an emerging distributed machine learning paradigm. Federated learning allows multiple participants to collaborate on training models without sharing original data, effectively protecting data privacy.

[0058] Although federated learning has made significant progress in protecting privacy, it still has some limitations. For example, the performance of traditional federated learning algorithms may be affected when processing non-independent and identically distributed (Non-IID) data. In addition, the communication overhead in the model aggregation process is also an issue that needs to be addressed.

[0059] Consider a typical scenario: multiple financial institutions want to work together to develop an intelligent marketing model, but due to user privacy protection requirements, they cannot directly share original customer marketing data. At the same time, the data distribution of different institutions may be different, which brings challenges to the training and generalization of the model. In this case, how to effectively utilize the data scattered across various institutions while protecting privacy and improve the performance of the model on non-independent and identically distributed data has become a technical problem that needs to be solved urgently.

[0060] This application designs a prototype-based federated learning method, system, device and storage medium to solve the technical problem that in the application of financial intelligent marketing, the customer data of financial institutions often have large differences in storage devices, degree of dispersion, etc. These differences lead to non-independent and identically distributed data distribution, which cannot meet the basic assumptions of standard machine learning algorithms, resulting in poor model reasoning performance and low prediction accuracy of the federated model.

[0061] For easier understanding, see Figure 1 , Figure 1 This is a flow chart of the prototype-based federated learning method in the embodiment of the present application, such as Figure 1 As shown, specifically:

[0062] S101. In the last round of iterations, several clients transmit the first model parameters of the local target model to the server for model aggregation based on the federated learning algorithm, and at the same time, several clients transmit the first prototype calculated locally to the server for prototype aggregation;

[0063] It should be noted that in machine learning, prototype refers to the average value of individuals or categories obtained by clustering or segmenting data and calculating the center value of each cluster or segment. Therefore, the prototype is essentially the average value of multiple features. This concept has been explored in various tasks. For example, in image classification, the prototype can be a proxy for the class and calculate the mean of the feature vector in each class.

[0064] In the embodiment of the present application, the prototype is represented as a category, and prototype aggregation is applied to heterogeneous FL. The predictions made by the classifier in federated learning often have high bias.

[0065] The original federated learning framework (PFMF, Prototype Federated Marketing Framework) makes predictions through the previous layer of the classifier. The output of this layer is the feature space of the class, and the average value of the feature space in the same class space is defined as the prototype of the class.

[0066] Therefore, the original federated learning framework based on prototype aggregation can improve the performance of model reasoning and improve the accuracy of model prediction in the case of heterogeneous clients, while achieving higher communication efficiency.

[0067] The specific contents of the original federated learning framework are as follows:

[0068] Assume that in a distributed edge network, there exists a client set S with a private dataset D of size D. i ={(x i ,y i )}, where x i represents the feature vector of the i-th client, and yi represents the sample label.

[0069] In the traditional FL framework, the client and server jointly train the federated model F(α; x i ), where α is the model parameter of the global model, x i Represents the feature vector of the i-th client.

[0070] The goal is to minimize the loss of clients in a heterogeneous environment, namely:

[0071]

[0072] Among them, yi represents the sample label and Li can be expressed as cross-entropy loss.

[0073] Assume that N rounds of global iterations are performed between the client and the server. In the Nth round of global iterations, the client not only transmits the model parameters, but also transmits their prototypes to the server to perform model aggregation and prototype aggregation, and finally makes predictions based on the distance between the local prototype and the global prototype.

[0074] The server collects the first model parameters and the first prototype sent by all clients, and performs model aggregation and prototype aggregation, wherein:

[0075] Model aggregation is to update the global model by averaging the model parameters of all clients;

[0076] Prototype aggregation is to obtain the global category prototype by calculating the average value of the corresponding category prototypes of all clients.

[0077] Furthermore, the target model includes a feature extraction layer and a decision layer;

[0078] The target model processes the input data through the feature extraction layer to generate a feature vector;

[0079] The decision layer of the target model takes the feature vector as input and generates a decision result.

[0080] It should be noted that the deep learning model consists of two parts: feature extraction layer and decision layer.

[0081] The feature extraction layer is denoted as f e (α e ; x), the decision layer is represented by f d (α d ; y), so the federation model can be expressed as F(α; x) = f d (f e (α e ; x),y), which means that the output of the feature extraction layer serves as the input of the decision layer.

[0082] In the feature extraction layer, α eRepresents the parameters of the feature extraction layer, which will be optimized during the training process. x is the input data of the model, which can be any data type that needs to be processed, such as images, text, audio, etc. The feature extraction layer is responsible for extracting useful features from the input data. These features can capture the key information of the data and provide input for the decision layer. Finally, the feature extraction layer outputs a feature vector, which is a representation of the input data in the feature space, usually with lower dimensions and higher levels of abstraction. The feature extraction layer can adopt a variety of deep learning architectures, such as convolutional neural network (CNN), recurrent neural network (RNN) or transformer, etc. The specific choice depends on the type of data and the nature of the task. For example, for image classification tasks, classic CNN architectures such as ResNet or VGG can be used as feature extraction layers; for natural language processing tasks, pre-trained models such as BERT or GPT can be selected as the basis of the feature extraction layer. The main goal of the feature extraction layer is to map the high-dimensional raw input data to a low-dimensional feature space, which should be able to effectively capture the essential characteristics and discriminative information of the data.

[0083] In the decision-making layer, α d represents the parameters of the decision layer, which will also be optimized during the training process. y is the output of the feature extraction layer, that is, the feature vector. The decision layer is responsible for making the final decision based on the input provided by the feature extraction layer. In classification tasks, this usually involves determining to which category the input data belongs. Finally, the decision layer outputs the final prediction result, for example, in classification tasks, this may be a class label or a probability distribution. The decision layer usually adopts a relatively simple structure such as a fully connected layer or a softmax layer. It receives the output of the feature extraction layer as input and makes the final classification decision based on these features. The design of the decision layer can be adjusted according to the specific task. For example, for a binary classification problem, a single neuron can be used with a sigmoid activation function; for a multi-classification problem, the same number of neurons as the number of categories can be used with a softmax activation function.

[0084] This hierarchical design brings many advantages. First, it improves the interpretability of the model. By analyzing the output of the feature extraction layer, we can better understand how the model understands and represents the input data. Second, this structure enhances the modularity of the model, allowing us to optimize different subtasks (feature extraction and decision making) separately. For example, we can use transfer learning techniques in the feature extraction layer, using models pre-trained on large-scale datasets, and only need to fine-tune the decision layer, which greatly improves the training efficiency and generalization ability of the model.

[0085] In practical applications, the target model structure of this application can be flexibly adapted to different scenarios. For example, in the task of medical image classification, the feature extraction layer can use a pre-trained DenseNet structure to extract the key features of the image; the decision layer can design a corresponding number of output neurons according to the number of specific disease categories. In this way, the model can effectively learn the feature representations of different diseases and make accurate diagnostic decisions based on this.

[0086] Another example is in the field of financial risk assessment. The feature extraction layer can be designed as a long short-term memory network (LSTM) for processing time series data to capture the time series features in the customer's historical transaction data; the decision layer can be designed as a multi-layer perceptron (MLP) to classify the risk level based on the extracted features. This structure can effectively handle the time series dependency of financial data while maintaining the flexibility of the decision-making process.

[0087] In the federated model, α is the parameter set of the entire model, including the parameter α of the feature extraction layer e and the decision layer parameter α d The federated model combines the functionality of the feature extraction layer and the decision layer, allowing the model to extract features from the input data x and then make decisions based on these features. In federated learning, this model structure allows each client to extract features locally and then send the features (instead of the original data) to the server for training the decision layer. This helps protect user privacy because the original data does not need to leave the client.

[0088] Suppose we are building a federated learning system for image recognition. In this system:

[0089] The feature extraction layer may contain a series of convolutional layers that can extract features such as edges and textures from the image.

[0090] The decision layer may be one or more fully connected layers that map feature vectors to different categories.

[0091] In the process of federated learning, each client (such as a smartphone) uses its local image data to train the feature extraction layer and then sends the extracted features to the server. The server uses these features to train the decision layer and update the parameters of the global model.

[0092] This layered approach not only helps preserve privacy, but also enables the model to process and learn from data more efficiently.

[0093] Furthermore, the first prototype of the client local calculation is specifically:

[0094] The client processes all input data of the target category through the feature extraction layer of the local target model to obtain the feature vector corresponding to the input data;

[0095] The average value of the feature vectors corresponding to all input data of the target category is calculated to obtain the first prototype of the client corresponding to the target category.

[0096] It should be noted that the calculation formula for the j-th prototype in the i-th client is:

[0097]

[0098] Where D i,j is the distribution of the i-th client belonging to class j, and D is D i,j The size of is the number of samples in this category.

[0099] The formula calculates the average value of all samples of the jth category in the ith client after being processed by the feature extraction layer, and the resulting sample is the prototype of the category.

[0100] In practical applications, the method of the present application may have many variations. For example, in addition to using a simple arithmetic mean, a weighted average may be considered, where the weights may be set based on the importance or reliability of the sample. Another possible variation is to use the median instead of the mean, which may be more robust when dealing with data with outliers. In addition, there may be different strategies for selecting the feature extraction layer, such as selecting shallow features close to the input, selecting deeper features, or even comprehensively considering features from multiple layers.

[0101] For example, suppose that in an image classification task, client A has 100 pictures belonging to the "cat" category. First, these 100 pictures will pass through the feature extraction layer of the target model to obtain 100 feature vectors. Then, the average value of these 100 feature vectors is calculated to obtain the prototype of the "cat" category. This prototype represents client A's understanding of the "cat" category. The same process will be applied to other categories and other clients.

[0102] S102: After calculating new second model parameters and second prototypes based on the aggregated models and prototypes, the server sends the new second model parameters and second prototypes to a number of clients respectively, and each client performs model inference based on the second model parameters and second prototype.

[0103] It should be noted that after the server calculates the new second model parameters and the second prototype, it sends these updates back to each client.

[0104] The client receives the second model parameters and the second prototype and uses these updates to perform model inference.

[0105] Furthermore, the server performs prototype aggregation specifically as follows:

[0106] Obtaining a global category prototype of the target category by calculating the average of the first prototypes of all clients in the target category;

[0107] The global category prototypes of all categories are packaged into one set to form the second prototype.

[0108] It should be noted that the global prototype aggregation formula is:

[0109] Where |S| is the number of clients in the network.

[0110] This formula calculates the average value of the j-th prototype among all clients, and obtains the global category prototype.

[0111] In actual implementation, there can be many variations of the process of prototype aggregation. For example, in addition to the simple arithmetic average, you can also consider using a weighted average, where the weights can be determined based on the amount of data or the quality of data from each client. Another possible implementation is to use the median instead of the mean, which can provide better robustness in some cases, especially when there are outliers. In addition, you can also consider using a clustering algorithm, such as K-means clustering, to generate a global prototype for each category, which may be more advantageous when dealing with high-dimensional data.

[0112] Furthermore, the client performs model reasoning according to the second model parameters and the second prototype as follows:

[0113] The client updates the parameters of the local target model according to the second model parameters;

[0114] The client obtains the predicted label value by measuring the distance between the target model after parameter update and each global category prototype in the second prototype.

[0115] Furthermore, the client obtains the predicted label value by measuring the distance between the target model after parameter update and each global category prototype in the second prototype, specifically including:

[0116] The client passes the new input data through the feature extraction layer to obtain the feature vector;

[0117] The client calculates the Euclidean distance between the feature vector and each global category prototype in the second prototype, and takes the category corresponding to the global category prototype with the smallest Euclidean distance as the predicted label value.

[0118] It should be noted that the formula for model inference is: in is the final predicted label value.

[0119] The formula represents the feature vector f obtained by the feature extraction layer for the new input data x e (α e ; x), with each global category prototype The L2 distance (i.e., Euclidean distance) is compared and the category j with the smallest distance is selected as the prediction result.

[0120] Furthermore, before step S101, the following steps are also included:

[0121] In the non-final iteration, several clients train the target model locally and upload the trained third model parameters to the server;

[0122] The server aggregates the third model parameters uploaded by each client, performs global iteration, and distributes the updated fourth model parameters to each client respectively.

[0123] It should be noted that, assuming that N rounds of global iterations are performed between the client and the server, the first (N-1) rounds of iterations are the same as the currently popular FL framework, and the client and the server train the federated model by transmitting model parameters.

[0124] In non-final rounds, the client and server perform global iterations of the model parameters of the target model. This means that the client sends their model parameters to the server, the server aggregates and sends the updated model parameters back to the client, and the client uses these parameters for the next round of local training.

[0125] Federated Learning (FL) is a machine learning technique that allows multiple clients (such as mobile devices, browsers, distributed servers, etc.) to collaborate to train a shared model while maintaining the privacy and locality of the data. This approach is particularly suitable for data-sensitive environments because it allows data to remain in place without the need to store data centrally in the cloud or on a central server. The key features and advantages of federated learning include:

[0126] Data privacy protection: Since the original data does not need to leave the user's device, federated learning helps protect user privacy and comply with data protection regulations (such as the EU's General Data Protection Regulation (GDPR).

[0127] Data locality: Data is processed locally, reducing the need for data transfer, which is especially important in areas where network connectivity is limited or costly.

[0128] Distributed computing: Federated learning takes advantage of edge computing and can process data at the location where it is generated, improving efficiency and responsiveness.

[0129] Model generalization ability: By training on multiple different data sources, federated learning helps improve the model's generalization ability because it can learn more diverse data features.

[0130] Communication efficiency: Federated learning reduces communication overhead by transmitting only model updates (such as gradients or model parameters) instead of the entire dataset.

[0131] The basic process of federated learning generally includes the following steps:

[0132] Initialization: Select one or more clients to participate in the federated learning process and initialize the model parameters.

[0133] Local training: Each participating client trains the model using its local data and updates the model parameters.

[0134] Model aggregation: The clients send the model updates to the central server, and the server aggregates these updates to improve the global model.

[0135] Model update: The server distributes the updated global model parameters to all participating clients for the next round of local training.

[0136] Iteration: Repeat the local training and model aggregation steps until the model reaches satisfactory performance or a predetermined number of iterations.

[0137] Challenges faced by federated learning include data heterogeneity (non-independent and identically distributed data), communication efficiency, model convergence, collaboration strategies between devices, and security and privacy protection. To address these issues, researchers have proposed various algorithms and techniques, such as differential privacy, homomorphic encryption, compressed communication, encryption of model updates, etc.

[0138] The algorithm corresponding to the embodiments of this application is specifically as follows:

[0139] Input: Dataset Di, αi

[0140] Model training:

[0141] Initialize α0,

[0142] When n = 1, 2, …, N execute

[0143] When i = 0, 1, …, M execute synchronously

[0144] If n = N then

[0145] Update the local model.

[0146] Aggregate prototypes using formula (3)

[0147] If n < N then

[0148] Update local model

[0149] Finish

[0150] Finish

[0151] Finish

[0152] Model testing:

[0153] For each sample i belonging to the test dataset, execute

[0154] For each Category j performs

[0155] Measure f e (α e ;x i )and The L2 distance between the two

[0156] Finish

[0157] Use formula (4) to output the final prediction value

[0158] Finish

[0159] In the prototype-based federated learning method, the non-final round of iterative processes also plays an important role. These iterative rounds mainly focus on the global optimization of the target model parameters, laying the foundation for the final round of prototype learning. However, in this process, we may encounter some technical challenges, such as slow model convergence speed and high communication overhead. In order to solve these problems, the embodiment of the present application can also provide an improved iteration strategy.

[0160] A key advantage of this iterative strategy is that it can effectively use data distributed across clients to optimize the model while protecting data privacy. Through multiple rounds of iterations, the model can gradually learn the common features in data from different clients, thereby improving the generalization ability of the model.

[0161] In order to further improve the iteration efficiency, this application proposes several possible implementation methods:

[0162] Adaptive learning rate: In each iteration, the learning rate is dynamically adjusted according to the convergence of the model. This can speed up the convergence of the model and avoid falling into the local optimal solution.

[0163] Gradient compression: When uploading model updates on the client, you can use gradient compression techniques to reduce communication overhead. For example, you can only transmit gradients with larger absolute values, or use quantization techniques to compress gradients.

[0164] Asynchronous updates: Allow clients to upload model updates asynchronously, rather than waiting for all clients to complete training. This can improve the overall efficiency of the system, especially when the computing power of clients varies greatly.

[0165] In practical applications, this iterative strategy can be applied to a variety of scenarios. For example, in a project where multiple banks cooperate to develop a credit scoring model, each bank, as a client, can continuously optimize model parameters through multiple rounds of iterations while protecting customer privacy. Another example is that in a cross-regional medical imaging diagnosis system, different hospitals can participate in model training as clients, and gradually improve the diagnostic accuracy of the model through an iterative process.

[0166] This iterative strategy of the present application not only solves some problems in traditional federated learning, but also lays a good foundation for the final round of prototype learning. Through multiple rounds of iterations, the model can fully learn the characteristics of each client's data, which makes the prototype calculated in the final round more representative and generalizable. At the same time, this strategy also maintains the privacy protection characteristics of federated learning, because throughout the process, the client only needs to upload the model parameters without sharing the original data.

[0167] In the entire iterative process, each feature plays an important role. The client trains the model based on local data, which ensures that the model can capture the characteristics of local data. The server aggregates the model, which enables the model to integrate information from different clients. The design of multiple rounds of iterations ensures that the model can be gradually optimized and the performance can be continuously improved. The working principle of this iterative strategy is to gradually find a set of model parameters that can perform well on all client data through continuous local training and global aggregation.

[0168] The prototype-based federated learning method provided in the embodiment of the present application uploads the local computing prototype to the server for aggregation before each client (bank institution) completes the last federated iteration, and then sends the aggregated prototype back to each client for local model reasoning.

[0169] 1. In the federated setting, the classifier has a greater bias than other layers. Using the output of the previous layer of the classifier, i.e., the feature space of the class, to achieve prediction can improve the accuracy of model prediction, output a more accurate and complete bank customer profile, better provide personalized product recommendations to customers, and achieve cost reduction and efficiency improvement;

[0170] 2. On heterogeneous data sets, aggregation as a prototype of feature space can effectively integrate feature expressions from data with different distributions, reduce the negative impact of data heterogeneity, and improve model reasoning performance when different client data are heterogeneous;

[0171] 3. The prototype is defined as the average value of the feature space in the same class space, and its size is usually much smaller than the model parameters. Therefore, the transmission of the prototype between the client and the server can improve the communication efficiency with a small increase in the communication cost;

[0172] 4. The prototype is a one-dimensional vector generated by averaging the low-dimensional feature expressions of samples of the same type. This process is irreversible, and attackers cannot reconstruct the original data through the prototype. Therefore, sharing of prototypes can ensure the security of customer privacy data of banking institutions.

[0173] See also Figure 2 , Figure 2 Schematic diagram of the structure of the prototype-based federated learning system in the embodiment of the present application. Figure 2 As shown, the system includes several clients 201 and a server 202, and the several clients 201 are connected to the server 202 respectively, wherein:

[0174] In the last round of iterations, several clients 201 transmit the first model parameters of the local target model to the server 202 for model aggregation based on the federated learning algorithm, and at the same time, several clients 201 transmit the first prototype calculated locally to the server 202 for prototype aggregation;

[0175] After calculating new second model parameters and second prototypes according to the aggregated models and prototypes, the server 202 sends the second model parameters and second prototypes to the plurality of clients 201 respectively;

[0176] Each client 201 performs model inference according to the second model parameters and the second prototype.

[0177] Another embodiment of the present invention provides a prototype-based federated learning device, such as Figure 3 As shown, the device 10 includes:

[0178] One or more processors 110 and memory 120, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0179] The processor 110 is used to complete various control logics of the device 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.

[0180] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the method for constructing a multilingual phoneme representation model in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the method for constructing a multilingual phoneme representation model in the above method embodiment.

[0181] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0182] One or more units are stored in the memory 120, and when executed by one or more processors 110, the following steps are implemented:

[0183] S101. In the last round of iterations, several clients transmit the first model parameters of the local target model to the server for model aggregation based on the federated learning algorithm, and at the same time, several clients transmit the first prototype calculated locally to the server for prototype aggregation;

[0184] S102: After calculating new second model parameters and second prototypes according to the aggregated models and prototypes, the server sends the second model parameters and second prototypes to a plurality of clients respectively;

[0185] S103: Each client performs model inference according to the second model parameters and the second prototype.

[0186] An embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, any implementation of the prototype-based federated learning method described in the above embodiments is implemented.

[0187] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0188] In the embodiments of the present application, a prototype-based federated learning method, system, device and storage medium are provided. In the last round of iteration, the client not only transmits model parameters to train the target model, but also transmits the prototype of the client to the server, which performs model aggregation and prototype aggregation, and finally makes predictions based on the distance between the local prototype and the global model. On heterogeneous data sets, aggregation as the prototype of the feature space can effectively integrate the feature expressions of data from different distributions, reduce the negative impact of data heterogeneity, and improve the model reasoning performance in the case of heterogeneous data of different clients. This solves the problem that in the application of financial intelligent marketing, the customer data of financial institutions often have large differences in storage devices, degree of dispersion, etc. These differences lead to non-independent and identically distributed data distribution, which cannot meet the basic assumptions of standard machine learning algorithms, resulting in poor model reasoning performance and low prediction accuracy of the federated model.

[0189] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0190] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0191] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural 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, c can be single or multiple.

[0192] In the several embodiments provided in the present application, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0195] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable 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 method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store program codes.

[0196] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

[0197] It should be noted that if software tools or components other than those of our company appear in the embodiments of the present application, they are only used for illustrative purposes and do not represent actual use.

Claims

1. A prototype-based federated learning method, characterized in that: include: In the last round of iterations, several clients transmit the first model parameters of the local target model to the server for model aggregation based on the federated learning algorithm, and at the same time, several of the clients transmit the first prototype calculated locally to the server for prototype aggregation; The server calculates new second model parameters and second prototype according to the aggregated model and prototype, and sends the second model parameters and second prototype to a plurality of the clients respectively; Each of the clients performs model inference according to the second model parameters and the second prototype.

2. The prototype-based federated learning method according to claim 1, characterized in that: Also includes: In an iteration other than the last round, a plurality of clients train the target model locally and upload the trained third model parameters to the server; The server aggregates the third model parameters uploaded by each of the clients, performs global iteration, and distributes updated fourth model parameters to each of the clients respectively.

3. The prototype-based federated learning method according to claim 1, characterized in that: The target model includes a feature extraction layer and a decision layer; The target model processes input data through the feature extraction layer to generate a feature vector; The decision layer of the target model takes the feature vector as input to generate a decision result.

4. The prototype-based federated learning method according to claim 3, characterized in that: The first prototype of the client local calculation is specifically: The client processes all input data of the target category through the local feature extraction layer of the target model to obtain a feature vector corresponding to the input data; An average value of the feature vectors corresponding to all the input data of the target category is calculated to obtain a first prototype of the client corresponding to the target category.

5. The prototype-based federated learning method according to claim 4, characterized in that: The server performs prototype aggregation specifically as follows: Obtaining a global category prototype of the target category by calculating an average value of the first prototypes of all the clients in the target category; The global category prototypes of all categories are packaged into a set to form a second prototype.

6. The prototype-based federated learning method according to claim 5, characterized in that: The client performs model reasoning according to the second model parameter and the second prototype as follows: The client updates the parameters of the local target model according to the second model parameters; The client obtains a predicted label value by measuring the distance between the target model after parameter update and each of the global category prototypes in the second prototype.

7. The prototype-based federated learning method according to claim 6, characterized in that: The client obtains the predicted label value by measuring the distance between the target model after parameter update and each of the global category prototypes in the second prototype, specifically including: The client passes the new input data through the feature extraction layer to obtain a feature vector; The client calculates the Euclidean distances between the feature vector and each of the global category prototypes in the second prototype, and uses the category corresponding to the global category prototype with the smallest Euclidean distance as the predicted label value.

8. A prototype-based federated learning system, characterized in that: The system includes several clients and a server, and the several clients are connected to the servers respectively, wherein: In the last round of iterations, several of the clients transmit the first model parameters of the local target model to the server for model aggregation based on the federated learning algorithm, and at the same time, several of the clients transmit the first prototype calculated locally to the server for prototype aggregation; After calculating new second model parameters and second prototype according to the aggregated models and prototypes, the server sends the new second model parameters and second prototype to several clients respectively, and each client performs model inference according to the second model parameters and the second prototype.

9. A prototype-based federated learning device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the prototype-based federated learning method described in any one of claims 1-7 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and the program code is used to execute the prototype-based federated learning method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Iterative clustering type federated learning method based on prototype network

    CN115049076A

  • Federal learning method and device, medium and computer equipment

    CN115759297A

Cited By

  • Multi-subject united variety yield prediction method and system for protecting data privacy

    CN119849985A

  • Federal learning privacy protection method and federal learning privacy protection system for label-free public data set

    CN120561972A