Federated learning configuration methods, devices, electronic equipment, and storage media
By acquiring and processing data from federated learning nodes, determining and merging the processing methods for features and labels, the problem of manual configuration errors is solved, achieving efficient and accurate federated learning configuration and reducing labor costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2026-04-03
AI Technical Summary
Manually configuring federated learning processes is prone to errors, leading to failures, and requires a great deal of expertise, increasing labor costs.
By acquiring the data to be processed from the current node and related nodes, it is determined whether the feature fields and labels are the features/labels to be processed, the processing methods are determined and merged, the data format is unified, and the preset machine learning model is trained.
It improves the configuration success rate of federated learning, reduces labor costs, improves the standardization and availability of data, and enhances the efficiency and accuracy of model training.
Smart Images

Figure CN115879528B_ABST
Abstract
Description
Technical Field
[0001] This application relates to artificial intelligence technology, and more particularly to a federated learning configuration method, apparatus, electronic device, and storage medium. Background Technology
[0002] Federated learning is a distributed machine learning technique that balances data privacy protection with data-sharing computation.
[0003] Federated learning builds upon machine learning by incorporating federated concepts, cryptography, distributed computing, network communication, and other algorithms. The different algorithm designs and internal logic demand a higher level of expertise and experience.
[0004] Manually configuring the federated learning process is prone to errors that can lead to failures, and it also requires personnel to acquire extensive professional knowledge, resulting in high labor costs. Summary of the Invention
[0005] This application provides a federated learning configuration method, apparatus, electronic device, and storage medium to improve configuration success rate and reduce labor costs.
[0006] Firstly, embodiments of this application provide a federated learning configuration method, which includes:
[0007] Retrieve the data to be processed from the current node and its associated nodes;
[0008] Determine whether each feature field of the data to be processed is a feature to be processed, and determine whether the label of the data to be processed is a label to be processed;
[0009] If each feature field is a feature to be processed, then determine the processing method for each feature to be processed; and if each label of the data to be processed is a label to be processed, then determine the processing method for each label to be processed.
[0010] The processing methods for each feature and label to be processed are combined to obtain the target processing method;
[0011] The data to be processed is processed according to the target processing method to obtain the data to be learned;
[0012] Train a pre-defined machine learning model based on the data to be learned.
[0013] Secondly, embodiments of this application also provide a federated learning configuration apparatus, which includes:
[0014] The pending data acquisition module is used to acquire pending data from the current node and associated nodes;
[0015] The pending data determination module is used to determine whether each feature field of the pending data is a pending feature, and to determine whether the label of the pending data is a pending label.
[0016] The processing method determination module is used to determine the processing method of each feature if each feature field is a feature to be processed, and to determine the processing method of each label if each label of the data to be processed is a label to be processed.
[0017] The processing method merging module is used to merge the processing methods of each feature to be processed and each label to be processed to obtain the target processing method;
[0018] The data acquisition module is used to process the data to be processed according to the target processing method to obtain the data to be learned.
[0019] The learning data application module is used to train a preset machine learning model based on the learning data.
[0020] Thirdly, embodiments of this application also provide an electronic device, which includes:
[0021] One or more processors;
[0022] Storage device for storing one or more programs;
[0023] When one or more programs are executed by one or more processors, the one or more processors implement any of the federated learning configuration methods provided in the embodiments of this application.
[0024] Fourthly, embodiments of this application also provide a storage medium including computer-executable instructions, which, when executed by a computer processor, are used to perform any of the federated learning configuration methods provided in embodiments of this application.
[0025] This application obtains data for federated learning by acquiring the data to be processed from the current node and associated nodes. It determines whether each feature field and label of the data to be processed is a feature to be processed, and whether processing is required for each feature field and label, improving data standardization and usability. If each feature field is a feature to be processed, the processing method for each feature is determined; if each label is a label to be processed, the processing method for each label is determined, reducing manual configuration workload and improving the efficiency and accuracy of subsequent model training. By merging the processing methods for each feature and label, a target processing method is obtained. Merging the processing methods for each feature field ensures that all data to be processed is processed uniformly according to the processing method, avoiding inconsistent feature field data formats, improving data usability, and ensuring that the subsequent data to be processed can be used to train the preset machine learning model. By processing the data to be processed according to the target processing method, the obtained data to be processed meets the model requirements, improving the success rate of subsequent model training. By training the preset machine learning model based on the data to be processed, a machine learning model for federated learning can be obtained. Therefore, the technical solution of this application solves the problems of manual configuration of federated learning process, which is prone to errors during configuration leading to federated learning failure, and requires configuration personnel to learn a lot of professional knowledge, resulting in high labor costs. It achieves the effect of improving the success rate of configuration and reducing labor costs. Attached Figure Description
[0026] Figure 1 This is a flowchart of a federated learning configuration method according to Embodiment 1 of this application;
[0027] Figure 2 This is a flowchart of a federated learning configuration method according to Embodiment 2 of this application;
[0028] Figure 3 This is a schematic diagram of a federated learning configuration device according to Embodiment 3 of this application;
[0029] Figure 4 This is a schematic diagram of the structure of an electronic device according to Embodiment 4 of this application. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first" and "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] Example 1
[0033] Figure 1 This is a flowchart of a federated learning configuration method provided in Embodiment 1 of this application. This embodiment can be applied to the configuration of machine learning models in federated learning. The method can be executed by a federated learning configuration device, which can be implemented in software and / or hardware and specifically configured in a federated learning platform, such as a computer.
[0034] See Figure 1 The federated learning configuration method shown includes the following steps:
[0035] S110. Obtain the data to be processed for the current node and associated nodes.
[0036] The current node can be the current data platform, used for federated learning of the data to be processed. Related nodes are platforms that need to be acquired when the current node performs federated learning on the data to be processed. For example, if the current node is data platform A, and when the current node processes data from platform A, it needs to perform federated learning on the related data from data platforms B, C, and D. In this case, data platforms B, C, and D are related nodes of data platform A. The data to be processed can be the data required for federated learning between the current node and related nodes.
[0037] The core idea of federated learning is to build a global model based on virtual fused data by distributing model training among multiple current nodes and associated nodes that possess local data, without exchanging local individual data or sample data among the nodes, but only by exchanging model parameters or intermediate results. This achieves a balance between data privacy protection and data-sharing computation, namely, a new application paradigm of "data usable but not visible" and "data stationary while the model moves".
[0038] In one optional embodiment, obtaining the pending data of the current node and associated nodes includes: determining whether to obtain the pending data of the node based on at least one of the communication latency, failure rate and data quality of the current node and associated nodes.
[0039] When obtaining the data to be processed from the current node and associated nodes, the system first determines whether the node's communication latency, failure rate, and data quality meet the requirements. If any one of these requirements is not met, the data from that node will not be used as the data to be processed.
[0040] Specifically, if a node experiences significant communication latency, it is recommended not to use that node; if a node has a high failure rate in recent federated learning due to communication or hardware failures, it is recommended not to use that node; if a node's data has a high failure rate in recent federated learning due to low data quality, it is recommended not to use that node. "Recently" can refer to a preset time period, such as within a week, ten days, or a month. This application does not impose specific limitations on this; limitations can be set according to actual needs. For example, data quality can be characterized by a small sample size, many missing values, or many outliers.
[0041] By determining whether to acquire the pending data of a node based on at least one of the communication latency, failure rate, and data quality of the current node and its associated nodes, the decision to acquire the pending data of a node is made from multiple aspects at the node level, thus ensuring the overall quality of the acquired pending data.
[0042] S120. Determine whether each feature field of the data to be processed is a feature to be processed, and determine whether the label of the data to be processed is a label to be processed.
[0043] Each feature field can be any field in the data to be processed that represents different features, used to process the data to be processed to obtain the data to be learned. For example, when the data to be processed is data representing area, the feature fields can include length, width, and height.
[0044] The features to be processed can be feature fields that require processing. Preset rules can be used to determine whether each feature field in the data to be processed is a feature to be processed. These preset rules can be pre-defined processing methods for feature fields, and can be set according to a preset machine learning model or federated learning objective. For example, preset rules could include character digitization, filling in missing values, and deleting outliers.
[0045] In an optional embodiment, determining whether each feature field of the data to be processed is a feature to be processed includes: judging whether each feature field of the data to be processed meets preset feature processing conditions, wherein the preset feature processing conditions include at least one of the following: the presence of characters, the presence of missing data, the presence of outliers, and weak correlation; and determining whether each feature field is a feature to be processed based on the judgment result.
[0046] The preset feature processing conditions can be pre-defined conditions that require processing of feature fields. Specifically, if a feature of the data to be processed meets the preset feature processing conditions, then that feature of the data to be processed is determined as the feature to be processed.
[0047] The presence of characters refers to the presence of characters in the data of the feature field. The presence of missing values refers to the presence of missing values or empty values in the feature field. The presence of outliers refers to isolated points in the feature field where the distribution is highly skewed. Specifically, outliers can be pre-defined using relevant thresholds. For example, a threshold based on the distance from the center of the numerical distribution can be set. Weak correlation refers to feature fields that are weakly correlated with the purpose of federated learning. Specifically, correlation can be calculated using a formula or set manually; this application does not impose specific limitations on this.
[0048] If any of the feature fields of the data to be processed satisfy any one of the following conditions: the presence of characters, the presence of missing data, the presence of outliers, or weak correlation, then the feature field is determined to be a feature to be processed; otherwise, the feature field is not determined to be a feature to be processed.
[0049] By judging whether each feature field of the data to be processed meets the preset feature processing conditions, the preset feature processing conditions include at least one of the following: the presence of characters, the presence of missing data, the presence of outliers, and weak correlation. Based on the judgment results, it is determined whether each feature field is a feature to be processed. The features to be processed can be determined from aspects such as the presence of characters, the presence of missing data, the presence of outliers, and weak correlation, so as to ensure the comprehensiveness of the determination of the features to be processed.
[0050] Labels can be the output values of federated learning in the data to be processed. For example, if the purpose of federated learning is to determine the type of vehicle in an image, the labels could include cars, trucks, and buses. Labels to be processed can be the labels that need to be processed. Preset rules can be used to determine whether the labels in the data to be processed are suitable for processing. These preset rules can be pre-defined methods for processing labels. For example, preset rules could include specifying positive examples, removing non-target values, and character digitization.
[0051] In an optional embodiment, determining whether the label of the data to be processed is a label to be processed includes: judging whether the label of the data to be processed meets the preset label processing conditions, wherein the preset label processing conditions include at least one of the following: a positive example needs to be specified, a non-target value exists, and a character exists; and determining whether the label is a label to be processed based on the judgment result.
[0052] Positive examples can be used to determine the evaluation value of a pre-defined machine learning model during subsequent training, such as the model's accuracy. Therefore, when there are two labels, it is necessary to determine one of the two labels as a positive example.
[0053] Specifying a positive example is required when the label value is 2 but no positive example is explicitly defined. The existence of a non-target value can occur when the label value is 2 and can be either 0 or 1, or when there are two or more labels that are concentrated on two values, and the federated learning is binary classification. The presence of a character can also occur when a character exists within the label.
[0054] If the label of the data to be processed meets any of the following conditions: a positive example needs to be specified, a non-target value exists, or a character exists, then the label is determined to be a label to be processed; otherwise, the label is not determined to be a label to be processed.
[0055] By judging whether the label of the data to be processed meets the preset label processing conditions, the preset label processing conditions include at least one of the following: a positive example needs to be specified, a non-target value exists, and a character exists; based on the judgment result, it is determined whether the label is a label to be processed. The label to be processed can be determined from aspects such as specifying a positive example, having a non-target value, and having a character, so as to ensure the comprehensiveness of the determination of the label to be processed.
[0056] S130. If each feature field is a feature to be processed, then determine the processing method for each feature to be processed; and if each label of the data to be processed is a label to be processed, then determine the processing method for each label to be processed.
[0057] The processing methods can be tailored to the features or labels being processed. For example, if the feature to be processed contains characters, the processing method could be to convert the characters into numerical values. For instance, the numerical conversion method could be a single valid code or binning of character-type features within a feature bin. For example, if the feature to be processed has missing values, the processing method could be to fill in the missing values. The filling method can be determined based on the data type. For example, if the data type is character, the mode of the feature field can be selected for filling, or it can be consistent with the previous option. For example, if the data type is number, the mean or median of the feature field can be selected for filling. Furthermore, if the missing values meet a preset threshold, the feature field can be deleted; for example, if the missing values reach 50%, the feature field is deleted. For example, if the feature to be processed has outliers, the processing method could be to replace the outliers with the average value or remind the user to set outlier handling methods. For example, if the feature to be processed has weak correlation, the processing method could be to delete the feature.
[0058] For example, if the label to be processed requires specifying a positive example, the processing method can be to prompt relevant personnel to specify a positive example. For instance, if the target result has values of 0 and 1, the user needs to be prompted to select 0 or 1 as the positive example; if the target result has two possible values, but the values are other than 0 and 1, the user needs to be prompted to specify a certain value as the positive example. For example, if the label to be processed contains non-target values, the processing method can be to unify the labels to be processed or delete the data corresponding to the non-target value labels. For example, if the label to be processed contains characters, the processing method can be to convert the characters into numerical values.
[0059] The specific handling method can be shown to the staff, and the staff can be reminded and given suggestions, and then the staff can determine the final handling method.
[0060] S140. Combine the processing methods of each feature to be processed and each label to be processed to obtain the target processing method.
[0061] The target processing method can be the processing method for each feature and label to be processed in the current node and its associated nodes. This method is used to uniformly process the data to be processed in the current node and its associated nodes, thereby improving the efficiency and accuracy of federated learning. The processing methods for the features and labels to be processed in the data to be processed in the current node and its associated nodes may differ. Therefore, the processing methods for each feature and label to be processed can be merged to obtain the target processing method.
[0062] For example, the processing methods for each feature to be processed may include at least one of padding, deletion, and character encoding; the processing methods for each tag to be processed may include at least one of specifying positive examples, standardization, and character encoding. Combining the processing methods for each feature and tag to be processed allows for processing of a feature or tag performed on a certain node to be performed on other nodes in the same way. For example, after padding a feature field of a previous node, the same feature field of related nodes must also be padded to ensure that the data to be processed after the target processing method has the same data length or type.
[0063] In an optional embodiment, before merging the processing methods of each feature to be processed and each label to be processed, the method further includes: determining a target processing method suggestion based on the processing results of the historical processing methods of each feature to be processed and each label to be processed in the data to be processed.
[0064] The results of historical processing methods can be the evaluation metrics for federated learning of data processed using that method in historical federated learning. These metrics could include accuracy, stability, and generalization. For example, if removing outliers from a specific feature field of the historical data improves the accuracy of federated learning, then outlier removal of that feature field is recommended.
[0065] By determining the target processing method based on the processing results of each feature and label of the data to be processed in the past, the rationality of the target processing method and the accuracy of subsequent federated learning can be improved.
[0066] S150. Process the data to be processed according to the target processing method to obtain the data to be learned.
[0067] The data to be learned can be data processed according to a specific objective method, used to train a pre-defined machine learning model. By processing the data according to the objective method, the subsequent training of the pre-defined machine learning model can be effectively improved, thus enhancing the efficiency and accuracy of federated learning. For example, the objective method could be the digitization of characters, which can effectively reduce errors during training. Similarly, the objective method could be the removal of outliers from various feature fields, which can effectively improve the accuracy of the trained model. Processing the data according to the objective method ensures a unified data processing approach, meaning that the data processing method for the current node and its associated nodes is the same.
[0068] S160. Train a preset machine learning model based on the data to be learned.
[0069] The preset machine learning model is a machine learning model pre-selected by this node based on the target result, used to train the preset machine learning model on the data to be learned. The target result can be the result that the user of the current node wants to obtain through federated learning based on the preset machine learning model. For example, the target result can be a regression result or a classification result, etc., which the user can determine according to actual needs.
[0070] In an optional embodiment, before training a preset machine learning model based on the data to be learned, the method further includes: determining a suggested model for the preset machine learning model based on the number of labels in the data to be processed, and after determining the preset machine learning model, determining a suggested target processing method based on the historical target processing methods of the determined preset machine learning model.
[0071] Federated learning can determine a preset machine learning model from multiple candidate machine learning models. Candidate machine learning models can be any machine learning model available to the current node for federated learning. The preset machine learning model can be a machine learning model that matches the target result. For example, the preset machine learning model can be a binary classification machine learning model, a multi-class machine learning model, or a regression machine learning model, etc.
[0072] After obtaining the target result, the current node can provide suggestions for selecting a preset machine learning model based on the target result, so that users can make a quick selection and improve the speed and reliability of model selection.
[0073] The number of labels in the data to be processed is also the number of possible values for the target result. Therefore, the suggested model for the preset machine learning model can be determined by the number of labels.
[0074] For example, if the number of labels is 2, the default machine learning model is recommended to be a binary classification machine learning model. Specifically, if the number of labels is 2, the default machine learning model can be selected from the following machine learning models: logistic regression, Poisson regression, decision tree, XGBoost (a technical term, an optimized distributed gradient boosting library), and support vector machine, etc.
[0075] For example, if the number of labels is greater than 2 and less than or equal to 6, the default machine learning model is recommended to be a multi-class machine learning model. Specifically, if the number of possible values for the target result is greater than 2 and less than or equal to 6, the default machine learning model can be selected from the following machine learning models: multi-class machine learning models such as logistic regression and decision trees.
[0076] For example, if the number of labels is greater than 6, the default machine learning model is a regression model. Specifically, if the number of possible values for the target result is greater than 6, the default machine learning model can be selected from the following models: regression and generalized linear regression, etc.
[0077] For example, if the number of labels is 0, the default machine learning model is recommended to be a clustering machine learning model. Specifically, if the number of possible values for the target result is 0, the default machine learning model can be selected from the following machine learning models: K-means (K-means Clustering Algorithm, an iterative clustering analysis algorithm) and DBSCAN (Density-Based Spatial Clustering of Applications with Noise, a density-based clustering algorithm) machine learning models.
[0078] For example, suggestions for preset machine learning models can be presented to the user in various forms, such as selection or enumeration. After the user makes a selection, the machine learning model selected by the user is used as the preset machine learning model.
[0079] After determining the preset machine learning model, based on the historical target processing methods of the determined preset machine learning model, a target processing method suggestion is determined. For example, the target processing method suggestion could be that the historical target processing method includes numerical normalization, and that the accuracy of the model is improved after normalization.
[0080] Suggested target processing methods are presented to staff to help them optimize these methods, thereby improving the rationality of target processing configuration and increasing the success rate of federated learning configuration.
[0081] The technical solution of this embodiment obtains the data to be processed from the current node and associated nodes, thus acquiring the data for federated learning. It determines whether each feature field of the data to be processed is a feature to be processed, and whether the label of the data to be processed is a label to be processed. Based on these factors, it determines whether processing is required, improving the standardization and usability of the data. If each feature field is a feature to be processed, the processing method for each feature to be processed is determined; if each label of the data to be processed is a label to be processed, the processing method for each label to be processed is determined. This reduces the workload of manual configuration and improves the efficiency and accuracy of subsequent model training. The accuracy of the data is ensured by merging the processing methods of each feature and label to be processed, thus obtaining the target processing method. Merging the processing methods of each feature field ensures that all data to be processed is processed uniformly according to the target method, avoiding inconsistent feature field data formats, improving data usability, and guaranteeing that the subsequent training data can be used to train the preset machine learning model. Processing the data to be processed according to the target processing method ensures that the obtained training data meets the model requirements, improving the success rate of subsequent model training. Training the preset machine learning model based on the training data yields the machine learning model for federated learning. Therefore, the technical solution of this application solves the problems of manually configuring the federated learning process, which is prone to errors leading to failure, and requires personnel to learn extensive professional knowledge, resulting in high labor costs. This achieves the effect of improving the success rate of configuration and reducing labor costs.
[0082] Example 2
[0083] Figure 2 This is a flowchart of a federated learning configuration method provided in Embodiment 2 of this application. The technical solution of this embodiment is further refined based on the above technical solution.
[0084] Furthermore, the phrase "train a preset machine learning model based on the data to be learned" is further refined into: "obtain historical configuration data of the preset machine learning model; update the preset machine learning model based on the configuration results of the historical configuration data; train the updated preset machine learning model based on the data to be learned," so as to automatically configure the model.
[0085] See Figure 2 One example of a federated learning configuration method is shown, which includes:
[0086] S210. Obtain the data to be processed for the current node and associated nodes.
[0087] S220. Determine whether each feature field of the data to be processed is a feature to be processed, and determine whether the label of the data to be processed is a label to be processed.
[0088] S230. If each feature field is a feature to be processed, then determine the processing method for each feature to be processed; and if each label of the data to be processed is a label to be processed, then determine the processing method for each label to be processed.
[0089] S240. Combine the processing methods of each feature to be processed and each label to be processed to obtain the target processing method.
[0090] S250. Process the data to be processed according to the target processing method to obtain the data to be learned.
[0091] S260. Obtain historical configuration data for the preset machine learning model.
[0092] Historical configuration data can be the configuration data for the preset machine learning model prior to the current configuration, used for configuring the preset machine learning model. For example, historical configuration data may include configuration processes, configuration results, parameter configurations, and component configurations. During the historical configuration process, candidate machine learning models store their corresponding configuration data as historical configuration data, and are identified according to the candidate machine learning model category. The corresponding historical configuration data can be retrieved based on the identifier of the preset machine learning model category.
[0093] S270. Update the preset machine learning model based on the configuration results of historical configuration data.
[0094] Configuration results can include successful and failed configurations, indicating whether the machine learning model configured through this process is usable. Based on historical configuration data showing failed configurations, the reasons for failures can be determined, allowing for correction of the default machine learning model's configuration data and preventing future failures. Successful configuration results can include the model's evaluation results. By comparing successful configuration data with historical data, optimal configuration data can be identified and used to update the default machine learning model's configuration, thus improving its performance. For example, improving the default machine learning model's performance could involve increasing its accuracy.
[0095] In one optional embodiment, updating the preset machine learning model based on the configuration results of historical configuration data includes: determining the failure reason of the configuration result being the historical configuration data that failed to configure; if the failure reason is a missing configuration process, updating the preset machine learning model based on the missing information of the missing process; otherwise, determining the model evaluation result of the preset machine learning model configured by the historical configuration data that succeeded to configure; selecting the configuration process corresponding to the historical configuration data with the highest model evaluation result, and updating the preset machine learning model.
[0096] Configuration failure can result in a configuration outcome indicating that the machine learning model is unavailable. The reason for failure can be the cause of the configuration failure. The reason for failure can be determined by examining the corresponding records in historical configuration data where the configuration outcome was a failure. Specifically, the reason for failure can include missing configuration or configuration errors. For example, a configuration failure could be due to the absence of component A being configured. Alternatively, a configuration failure could be due to an incorrect configuration of parameter B. The reason for failure can be determined based on missing and incorrect configuration data.
[0097] If the failure is due to missing configuration data, the missing configuration data will be automatically filled in when configuring the preset machine learning model; if the failure is due to a configuration error, the incorrect configuration data will be automatically corrected when configuring the preset machine learning model. The correct configuration data for correcting incorrect configuration data can be obtained from historical configuration data where the configuration result was successful.
[0098] By identifying the reasons for configuration failures in historical configuration data, and updating the preset machine learning model based on these reasons, configuration errors in the preset machine learning model can be avoided, the model configuration success rate can be improved, manual operations can be reduced, and labor costs can be lowered.
[0099] Missing steps can refer to steps that are missing from a configuration process. Specifically, missing steps can be due to missing configuration parameters or components. Missing information can refer to specific details of the missing process. Specifically, missing information includes the location and content of the missing steps.
[0100] Based on the missing location and content of the missing process, the system automatically fills in the corresponding content and updates the preset machine learning model. For example, if the missing information is the number of training epochs in the training parameters, then the parameter for the number of training epochs will be filled in the configuration location. The automatically filled content can be obtained from the successful configuration results. For example, if the missing information is component A in model building, then component A will be configured in the model building process.
[0101] If the failure is due to a missing configuration process, the preset machine learning model is updated based on the missing information of the missing process to avoid missing configuration processes, ensure the integrity of the configuration, reduce manual configuration processes, and improve the configuration success rate.
[0102] Otherwise, the configuration failure is not due to a missing configuration process. Successful configuration results in a configuration usable by the machine learning model. Model evaluation results can be performance evaluations of the model, used to assess its performance. For example, model evaluation results may include evaluation metrics such as accuracy, efficiency, and stability. Model evaluation results can be a weighted average of the scores for each evaluation metric or a score for a single evaluation metric; the choice can be made based on actual needs, and this application does not impose specific limitations on this.
[0103] The highest evaluation result can be the maximum weighted sum of scores from all evaluation metrics, or the highest score for a single metric. A highest evaluation result indicates that the machine learning model configured based on the corresponding configuration data performs best. Therefore, the configuration process corresponding to the historical configuration data with the highest model evaluation result can be selected to configure the preset machine learning model and update it. When users manually configure the model, appropriate prompts can also be provided based on the model evaluation results.
[0104] Optionally, historical configuration data showing successful configuration results can be analyzed to determine configurations that improve model evaluation results, and suggestions can be provided when users make configurations.
[0105] Improving model evaluation results can be achieved through configurations such as parameters or training data. For example, analyzing historical configuration data showing successful configurations reveals that a pre-defined machine learning model using feature field A for federated learning has high accuracy. Therefore, suggestions can be provided during the configuration process of the corresponding pre-defined machine learning model. For instance, the suggestion could be: "Selecting feature field A as a training parameter can improve model accuracy."
[0106] Optionally, the default machine learning model configuration habits of the same user can be inherited, and the default machine learning model can be updated when the user configures it again.
[0107] Configuration habits can include configuration selection preferences and error-prone configuration processes. Automatic configuration can be performed at user-preferred settings based on these preferences, reducing manual configuration steps. Warnings can be provided at points in the user's frequently missed configuration processes, and incorrect configuration steps can be corrected to improve the success rate of configuration.
[0108] By identifying the failure reasons from historical configuration data that resulted in configuration failures, corrections or suggestions can be made for different failure reasons. If the failure reason is a missing configuration process, the preset machine learning model is updated based on the missing information to avoid missing configuration processes, ensure configuration integrity, reduce manual configuration processes, and improve the configuration success rate. Otherwise, the configuration result is determined to be the model evaluation result of the preset machine learning model configured from historical configuration data that resulted in successful configurations. The configuration process corresponding to the historical configuration data with the highest model evaluation result is selected to update the preset machine learning model. Based on the experience of successful configurations in the past, the configuration process of the preset machine learning model can be optimized to improve the performance of the updated preset machine learning model.
[0109] In one optional embodiment, updating the preset machine learning model based on the configuration results of historical configuration data includes: determining the impact values of each node, target processing method, and each candidate influencing factor in the machine learning model on the model learning effect; determining optimization suggestions for the preset machine learning model based on the impact values of each candidate influencing factor on the model learning effect; and updating the preset machine learning model based on the response to the optimization suggestions.
[0110] Each candidate influencing factor can be a node, target processing method, or factor in the machine learning model that may affect the configuration result. For example, each candidate influencing factor can be a node, feature to be processed, label to be processed, or the configuration process of the machine learning model. The impact value of the learning effect can be an evaluation value representing the impact on each evaluation result of the model. For example, the learning effect can be computation time or model evaluation metrics. Optimization suggestions can be suggested processing methods for each candidate influencing factor, determined based on the impact values of each candidate influencing factor on the model's learning effect.
[0111] For example, if a historical task takes a long time to compute for the same data and the same machine learning model, then an optimization suggestion could be to change the parameters of the machine learning algorithm. Specifically, optimization suggestions could include: configuring feature selection to reduce features with low value; configuring standardization to reduce the number of sample values.
[0112] For example, if the learning performance on a historical task is poor with the same data and the same machine learning model, then optimization suggestions could include changing the parameters of the machine learning algorithm. Specifically, optimization suggestions could include: configuring supervised learning feature binning, such as chi-square binning; configuring standardization to unify the range of sample values; configuring outlier detection to unify the range of sample values; and configuring hierarchical data splitting to avoid inconsistent dataset distribution.
[0113] For example, if the learning performance on a historical task is poor with the same data and the same machine learning model, then optimization suggestions could be to optimize the machine learning algorithm. Specifically, optimization suggestions could include: changing to a different machine learning algorithm, for example, suggesting a change from generalized linear regression to a tree model, or suggesting a change from an unsupervised learning model to a supervised learning model.
[0114] It should be noted that the system can intelligently analyze historical tasks to identify key factors affecting computation time and learning outcomes. Specifically, inputs can include the nodes of each task, the target processing method, key information of the preset machine learning model, computation time, and learning outcomes. Outputs include the correlation coefficients and entropies between each key piece of information and computation time, as well as the correlation coefficients and entropies of the learning outcomes.
[0115] If an indicator meets a preset threshold, such as a correlation coefficient greater than 0.3 or an information entropy greater than 0.1, then the information is considered important, and optimization suggestions such as modification, deletion, or addition should be provided in the new federated learning configuration. For example, if the correlation coefficient between a participating node and computation time is greater than 0.3, it indicates that the participating node has a significant impact on computation time. Identify the key node, such as node 3, and suggest not adopting node 3. Similarly, if the correlation coefficient between a participating node and the AUC (Area Under Curve, a learning performance evaluation metric) is greater than 0.3, it indicates that the participating node has a significant impact on learning performance. Identify the key node, such as node 3, and suggest adopting node 3.
[0116] The response to optimization suggestions for a preset machine learning model can be an action taken by a staff member in response to the optimization suggestions. For example, the response to optimization suggestions for a preset machine learning model can be to adopt the optimization suggestion or not adopt the optimization suggestion.
[0117] The preset machine learning model is updated based on the configuration results of historical configuration data. This includes: determining the impact of each node, target processing method, and candidate influencing factors in the machine learning model on the model's learning performance; determining optimization suggestions for the preset machine learning model based on the impact of each candidate influencing factor on the model's learning performance; and updating the preset machine learning model based on the response to the optimization suggestions, thereby optimizing the model configuration and improving the success rate of configuration.
[0118] S280. Train the updated preset machine learning model based on the data to be learned.
[0119] After obtaining the updated preset machine learning model, the updated preset machine learning model is trained on the data to be learned for subsequent federated learning.
[0120] The technical solution of this embodiment involves acquiring historical configuration data of a preset machine learning model; updating the preset machine learning model based on the configuration results of the historical configuration data; and training the updated preset machine learning model based on the data to be learned. Configuring and updating the preset machine learning model based on historical configuration data reduces manual configuration processes. Furthermore, updating the preset machine learning model based on the configuration results of historical configuration data, and using configuration data with better historical configuration results to update the preset machine learning model, improves the success rate of configuration.
[0121] Example 3
[0122] Figure 3 The diagram shown is a schematic representation of a federated learning configuration device according to Embodiment 3 of this application. This embodiment is applicable to configuring machine learning models in federated learning. The specific structure of the federated learning configuration device is as follows:
[0123] The pending data acquisition module 310 is used to acquire pending data from the current node and associated nodes;
[0124] The pending processing determination module 320 is used to determine whether each feature field of the pending data is a pending feature, and to determine whether the label of the pending data is a pending label;
[0125] The processing method determination module 330 is used to determine the processing method of each feature if each feature field is a feature to be processed, and to determine the processing method of each label if each label of the data to be processed is a label to be processed.
[0126] The processing method merging module 340 is used to merge the processing methods of each feature to be processed and each label to be processed to obtain the target processing method;
[0127] The learning data acquisition module 350 is used to process the data to be processed according to the target processing method to obtain the learning data;
[0128] The learning data application module 360 is used to train a preset machine learning model based on the learning data.
[0129] The technical solution of this embodiment obtains the data to be processed from the current node and associated nodes, thus acquiring the data for federated learning. It determines whether each feature field of the data to be processed is a feature to be processed, and whether the label of the data to be processed is a label to be processed. Based on these factors, it determines whether processing is required, improving the standardization and usability of the data. If each feature field is a feature to be processed, the processing method for each feature to be processed is determined; if each label of the data to be processed is a label to be processed, the processing method for each label to be processed is determined. This reduces the workload of manual configuration and improves the efficiency and accuracy of subsequent model training. The accuracy of the data is ensured by merging the processing methods of each feature and label to be processed, thus obtaining the target processing method. Merging the processing methods of each feature field ensures that all data to be processed is processed uniformly according to the target method, avoiding inconsistent feature field data formats, improving data usability, and guaranteeing that the subsequent training data can be used to train the preset machine learning model. Processing the data to be processed according to the target processing method ensures that the obtained training data meets the model requirements, improving the success rate of subsequent model training. Training the preset machine learning model based on the training data yields the machine learning model for federated learning. Therefore, the technical solution of this application solves the problems of manually configuring the federated learning process, which is prone to errors leading to failure, and requires personnel to learn extensive professional knowledge, resulting in high labor costs. This achieves the effect of improving the success rate of configuration and reducing labor costs.
[0130] Optionally, the process determination module 320 includes:
[0131] The preset feature processing condition judgment unit is used to determine whether each feature field of the data to be processed meets the preset feature processing conditions. The preset feature processing conditions include at least one of the following: the presence of characters, the presence of missing data, the presence of outliers, and weak correlation.
[0132] The feature determination unit is used to determine whether each feature field is a feature to be processed based on the judgment result.
[0133] as well as,
[0134] The label processing condition judgment unit is used to determine whether the label of the data to be processed meets the preset label processing conditions. The preset label processing conditions include at least one of the following: a positive example needs to be specified, a non-target value exists, and a character exists.
[0135] The tag determination unit is used to determine whether a tag is a tag to be processed based on the judgment result.
[0136] Optionally, the federated learning configuration device may also include:
[0137] The target processing method suggestion module is used to determine the target processing method suggestion based on the processing results of each feature to be processed and the historical processing methods of each label to be processed.
[0138] Optional, the learning data application module 360 includes:
[0139] The historical configuration data acquisition unit is used to acquire historical configuration data of the preset machine learning model;
[0140] The model update unit is used to update the preset machine learning model based on the configuration results of historical configuration data.
[0141] The model training unit is used to train an updated preset machine learning model based on the data to be learned.
[0142] Optional, the model update unit includes:
[0143] The failure reason determination subunit is used to determine the failure reason of historical configuration data where the configuration result is a configuration failure.
[0144] The model update subunit is used to update the preset machine learning model based on the missing information of the missing process if the failure is due to a missing configuration process.
[0145] The evaluation result determines the sub-unit; otherwise, the configuration result is determined as the model evaluation result of the preset machine learning model configured based on the historical configuration data that was successfully configured.
[0146] The configuration process determines the sub-unit, which is used to select the configuration process corresponding to the historical configuration data with the highest model evaluation result and update the preset machine learning model.
[0147] Optional, the model update unit includes:
[0148] The influence value determination subunit is used to determine the influence value of each node, target processing method, and candidate influencing factors in the machine learning model on the model learning effect.
[0149] The optimization suggestion determination sub-unit is used to determine the optimization suggestions for the preset machine learning model based on the impact value of each candidate influencing factor on the model learning effect.
[0150] The optimization suggestion response subunit is used to update the preset machine learning model based on the optimization suggestion response to the preset machine learning model.
[0151] Optionally, the federated learning configuration device may also include:
[0152] The model selection suggestion module is used to determine the suggested model of the preset machine learning model based on the number of labels of the data to be processed, and after determining the preset machine learning model, to determine the target processing method suggestion based on the historical target processing method of the determined preset machine learning model.
[0153] Optionally, the data acquisition module 310 includes:
[0154] The node determination unit is used to determine whether to acquire the data to be processed from the current node based on at least one of the communication latency, failure rate, and data quality of the current node and its associated nodes.
[0155] The federated learning configuration apparatus provided in this application embodiment can execute the federated learning configuration method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the federated learning configuration method.
[0156] Example 4
[0157] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application, as shown below. Figure 4 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of processors 410 in the electronic device can be one or more. Figure 4 Taking a processor 410 as an example; the processor 410, memory 420, input device 430, and output device 440 in the electronic device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0158] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the federated learning configuration method in this embodiment (e.g., the data acquisition module 310, the data to be processed determination module 320, the processing method determination module 330, the processing method merging module 340, the data to be learned acquisition module 350, and the data to be learned application module 360). The processor 410 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 420, thereby implementing the aforementioned federated learning configuration method.
[0159] The memory 420 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 420 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include memory remotely located relative to the processor 410, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0160] Input device 430 can be used to receive input character information and generate key signal inputs related to user settings and function control of the electronic device. Output device 440 may include display devices such as a display screen.
[0161] Example 5
[0162] Embodiment 5 of this application also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute a federated learning configuration method. The method includes: acquiring data to be processed from the current node and associated nodes; determining whether each feature field of the data to be processed is a feature to be processed, and determining whether the label of the data to be processed is a label to be processed; if each feature field is a feature to be processed, determining the processing method for each feature to be processed, and if each label of the data to be processed is a label to be processed, determining the processing method for each label to be processed; merging the processing methods of each feature to be processed and each label to be processed to obtain a target processing method; processing the data to be processed according to the target processing method to obtain data to be learned; and training a preset machine learning model based on the data to be learned.
[0163] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the method operations described above, but can also execute related operations in the federated learning configuration method provided in any embodiment of this application.
[0164] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0165] It is worth noting that in the embodiments of the search device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.
[0166] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. A federated learning configuration method, characterized in that, include: Retrieve the data to be processed from the current node and its associated nodes; The current node is the current data platform, and the associated node is the platform that needs to obtain associated data when the current node performs federated learning. Determine whether each feature field of the data to be processed is a feature to be processed, and determine whether the label of the data to be processed is a label to be processed; If each of the aforementioned feature fields is a feature to be processed, then the processing method for each of the aforementioned features to be processed is determined; and if each of the aforementioned data to be processed is a label to be processed, then the processing method for each of the aforementioned labels to be processed is determined. The processing methods of each of the features to be processed and each of the tags to be processed are combined to obtain the target processing method; The data to be processed is processed according to the target processing method to obtain the data to be learned; Train a preset machine learning model based on the data to be learned; The step of determining whether each feature field of the data to be processed is a feature to be processed, and determining whether the label of the data to be processed is a label to be processed, includes: Determine whether each feature field of the data to be processed meets the preset feature processing conditions, wherein the preset feature processing conditions include at least one of the following: the presence of characters, the presence of missing data, the presence of outliers, and weak correlation. Based on the judgment result, determine whether each of the aforementioned feature fields is the feature to be processed; as well as, Determine whether the label of the data to be processed meets the preset label processing conditions, wherein the preset label processing conditions include at least one of the following: a positive example needs to be specified, a non-target value exists, and a character exists; Based on the judgment result, determine whether the tag is the tag to be processed; The step of training a preset machine learning model based on the data to be learned includes: Obtain the historical configuration data of the preset machine learning model; The preset machine learning model is updated based on the configuration results of the historical configuration data; Based on the data to be learned, train the updated preset machine learning model; The step of obtaining the data to be processed for the current node and associated nodes includes: Based on at least one of the communication latency, failure rate, and data quality of the current node and associated nodes, determine whether to acquire the data to be processed from that node.
2. The method according to claim 1, characterized in that, Before the process of merging the features to be processed and the tags to be processed, the method further includes: Based on the processing results of each of the features to be processed and the historical processing methods of each of the tags to be processed in the data to be processed, a target processing method suggestion is determined.
3. The method according to claim 1, characterized in that, The step of updating the preset machine learning model based on the configuration results of the historical configuration data includes: The reason for the failure of the configuration result is determined as historical configuration data of the configuration failure; If the failure is due to a missing configuration process, the preset machine learning model is updated based on the missing information of the missing process. Otherwise, the configuration result is determined to be the model evaluation result of the preset machine learning model configured by the historical configuration data that was successfully configured; The configuration process corresponding to the historical configuration data with the highest model evaluation result is selected to update the preset machine learning model.
4. The method according to claim 3, characterized in that, The step of updating the preset machine learning model based on the configuration results of the historical configuration data includes: Determine the impact values of each node, the target processing method, and each candidate influencing factor in the machine learning model on the model learning effect; Based on the impact values of each candidate influencing factor on the model learning effect, optimization suggestions for the preset machine learning model are determined; The preset machine learning model is updated based on the optimization suggestions provided in response to the preset machine learning model.
5. The method according to claim 1, characterized in that, Before training the preset machine learning model based on the data to be learned, the method further includes: Based on the number of labels in the data to be processed, a suggested model for the preset machine learning model is determined. After determining the preset machine learning model, a suggested target processing method is determined based on the historical target processing methods of the determined preset machine learning model.
6. A federated learning configuration device, characterized in that, include: The pending data acquisition module is used to acquire pending data from the current node and associated nodes; The current node is the current data platform, and the associated node is the platform that needs to obtain associated data when the current node performs federated learning. The pending processing determination module is used to determine whether each feature field of the pending data is a pending feature, and to determine whether the label of the pending data is a pending label; The processing method determination module is used to determine the processing method of each feature if each feature field is a feature to be processed, and to determine the processing method of each label if each label of the data to be processed is a label to be processed. The processing method merging module is used to merge the processing methods of each of the features to be processed and each of the tags to be processed to obtain the target processing method; The learning data acquisition module is used to process the learning data according to the target processing method to obtain the learning data; The learning data application module is used to train a preset machine learning model based on the learning data. The module for determining the subject of processing includes: A preset feature processing condition judgment unit is used to judge whether each feature field of the data to be processed meets the preset feature processing conditions, wherein the preset feature processing conditions include at least one of the following: the presence of characters, the presence of missing data, the presence of outliers, and weak correlation. The feature determination unit is used to determine whether each of the feature fields is the feature to be processed based on the judgment result. as well as, A tag processing condition judgment unit is used to determine whether the tags of the data to be processed meet preset tag processing conditions, wherein the preset tag processing conditions include at least one of the following: a positive example needs to be specified, a non-target value exists, and a character exists; The tag to be processed determination unit is used to determine whether the tag is the tag to be processed based on the judgment result; The learning data application module includes: The historical configuration data acquisition unit is used to acquire the historical configuration data of the preset machine learning model; The model update unit is used to update the preset machine learning model based on the configuration results of the historical configuration data; The model training unit is used to train an updated preset machine learning model based on the data to be learned. The data acquisition module includes: The node determination unit is used to determine whether to acquire the data to be processed of the current node based on at least one of the communication latency, failure rate and data quality of the current node and associated nodes.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a federated learning configuration method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a federated learning configuration method as described in any one of claims 1-5.
Citation Information
Patent Citations
Federal learning modeling optimization method based on feature engineering
CN114091769A
Federal learning method and system suitable for carbon credit evaluation, and electronic equipment
CN114818011A