Method and system for evaluating contribution degree of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapril value
By setting significance judgment thresholds and guiding sorting in federated learning, the complexity of Shapley value calculation is reduced, the problem of long-term user contribution evaluation in large-scale federated learning is solved, and the real-time performance of tool fault diagnosis is improved and evaluate efficiency.
Patent Information
- Application Number
- CN202411275137.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-31
AI Technical Summary
In large-scale federated learning scenarios, the calculation of user contribution degree based on Shapley value is high, which leads to the long time of evaluation of user contribution degree in federated learning, which makes it difficult to meet the real-time requirements of tool fault diagnosis.
Using a synchronous federated learning method based on truncated Shapley values, by setting the threshold for the significance of the diagnosis model change, only the significantly updated rounds and users were calculated, and guiding some users were designed to reduce the number of sorts. and calculate overhead.
It significantly reduces the number of times and sorting length of Shapril value calculations, improves the efficiency and real-time nature of contribution assessment, and ensures that the user contribution assessment is quickly completed without damaging the rationality of the assessment.
Smart Images

Figure CN119229255A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of federated learning, and specifically relates to a method and system for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley values. Background Art
[0002] How to reasonably evaluate the contribution of participating users in federated learning is the basis for ensuring the fairness of federated learning and designing incentive mechanisms, and plays a positive role in promoting the efficient and orderly circulation of data elements. Using the improvement of global model performance to measure the quality of user data and evaluating the user's contribution based on the Shapley value is a mainstream evaluation method. Calculating the contribution of user local updates to the global model requires full sorting of participating users and calculating the marginal improvement of any user in each sorting. However, the exponential complexity corresponding to the full sorting makes it difficult to apply to large-scale federated learning scenarios. How to significantly reduce the computational complexity of the contribution based on the Shapley value without affecting the rationality of the user contribution evaluation is a key technology for evaluating user contributions in actual large-scale federated learning scenarios, and its research is of great significance.
[0003] Tool fault diagnosis has important practical significance in the manufacturing industry, which can ensure equipment safety and improve product quality. The main technologies include fault diagnosis based on signal processing, fault diagnosis based on physical models, and fault diagnosis based on data-driven. The fault diagnosis cycle based on signal processing is long and the accuracy is not high; although the fault diagnosis based on physical models is highly accurate, the model establishment cost is high and difficult. In recent years, data-driven fault diagnosis technology only needs to analyze the monitoring data during the use of tools, which can significantly reduce the diagnosis cost into diagnosis cycle and detection cost. However, in order to ensure the accuracy of diagnosis, a large amount of fault data of various categories needs to be collected, which is usually difficult for a single enterprise to complete. Tool fault diagnosis based on federated learning can enrich data types, improve model utility, and protect the data privacy of each enterprise, but it is necessary to quickly and reasonably measure the contribution of each enterprise involved in tool fault diagnosis to provide scientific support for guiding production and subsequent profit distribution. Summary of the invention
[0004] In view of the problem that the user contribution calculation overhead based on Shapley value in the existing federated learning tool fault diagnosis is large, resulting in a long contribution calculation time when a large number of users perform federated learning, which makes it difficult to meet the timeliness of fault diagnosis, the present invention proposes a synchronous federated learning tool fault diagnosis contribution evaluation method and system based on truncated Shapley value, sets two diagnostic model change significance judgment thresholds, which are used to judge whether the global fault diagnosis model update difference and the single user update difference are significant, and only performs Shapley value calculation for the global round and user sorting with significant update difference, so as to significantly reduce the number of Shapley value calculations. Furthermore, when calculating the Shapley value of the sorted users, a guiding partial user sorting method is designed to reduce the total number of sorting. This method can omit the contribution calculation when the aggregation effect of a large number of models is not significant and truncate the sorting length of a single contribution calculation, so as to significantly reduce the calculation overhead of contribution evaluation without damaging the rationality of the contribution evaluation of each user in the tool fault diagnosis model.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A synchronous federated learning tool fault diagnosis contribution evaluation method based on truncated Shapley value includes the following steps:
[0007] S1: Acquire images of different types of cutting tools;
[0008] S2: Build a global image classification model based on images of different tool models and horizontal federated learning;
[0009] S3: sort the images of different types of tools to obtain a training set;
[0010] S4: using the FedAvg algorithm and the training set, updating the global image classification model, and performing significance judgment on the current round of updates to obtain a global image classification model whose performance meets preset requirements;
[0011] S5: Calculate the contribution of the tool images participating in the current round to the global model of image classification;
[0012] S6: Repeat S4 and S5 until the image classification global model update round reaches a threshold, and obtain the contribution of all tool images to the image classification global model in the image classification global model update;
[0013] S7: Based on the contribution of all tool images to the global image classification model, the trained tool fault diagnosis federated learning model is constructed;
[0014] S8: The trained tool fault diagnosis federated learning model is applied to new tool images to obtain fault diagnosis results.
[0015] Preferably, in S3, the method of sorting the images of different types of tools to obtain a training set includes:
[0016] Determine the number of approximate Monte Carlo sampling; specifically: According to the central limit theorem and the Hoffding inequality, for a given approximate sampling accuracy ∈,δ, the number of Monte Carlo samplings required to be performed is not less than Where r represents the marginal benefit of a single sample, K is the number of local users participating in the t+1th global update, ∈ represents the upper bound of the deviation between the true value and the estimated value, and δ represents the probability that the deviation exceeds ∈;
[0017] Based on the approximate Monte Carlo sampling times, a guiding partial user ranking is performed; specifically: the number of users sampled in each round of global update is K, and k is determined to satisfy The minimum natural number of k≤K, and then get the sampled user set Extract all the rankings of k users from the , and record the set composed of them as Π p ; Each user Holds a labeled image dataset D i , the images are photos of different models of tools.
[0018] Preferably, in S4, the method of updating the global image classification model using the FedAvg algorithm and the training set includes:
[0019] Update the global image classification model according to the FedAvg algorithm. After the tth round of global update, the global model parameters are changed from w t-1 Update to w t , the update formula is Among them, p i is the aggregation weight, is the model change, γ g Learning rate for global model updates.
[0020] Preferably, in S4, the method for determining the significance of the current round of updates includes:
[0021] After the tth round of global model update, the server According to the formula V(w t )=norm(w t ) evaluates the performance improvement of the global model of image classification in the current round, where the function norm(w t ) represents the norm of the model parameter, denoted as V(w t ), if |V(w t )-V(w t-1)|≥Ψ, the performance of the image classification model is considered to be significantly improved, where Ψ is the significance threshold of the global model update; otherwise, it is considered that the performance improvement of the global image classification model by the user update in this round is too small, and the user who participated in the global model update in this round The contribution of is recorded as 0.
[0022] Preferably, in S5, the method for calculating the contribution of the tool images participating in the current round to the global image classification model includes:
[0023] From the generated instructive partial user ranking set Π p Choose a sort π p To expand;
[0024] Calculate the expanded sort π p The Shapley value of each user in;
[0025] Calculate the contribution of each participating user to the global image classification model in the tth round of image classification global model update.
[0026] Preferably, in S6, the method for obtaining the contribution of all tool images to the image classification global model in updating the image classification global model includes:
[0027] After each round of global update, update the user's cumulative contribution to the global image classification model where φ i represents the cumulative contribution of the i-th user in the first t-1 rounds, represents the contribution of the user in the tth round. Repeat S4 and S5 until the image classification global model update round reaches T, and return the contribution of all users to the image classification global model in the image classification global model update {φ1,φ2,…,φ N}.
[0028] The present invention also discloses a synchronous federated learning tool fault diagnosis contribution evaluation system for each participating enterprise based on truncated Shapley value, which is characterized by comprising: an acquisition module, a first construction module, a sorting module, a training module, a partial calculation module, a global calculation module, a second construction module and a diagnosis module;
[0029] The acquisition module is used to acquire images of tools of different models;
[0030] The building module is used to build a global image classification model based on images of different types of tools and horizontal federated learning;
[0031] The sorting module is used to sort the images of cutting tools of different models to obtain a training set;
[0032] The training module is used to update the global image classification model using the FedAvg algorithm and the training set, and perform significance judgment on the current round of updates to obtain a global image classification model whose performance meets preset requirements;
[0033] The partial calculation module is used to calculate the contribution of the tool images participating in the current round to the global model of image classification;
[0034] The global calculation module is used to repeat the training module and the partial calculation module until the image classification global model update round reaches a threshold, and obtain the contribution of all tool images to the image classification global model in the image classification global model update;
[0035] The second building module is used to build a trained tool fault diagnosis federated learning model based on the contribution of all tool images to the image classification global model;
[0036] The diagnosis module is used for the trained tool fault diagnosis federated learning model, and is applied to new tool images to obtain fault diagnosis results.
[0037] Preferably, the sorting module comprises: a sampling times determination unit and a user sorting unit;
[0038] The sampling number determination unit is used to determine the number of approximate Monte Carlo sampling; specifically: according to the central limit theorem and the Hoffding inequality, for a given approximate sampling accuracy ∈, δ, the number of Monte Carlo samplings to be performed is not less than Where r represents the marginal benefit of a single sample, K is the number of local users participating in the t+1th global update, ∈ represents the upper bound of the deviation between the true value and the estimated value, and δ represents the probability that the deviation exceeds ∈;
[0039] The user ranking unit is used to perform instructive partial user ranking based on the approximate Monte Carlo sampling number; specifically: the number of users extracted in each round of global update is K, and k is determined to satisfy The minimum natural number of k≤K, and then get the sampled user set Extract all the rankings of k users from the , and record the set composed of them as Π p ; Each user Holds a labeled image dataset D i , the images are photos of different models of tools.
[0040] Preferably, in the training module, the process of updating the global image classification model using the FedAvg algorithm and the training set includes:
[0041] Update the global image classification model according to the FedAvg algorithm. After the tth round of global update, the global model parameters are changed from wt-1 Update to w t , the update formula is Among them, p i is the aggregation weight, is the model change, γ g Learning rate for global model updates.
[0042] Preferably, in the training module, the process of determining the significance of the current round of updates includes:
[0043] After the tth round of global model update, server S follows the formula V(w t )=norm(w t ) evaluates the performance improvement of the global model of image classification in the current round, where the function norm(w t ) indicates that the norm of the model parameter is V(w t ), if |V(w t )-V(w t-1 )|≥Ψ, the performance of the image classification model is considered to be significantly improved, where Ψ is the significance threshold of the global model update; otherwise, it is considered that the performance improvement of the global image classification model by the user update in this round is too small, and the user who participated in the global model update in this round The contribution of is recorded as 0.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] The invention discloses a synchronous federated learning tool fault diagnosis contribution evaluation method and system based on truncated Shapley value, including a contribution calculation execution strategy for significance judgment and a guiding partial user sorting method. The contribution calculation execution strategy for significance judgment is used to judge the significance of the global model update difference and the individual user update difference, and only performs Shapley value calculation for the global round and user sorting with significant update difference. The guiding partial user sorting method determines the sampling number by approximate Monte Carlo sampling analysis, and then uses the sampling number to guide the sorting of partial users to generate a partial user sorting set. The synchronous federated learning contribution evaluation method combining significance judgment and guiding partial user sorting can significantly reduce the computational overhead without compromising the rationality of contribution evaluation, and quickly complete the contribution evaluation of participating users in actual federated scenarios. For the tool fault diagnosis application of federated learning, when the number of enterprises participating in federated learning is large, the exponential Shapley value calculation complexity will cause the evaluation time of the federated learning process to be too long, affecting the real-time performance of tool fault diagnosis. The present invention sets two significance thresholds. When the aggregate changes of the local fault diagnosis model of each enterprise are not significant, the contribution evaluation of the current round is skipped. When the aggregate changes of the local fault diagnosis model are significant, the arrangement length of the contribution calculation is truncated. Through the above technology, the complexity of contribution calculation can be significantly reduced while ensuring the rationality of contribution evaluation, and the real-time performance of tool fault diagnosis and contribution evaluation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 This is a logic flow chart of the synchronous federated learning contribution evaluation method based on truncated Shapley value according to an embodiment of the present invention applied to an image classification task. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0050] Embodiment 1
[0051] like Figure 1 As shown, the present invention provides a method for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley value, comprising the following steps:
[0052] S1: Acquire images of different types of cutting tools;
[0053] S2: Build a global image classification model based on images of different types of tools and horizontal federated learning;
[0054] S3: sort the images of different types of tools to obtain a training set;
[0055] S4: using the FedAvg algorithm and the training set, updating the global image classification model, and performing significance judgment on the current round of updates to obtain a global image classification model whose performance meets preset requirements;
[0056] S5: Calculate the contribution of the tool images participating in the current round to the global model of image classification;
[0057] S6: Repeat S4 and S5 until the image classification global model update round reaches a threshold, and obtain the contribution of all tool images to the image classification global model in the image classification global model update;
[0058] S7: Based on the contribution of all tool images to the global image classification model, the trained tool fault diagnosis federated learning model is constructed;
[0059] S8: The trained tool fault diagnosis federated learning model is applied to new tool images to obtain fault diagnosis results.
[0060] In this embodiment, the horizontal federated learning parameters are set as the initialization step, including declaring the federated learning task, federated learning architecture, participating roles, aggregation algorithm, and significance judgment threshold. Specifically, it includes:
[0061] 1) Declare a federated learning task. The task is horizontal federated learning image classification. Each user Holds a labeled image dataset D i , all users need to obtain an image classification model through federated learning without moving their data. At the same time, each user needs to obtain his dataset D i Contribution to the final image classification model.
[0062] 2) Set up a horizontal federated learning architecture. Horizontal federated learning consists of a server With several users Composition, including server It is a trusted third party that does not hold task-related user data and is only responsible for the distribution and aggregation of the global model w (global image classification model). The global model is set to the convolutional neural network VGG16. User collection There are N users in total. All users use their private data to jointly maintain a global model w. Its initial parameters are recorded as w0, and the model parameters after the global update in the t-1th round are recorded as w t-1 , there are T global updates in total.
[0063] 3) Set the horizontal federated learning algorithm to FedAvg, including user sampling, local update, server aggregation, and global model update standard steps. Taking the tth round as an example, the server first extracts the user set Randomly select a subset of users from And the current global model w t-1 Distribute to selected users; Selected users Using its private data to the global model w t-1 Update and change the model Sent to the server; the server receives the selected user subset After returning all local updates, aggregate the local updates to get where p i The aggregation weight satisfies The server uses local aggregate information to update the global model. The formula is: where γ t Represents the global update learning rate.
[0064] 4) Set the global model update significance threshold Ψ and the marginal update significance threshold ψ, and initialize the contribution φ of all users i =0, let represents the contribution of user i in the dth sampling of the global update in the tth round, i = 1, 2, …, N.
[0065] In this embodiment, in S3, the method of sorting the tool images of different models to obtain the training set includes:
[0066] Determine the number of approximate Monte Carlo sampling; specifically: According to the central limit theorem and the Hoffding inequality, for a given approximate sampling accuracy ∈,δ, the number of Monte Carlo samplings required to be performed is not less than Where r represents the marginal benefit of a single sample, K is the number of local users participating in the t+1th global update, ∈ represents the upper bound of the deviation between the true value and the estimated value, and δ represents the probability that the deviation exceeds ∈;
[0067] Based on the approximate Monte Carlo sampling times, a guiding partial user ranking is performed; specifically: the number of users sampled in each round of global update is K, and k is determined to satisfy The minimum natural number of k≤K, and then get the sampled user set Extract all the rankings of k users from the , and record the set composed of them as Π p ; Each user Holds a labeled image dataset D i , the images are photos of different models of tools.
[0068] In this embodiment, in S4, the method of updating the global image classification model using the FedAvg algorithm and the training set includes:
[0069] Start horizontal federated training and update the global image classification model according to the FedAvg algorithm. After the tth round of global update, the global model parameters are changed from w t-1 Update to w t , the update formula is Among them, p i is the aggregation weight, is the model change, γ g Learning rate for global model updates.
[0070] In this embodiment, in S4, the method for determining the significance of the current round of updates includes:
[0071] After the tth round of global model update, the server According to the formula V(w t )=norm(w t ) evaluates the performance improvement of the global model of image classification in the current round, where the function norm(w t ) represents the norm of the model parameter, and this value is recorded as V(w t ), if |V(w t )-v(w t-1 )|≥Ψ, the performance of the image classification model is considered to have been significantly improved, and S5 is performed to calculate the contribution of the users participating in the current round to the model performance improvement, where Ψ is the significance threshold of the global model update; otherwise, it is considered that the performance improvement of the global image classification model by the users’ updates in this round is too small, and the users participating in the global model update in this round are removed. The contribution of is recorded as 0.
[0072] In this embodiment, in S5, the method for calculating the contribution of the tool images participating in the current round to the global image classification model includes:
[0073] From the generated instructive partial user ranking set Π pChoose a sort π p To expand;
[0074] Calculate the expanded sort π p The Shapley value of each user in;
[0075] Calculate the contribution of each participating user to the global image classification model in the tth round of image classification global model update.
[0076] Specifically include:
[0077] 1) Generate the user's full sort. In a cyclic manner, each time from the set Π p Choose a sort π p , the order selected for the dth time is Randomly subtract Add the elements in At the end, we get the full order of the dth sampling in the tth round of global model update Where K represents the number of users participating in the current model aggregation.
[0078] 2) Calculate the Shapley value of participating users. Select the subset corresponding to the first j elements in Calculated in Aggregation results of the above model Then calculate The evaluation function value of Recorded as like Indicates the label set The local update of the corresponding user significantly improves the performance of the global model. The Shapley value for the corresponding user is where θ is and The angle α1 and α2 are used to adjust the user The proportion of the effect of global model update and the effect of extracted user update. Indicates the label set The local update of the corresponding user does not significantly improve the performance of the global model. Indicates the label The contribution of the corresponding user's local update to the global image classification model is 0.
[0079] 3) Participate in the update of user contribution. According to the formula Update Sequence The corresponding user's contribution in the current ranking. When , it means that the calculation of user contribution in the tth round global model update has taken into account all valid user rankings, that is, the calculation of participating user contribution is completed, and go to step 6 to update the cumulative contribution of users during the training process. Otherwise, it means that the user ranking still affects the contribution calculation of the image classification model, let d←d+1, and repeat 1) and 2) of S5.
[0080] In this embodiment, in S6, the method for obtaining the contribution of all tool images to the image classification global model in the image classification global model update includes:
[0081] After each round of global update, update the user's cumulative contribution to the global image classification model where φ i represents the cumulative contribution of the i-th user in the first t-1 rounds, represents the contribution of the user in the tth round. Repeat S4 and S5 until the image classification global model update round reaches T, and return the contribution of all users to the image classification global model in the image classification global model update {φ1,φ2,…,φ N}.
[0082] In this embodiment, the process of tool fault diagnosis reasoning using the trained tool fault diagnosis federated learning model is as follows: the acquired new tool image is input into the trained fault diagnosis model, the probability distribution corresponding to different faults is output, and the one with the highest probability is selected as the diagnosis result, including tool wear, tool chipping, tool thermal cracking, tool bonding, and tool plastic deformation.
[0083] Embodiment 2
[0084] The present invention also provides a synchronous federated learning tool fault diagnosis contribution evaluation system for each participating enterprise based on truncated Shapley value, comprising: an acquisition module, a construction module, a sorting module, a training module, a partial calculation module, a global calculation module and a diagnosis module;
[0085] The acquisition module is used to acquire images of tools of different models;
[0086] The building module is used to obtain a global model for image classification based on images of different types of cutting tools and horizontal federated learning;
[0087] The sorting module is used to sort the images of different types of tools to obtain a training set;
[0088] The training module is used to update the global image classification model using the FedAvg algorithm and the training set, and to perform significance judgment on the current round of updates to obtain a global image classification model whose performance meets preset requirements;
[0089] Some calculation modules are used to calculate the contribution of the tool images participating in the current round to the global model of image classification;
[0090] The global calculation module is used to repeat the training module and the partial calculation module until the image classification global model update round reaches a threshold, and obtain the contribution of all tool images to the image classification global model in the image classification global model update;
[0091] The second building module is used to build a trained tool fault diagnosis federated learning model based on the contribution of all tool images to the image classification global model;
[0092] The diagnosis module is used for the trained tool fault diagnosis federated learning model and applied to new tool images to obtain fault diagnosis results.
[0093] In this embodiment, the sorting module includes: a sampling times determination unit and a user sorting unit;
[0094] The sampling number determination unit is used to determine the number of approximate Monte Carlo sampling; specifically: according to the central limit theorem and the Hoffding inequality, for a given approximate sampling accuracy ∈,δ, the number of Monte Carlo samplings to be performed is not less than Where r represents the marginal benefit of a single sample, K is the number of local users participating in the t+1th global update, ∈ represents the upper bound of the deviation between the true value and the estimated value, and δ represents the probability that the deviation exceeds ∈;
[0095] The user ranking unit is used to perform guiding partial user ranking based on the approximate Monte Carlo sampling number; specifically: the number of users sampled in each round of global update is K, and k is determined to satisfy The minimum natural number of k≤K, and then get the sampled user set Extract all the rankings of k users from the , and record the set composed of them as Π p ; Each user Holds a labeled image dataset D i , the images are photos of different models of tools.
[0096] In this embodiment, in the training module, the process of updating the global image classification model using the FedAvg algorithm and the training set includes:
[0097] Update the global image classification model according to the FedAvg algorithm. After the tth round of global update, the global model parameters are changed from w t-1 Update to w t , the update formula is Among them, p i is the aggregation weight, is the model change, γ gLearning rate for global model updates.
[0098] In this embodiment, in the training module, the process of determining the significance of the current round of updates includes:
[0099] After the tth round of global model update, server S follows the formula V(w t )=norm(w t ) evaluates the performance improvement of the global model of image classification in the current round, where the function norm(w t ) represents the norm of the model parameter, denoted as V(w t ), if |V(w t )-V(w t-1 )|≥Ψ, the performance of the image classification model is considered to be significantly improved, where Ψ is the significance threshold of the global model update; otherwise, it is considered that the performance improvement of the global image classification model by the user update in this round is too small, and the user who participated in the global model update in this round The contribution of is recorded as 0.
[0100] In this embodiment, the partial calculation modules include: an expansion unit, a Shapley value calculation unit and a contribution calculation unit;
[0101] The expansion unit is used to generate a guiding partial user sorting set UI p Choose a sort π p To expand;
[0102] The Shapley value calculation unit is used to calculate the expanded ranking π p The Shapley value of each user in;
[0103] The contribution calculation unit is used to calculate the contribution of each participating user to the image classification global model in the tth round of image classification global model update.
[0104] In this embodiment, in the global calculation module, the process of obtaining the contribution of all tool images to the image classification global model in the image classification global model update includes:
[0105] After each round of global update, update the user's cumulative contribution to the global image classification model where φ i represents the cumulative contribution of the i-th user in the first t-1 rounds, Indicates the contribution of the user in the tth round. Repeat the training module and some calculation modules until the image classification global model update round reaches T. Return the contribution of all users to the image classification global model in the image classification global model update {φ1,φ2,…,φ N}.
[0106] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A synchronous federated learning tool fault diagnosis contribution evaluation method based on truncated Shapley value, characterized in that: The following steps are involved: S1: Acquire images of different types of cutting tools; S2: Build a global image classification model based on images of different types of tools and horizontal federated learning; S3: sort the images of different types of tools to obtain a training set; S4: using the FedAvg algorithm and the training set, updating the global image classification model, and performing significance judgment on the current round of updates to obtain a global image classification model whose performance meets preset requirements; S5: Calculate the contribution of the tool images participating in the current round to the global model of image classification; S6: Repeat S4 and S5 until the image classification global model update round reaches a threshold, and obtain the contribution of all tool images to the image classification global model in the image classification global model update; S7: Based on the contribution of all tool images to the global image classification model, the trained tool fault diagnosis federated learning model is constructed; S8: The trained tool fault diagnosis federated learning model is applied to new tool images to obtain fault diagnosis results.
2. The method for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley value according to claim 1 is characterized in that: In S3, the method of sorting the images of different types of tools to obtain a training set includes: Determine the number of approximate Monte Carlo sampling; specifically: According to the central limit theorem and the Hoffding inequality, for a given approximate sampling accuracy ∈,δ, the number of Monte Carlo samplings required to be performed is not less than Where r represents the marginal benefit of a single sample, K is the number of local users participating in the t+1th global update, ∈ represents the upper bound of the deviation between the true value and the estimated value, and δ represents the probability that the deviation exceeds ∈; Based on the approximate Monte Carlo sampling times, a guiding partial user ranking is performed; specifically: the number of users sampled in each round of global update is K, and k is determined to satisfy The minimum natural number of k≤K, and then get the sampled user set Extract all the rankings of k users from the , and record the set composed of them as Π p ; Each user Holds a labeled image dataset D i , the images are photos of different models of tools.
3. The method for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley value according to claim 2 is characterized in that: In S4, the method of updating the global image classification model using the FedAvg algorithm and the training set includes: Update the global image classification model according to the FedAvg algorithm. After the tth round of global update, the global model parameters are changed from w t-1 Update to w t , the update formula is Among them, p i is the aggregation weight, is the model change, γ g Learning rate for global model updates.
4. The method for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley value according to claim 2 is characterized in that: In S4, the method for determining the significance of the current round of updates includes: After the tth round of global model update, the server According to the formula V(w t )=norm(w t ) evaluates the performance improvement of the global model of image classification in the current round, where the function norm(w t ) represents the norm of the model parameter, denoted as V(w t ), if |V(w t )-V(w t-1 )|≥Ψ, the performance of the image classification model is considered to be significantly improved, where Ψ is the significance threshold of the global model update; otherwise, it is considered that the performance improvement of the global image classification model by the user update in this round is too small, and the user who participated in the global model update in this round The contribution of is recorded as 0.
5. The method for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley value according to claim 2 is characterized in that: In S5, the method for calculating the contribution of the tool images participating in the current round to the global image classification model includes: From the generated instructive partial user ranking set Π p Choose a sort π p To expand; Calculate the expanded sort π p The Shapley value of each user in; Calculate the contribution of each participating user to the global image classification model in the tth round of image classification global model update.
6. The method for evaluating the contribution of each participating enterprise in synchronous federated learning tool fault diagnosis based on truncated Shapley value according to claim 2 is characterized in that: In S6, the method for obtaining the contribution of all tool images to the image classification global model in the image classification global model update includes: After each round of global update, update the user's cumulative contribution to the global image classification model where φ i represents the cumulative contribution of the i-th user in the first t-1 rounds, represents the contribution of the user in the tth round. Repeat S4 and S5 until the image classification global model update round reaches T, and return the contribution of all users to the image classification global model in the image classification global model update {φ1,φ2,…,φ N }.
7. A synchronous federated learning tool fault diagnosis contribution evaluation system for participating enterprises based on truncated Shapley value, characterized in that: include: An acquisition module, a first construction module, a sorting module, a training module, a partial calculation module, a global calculation module, a second construction module and a diagnosis module; The acquisition module is used to acquire images of tools of different models; The building module is used to build a global image classification model based on images of different types of tools and horizontal federated learning; The sorting module is used to sort the images of cutting tools of different models to obtain a training set; The training module is used to update the global image classification model using the FedAvg algorithm and the training set, and perform significance judgment on the current round of updates to obtain a global image classification model whose performance meets preset requirements; The partial calculation module is used to calculate the contribution of the tool images participating in the current round to the global model of image classification; The global calculation module is used to repeat the training module and the partial calculation module until the image classification global model update round reaches a threshold, and obtain the contribution of all tool images to the image classification global model in the image classification global model update; The second building module is used to build a trained tool fault diagnosis federated learning model based on the contribution of all tool images to the image classification global model; The diagnosis module is used for the trained tool fault diagnosis federated learning model, and is applied to new tool images to obtain fault diagnosis results.
8. The synchronous federated learning tool fault diagnosis and contribution evaluation system for each participating enterprise based on truncated Shapley value according to claim 7 is characterized in that: The sorting module includes: a sampling times determination unit and a user sorting unit; The sampling number determination unit is used to determine the number of approximate Monte Carlo sampling; specifically: according to the central limit theorem and the Hoffding inequality, for a given approximate sampling accuracy ∈, δ, the number of Monte Carlo samplings to be performed is not less than Where r represents the marginal benefit of a single sample, K is the number of local users participating in the t+1th global update, ∈ represents the upper bound of the deviation between the true value and the estimated value, and δ represents the probability that the deviation exceeds ∈; The user ranking unit is used to perform instructive partial user ranking based on the approximate Monte Carlo sampling number; specifically: the number of users extracted in each round of global update is K, and k is determined to satisfy The minimum natural number of k≤K, and then get the sampled user set Extract all the rankings of t users from the , and record the set composed of them as Π p ; Each user Holds a labeled image dataset D i , the images are photos of different models of tools.
9. The synchronous federated learning tool fault diagnosis and contribution evaluation system for each participating enterprise based on truncated Shapley value according to claim 8 is characterized in that: In the training module, the process of updating the global image classification model using the FedAvg algorithm and the training set includes: Update the global image classification model according to the FedAvg algorithm. After the tth round of global update, the global model parameters are changed from w t-1 Update to w t , the update formula is Among them, p i is the aggregation weight, is the model change, γ g Learning rate for global model updates.
10. The synchronous federated learning tool fault diagnosis and contribution evaluation system for each participating enterprise based on truncated Shapley value according to claim 8, characterized in that: In the training module, the process of determining the significance of the current round of updates includes: After the tth round of global model update, the server According to the formula V(w t )=norm(w t ) evaluates the performance improvement of the global model of image classification in the current round, where the function norm(w t ) represents the norm of the model parameter, denoted as V(w t ), if |V(w t )-V(w t-1 )|≥Ψ, the performance of the image classification model is considered to be significantly improved, where Ψ is the significance threshold of the global model update; otherwise, it is considered that the performance improvement of the global image classification model by the user update in this round is too small, and the user who participated in the global model update in this round The contribution of is recorded as 0.
Citation Information
Patent Citations
Cutter surface defect on-machine detection method
CN116539620A
Clustering federal learning method based on contribution perception
CN116796204A
Fair federated learning method based on contribution and income collaborative balance
CN117933422A
Method and apparatus for determining contribution degree of participant in federated learning, and federated learning training method and apparatus
WO2023082787A1
Cited By
Federal learning client optimization privacy protection method and device based on block chain
CN120408717A
