Federal learning model training method and device, equipment and storage medium

Through the method of extracting features from the original dataset and generating the target dataset, the problem of data leakage in federated learning is solved, and efficient data privacy protection and model performance balance is achieved.

CN119204264APending Publication Date: 2024-12-27PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411363586.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing federated learning methods have the potential risk of data leakage in data privacy protection, especially the leakage of raw data through gradient information. Existing encryption technologies cannot completely eliminate data leakage and may affect model performance while protecting data privacy.

Method used

By extracting data features from the original dataset, determining the sampling range and number of groups, sampling and grouping the data, selecting the best fit distribution model to generate the target dataset, and using the original dataset and the target dataset for federated learning model training, avoiding Directly pass and expose raw data to achieve data privacy protection.

Benefits of technology

It effectively avoids the risk of data leakage, while improving the efficiency and accuracy of model training, enhancing the effect of data privacy protection, and not significantly affecting the performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204264A_ABST
    Figure CN119204264A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine learning and artificial intelligence, and discloses a federated learning model training method, which comprises the following steps: extracting data features from an original data set, and determining a sampling range according to the data features; sampling the original data set according to the sampling range to obtain sampling data; determining a grouping number, and grouping the sampling data according to the grouping number to form a grouped data set; selecting an optimal fitting distribution model based on the grouped data set, and inputting the grouped data set into the optimal fitting distribution model to obtain a target data set; and performing federated learning model training by using the original data set and the target data set to obtain a target global model. According to the method, the target data set which is similar to the original data but does not contain the real original data is generated by combining the optimal fitting distribution model through the statistical characteristics of the grouped data set, so that direct transmission and exposure of the original data are avoided, and privacy protection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning and artificial intelligence technology, and in particular to a federated learning model training method, device, equipment and storage medium. Background Art

[0002] With the rapid development of big data and artificial intelligence, the importance of data privacy protection has become increasingly prominent. Traditional centralized machine learning methods usually require all data to be concentrated on a central server for training, but this practice brings serious data leakage risks and may violate data privacy laws and regulations. In order to meet these challenges, Federated Learning has emerged as a new type of distributed machine learning method. Federated learning protects data privacy to a certain extent by training models on local data of multiple participants without transferring the data to a central server.

[0003] Federated learning is mainly divided into two modes: horizontal federated learning and vertical federated learning. In horizontal federated learning, the data of different participants have the same feature space, and the global model is constructed by training the model on their respective data sets and exchanging parameters; while in vertical federated learning, the data of different participants have the same user space, but different feature spaces. In this mode, the participants collaborate to train the model through technologies such as secure multi-party computing. However, no matter which mode is used, there is always a process of exchanging calculation results (such as gradients, model parameters, etc.) between participants in federated learning. Even if these exchanged results are encrypted, they may still be used by attackers to reconstruct the original data.

[0004] Although federated learning has made some progress in data privacy protection, research shows that by intercepting and analyzing the gradient information exchanged during training, attackers may be able to reconstruct local training data that should be private. This method, called "Deep Leakage from Gradients" (DLG), has proven that federated learning still faces the potential risk of data leakage. Although current encryption technologies such as homomorphic encryption and differential privacy can alleviate this risk to a certain extent, they still cannot completely eliminate data leakage.

[0005] Although federated learning and its related privacy protection technologies are constantly developing, there is no method that can ensure that data is not leaked in all cases. Although technologies such as encryption and differential privacy have enhanced data protection, there is still a possibility of being cracked. In addition, existing methods often have a certain negative impact on model performance while protecting data privacy, such as increasing computational complexity or reducing model accuracy. Therefore, the industry urgently needs a new method that can effectively protect data privacy without significantly affecting model performance. Summary of the invention

[0006] The main purpose of the present invention is to provide a federated learning model training method, device, equipment and storage medium, aiming to solve the technical problem that the prior art has the risk of leaking original data through gradient information.

[0007] To achieve the above object, the present invention provides a federated learning model training method, which comprises the following steps:

[0008] Acquire an original data set, extract data features from the original data set, and determine a sampling range according to the data features;

[0009] Sampling within the sampling range to obtain sampling data;

[0010] Determine the number of groups by a preset standard number or data distribution pattern analysis, and group the sampled data according to the number of groups to obtain a grouped data set;

[0011] A best-fit distribution model is determined based on the grouped data set, the grouped data set is input into the best-fit distribution model to obtain a target data set, and the original data set and the target data set are used to perform federated learning model training to obtain a target global model.

[0012] Optionally, determining a best-fit distribution model based on the grouped data set comprises:

[0013] Select multiple preset fitting distribution models, fit each preset fitting distribution model respectively through the grouped data set, calculate the fitting degree of each preset fitting distribution model, and select the preset fitting distribution model with the highest fitting degree as the best fitting distribution model.

[0014] Optionally, fitting each preset fitting distribution model respectively through the grouped data set, and calculating the fitting degree of each preset fitting distribution model, includes:

[0015] Fitting each preset fitting distribution model respectively through the grouped data set within a preset time length, and calculating the fitting degree of each preset fitting distribution model;

[0016] When the fitting time of a preset fitting distribution model reaches the preset time length, the fitting process and the fitting degree calculation process of the preset fitting distribution model are terminated.

[0017] Optionally, determining a sampling range according to the data characteristics includes:

[0018] The maximum value and the minimum value of the data feature are calculated, and the maximum value and the minimum value of the data feature are used as the maximum value and the minimum value of the sampling range.

[0019] Optionally, the number of groups is determined by analyzing a preset standard number or data distribution pattern, including:

[0020] Setting a preset standard quantity, and using the preset standard quantity as the grouping quantity;

[0021] Alternatively, a data distribution morphology analysis is performed on the sampled data, a quantity adjustment ratio is determined according to the data distribution result, and the preset standard quantity is adjusted according to the quantity adjustment ratio to obtain the grouping quantity.

[0022] Optionally, sampling within the sampling range to obtain sampling data includes:

[0023] Determine a preset sample quantity range, sample the original data set according to the sampling range and the preset sample quantity range, and obtain sampled data, wherein the number of samples in the sampled data is within the preset sample quantity range.

[0024] Optionally, extracting data features from the original data set includes:

[0025] Determine a target variable, and calculate the correlation between the target variable and each data feature of the original data set;

[0026] A correlation threshold is set, and data features whose correlation exceeds the correlation threshold are screened out from the data features of the original data set.

[0027] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a federated learning model training device, the federated learning model training device comprising:

[0028] A data preprocessing module is used to obtain an original data set, extract data features from the original data set, and determine a sampling range according to the data features;

[0029] A data sampling module, used for sampling in the sampling range to obtain sampling data;

[0030] A data grouping module, used to determine the number of groups by a preset standard number or data distribution morphology analysis, and group the sampled data according to the number of groups to obtain a grouped data set;

[0031] A model training and optimization module is used to determine the best fitting distribution model based on the grouped data set, input the grouped data set into the best fitting distribution model to obtain a target data set, and use the original data set and the target data set to perform federated learning model training to obtain a target global model.

[0032] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a federated learning model training device, which includes a memory, a processor, and a federated learning model training program stored in the memory and executable on the processor, and the federated learning model training program, when executed by the processor, implements the steps of the federated learning model training method described above.

[0033] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a federated learning model training program is stored, and when the federated learning model training program is executed by a processor, the steps of the federated learning model training method as described above are implemented.

[0034] The present invention relates to the field of machine learning and artificial intelligence technology, and discloses a method for training a federated learning model, which extracts data features from an original data set, and determines a sampling range according to the data features; samples the original data set according to the sampling range to obtain sampled data; determines the number of groups, and groups the sampled data according to the number of groups to form a grouped data set; selects a best-fit distribution model based on the grouped data set, and inputs the grouped data set into the best-fit distribution model to obtain a target data set; and uses the original data set and the target data set to train a federated learning model to obtain a target global model. The present invention generates a target data set that is similar to the original data but does not contain the real original data by combining the statistical characteristics of the grouped data set with the best-fit distribution model, thereby avoiding direct transmission and exposure of the original data and achieving privacy protection. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of the structure of the device hardware operating environment involved in the embodiment of the federated learning model training device of the present invention;

[0036] Figure 2 This is a flow chart of the first embodiment of the federated learning model training method of the present invention;

[0037] Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the federated learning model training device of the present invention.

[0038] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0039] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0040] It should be noted that with the rapid development of big data and artificial intelligence, the importance of data privacy protection has become increasingly prominent. Traditional centralized machine learning methods usually require all data to be concentrated on a central server for training, but this practice brings serious data leakage risks and may violate data privacy laws and regulations. In order to meet these challenges, Federated Learning has emerged as a new type of distributed machine learning method. Federated learning protects data privacy to a certain extent by training models on local data of multiple participants without transferring the data to a central server.

[0041] Federated learning is mainly divided into two modes: horizontal federated learning and vertical federated learning. In horizontal federated learning, the data of different participants have the same feature space, and the global model is constructed by training the model on their respective data sets and exchanging parameters; while in vertical federated learning, the data of different participants have the same user space, but different feature spaces. In this mode, the participants collaborate to train the model through technologies such as secure multi-party computing. However, no matter which mode is used, there is always a process of exchanging calculation results (such as gradients, model parameters, etc.) between participants in federated learning. Even if these exchanged results are encrypted, they may still be used by attackers to reconstruct the original data.

[0042] Although federated learning has made some progress in data privacy protection, research shows that by intercepting and analyzing the gradient information exchanged during training, attackers may be able to reconstruct local training data that should be private. This method, called "Deep Leakage from Gradients" (DLG), has proven that federated learning still faces the potential risk of data leakage. Although current encryption technologies such as homomorphic encryption and differential privacy can alleviate this risk to a certain extent, they still cannot completely eliminate data leakage.

[0043] Although federated learning and its related privacy protection technologies are constantly developing, there is no method that can ensure that data is not leaked in all cases. Although technologies such as encryption and differential privacy have enhanced data protection, there is still a possibility of being cracked. In addition, existing methods often have a certain negative impact on model performance while protecting data privacy, such as increasing computational complexity or reducing model accuracy. Therefore, the industry urgently needs a new method that can effectively protect data privacy without significantly affecting model performance.

[0044] Based on the above defects, the present invention provides a federated learning model training device, referring to Figure 1 , Figure 1This is a schematic diagram of the structure of the device hardware operating environment involved in the implementation scheme of the federated learning model training device of the present invention.

[0045] like Figure 1 As shown, the federated learning model training device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0046] Those skilled in the art will understand that Figure 1 The hardware structure of the federated learning model training device shown in the figure does not constitute a limitation of the federated learning model training device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0047] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a federated learning model training program. Among them, the operating system is a program for managing and controlling the federated learning model training device and software resources, supporting the operation of the network communication module, the user interface module, the federated learning model training program, and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.

[0048] exist Figure 1 In the hardware structure of the federated learning model training device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client and communicate data with the client; the processor 1001 can call the federated learning model training program stored in the memory 1005 and perform the following operations:

[0049] Acquire an original data set, extract data features from the original data set, and determine a sampling range according to the data features;

[0050] Sampling within the sampling range to obtain sampling data;

[0051] Determine the number of groups by a preset standard number or data distribution pattern analysis, and group the sampled data according to the number of groups to obtain a grouped data set;

[0052] A best-fit distribution model is determined based on the grouped data set, the grouped data set is input into the best-fit distribution model to obtain a target data set, and the original data set and the target data set are used to perform federated learning model training to obtain a target global model.

[0053] Further, determining the best fitting distribution model based on the grouped data set includes:

[0054] Select multiple preset fitting distribution models, fit each preset fitting distribution model respectively through the grouped data set, calculate the fitting degree of each preset fitting distribution model, and select the preset fitting distribution model with the highest fitting degree as the best fitting distribution model.

[0055] Furthermore, fitting each preset fitting distribution model respectively through the grouped data set and calculating the fitting degree of each preset fitting distribution model includes:

[0056] Fitting each preset fitting distribution model respectively through the grouped data set within a preset time length, and calculating the fitting degree of each preset fitting distribution model;

[0057] When the fitting time of a preset fitting distribution model reaches the preset time length, the fitting process and the fitting degree calculation process of the preset fitting distribution model are terminated.

[0058] Further, determining the sampling range according to the data characteristics includes:

[0059] The maximum value and the minimum value of the data feature are calculated, and the maximum value and the minimum value of the data feature are used as the maximum value and the minimum value of the sampling range.

[0060] Further, the number of groups is determined by analyzing the preset standard number or data distribution pattern, including:

[0061] Setting a preset standard quantity, and using the preset standard quantity as the grouping quantity;

[0062] Alternatively, a data distribution morphology analysis is performed on the sampled data, a quantity adjustment ratio is determined according to the data distribution result, and the preset standard quantity is adjusted according to the quantity adjustment ratio to obtain the grouping quantity.

[0063] Further, sampling in the sampling range to obtain sampling data includes:

[0064] Determine a preset sample quantity range, sample the original data set according to the sampling range and the preset sample quantity range, and obtain sampled data, wherein the number of samples in the sampled data is within the preset sample quantity range.

[0065] Furthermore, extracting data features from the original data set includes:

[0066] Determine a target variable, and calculate the correlation between the target variable and each data feature of the original data set;

[0067] A correlation threshold is set, and data features whose correlation exceeds the correlation threshold are screened out from the data features of the original data set.

[0068] The specific implementation of the federated learning model training device of the present invention is basically the same as the various embodiments of the following federated learning model training method, and will not be repeated here.

[0069] The present invention also provides a federated learning model training method based on the above-mentioned federated learning model training device.

[0070] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the federated learning model training method of the present invention.

[0071] The embodiments of the present invention provide an embodiment of a federated learning model training method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown here.

[0072] In various embodiments of the federated learning model training method, the execution entity is a federated learning model training device.

[0073] The federated learning model training method is applied to a federated learning model training device, and the federated learning model training method includes:

[0074] Step S10, obtaining an original data set, extracting data features from the original data set, and determining a sampling range according to the data features;

[0075] With the rapid development of big data and artificial intelligence, the importance of data privacy protection has become increasingly prominent. Traditional centralized machine learning methods usually require all data to be concentrated on a central server for training, but this practice brings serious data leakage risks and may violate data privacy laws and regulations. In order to meet these challenges, Federated Learning has emerged as a new type of distributed machine learning method. Federated learning protects data privacy to a certain extent by training models on local data of multiple participants without transferring the data to a central server.

[0076] Federated learning is mainly divided into two modes: horizontal federated learning and vertical federated learning. In horizontal federated learning, the data of different participants have the same feature space, and the global model is constructed by training the model on their respective data sets and exchanging parameters; while in vertical federated learning, the data of different participants have the same user space, but different feature spaces. In this mode, the participants collaborate to train the model through technologies such as secure multi-party computing. However, no matter which mode is used, there is always a process of exchanging calculation results (such as gradients, model parameters, etc.) between participants in federated learning. Even if these exchanged results are encrypted, they may still be used by attackers to reconstruct the original data.

[0077] Although federated learning has made some progress in data privacy protection, research shows that by intercepting and analyzing the gradient information exchanged during training, attackers may be able to reconstruct local training data that should be private. This method, called "Deep Leakage from Gradients" (DLG), has proven that federated learning still faces the potential risk of data leakage. Although current encryption technologies such as homomorphic encryption and differential privacy can alleviate this risk to a certain extent, they still cannot completely eliminate data leakage.

[0078] Although federated learning and its related privacy protection technologies are constantly developing, there is no method that can ensure that data is not leaked in all cases. Although technologies such as encryption and differential privacy have enhanced data protection, there is still a possibility of being cracked. In addition, existing methods often have a certain negative impact on model performance while protecting data privacy, such as increasing computational complexity or reducing model accuracy. Therefore, the industry urgently needs a new method that can effectively protect data privacy without significantly affecting model performance.

[0079] In this embodiment, the original data set is usually held by multiple parties and contains the original data used to train the model. Such data can be user behavior records, device sensor data, financial transaction data, etc., depending on the specific application scenario.

[0080] Data features refer to representative data variables extracted from the original data. They are considered to be factors that affect the prediction target (i.e., target variable). For example, in a house price prediction model, the area, location, and age of the house are all data features. This step involves feature selection and feature engineering, which screens out the most important features by analyzing the relationship between each data feature and the target variable.

[0081] The sampling range refers to the boundary of selecting part of the data from the original data set for further processing. By analyzing the distribution of data features, a reasonable sampling range can be determined to ensure that the sampled data can represent the distribution characteristics of the entire data set. Usually, the sampling range is determined by calculating the minimum and maximum values ​​of the data features, or by setting a specific threshold.

[0082] Specific implementations may be:

[0083] Obtaining the original data set: In the actual application of federated learning, each participant, such as banks, insurance companies, and mobile device users, holds their own original data set. The data set may include the user's transaction records, health data, device usage data, etc. Each participant extracts the relevant original data set from the database according to its business needs or model training goals.

[0084] Extracting data features from the original data set: After obtaining the original data set, the system first cleans the data and handles missing values, outliers, etc. Then, through feature engineering, data features related to the target variable are extracted from the data set. For example, in a model that predicts a user's credit score, the user's income, credit card usage frequency, historical loan records, etc. may be extracted as features. The feature extraction process may also involve steps such as standardization and normalization of features so that the data is more suitable for model input.

[0085] Determine the sampling range based on data features: Once the data features are extracted, the system will analyze the distribution of these features. For example, the sampling range is determined by calculating the maximum, minimum, and standard deviation of each feature. Assuming that the values ​​of a certain feature are concentrated in a certain range (such as the 5th to 95th percentiles), you can choose to sample within this range to ensure the representativeness of the model training data. This method can effectively filter out extreme values ​​or outliers and ensure the quality of the data.

[0086] Example: Credit score prediction in financial applications

[0087] Obtaining the original data set: Extracting user transaction records, repayment history, credit card usage and other data from different banking systems.

[0088] Extract data features: Select the user's monthly income, credit card usage frequency, historical overdue records, etc. as data features. Through feature engineering, these features are normalized to eliminate the differences between different feature dimensions.

[0089] Determine the sampling range: By analyzing the distribution of users' monthly income, it is found that most users' monthly income is between 5,000 and 20,000. Therefore, the sampling range is set to 5,000 to 20,000, filtering out extreme high-income or low-income data to form a representative sample set.

[0090] By obtaining the original data set, extracting important data features and determining the appropriate sampling range to optimize the training process of the federated learning model, it ensures that the training data of the model is representative and of high quality, which helps to improve the accuracy and robustness of the model.

[0091] S20, sampling within the sampling range to obtain sampling data;

[0092] In this embodiment, after the sampling range is determined, data points that meet the range are selected from the original data set. The purpose of sampling is to reduce the data size while ensuring that the selected data can represent the characteristics of the entire data set. The sampling range can be determined based on the interval, distribution or other statistical indicators of specific data features, thereby effectively filtering out irrelevant or abnormal data points.

[0093] Specific data features are extracted from the original data set to determine a sampling range and sample the data within this range. The sampled data is a part selected from the original data set, representing certain characteristics of the entire data set, such as a specific numerical interval or statistical distribution. The data interval determined by the extracted feature values ​​(such as the minimum and maximum values ​​of a specific feature) is used as a sampling restriction to ensure that sampling is performed within this range. Data points that meet the sampling range are selected from the original data set. This process can be random sampling or based on a certain strategy (such as uniform distribution, random selection, etc.).

[0094] By sampling the original data within the sampling range, it is possible to maintain the representativeness of the data while protecting privacy, reduce computational complexity, and ensure the effectiveness of subsequent model training.

[0095] S30, determining the number of groups by a preset standard number or data distribution morphology analysis, and grouping the sampled data according to the number of groups to obtain a grouped data set;

[0096] In this embodiment, after sampling, the sampled data is grouped in order to better analyze and process the data. The number of groups can be determined based on the distribution characteristics of the data, the number of data points, and the needs of subsequent model training. Reasonable grouping can help simplify the data structure and make data analysis and model training more efficient.

[0097] Once the number of groups is determined, the sampled data will be divided according to the grouping criteria. The grouping can be equal interval grouping, percentile-based grouping, or other adaptive grouping methods. After grouping, the data sets of each group are synthesized into grouped data sets, which will be used for subsequent model training or analysis steps.

[0098] Specific implementations may be:

[0099] Sampling data: After the sampling range is determined in the previous step, the system will select data points that fit the range from the original data set. Assuming the sampling range is based on the minimum and maximum values ​​of a feature, for example, the user's income is between 5,000 and 20,000, the system will extract all user data with income within this range to form a sampling data set.

[0100] Determine the number of groups: After the sampled data is determined, the system needs to decide how to group the data. The number of groups can be determined based on the distribution characteristics of the data. For example, if the income distribution in the sampled data set is relatively uniform, you can choose to divide the data into 10 equally spaced groups; if the income data is skewed, more groups may be needed to accurately reflect the characteristics of the data distribution.

[0101] In practical applications, the number of groups can also be automatically determined based on experience, business requirements, or through data analysis tools. For large-scale data sets, the number of groups can be dynamically adjusted through statistical analysis.

[0102] Generation of grouped data sets: Once the number of groups is determined, the system will group the sampled data according to the set grouping criteria. For example, if you decide to divide the data into 10 groups, you can divide the income intervals into equal intervals, and the data points in each interval belong to the same group. Another method is to group based on the percentile of the data, such as dividing the data into 10 groups with each group containing 10% of the data points.

[0103] After the grouping is completed, the data of each group will form a grouped data set. All grouped data sets will constitute the overall number of groups for subsequent model training.

[0104] Example description: User income group analysis

[0105] Sampling data: Assume that there are 100,000 users in the original data set. By setting the income range to 5,000 to 20,000 yuan, we sample data from 60,000 users.

[0106] Determine the number of groups: Based on the distribution of income data, it is decided to divide the data into 5 groups, namely 5000-8000 yuan, 8001-11000 yuan, 11001-14000 yuan, 14001-17000 yuan, and 17001-20000 yuan.

[0107] Grouped dataset generation: The data of 60,000 users are grouped according to the above intervals to obtain 5 grouped datasets, each of which contains the data of users whose income is within the interval. These grouped datasets will be used for further analysis or model training, such as predicting user consumption behavior.

[0108] Through the above steps, the efficiency of data processing is improved, and the representativeness of the data and the accuracy of the analysis results are ensured.

[0109] Step S40, determining the best fitting distribution model based on the grouped data set, inputting the grouped data set into the best fitting distribution model to obtain a target data set, and using the original data set and the target data set to perform federated learning model training to obtain a target global model.

[0110] In this embodiment, before entering the fitting distribution model, the sampled data set needs to be grouped first. Each grouping should try to make the data have similar characteristics in the same interval. Usually the grouping method can be grouping by numerical interval, grouping by characteristic value, etc. The generated grouped data set will be the basis for the subsequent fitting model. For example, if it is income data, it can be divided into a "low-income group" (such as 0-5000 yuan), a "middle-income group" (5000-20000 yuan) and a "high-income group" (more than 20000 yuan).

[0111] Perform basic statistical analysis on each grouped data set and calculate its statistical indicators such as mean, variance, skewness and kurtosis. These indicators will help to preliminarily determine the distribution characteristics of the grouped data. Skewness is used to determine the symmetry of the data. Positive skewness means that the data is right-skewed, and negative skewness means that the data is left-skewed. Kurtosis is used to determine the peak or flatness of the data. A higher kurtosis means that the data is concentrated around the mean, and a lower kurtosis indicates that the data is more flat. For example, if the skewness of the data is found to be high, it may mean that the data presents a strong skewed distribution, which can guide the next step of model selection.

[0112] According to the statistical characteristics, several common distribution models are selected as candidate models. For example:

[0113] Normal distribution: Suitable when the data is symmetric and unbiased.

[0114] Gamma distribution: Suitable for non-negative, right-skewed data.

[0115] t-distribution: Suitable for small sample sizes and has wider tails.

[0116] Lognormal distribution: Applicable when the data presents a logarithmic relationship.

[0117] You can select 2-3 candidate distribution models to try based on the characteristics of the data.

[0118] Fit each candidate distribution model separately. The fitting process includes bringing the data into the distribution model and calculating the parameters of the model, such as the mean and standard deviation of the normal distribution, the shape parameter and scale parameter of the gamma distribution, etc. When fitting, it is necessary to use the maximum likelihood estimation (MLE) or other fitting algorithms to estimate the parameters of each model. This step aims to make the distribution of the model match the actual distribution of the data as much as possible.

[0119] Calculate the goodness of fit for each distribution model to assess whether the model can accurately describe the data. Common goodness of fit assessment indicators include:

[0120] Mean Square Error (MSE): Calculates the sum of squared errors between the model fitting value and the actual data. The smaller the error, the better the fitting effect.

[0121] Akaike Information Criterion (AIC): The smaller the AIC value, the better the model fit and the lower the complexity.

[0122] Bayesian Information Criterion (BIC): Similar to AIC, BIC takes into account model complexity through a penalty term. The lower the BIC value, the better.

[0123] These indicators are used to quantify the fitting effect of the model and select the distribution model with the best fitting.

[0124] According to the goodness of fit index (such as MSE, AIC, BIC, etc.), compare the fitting effects of all candidate distribution models, and select the model with the highest goodness of fit and the smallest error as the best fitting distribution model. When selecting the best model, not only the numerical value of the goodness of fit should be considered, but also the complexity of the model. Generally, models with better fitting effects and lower model complexity will be given priority.

[0125] After determining the best fitting distribution model, record the parameters of the model (such as the mean and variance of the normal distribution, the shape parameter and scale parameter of the Gamma distribution, etc.), and output the model and its fitting results. The data can be visualized, such as drawing a comparison chart of the fitted distribution curve and the actual distribution of the data to intuitively display the model fitting effect.

[0126] Once the best fitting distribution model is determined, a new dataset can be generated based on the model, called the target dataset. This target dataset has similar statistical properties to the original dataset, but because it is generated based on the distribution model, it can be used to enhance the diversity of the dataset or protect privacy in the event of data leakage.

[0127] Finally, the original data set and the generated target data set are used to train the federated learning model to obtain the final target global model. The target global model is not only the global model obtained in traditional federated learning, but also combined with the training of the target data set generated by fitting the distribution model. Therefore, the target global model has good privacy protection characteristics. At the same time, under the synergy of different data nodes, it can capture the characteristics of multi-party data and has strong generalization ability.

[0128] Specific implementations may be:

[0129] Determine the best fitting distribution model: Based on the grouped data set, the system will analyze the data distribution characteristics of each group. A common approach is to use statistical tests (such as chi-square test, Kolmogorov-Smirnov test) to evaluate the distribution type of the data. The system will try to fit multiple distribution models (such as normal distribution, gamma distribution, etc.) and select the distribution model with the best fit by comparing the goodness of fit (such as AIC, BIC, etc.).

[0130] For example, for a data set of income groups, the system might find that the income data best fits a lognormal distribution. Therefore, the system selects the lognormal distribution as the best fitting distribution model for that grouped quantity.

[0131] Forming the target dataset: Once the best fitting distribution model is selected, the system will use the model to generate new data points, which will form the target dataset. The generated data has similar statistical properties to the grouped dataset, but is not directly extracted from the original data, but is generated through model simulation, thereby increasing the diversity of the data. The generation of the target dataset can be based on the parameters of the distribution model, such as mean and variance. In the example of income grouping, the data points in the target dataset will be generated according to the fitted lognormal distribution and maintain a distribution shape similar to the original income data.

[0132] Federated learning model training: Under the framework of federated learning, the system will use the original data set and the generated target data set to train the model together. The characteristic of federated learning is that multiple participants train the model locally and collaborate through parameter exchange without sharing the original data. Training in combination with the target data set can further improve the robustness and generalization ability of the model while effectively protecting data privacy. For example, when conducting federated learning of a credit scoring model between multiple banks, each bank uses both local original data and a target data set generated based on the best fit distribution to train the model. Ultimately, multiple banks form a global model by sharing parameters without sharing each other's original data.

[0133] Example description: Distribution fitting of income data and target dataset generation

[0134] Determine the best fitting distribution model: After analyzing the income grouping data set, it was found that the data best fits the lognormal distribution, so the lognormal distribution was selected as the best fitting model.

[0135] Forming the target data set: Based on the lognormal distribution model, pseudo data similar to the original income data are generated to form the target data set. These pseudo data retain the characteristics of the income distribution but do not leak the real income information.

[0136] Federated learning model training: Using the original income data and generated pseudo data, multiple banks conduct model training in their respective local locations. Through the parameter sharing mechanism, a global credit scoring model is constructed.

[0137] Through the above steps, the training effect of the model is improved, the protection of data privacy is enhanced, and the privacy leakage risk existing in traditional federated learning is solved.

[0138] The present invention relates to a method for training a federated learning model, which extracts data features from an original data set and determines a sampling range according to the data features; samples the original data set according to the sampling range to obtain sampled data; determines the number of groups, and groups the sampled data according to the number of groups to form a grouped data set; then, by selecting the best fitting distribution model, the grouped data set is converted into a target data set; finally, the original data set and the target data set are used to train the federated learning model. The present invention effectively improves the efficiency and accuracy of model training by optimizing data sampling and grouping and combining the best fitting distribution model, while enhancing the effect of data privacy protection.

[0139] Furthermore, a second embodiment of the federated learning model training method of the present invention is proposed. In the above S40, determining the best fitting distribution model based on the grouped data set includes:

[0140] a1, select multiple preset fitting distribution models, fit each preset fitting distribution model respectively through the grouped data set, calculate the fitting degree of each preset fitting distribution model, and select the preset fitting distribution model with the highest fitting degree as the best fitting distribution model.

[0141] In this embodiment, during the data analysis process, there may be a variety of different distribution models, which are used to fit the distribution characteristics of the data. The preset fitting distribution models may include normal distribution, gamma distribution, lognormal distribution, chi-square distribution, t distribution, etc. In order to find the distribution model that best fits the grouped data set, it is first necessary to select a group of possible distribution models as candidates.

[0142] For each preset distribution model, the grouped data set is used for fitting. The fitting process is to adjust the parameters of the distribution model so that the model can reflect the distribution characteristics of the data set as much as possible. Each grouped data set is fitted to all candidate distribution models.

[0143] Goodness of fit is an indicator that measures how well a distribution model matches a data set. Common goodness of fit indicators include mean square error (MSE), Akaike Information Criterion (AIC), Bayesian Information Criterion (BIC), log likelihood, etc. By calculating these indicators, we can quantify the degree of fit between each model and the data. The higher the goodness of fit, the more suitable the model is for the data.

[0144] Finally, from all the preset distribution models, the model with the highest fit is selected as the best fitting distribution model. This model best reflects the distribution characteristics of the grouped data set and will be used in subsequent target data set generation and model training.

[0145] Specific implementations may be:

[0146] Select multiple preset fitting distribution models: Before determining the best fitting distribution model, you first need to select a set of candidate distribution models. For example, the system may select normal distribution, gamma distribution, lognormal distribution, t distribution, and chi-square distribution as preset fitting distribution models. These models cover common data distribution types and provide multiple choices for finding the best fitting model.

[0147] Fit each preset fitting distribution model by grouping the data set: Next, the system fits each grouped data set to all preset distribution models. For example, for an income data set, the system will use normal distribution, gamma distribution and other models for fitting. The fitting process adjusts the model parameters (such as mean, variance, etc.) to make the theoretical distribution of the model as close as possible to the distribution of the actual data.

[0148] Calculate the goodness of fit for each preset fitted distribution model: The system calculates a goodness of fit indicator for each distribution model, such as AIC or BIC. The higher the goodness of fit, the better the model matches the data. For example, if AIC is used as the goodness of fit indicator, the system will calculate the AIC value for each distribution model and judge the quality of the model based on these values.

[0149] Select the best fitting distribution model: Based on the fit index, select the distribution model with the highest fit as the best fitting distribution model. For example, if the AIC value of the Gamma distribution is the lowest (i.e., the fit is the highest) during the fitting of the income data, the system selects the Gamma distribution as the best fitting distribution model.

[0150] Example: Fitting process for income data

[0151] Select a preset fitted distribution model: Select Normal distribution, Lognormal distribution, Gamma distribution, and Chi-square distribution as candidate models.

[0152] Fitting process: After the income data is grouped, the above four distribution models are fitted to each grouped data set. The system adjusts the parameters of each model so that the theoretical distribution of each model matches the actual data as much as possible.

[0153] Calculate the goodness of fit: For each fitted model, calculate the AIC value and BIC value. Assuming that the AIC and BIC values ​​of the Gamma distribution are the lowest, it means that the Gamma distribution is the most suitable for fitting the income data.

[0154] Select the best model: Ultimately, the system selects the Gamma distribution as the best fitting distribution model for the income data and uses this model in subsequent target dataset generation.

[0155] Through the above steps, this embodiment ensures that the generated data can reflect the characteristics of the original data to the greatest extent possible, while enhancing the effect of data privacy protection.

[0156] Furthermore, a third embodiment of the federated learning model training method of the present invention is proposed. In the above step a1, each preset fitting distribution model is fitted respectively by the grouped data set, and the fitting degree of each preset fitting distribution model is calculated, including:

[0157] b1, fitting each preset fitting distribution model respectively through the grouped data set within a preset time length, and calculating the fitting degree of each preset fitting distribution model;

[0158] b2, when the fitting time of a preset fitting distribution model reaches the preset time length, the fitting process and the fitting degree calculation process of the preset fitting distribution model are terminated.

[0159] In this embodiment, in order to improve efficiency and avoid too long calculation time, a time limit (i.e., preset duration) is set for each distribution model fitting. Within this preset duration, the distribution model is fitted for each grouped data set. The fitting process is to adjust the parameters of the distribution model so that it can maximize the distribution characteristics of the actual data.

[0160] During the fitting process, the degree of fit between the model and the data is evaluated by calculating the fit index of each model (such as mean square error, AIC, BIC, etc.). The higher the fit, the more accurately the model can describe the distribution characteristics of the data.

[0161] If the fitting time of a model reaches the preset time limit, the system will immediately terminate the fitting process and the calculation of the fitting degree of the model. This step ensures that the calculation process is completed within a controllable time to prevent excessive calculation time from affecting the overall efficiency. Even if the optimal fit is not completed, the system will record the fitting degree at this time for subsequent model selection.

[0162] Specific implementations may be:

[0163] Set a preset duration: Before fitting a distribution model, the system first sets a time limit (such as 30 seconds or 1 minute) for the fitting process of each distribution model. This preset duration can be adjusted based on computing resources and the size of the data set.

[0164] The fitting process begins: Each preset distribution model is fitted on the grouped data set. For example, if the normal distribution and the gamma distribution are selected as candidate models, the system will fit these models simultaneously or sequentially, adjusting the model parameters to best match the data distribution.

[0165] Goodness of fit calculation: During the fitting process, the system will calculate the goodness of fit of the model in real time. For example, the current fit of the model can be evaluated by calculating the AIC or BIC value. The goodness of fit is continuously updated as the model parameters are adjusted.

[0166] Processing when the preset time is reached: When the fitting time of a distribution model reaches the preset time (such as 30 seconds), the system will immediately stop the fitting and fitting calculation of the model, and record the fitting at this time. Even if the model does not reach the global optimal fit, the system will use the fitting results at this time for subsequent analysis.

[0167] Subsequent selection and processing: Based on the fit indicators of each model, the system will select the model with the highest fit as the best fitting distribution model for subsequent target data set generation and federated learning model training.

[0168] Example: Time limit in financial data fitting

[0169] Preset duration: Set the time limit of the fitting process to 30 seconds to ensure that the fitting calculations of all distribution models are completed within a controllable time.

[0170] Fitting process: Assume that the system selects the normal distribution, lognormal distribution, and gamma distribution models when fitting the income data. The system starts fitting the normal distribution, calculates the AIC value of the model over time, and continuously adjusts the model parameters to optimize the fit.

[0171] Reaching the time limit: When the fitting process reaches 30 seconds, the system finds that the fitting process of the Gamma distribution is not yet completed, so it terminates the fitting of the Gamma distribution and records the fitting index at this time.

[0172] Result evaluation: Although the Gamma distribution does not reach the optimal fit state, the system still compares its fit with other models and selects the model with the highest fit (which may be the lognormal distribution that has been fitted) as the final best fit distribution model.

[0173] Through the above steps, this embodiment can effectively control the calculation time and ensure that the selection of the distribution model has high accuracy.

[0174] Furthermore, a fourth embodiment of the federated learning model training method of the present invention is proposed. In the above S10, determining the sampling range according to the data features includes:

[0175] c1, calculating the maximum value and the minimum value of the data feature, and taking the maximum value and the minimum value of the data feature as the maximum value and the minimum value of the sampling range.

[0176] In this embodiment, for each data feature, the maximum value (xmax) and minimum value (xmin) in the original data set are first calculated. These extreme values ​​represent the range of the feature in the data set and reflect the overall distribution of the data.

[0177] Once the maximum and minimum values ​​of a data feature are determined, these values ​​can be directly used to define the sampling range of the feature. In this way, the sampling range is limited to the actual value range of the data feature, ensuring that the sampled data can fully reflect the distribution of the feature.

[0178] Specific implementations may be:

[0179] Extract data features: Select target data features from the original data set. For example, in a user data set, select the user's age as the target data feature.

[0180] Calculate maximum and minimum values: Perform statistical analysis on the selected data features and calculate their maximum value (for example, the maximum value of the age feature may be 80) and minimum value (for example, the minimum value of the age feature may be 18) in the entire data set. These two values ​​mark the boundaries of the data features.

[0181] Determine the sampling range: The calculated maximum value (80) and minimum value (18) are used as the sampling range of the feature, and the sampled data points must fall within this range. That is, the sampling range is 18,80, and all data points with ages within this interval will be included in the sampled data set.

[0182] Sampling data: According to the determined sampling range, eligible data points are extracted from the original data set. All user data between the ages of 18 and 80 will be included in the sampling data set. This sampling data set will be used for subsequent analysis or model training.

[0183] In addition, before determining the maximum and minimum values, the data is usually analyzed for outliers. If there are extreme outliers (such as very high or very low values), these data points may be removed or corrected to redefine a more reasonable sampling range. For example, the maximum and minimum values ​​are set to the percentiles (P5-P95 interval) that remove the first 5% and last 5% of the data, rather than simply using the global maximum and minimum values.

[0184] Example description: Sampling of commodity price data

[0185] Extract data features: From the product data set of an e-commerce platform, select product price as the data feature.

[0186] Calculate the maximum and minimum values: Through statistical analysis, it is found that the minimum value of the commodity price is 1 yuan and the maximum value is 5,000 yuan.

[0187] Determine the sampling range: The minimum value of the price feature is 1 yuan and the maximum value is 5,000 yuan as the sampling range, that is, 1,5000 yuan.

[0188] Sampling data: Based on this sampling range, product data with prices between 1 yuan and 5,000 yuan are extracted from the original data set to form a sampling data set, which is used to analyze product pricing strategies or predict future sales trends.

[0189] Through the above steps, this embodiment ensures that the determination of the sampling range is based on the maximum and minimum values ​​of the actual data features, thereby ensuring that the sampled data can reflect the actual feature distribution.

[0190] Furthermore, a fifth embodiment of the federated learning model training method of the present invention is proposed. In the above S30, the number of groups is determined by analyzing the preset standard number or data distribution form, including:

[0191] d1, setting a preset standard number, and using the preset standard number as the grouping number;

[0192] d2, or performing data distribution morphology analysis on the sampled data, determining a quantity adjustment ratio according to the data distribution result, adjusting the preset standard quantity according to the quantity adjustment ratio, and obtaining the grouping quantity.

[0193] In this embodiment, before performing data grouping, it is necessary to first set an initial number of groups, which is called a "preset standard number". This number can be pre-set based on experience, historical data or business needs as a starting number of groups. If the data features are relatively simple and evenly distributed, the preset standard number may be directly used as the final number of groups.

[0194] If it is determined after analysis that the preset standard quantity does not need to be adjusted, then the preset standard quantity will be directly used as the final grouping quantity for subsequent data grouping. In this case, the data will be grouped according to this quantity.

[0195] If the distribution of data features is complex or uneven, it is necessary to analyze the distribution of the sampled data. This may involve statistical data such as mean, variance, skewness, kurtosis, etc., or use visualization tools such as histograms and density maps to observe the actual distribution of the data.

[0196] After analyzing the data distribution pattern, if it is found that the data distribution does not match the preset number of groups, the number of groups needs to be adjusted according to the actual distribution of the data. The adjustment ratio may be determined based on the degree of dispersion or concentration of the data. For example, if the data is concentrated in a certain area, the number of groups in that area may need to be increased, otherwise it may be reduced.

[0197] After the adjustment ratio is determined, the preset standard number will be adjusted according to the ratio to finally determine the number of groups suitable for the data distribution. This adjustment ensures that the grouping can better reflect the real distribution characteristics of the data and optimize the subsequent data analysis or model training.

[0198] Specific implementations may be:

[0199] Set a preset standard number: Before grouping the data, set an empirical number of groups (such as 100 groups or 10 groups), for example, divide the data into 10 groups. This preset standard number can be set based on past experience, the complexity of data features, or specific business needs.

[0200] Directly use the preset standard number: If the data distribution is relatively uniform or simple, the system may directly use the preset 10 groups as the final grouping number. The subsequent grouping process will be carried out according to this number without further adjustment.

[0201] Data distribution pattern analysis: For data features with complex distribution, the system will perform detailed distribution analysis on the sampled data. For example, use a histogram to observe the distribution pattern of the data, calculate the skewness and kurtosis of the data, and determine whether the data is concentrated in a certain area or has a multi-peak distribution.

[0202] Determine the adjustment ratio: Determine whether the number of groups needs to be adjusted based on the data distribution analysis results. For example, if the data is very concentrated in a certain interval, the number of groups in that area may need to be increased, and the adjustment ratio may be increased by 20% or decreased by 10%, etc. On the contrary, if the data distribution is relatively uniform, the adjustment ratio may be 0, that is, no adjustment is made.

[0203] Adjust the preset standard quantity to obtain the final number of groups: modify the preset standard quantity according to the determined adjustment ratio. For example, the original preset standard quantity is 10 groups. After analysis, it is decided to increase the number of groups by 20%, and the final number of groups is 12. In this way, the number of groups is more in line with the actual distribution of data, which helps to improve the accuracy of data processing and analysis.

[0204] Example description: Grouping of age data of e-commerce platform users

[0205] Set the number of preset standards: The system is initially set to divide user age data into 5 groups.

[0206] Directly use the preset standard number: If it is found that the age distribution of users is relatively uniform, the system may directly use 5 groups as the final number of groups.

[0207] Data distribution pattern analysis: Through histogram analysis, it is found that the user age data is concentrated between 25 and 35 years old, but the number of users over 45 years old is significantly reduced, and the data presents a skewed distribution.

[0208] Determine the proportion of quantity adjustment: Based on this finding, the system decides to increase the number of groups in the 25 to 35 age range, for example, by 50%, while keeping the same or reducing the number of groups in other ranges.

[0209] Adjustment of the number of groups: Based on the adjustment ratio, the final number of groups may increase from 5 to 7, of which there may be 3 groups in the 25 to 35 age range and 1 or 2 groups in the remaining ranges.

[0210] Through the above steps, this embodiment ensures that the number of data groups can adapt to the actual distribution of data and improve the effect of data analysis or model training.

[0211] Furthermore, a sixth embodiment of the federated learning model training method of the present invention is proposed, wherein the above S20 includes:

[0212] e1, determine a preset sample quantity range, sample the original data set according to the sampling range and the preset sample quantity range, and obtain sampled data, wherein the number of samples in the sampled data is within the preset sample quantity range.

[0213] In this embodiment, before sampling, a predefined sample quantity range needs to be set, that is, the upper and lower limits of the number of required samples. This range can be set according to actual business needs, computing resource limitations, or data characteristics. For example, the sample quantity range may be set to 10,000 to 50,000 data points to ensure that the sampled data is representative and does not exceed the capacity of computing resources.

[0214] After defining the sampling range and sample size range, the sampling process will be carried out according to these two criteria. First, the sampling range is determined based on the maximum and minimum values ​​of the data features, and then random sampling or other types of sampling are performed on the data that meets this sampling range to ensure that the final number of samples obtained is within the preset range.

[0215] The number of samples in the final sampled data set must fall within the preset sample number range. This means that no matter how large the original data set is, the sampled data set will be limited to a controllable sample number range, thereby ensuring the feasibility and efficiency of subsequent calculations.

[0216] Specific implementations may be:

[0217] Determine the preset sample number range: For example, in a user behavior analysis scenario, the sample number range is set to 10,000 to 50,000 data points based on computing resources and model training requirements. This range ensures the representativeness of the sampled data while also controlling the computational complexity.

[0218] Sampling based on the sampling range and the preset sample quantity range: First, determine the sampling range, for example, select users between 18 and 65 years old as the sampling range. Then, extract all data points that meet this sampling range from the original data set. Assume that there are 100,000 data points of users in this age group in the original data set.

[0219] Next, random sampling is performed from these 100,000 data points according to the preset sample size range, and the final sample size is between 10,000 and 50,000.

[0220] Ensure that the number of samples of the sampled data is within the preset range: When the system is sampling, it dynamically adjusts the sampling strategy to ensure that the number of samples in the final sampled data set meets the preset range. For example, if the amount of data obtained by the initial random sampling exceeds 50,000, then secondary sampling is performed or the sampling range is reduced, and vice versa. If the sampling result is less than 10,000, the sampling range may be expanded or multiple sampling methods may be used.

[0221] Example description: Sampling of bank customer credit data

[0222] Determine the preset sample size range: Set the sampling sample size range to 20,000 to 30,000 customer data points to ensure that the data is sufficient for training the credit risk model without increasing the computational burden too much.

[0223] Sampling based on the sampling range and the preset sample size range: Assume that the sampling range is customer data with a credit score between 600 and 800. There are 70,000 data points of customers in the original data set that meet this score range. In order to meet the preset sample size range, the system randomly selects 25,000 data points from these 70,000 customer data.

[0224] Ensure that the sample size is within the preset range: The final sample size of 25,000 customer data points falls within the preset range of 20,000 to 30,000, complies with the sampling strategy, and is used for subsequent credit risk model training.

[0225] Through the above steps, this embodiment ensures that the sampling process can not only follow the preset sampling range, but also control the final number of samples within a reasonable range, thereby optimizing the efficiency of data processing and model training.

[0226] Furthermore, a seventh embodiment of the federated learning model training method of the present invention is proposed. In the above S10, extracting data features from the original data set includes:

[0227] Step f1, determining a target variable, and calculating the correlation between the target variable and each data feature of the original data set.

[0228] In this example, the target variable is the main variable that the model is trying to predict or explain. It is part of the model output and is used to measure the effectiveness of the model. In supervised learning, the target variable is usually the result that the model wants to learn and predict. First, you need to clarify which variable in the entire dataset you want to predict or analyze through other features. For example, in a house price prediction model, the house price is the target variable.

[0229] Once the target variable is identified, the next step is to calculate the correlation between the target variable and each feature in the dataset. This can be done using a variety of methods such as Pearson’s correlation coefficient (for continuous data), Spearman’s correlation coefficient (for ordinal data), etc. Correlation measures can help identify which features have a significant impact on the target variable.

[0230] In order to filter out the most useful features for the target variable, a correlation threshold needs to be set. Only features with a correlation with the target variable exceeding this threshold will be retained for model training. This threshold can be set based on actual needs or through experience. For example, features with a correlation coefficient higher than 0.3 are considered meaningful.

[0231] Through the previous correlation analysis and threshold setting, we can screen out those data features that are highly correlated with the target variable. These features will be used as the main input in subsequent model training to help improve the accuracy and effect of the model.

[0232] Specific implementations may be:

[0233] Determine the target variable: In a credit scoring model, the target variable could be “credit score.” This is the output of the model and all other data features (like income, loan history, etc.) are used to predict this target variable.

[0234] Calculate correlation: Calculate the correlation between "credit score" and other data features (such as income, age, repayment history, etc.). Suppose that through the Pearson correlation coefficient calculation, it is found that the correlation coefficient between "credit score" and "income" is 0.65, the correlation coefficient with "age" is 0.3, and the correlation coefficient with "repayment history" is 0.75.

[0235] Set a correlation threshold: Set a correlation threshold, such as 0.5. Any data feature with a correlation with "credit score" greater than 0.5 will be retained, and features with a correlation below 0.5 will be excluded.

[0236] Screening features: By comparing the correlation coefficients, the two features "income" (0.65) and "repayment history" (0.75) are screened out because their correlations exceed the threshold of 0.5, while the "age" feature is excluded because of its correlation of 0.3.

[0237] Example description: Feature screening for house price prediction model

[0238] Determine the target variable: In a house price prediction model, the target variable is "house price".

[0239] Calculate correlations: Calculate the correlation between house prices and various data features such as house size, number of bedrooms, geographic location, etc. Suppose you find that house prices have a correlation of 0.8 with "house size", 0.6 with "number of bedrooms", and 0.2 with "geographic location".

[0240] Set the correlation threshold: Set the correlation threshold to 0.5. Any data feature with a correlation with house price exceeding 0.5 will be retained for model training.

[0241] Screening features: Based on the correlation analysis, "house area" (0.8) and "number of bedrooms" (0.6) are retained as model input features, while "geographic location" is excluded due to its low correlation (0.2).

[0242] Through the above steps, this embodiment ensures that the selected data features can affect the target variable to the greatest extent, thereby improving the prediction ability and accuracy of the model. This not only optimizes the feature selection process, but also improves the efficiency of model training.

[0243] The present invention also provides a federated learning model training device.

[0244] Reference Figure 3 , Figure 3 This is a functional module diagram of the first embodiment of the federated learning model training device of the present invention. The federated learning model training device comprises:

[0245] The data preprocessing module 10 is used to obtain an original data set, extract data features from the original data set, and determine a sampling range according to the data features;

[0246] A data sampling module 20, used for sampling in the sampling range to obtain sampling data;

[0247] A data grouping module 30 is used to determine the number of groups by a preset standard number or data distribution morphology analysis, and to group the sampled data according to the number of groups to obtain a grouped data set;

[0248] The model training and optimization module 40 is used to determine the best fitting distribution model based on the grouped data set, input the grouped data set into the best fitting distribution model to obtain a target data set, and use the original data set and the target data set to perform federated learning model training to obtain a target global model.

[0249] In addition, an embodiment of the present invention further provides a computer storage medium.

[0250] A federated learning model training program is stored on the storage medium, and when the federated learning model training program is executed by the processor, the steps of the federated learning model training method as described above are implemented.

[0251] The specific implementation of the storage medium of the present invention is basically the same as the embodiments of the above-mentioned federated learning model training method, and will not be repeated here.

[0252] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims. All equivalent structures or equivalent process changes made using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, are protected by the present invention.

[0253] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0254] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the 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 several 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: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, RandomAccess Memory), a disk or an optical disk.

[0255] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0256] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0257] 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 method for training a federated learning model, characterized in that: The following steps are involved: Acquire an original data set, extract data features from the original data set, and determine a sampling range according to the data features; Sampling within the sampling range to obtain sampling data; Determine the number of groups by a preset standard number or data distribution pattern analysis, and group the sampled data according to the number of groups to obtain a grouped data set; A best-fit distribution model is determined based on the grouped data set, the grouped data set is input into the best-fit distribution model to obtain a target data set, and the original data set and the target data set are used to perform federated learning model training to obtain a target global model.

2. The federated learning model training method according to claim 1, characterized in that: Determining a best-fit distribution model based on the grouped data set includes: Select multiple preset fitting distribution models, fit each preset fitting distribution model respectively through the grouped data set, calculate the fitting degree of each preset fitting distribution model, and select the preset fitting distribution model with the highest fitting degree as the best fitting distribution model.

3. The federated learning model training method according to claim 2, characterized in that: Fitting each preset fitting distribution model respectively through the grouped data set, and calculating the fitting degree of each preset fitting distribution model, including: Fitting each preset fitting distribution model respectively through the grouped data set within a preset time length, and calculating the fitting degree of each preset fitting distribution model; When the fitting time of a preset fitting distribution model reaches the preset time length, the fitting process and the fitting degree calculation process of the preset fitting distribution model are terminated.

4. The federated learning model training method according to claim 1, characterized in that: Determining a sampling range according to the data characteristics includes: The maximum value and the minimum value of the data feature are calculated, and the maximum value and the minimum value of the data feature are used as the maximum value and the minimum value of the sampling range.

5. The federated learning model training method according to claim 1, characterized in that: The number of groups is determined by pre-set standard quantity or data distribution pattern analysis, including: Setting a preset standard quantity, and using the preset standard quantity as the grouping quantity; Alternatively, a data distribution morphology analysis is performed on the sampled data, a quantity adjustment ratio is determined according to the data distribution result, and the preset standard quantity is adjusted according to the quantity adjustment ratio to obtain the grouping quantity.

6. The federated learning model training method according to claim 1, characterized in that: Sampling in the sampling range to obtain sampling data includes: Determine a preset sample quantity range, sample the original data set according to the sampling range and the preset sample quantity range, and obtain sampled data, wherein the number of samples in the sampled data is within the preset sample quantity range.

7. The method for training a federated learning model as claimed in claim 1, wherein: Extracting data features from the original data set includes: Determine a target variable, and calculate the correlation between the target variable and each data feature of the original data set; A correlation threshold is set, and data features whose correlation exceeds the correlation threshold are screened out from the data features of the original data set.

8. A federated learning model training device, characterized in that: The federated learning model training device comprises: A data preprocessing module is used to obtain an original data set, extract data features from the original data set, and determine a sampling range according to the data features; A data sampling module, used for sampling in the sampling range to obtain sampling data; A data grouping module, used to determine the number of groups by a preset standard number or data distribution morphology analysis, and group the sampled data according to the number of groups to obtain a grouped data set; A model training and optimization module is used to determine the best fitting distribution model based on the grouped data set, input the grouped data set into the best fitting distribution model to obtain a target data set, and use the original data set and the target data set to perform federated learning model training to obtain a target global model.

9. A federated learning model training device, characterized in that: The federated learning model training device includes a memory, a processor, and a federated learning model training program stored in the memory and executable on the processor. When the federated learning model training program is executed by the processor, the steps of the federated learning model training method as described in any one of claims 1 to 7 are implemented.

10. A computer storage medium, characterized in that: The storage medium stores a federated learning model training program, which, when executed by a processor, implements the steps of the federated learning model training method as described in any one of claims 1 to 7.