Federal learning-based numerical control tool health state evaluation system and method under side cloud collaborative architecture
Through the federated learning system under the edge-cloud collaborative architecture, the data privacy and islanding issues in the health status assessment of CNC tools are solved, the consumption of transmission resources is reduced, the accuracy and fairness of the assessment are improved, and efficient health status identification is achieved.
Patent Information
- Application Number
- CN202410847302.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-27
AI Technical Summary
The existing technology has problems such as data privacy leakage, data island problem, high transmission resource consumption, poor global accuracy performance and insufficient user fairness in CNC tool health status assessment.
A CNC tool health assessment system based on federated learning under the edge-cloud collaborative architecture is used to perform personalized dynamic aggregation and model fine-tuning through the collaborative work of cloud servers and edge devices to ensure data privacy protection, reduce transmission resource consumption, and improve the global model. Accuracy and user fairness.
It can protect data privacy while reducing transmission resource consumption, improving the accuracy and precision of CNC tool health status identification, and improving processing quality and precision.
Smart Images

Figure CN118734167A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of CNC tool health performance monitoring, and in particular to a CNC tool health status assessment system and method based on federated learning under an edge-cloud collaborative architecture. Background Art
[0002] With the continuous development of science and technology, modern industrial production has put forward higher requirements for the smooth operation of mechanical equipment. CNC machine tools are important equipment in production workshops. Their complexity and operational uncertainty are gradually increasing. As the core component of machine tool processing and production, the health status of CNC tools will directly affect the quality and precision of processed parts. Therefore, how to reasonably evaluate the health performance of CNC tools has become an important issue in the production field. At present, the mainstream evaluation method for the health performance of CNC tools is a data-driven deep learning method.
[0003] Due to the continuous development of industrial Internet technology, modern industrial production is increasingly interconnected with industrial Internet platforms, and edge-cloud collaborative technology has also been widely used. For example, Chinese patent CN 112858901 A discloses a monitoring system for real-time status and life prediction of cutting tools based on edge-cloud architecture. By deploying a life prediction module on the gateway, the data transmission time between the cloud and the device is reduced. However, since all data needs to be uniformly transmitted to the cloud for processing and calculation, there is a privacy leakage problem. Chinese patent CN 115345199 A discloses a tool fault diagnosis method based on residual network. This solution can improve the accuracy of tool fault diagnosis to a certain extent, but it does not consider the problems of data collection difficulty and large computing resources required for model training in real production scenarios, and there are limitations of application difficulties. Chinese patent CN115587543 A discloses a method and system for predicting the remaining life of cutting tools combining federated learning and LSTM. This solution improves the generalization ability of the model to a certain extent, but does not consider the problem of accuracy performance decline caused by the federated learning framework. In addition, Chinese patent CN 114818476 A discloses a federated learning life prediction system for rotating machinery based on edge-cloud collaboration, which can reduce unnecessary data transmission and protect user privacy. However, this method requires the use of an encoder to extract features and then input them into a prediction model for life prediction to enhance accuracy. Therefore, it is necessary to train two models, the encoder and the life prediction model, which undoubtedly increases the data transmission burden and does not consider user fairness, that is, the user model is not optimized and improved based on each user's data information.
[0004] In summary, the existing technology has explored and applied some aspects in terms of using deep learning methods to improve the accuracy of CNC tool evaluation, edge-cloud collaboration and distributed framework. Considering the production cost, the computing unit connected to the CNC machine tool is often an edge device with limited computing power, and it is difficult to collect enough effective data information for a single tool in a single machine tool. There is a data island problem, and deep learning methods are difficult to apply. Although the use of edge-cloud collaboration technology to coordinate the data information of all interconnected machine tools on the entire platform is an effective means to solve the data island problem of CNC machine tools in the workshop, uploading all data to the cloud not only consumes a lot of transmission resources, but also cannot guarantee data security. Federated learning, as a distributed machine learning framework for data island problems, can provide a new idea for the application of deep learning in edge-cloud collaborative environments, but the traditional federated average algorithm still has the problems of poor global accuracy and poor accuracy of model detection for each user. At the same time, there is a problem that the global model cannot guarantee consistent accuracy for each user, that is, insufficient user fairness, so it is still in urgent need of optimization and improvement. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a CNC tool health status assessment system and method based on federated learning under an edge-cloud collaborative architecture, which can protect data privacy, solve the problem of data islands, and reduce the consumption of transmission resources. At the same time, the framework of the traditional federated averaging algorithm is optimized and improved to improve global accuracy and ensure user fairness.
[0006] The purpose of the present invention can be achieved through the following technical solutions: a CNC tool health status assessment system based on federated learning under an edge-cloud collaborative architecture, comprising a cloud server and multiple edge devices connected thereto, wherein the cloud server is a server and the edge device is a client, and the cloud server is used to store CNC tool health assessment model information; obtain each round of server-side models and issue them, receive and evaluate client models uploaded by edge devices; and perform personalized dynamic aggregation according to client models to form a new round of server-side models;
[0007] The edge device is connected to the CNC machine tool to process and store tool-related data information; obtain each round of server-side models issued by the cloud server; train and upload the model according to the respective client data information; receive the final server-side model and fine-tune it; and apply the fine-tuned model to identify the health status of the CNC tool.
[0008] Furthermore, the cloud server is provided with a model information library, a server-side model acquisition module, a client-side model evaluation module, and a personalized dynamic aggregation module, and the model information library is used to store a CNC tool health status evaluation model;
[0009] The server model acquisition module is used to obtain the server model information of the current round;
[0010] The client model evaluation module is used to evaluate the client model uploaded by each edge device;
[0011] The personalized dynamic aggregation module introduces personalized factors to influence the global model weight based on the output results of the client model evaluation module, and uses the dynamic aggregation mechanism to screen and obtain a new round of server-side models.
[0012] Furthermore, the edge device includes a data information library, a client model acquisition module, a client model training module and a client model fine-tuning module, and the data information library is used to pre-process, save and divide the raw data of the sensors on the CNC machine tool into data sets;
[0013] The client model acquisition module acquires the server model sent from the cloud server as the initial model of the client in the current round;
[0014] The client model training module uses the data set provided by the data information library to train the current round of initial model of the client to obtain an updated client model;
[0015] The client model fine-tuning module performs personalized data fine-tuning operations on the updated client model to obtain a final client model for use in identifying the health status of a numerically controlled tool.
[0016] A method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture includes the following steps:
[0017] S1. Complete information initialization in the cloud server and edge device respectively: initialize CNC tool evaluation model information and verification data set information in the cloud server, and initialize client data information in the edge device;
[0018] S2: Based on the federated learning framework under the edge-cloud architecture, CNC tool evaluation model training is performed;
[0019] S3. Fine-tune the CNC tool evaluation model in the edge device, use the fine-tuned CNC tool evaluation model to identify the health status of the CNC tool, and obtain the health status detection result of the corresponding CNC tool.
[0020] Furthermore, the step S1 of completing information initialization in the cloud server includes the following steps:
[0021] Collect CNC tool health assessment models based on deep learning network models;
[0022] According to different evaluation methods, the collected different model architectures are classified and stored by category;
[0023] Assign different address information to each model in different categories, so that the model and the address correspond one to one;
[0024] Initialize the parameters of each node in each model architecture;
[0025] According to the category requirements, collect and store representative data information in a targeted manner. The data information attributes must be completely consistent with the data information attributes used in edge device training, and the data volume must reach the preset threshold.
[0026] Since there may be multiple sets of verification data sets for each type of evaluation method, after assigning the same address header to each category, different address information is assigned to each set of verification sets and they correspond one to one.
[0027] Furthermore, the step S1 of completing information initialization at the edge device includes the following steps:
[0028] Collect the original sensor data information on CNC machine tools, and save it after preprocessing through feature extraction and data fusion;
[0029] According to different evaluation methods, different label information is assigned to the pre-processed data according to the current tool operation status;
[0030] The training set, validation set, and test set are divided according to the ratio of {a:b:c}, where a>b>c.
[0031] Furthermore, the step S2 comprises the following steps:
[0032] S201, cloud server: obtain the current round server model information and send it to each edge device;
[0033] S202, edge device: receiving the server model as the initial model of the client in the current round;
[0034] S203, edge device: train and update the initial model of the current round of client, and upload it to the cloud server;
[0035] S204, cloud server: evaluating each updated client model;
[0036] S205, cloud server: using personalized dynamic aggregation mechanism to update the server model;
[0037] S206, cloud server: determine whether the preset maximum number of training rounds has been reached. If so, end the training process and use the current round server model as the CNC tool evaluation model; otherwise, return to step S201.
[0038] Furthermore, the step S203 is specifically performed by each edge device iteratively updating the weight parameters of the current round of client initial models according to its own data information, and then uploading the updated client models to the cloud server.
[0039] Furthermore, the specific process of step S204 is as follows:
[0040] STEP1: Wait for edge devices to upload their respective client models;
[0041] STEP2: After the client model is uploaded, the loss information of each model is verified and ranked according to the validation set data information. The calculation method is:
[0042]
[0043] in, Represents the client model loss. The superscript c represents the ranking of the client model loss among all models. The smaller the c, the smaller the loss. The subscript i represents the current training round. represents the specific model of the cth client, and Loss(·) represents the loss function used to calculate the model in the validation data set. The loss on Represents the validation dataset existing in the cloud server;
[0044] STEP3: Calculate the Euclidean distance between the weight parameters of each client model and the current round of server model, and perform normalization. The calculation method is:
[0045]
[0046]
[0047] in, represents the weight parameter of the c-th client model, Represents the weight parameter of the current round of server-side model, Represents the distance information of the c-th client model.
[0048] Furthermore, the specific process of step S205 is as follows:
[0049] STEP1. Select the number of models n required for aggregation based on loss ranking i The specific client model corresponding to it, where n i The value range of is:
[0050] {n i |1≤n i ≤N c ,n i ∈N}
[0051] Where n i Indicates the number of aggregation models available for selection in the current round;
[0052] STEP2: According to the selected aggregation model number n i , calculate the personalization factor of each selected client model:
[0053]
[0054] In the formula, represents the personalization factor, L c Indicates the length of the training set corresponding to the client model;
[0055] STEP 3: Based on the weight parameters and personalization factors of the selected client model, aggregate an alternative server model:
[0056]
[0057] In the formula, Indicates that the number of aggregated models is n i The aggregate model obtained when
[0058] STEP4, for n i ∈[1,N c ], polymerize to obtain N c After selecting the server model, the validation set Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server model parameter for the next round. The calculation method is:
[0059]
[0060] In the formula, Indicates the server model parameters for the next round.
[0061] Furthermore, the step S3 fine-tunes the CNC tool evaluation model. Specifically, after receiving the final server-side model, each edge device freezes most of the neural network layers according to its own data information, retrains the last layer or layers of the neural network for a set number of rounds, and uses the fine-tuned model as the final model M of each client. c , the model weight parameter is w c .
[0062] Compared with the prior art, the present invention has the following advantages:
[0063] The present invention establishes a centralized horizontal federated learning system framework with cloud servers as the server and edge devices as the client, which can protect data privacy and solve the problem of data islands while reducing the consumption of transmission resources to a certain extent; in addition, considering the global optimality and user fairness, the present invention introduces personalized factors, dynamic aggregation and model fine-tuning methods on the basis of the traditional federated average algorithm for optimization and improvement, which can improve the accuracy of the global model and ensure user fairness. In this way, the health status of each CNC tool can be identified efficiently and accurately, which is conducive to improving the processing quality and precision of CNC machine tools.
[0064] The present invention fully considers the distributed production system in the industrial environment, combines modern deep learning methods, and provides an application device of centralized horizontal federated learning in an edge-cloud collaborative environment, establishing a correspondence between "cloud server-server" and "edge device-client". Due to the introduction of the federated learning method framework, while coordinating various data islands, there is no need to transmit any original data information to the cloud server, which protects user data privacy and reduces the loss of transmission resources.
[0065] Taking into account the problem that the traditional federated averaging algorithm is prone to cause poor global model accuracy, the present invention introduces personalized factors to different client models to influence the global model weight, and uses a dynamic aggregation mechanism to screen the optimal model. That is, combining personalized dynamic screening with the aggregation mechanism, the present invention comprehensively considers the requirements for global model optimality and the impact of different client models on the global model, which can effectively improve the accuracy of the global model.
[0066] The present invention also takes into account that the data information of each user has its own characteristics, and therefore further introduces a model fine-tuning mechanism. After the final global model training is completed, the model is fine-tuned according to the user's respective data information, and finally the unique model customization for each user is completed. Through model fine-tuning, each user further fits the characteristics of their own data, thereby ensuring user fairness while improving the accuracy of each user's model. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a schematic diagram of the system structure of the present invention;
[0068] Figure 2 A schematic diagram of a federated learning architecture in an edge-cloud system environment constructed in an embodiment;
[0069] Figure 3 It is a schematic diagram of the method flow of the present invention;
[0070] Figure 4 This is a schematic diagram of the information initialization process;
[0071] Figure 5Schematic diagram of the model training process;
[0072] Figure 6 It is a schematic diagram of the personalized dynamic aggregation process;
[0073] Figure 7 Schematic diagram of the model fine-tuning process;
[0074] Explanation of the marks in the figure: 1. Cloud server, 2. Edge device, 11. Model information library, 12. Server-side model acquisition module, 13. Client-side model evaluation module, 14. Personalized dynamic aggregation module, 21. Data information library, 22. Client-side model acquisition module, 23. Client-side model training module, 24. Client-side model fine-tuning module. DETAILED DESCRIPTION
[0075] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0076] Example
[0077] like Figure 1 As shown, a CNC tool health status assessment system based on federated learning under an edge-cloud collaborative architecture includes a cloud server 1 and multiple edge devices 2 connected thereto, wherein the cloud server 1 is a server and the edge device 2 is a client, and the cloud server 1 is used to store CNC tool health assessment model information; obtain each round of server-side models and send them down, receive and evaluate client models uploaded by the edge device 2; and perform personalized dynamic aggregation according to the client models to form a new round of server-side models;
[0078] The edge device 2 is connected to the CNC machine tool to process and store tool-related data information; obtain each round of server-side models issued by the cloud server 1; train and upload the models according to the respective client data information; receive the final server-side model and fine-tune it; and apply the fine-tuned model to identify the health status of the CNC tool.
[0079] The cloud server 1 is provided with a model information base 11, a server-side model acquisition module 12, a client-side model evaluation module 13, and a personalized dynamic aggregation module 14. The model information base 11 is used to store a CNC tool health status evaluation model;
[0080] The server model acquisition module 12 is used to obtain the current round of server model information;
[0081] The client model evaluation module 13 is used to evaluate the client model uploaded by each edge device 2;
[0082] The personalized dynamic aggregation module 14 targets the output results of the client model evaluation module, introduces personalized factors to influence the global model weight, and uses a dynamic aggregation mechanism to screen and obtain a new round of server-side models.
[0083] The edge device 2 includes a data information library 21, a client model acquisition module 22, a client model training module 23 and a client model fine-tuning module 24. The data information library 21 is used to pre-process, save and divide the original data of the sensors on the CNC machine tool into data sets;
[0084] The client model acquisition module 22 acquires the server model sent from the cloud server 1 as the initial model of the client in the current round;
[0085] The client model training module 23 uses the data set provided by the data information library 21 to train the current round of initial model of the client to obtain an updated client model;
[0086] The client model fine-tuning module 24 performs personalized data fine-tuning operations on the updated client model to obtain a final client model for use in identifying the health status of CNC tools.
[0087] This embodiment applies the above solution to construct Figure 2 The federated learning architecture in the edge-cloud system environment shown in the figure, where the cloud server is a single central server and the number of edge devices is N c . The basic idea of centralized horizontal federated learning is to establish a single central server and interact with multiple clients, and perform data usage and machine learning modeling under the premise of satisfying the privacy protection and data security of each client. The present invention applies this basic idea to the edge-cloud collaborative environment, establishes the correspondence between "cloud server-server" and "edge device-client", and optimizes and improves the original architecture. Its basic device architecture consists of two parts, a cloud server module S and an edge device module C. The cloud server module S includes a model information library SA, a server model acquisition module SB, a client model evaluation module SC and a personalized dynamic aggregation module SD; the edge device module C includes a data information library CA, a client model acquisition module CB, a client model training module CC and a client model fine-tuning module CD.
[0088] Specific:
[0089] (1) Cloud Server S
[0090] The cloud server mainly stores CNC tool health assessment model information, obtains and distributes each round of server-side models, receives and evaluates client models uploaded by edge devices, and dynamically aggregates client models to form a new round of server-side models. The cloud server includes the following modules:
[0091] 1) Model Information Repository SA
[0092] This module consists of two parts: model collection and construction module SA1 and model classification storage module SA2. Its main function is to store the CNC tool health status assessment model, in which the assessment model is mainly based on the deep learning model. The model attribute information can be defined as:
[0093] Model attributes = {evaluation method, model architecture, weight parameters, other attributes}
[0094] ①Evaluation method = {state identification, state prediction, life estimation, other methods}
[0095] State recognition: An evaluation method that classifies and recognizes the operating state of CNC tools, such as normal operation, idling, or chipping, based on the data information at the current operating time. The models used are mainly CNN (convolutional neural network) and other models that perform well in classification problems.
[0096] State prediction: In the production process, an evaluation method is used to predict the operation state of the CNC tool at the next moment based on the data information at the current operation moment. Since the key to prediction lies in the accurate simulation of data signals, the models used are mainly RNN (recurrent neural network) and TCN (temporal convolutional network) which perform well in the field of sequence prediction for signal simulation, and are combined with state recognition models for state prediction.
[0097] Life estimation: A method of evaluating the life or wear of a CNC tool based on the current data information during its entire life cycle from the start of machining to damage. The models used are also based on RNN and TCN architectures.
[0098] Other methods: including but not limited to diagnosing the fault status of the tool, analyzing the degree of wear of the tool and other evaluation methods.
[0099] ②Model architecture: Based on the different evaluation methods mentioned above, after literature search and actual testing, a deep learning model network architecture is specifically constructed.
[0100] ③Weight parameters: A parameter file containing the specific values of the weight parameters of all nodes in the neural network. The parameters of each node are equal when the network is initialized.
[0101] ④Other attributes: model storage address, model training results, specific application scenarios and other attributes.
[0102] 2) Server-side model acquisition module SB
[0103] This module includes two parts: model acquisition module SB1 and parameter update module SB2. Its main function is to obtain the server model information of the current round. The source of model information includes two parts: 1) Select the adapted model structure in the model information library and use it as the initial server model of the first round; 2) Update the new server model information obtained after the previous round of aggregation and use it as the initial server model of the current round. The model attribute definition is the same as in SA.
[0104] 3) Client model evaluation module SC
[0105] This module consists of two parts: model loss calculation module SC1 and parameter distance calculation module SC2. Its main function is to evaluate the client models uploaded by each edge device. The traditional federated average algorithm aggregates all models uploaded by each client to obtain a new round of server models, and does not take into account the impact of outlier data. Therefore, the present invention introduces an evaluation mechanism to evaluate and screen each client model. The evaluation basis can be defined as:
[0106] Evaluation basis = {current round server model, validation dataset}
[0107] ① Current round server model: The server model obtained based on the model information library or the previous round of aggregation, where the model attributes are the same as those defined in SA.
[0108] ② Validation data set: a set of representative data set information used to validate the performance of each client model. The data attributes are the same as those defined in CA.
[0109] The evaluation method is to calculate the client model verification loss based on the verification set data information and rank them, and then calculate the distance between each client model and the weight parameter of the current round server model and save them. The client model indicators after evaluation and screening can be defined as:
[0110] Model metrics = {loss, parameter distance}
[0111] ① Loss: Loss information obtained after model validation using the validation dataset.
[0112] ② Parameter distance: obtained by calculating the Euclidean distance between the weight parameters of the current client model and the current round of server model and normalizing them.
[0113] 4) Personalized dynamic aggregation module SD
[0114] This module includes a personalized factor calculation module SD1, a dynamic aggregation verification module SD2 and a server model parameter update module SD3, and its main function is to aggregate to obtain the next round of server models. After the model evaluation is completed, the common practice is to aggregate several models with smaller losses to obtain a new round of server model parameters, but the fixed number of aggregated models is prone to cause information redundancy or loss. In response to the above problems, the present invention introduces a personalized factor calculation module SD1 and a dynamic aggregation verification module SD2. First, module SD1 screens according to the evaluated model indicators of each client, and introduces personalized factors to the screened model; then, module SD2 uses a dynamic aggregation mechanism to obtain multiple candidate models; finally, the candidate model with the best accuracy and performance is obtained according to the verification data set as the server model for the next round.
[0115] (2) Edge device C
[0116] The edge device in the present invention refers to an intelligent device deployed in the workshop and connected to a single CNC machine tool. It mainly processes and stores tool-related data information, obtains each round of server-side models issued by the cloud server, trains and uploads models based on the respective client data information, and receives and fine-tunes the final server-side model. The edge device includes the following modules:
[0117] 1) Data Information Base CA
[0118] This module includes a data collection and processing module CA1 and a data set partitioning and storage module CA2, which mainly plays the role of preprocessing, saving and data set partitioning of sensor raw data. The attribute information of the processed data can be defined as:
[0119] Data attributes = {data type, data set, specific data, other attributes}
[0120] ①Data type = {sensor data, feature data, other data}
[0121] Sensor data: raw data information collected by the sensor, such as vibration data, current data, etc.
[0122] Feature data: data processed by common feature extraction methods such as Fourier transform and wavelet transform on raw sensor data.
[0123] Other data: including but not limited to data information generated by filtering, data enhancement, image or point cloud generation, data fusion, etc.
[0124] ②Dataset = {training set, validation set, test set}
[0125] Training set: data information used for model training.
[0126] Validation set: data information used for model validation.
[0127] Test set: data information used for model testing.
[0128] ③Specific data = {data format, data length, characteristics, labels}
[0129] Data form: Depending on the different evaluation methods and model architectures, the data form has its own characteristics. Taking one-dimensional sequence data as the model input as an example, state recognition requires the data type of "sequence-state" pairs, state prediction requires the data type of "sequence-sequence" pairs, and life estimation requires the data type of "sequence-life value" pairs.
[0130] Data length: the specific number of data messages included.
[0131] Features: Specific feature information of each piece of data.
[0132] Label: Specific label information for each piece of data.
[0133] ④Other attributes: definition information such as the number of feature channels, data dimensions, and data address information.
[0134] 2) Client model acquisition module CB
[0135] This module includes a model acquisition module CB1 and a parameter update module CB2, and its main function is to obtain the model information of each client in the current round. The specific method is to wait for the cloud server to send the server model of each round and use it as the initial model of the client in the current round.
[0136] 3) Client model training module CC
[0137] This module mainly includes the model training module CC1, which is mainly used to train and upload the client model. According to the data information of each client and the initial client model of the current round, each model weight parameter is trained and updated, and then the updated client model information is uploaded to the cloud server.
[0138] 4) Client model fine-tuning module CD
[0139] This module mainly includes a model fine-tuning module CD1, whose main function is to fine-tune the final client model. In the traditional federated average algorithm, each client directly applies the final server model after receiving it, without considering the influence of each client's personalized data. On this basis, the present invention introduces a model fine-tuning module CD1, which will wait for each client to wait for the cloud server to send the final server model information, and then fine-tune the model according to their own data information as the final model.
[0140] Based on the above system, a CNC tool health status assessment method based on federated learning under the edge-cloud collaborative architecture is implemented. Figure 3 As shown, the following steps are included:
[0141] S1. Complete information initialization in the cloud server and edge device respectively: initialize CNC tool evaluation model information and verification data set information in the cloud server, and initialize client data information in the edge device;
[0142] S2: Based on the federated learning framework under the edge-cloud architecture, CNC tool evaluation model training is performed;
[0143] S3. Fine-tune the CNC tool evaluation model in the edge device, use the fine-tuned CNC tool evaluation model to identify the health status of the CNC tool, and obtain the health status detection result of the corresponding CNC tool.
[0144] The overall application process of this embodiment includes three parts: information initialization, model training and model fine-tuning.
[0145] In the information initialization process of step S1, the basic information needs to be initialized before the federated learning architecture actually works. The cloud server needs to complete the initialization of the specific model and verification data set in the model information library, and the edge device needs to complete the initialization of the data information of each client. Figure 4 shown.
[0146] S101: Cloud server module S: Initialize model information
[0147] In the model information library SA, CNC tool health assessment models are collected and classified and stored according to different assessment methods. After assigning one-to-one corresponding address information, the model weight parameters are initialized to complete the initialization of the assessment model information.
[0148] STEP1: Collect the CNC tool health assessment model based on the deep learning network model by retrieving relevant literature or conducting actual development verification.
[0149] STEP 2: According to different evaluation methods such as state identification, state prediction and life estimation, the collected different model architectures are classified and stored by category.
[0150] STEP 3: Assign different address information to each model in different categories so that the model and the address correspond one to one.
[0151] STEP4: Initialize the parameters of each node in each model architecture.
[0152] S102: Cloud server module S: Initialize verification data set information
[0153] This part is to initialize the verification data set information used in the client evaluation model module SC. By collecting representative CNC tool data set information for different evaluation methods and assigning one-to-one corresponding address information, it is used for performance evaluation of the models uploaded by each client.
[0154] STEP 1: According to the category requirements of the model information library, collect and store representative data information in a targeted manner. The data information attributes must be completely consistent with the data information attributes used for edge device training, and the data volume must reach 20% or more of the total client data.
[0155] STEP 2: Since there may be multiple sets of verification data sets for each type of evaluation method, after assigning the same address header to each category, different address information is assigned to each set of verification sets and they correspond one to one.
[0156] S103: Edge device C: Initialize data information
[0157] In the data information library CA, the edge device preprocesses the original data, reconstructs the data classification according to different evaluation methods, and constructs the training set, verification set, and test set.
[0158] STEP 1: After collecting the original sensor data information, use feature extraction, data fusion and other means to pre-process the data and save it.
[0159] STEP 2: According to different evaluation methods, different label information is assigned to the pre-processed data based on the current tool operation status.
[0160] STEP3: Divide the training set, validation set and test set according to the ratio of {a:b:c}, generally in the range of a>b>c. In this embodiment, set a=7, b=2, c=1, that is, 70% is the training set, 20% is the validation set, and 10% is the test set.
[0161] In the model training process of step S2, after completing the information initialization, the model training can be started according to the federated learning architecture. This part introduces a personalized dynamic aggregation mechanism to optimize and improve the training process of the traditional federated average algorithm, such as sending the model, training the model, and aggregating the model. The specific training process of the improved algorithm is as follows: Figure 5 As shown in the figure. The number of training rounds is Epoch, and the number of edge devices is N. c .
[0162] S201: Cloud server S: obtains the current round server model information
[0163] In the server-side model acquisition module SB, the architecture parameters of the current round of server-side model are updated.
[0164] STEP 1: If it is the first round, obtain the required model architecture from the model information library. If it is an intermediate round, wait for the previous round of training to complete and obtain the updated model information.
[0165] STEP 2: Send the current round of server model information to each edge device.
[0166] S202: Edge device C: obtains the current round of client model information
[0167] In the client model acquisition module CB, the architecture parameters of the current round of client model are obtained.
[0168] STEP 1: Wait for the cloud server to send the current round of server model information.
[0169] STEP2: Let the initial model of each client in the current round be the server model.
[0170] S203: Edge device C: Client model training update
[0171] In the client model training module CC, each client iteratively updates the model weight parameters according to its own data information.
[0172] STEP 1: Each client performs an iterative update of weight parameters based on its own data information.
[0173] STEP 2: Upload the updated client models to the cloud server.
[0174] S204: Cloud server S: evaluates the updated client model
[0175] The traditional federated average algorithm aggregates the parameters of all client models and ignores the influence of some outlier data. In order to screen out the client model parameters with better performance, the present invention evaluates and compares each client model through an evaluation mechanism. The basic idea is to evaluate each updated client model in the client model evaluation module SC. The main evaluation method is to calculate the model loss and calculate the distance information after ranking according to the loss information.
[0176] STEP 1: Wait for edge devices to upload their respective client models.
[0177] STEP2: After the client model is uploaded, the loss information of each model is verified and ranked according to the validation set data information. The specific calculation method is:
[0178]
[0179] in Represents the client model loss. The superscript c represents the ranking of the client model loss among all models. The smaller the c, the smaller the loss. The subscript i represents the current training round. represents the specific model of the cth client, and Loss(·) represents the loss function used to calculate the model in the validation data set. The loss on Represents the validation dataset existing in the cloud server.
[0180] STEP3: Calculate the Euclidean distance between the weight parameters of each client model and the current round server model and perform normalization. The specific calculation method is shown in formulas (2) to (3).
[0181]
[0182] In the formula, represents the weight parameter of the c-th client model, Represents the weight parameter of the current round of server-side model, Represents the distance information of the c-th client model.
[0183] S205: Cloud server S: Update server model information
[0184] After the client model evaluation is completed, a new round of server-side model aggregation needs to be completed and sent to each edge device. The existing aggregation method is to select a fixed aggregation number to aggregate the client model with better performance, which results in the inclusion of poor model parameters or the neglect of some key model parameters in specific applications. The present invention improves this method by introducing SD1 and SD2 modules in the SD personalized dynamic aggregation module for model aggregation. The specific process is as follows: Figure 6 shown.
[0185] STEP 1: Select the number of models n required for aggregation based on loss ranking i The specific client model corresponding to it, where n i The value range of is:
[0186] {n i |1≤n i ≤N c ,n i ∈N} (4)
[0187] Where n i Indicates the number of aggregation models available for selection in the current round.
[0188] STEP2: According to the selected aggregation model number n i , calculate the personalization factor of each selected client model. The specific calculation method is:
[0189]
[0190] In the formula, represents the personalization factor, L c Indicates the length of the training set corresponding to the client model.
[0191] STEP3: Based on the weight parameters and personalization factors of the selected client model, an alternative server model is obtained by aggregation. The specific calculation method is:
[0192]
[0193] In the formula, Indicates that the number of aggregated models is n i The aggregate model obtained when .
[0194] STEP4: For n i ∈[1,N c ], polymerize to obtain N c After selecting the server model, the validation set Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server model parameter for the next round. The specific calculation method is:
[0195]
[0196] In the formula, Indicates the server model parameters for the next round.
[0197] S206: Cloud server S: Determine whether the maximum number of training rounds has been reached
[0198] Determine whether the current training round is the maximum training round. If so, stop training and send the final server model w to the edge device. s ; If not, update the server model and return to S201 to continue training.
[0199] S3: Edge Device C: Model Fine-tuning
[0200] After receiving the final server-side model, each edge device fine-tunes the model architecture in the SD client model fine-tuning module according to its own data information and then applies it. Figure 7 shown.
[0201] S301: Waiting for the cloud server to send the final server model
[0202] S302: Fine-tuning of each client model
[0203] After receiving the final server-side model, each edge device freezes most of the neural network layers according to its own data information, retrains the last layer or layers for a certain number of rounds, and uses the fine-tuned model as the final model M of each client. c , the model weight parameter is w c .
[0204] S303: Practical application of the model
[0205] The trained final model is put into use to complete the health performance evaluation of CNC tools.
[0206] To verify the effectiveness of this solution, this embodiment takes the state recognition of a numerical control tool as an example to illustrate a typical implementation process:
[0207] CNC tool state recognition requires real-time identification of tool operation state based on relevant data information. According to the above specific method, after completing the initialization of the model and data information, the model training is completed according to the improved federated learning process, and the model is fine-tuned and applied.
[0208] A typical specific process of implementing CNC tool health performance evaluation using state identification as an example is as follows:
[0209] Corresponding to the aforementioned step S1: complete the initialization of the state recognition model, the state verification data set and the data sets of each edge device.
[0210] Corresponding to the aforementioned step S101: construct a model based on a commonly used convolutional neural network architecture, store the model and initialize it.
[0211] STEP1: Search relevant literature, collect and construct commonly used convolutional neural network architectures such as AlexNet, VGG16, GoogLeNet, ResNet18, etc. During the specific construction, adjustments are made according to the amount and form of input data. Here, a one-dimensional convolutional architecture is used. After each node is proportionally reduced according to the amount of data, the model architecture is adjusted according to the input data form.
[0212] STEP 2: Store the above constructed network architecture in the category "state recognition model".
[0213] STEP 3: Assign an address header such as 0x00E1 to the category "state recognition model", and assign different address information to different models, such as 0x00E10000 for AlexNet and 0x00E11000 for VGG16.
[0214] STEP4: Initialize the model weight parameters. For example, the initial weight parameter of AlexNet is w A , the initial weight parameter of VGG16 is wV .
[0215] Taking AlexNet as the benchmark model, a typical state recognition model attribute can be expressed as:
[0216] {Evaluation method: state recognition, model architecture: AlexNet, weight parameter: w A}
[0217] Corresponding to the aforementioned step S102: the vibration signal dataset is used as the verification dataset information and initialized.
[0218] STEP1: Collect data set information of the "vibration signal-operating status" pair type, such as the processing data information of the same tool under the same working conditions corresponding to the machine tool where each edge device is located. A typical verification data set Attributes can be represented as:
[0219] {Data type: sensor data (vibration data),
[0220] Dataset: validation set,
[0221] Specific data: data format ("sequence-status"), data length (2000 items), features (1×1024), labels (idle, broken blade, normal, etc.)}
[0222] STEP2: Store the data set in the category "state identification data set", assign an address header such as 0x00E2 to the category, and the specific data address is 0x00E20000.
[0223] Corresponding to the aforementioned step S103: each edge device initializes its own vibration data information, taking one of the edge devices as an example.
[0224] STEP 1: Collect vibration sensor data. No data preprocessing is performed here. All data is decomposed into n×1024 format and saved. In this embodiment, it is assumed that there are 1000 valid data after decomposition, and the data format is 1000×1024.
[0225] STEP 2: Assign label information to all valid data. Assuming that there are 300, 300, and 400 pieces of idling, broken edge, and normal data respectively, the data format after labeling is idling (300×1024), broken edge (300×1024), and normal (400×1024).
[0226] STEP3: Divide the data set according to a certain ratio. This embodiment adopts {7:2:1}, and the divided data set is in the form of training set (700×1024; idling 210, chipping 210, normal 280), verification set (200×1024; idling 60, chipping 60, normal 80), and test set (100×1024; idling 30, chipping 30, normal 40). The data attributes of the training set here can be expressed as:
[0227] {Data type: sensor data (vibration data),
[0228] Dataset: training set,
[0229] Specific data: data format ("sequence-status"), data length (700 items), features (1×1024), labels (idle, broken, normal, etc.)}
[0230] Corresponding to the above step S2: Taking the AlexNet model as an example, the training process of the state recognition model is completed. Assume that the training round Epoch = 100 and the number of edge devices N c =10.
[0231] Corresponding to the above step S201: Assuming the current training round i = 20, obtain the server model information And send it to each edge device. When the training round i = 1,
[0232] Corresponding to the aforementioned step S202: after receiving the server model, each client model parameter
[0233] Corresponding to the aforementioned step S203: each edge device updates the client model parameters according to its own data information
[0234] Corresponding to the aforementioned step S204: using the validation data set to evaluate the current round of client model parameters, the evaluation basis adopted here can be expressed as:
[0235] {Current round server model: Validation dataset: }
[0236] STEP 1: Wait for each edge device to upload the updated client model
[0237] STEP2: Calculate the model loss of each client In this case, the cross entropy loss is used as the loss function for model verification. The specific calculation method is:
[0238] Loss(p,q)=-∑ xp(x)logq(x) (8)
[0239] In the formula, x represents the current sample, p(x) is the expected output probability, and q(x) is the actual data probability. The model loss can be calculated based on the above formula, for example
[0240] STEP3: Calculate the distance between each client model For example
[0241] Then the client model index with a ranking of 1 can be expressed as:
[0242] {loss: distance: }
[0243] S205: Dynamic aggregation to obtain the next round of server-side models
[0244] STEP1: Select the number of models to be aggregated, assuming n i =3.
[0245] STEP 2: Calculate n i =3, the personalization factor of the first three client models
[0246] A typical personalization factor calculation is as follows:
[0247] Assume that the indicators of the top 3 client models are:
[0248] {loss: distance: }, training set length L1 = 100
[0249] {loss: distance: }, training set length L2 = 150
[0250] {loss: distance: }, training set length L3 = 100
[0251] but
[0252] STEP 3: Aggregate to get the third candidate server model
[0253] STEP4: After obtaining 10 candidate server models, Verify the loss of each model. Assuming that the ninth candidate server model has the smallest loss among all the sum models, let
[0254] S206: The maximum number of training rounds has not been reached yet, and the training is continued in S201. When the training round i=100, the training is terminated, and the final server model w is sent to each edge device. s ,in
[0255] S3: Each edge device fine-tunes the model and then applies it.
[0256] S301: receiving the final server model information w s , let w c =w s .
[0257] S302: Fine-tune the model according to the respective data information. The fine-tuning method here is to freeze all feature extraction layers of the model and only train its classifier layer, that is, the module containing only the fully connected layer. The training round is set to 30. After continuously updating the model parameters, the final model parameters w of each client are obtained. c With Model M c .
[0258] S303: Each edge device will correspond to its own final client model M c Put into use to realize the status identification of CNC tools.
[0259] In summary, this solution targets the actual edge-cloud collaborative environment in the field of industrial production, and uses federated learning to build a distributed learning framework. It protects data privacy and solves the problem of data islands, while reducing the consumption of transmission resources to a certain extent. Taking into account the defects of the traditional federated averaging algorithm, personalized factors, dynamic aggregation, and model fine-tuning mechanisms are introduced to optimize and improve the framework, thereby improving the accuracy of the global model and solving the problem of user fairness.
Claims
1. A CNC tool health status assessment system based on federated learning under edge-cloud collaborative architecture, characterized in that: It comprises a cloud server (1) and a plurality of edge devices (2) connected thereto, wherein the cloud server (1) is a server, the edge devices (2) are clients, and the cloud server (1) is used to store CNC tool health assessment model information; Obtain the server model in each round and send it down, receive the client model uploaded by the edge device (2) and evaluate it; And according to the client model, personalized dynamic aggregation is performed to form a new round of server-side models; The edge device (2) is connected to the CNC machine tool and is used to process and store tool-related data information; Obtain each round of server-side models issued by the cloud server (1); train the models according to the data information of each client and upload them; Receive the final server-side model and fine-tune it; And the fine-tuned model is applied to identify the health status of CNC tools.
2. According to the CNC tool health status assessment system based on federated learning under the edge-cloud collaborative architecture of claim 1, it is characterized in that: The cloud server (1) is provided with a model information library (11), a server-side model acquisition module (12), a client-side model evaluation module (13), and a personalized dynamic aggregation module (14); the model information library (11) is used to store a CNC tool health status evaluation model; The server-side model acquisition module (12) is used to acquire the server-side model information of the current round; The client model evaluation module (13) is used to evaluate the client model uploaded by each edge device (2); The personalized dynamic aggregation module (14) introduces personalized factors to influence the global model weight based on the output results of the client model evaluation module (13), and uses a dynamic aggregation mechanism to screen and obtain a new round of server-side models; The edge device (2) comprises a data information library (21), a client model acquisition module (22), a client model training module (23) and a client model fine-tuning module (24), wherein the data information library (21) is used to pre-process and store raw data of sensors on a CNC machine tool and divide the data set; The client model acquisition module (22) acquires the server model sent from the cloud server (1) as the initial model of the client in the current round; The client model training module (23) uses the data set provided by the data information library (21) to train the current round of initial model of the client to obtain an updated client model; The client model fine-tuning module (24) performs personalized data fine-tuning operations on the updated client model to obtain a final client model for use in identifying the health status of a numerically controlled tool.
3. A method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture, characterized in that: The following steps are involved: S1. Complete information initialization in the cloud server and edge device respectively: initialize CNC tool evaluation model information and verification data set information in the cloud server, and initialize client data information in the edge device; S2: Based on the federated learning framework under the edge-cloud architecture, CNC tool evaluation model training is performed; S3. Fine-tune the CNC tool evaluation model in the edge device, use the fine-tuned CNC tool evaluation model to identify the health status of the CNC tool, and obtain the health status detection result of the corresponding CNC tool.
4. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 3, it is characterized in that: The step S1 of completing information initialization in the cloud server includes the following steps: Collect CNC tool health assessment models based on deep learning network models; According to different evaluation methods, the collected different model architectures are classified and stored by category; Assign different address information to each model in different categories, so that the model and the address correspond one to one; Initialize the parameters of each node in each model architecture; According to the category requirements, collect and store representative data information in a targeted manner. The data information attributes must be completely consistent with the data information attributes used in edge device training, and the data volume must reach the preset threshold. Since there may be multiple sets of verification data sets for each type of evaluation method, after assigning the same address header to each category, different address information is assigned to each set of verification sets and they correspond one to one.
5. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 3, it is characterized in that: The step S1 completes information initialization at the edge device and includes the following steps: Collect the original sensor data information on CNC machine tools, and save it after preprocessing through feature extraction and data fusion; According to different evaluation methods, different label information is assigned to the pre-processed data according to the current tool operation status; The training set, validation set, and test set are divided according to the ratio of {a:b:c}, where a>b>c.
6. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 3, it is characterized in that: The step S2 comprises the following steps: S201, cloud server: obtain the current round server model information and send it to each edge device; S202, edge device: receiving the server model as the initial model of the client in the current round; S203, edge device: train and update the initial model of the current round of client, and upload it to the cloud server; S204, cloud server: evaluating each updated client model; S205, cloud server: using personalized dynamic aggregation mechanism to update the server model; S206, cloud server: determine whether the preset maximum number of training rounds has been reached. If so, end the training process and use the current round server model as the CNC tool evaluation model; otherwise, return to step S201.
7. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 6, it is characterized in that: The step S203 is specifically that each edge device iteratively updates the weight parameters for the current round of client initial models according to its own data information, and then uploads the updated client models to the cloud server.
8. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 6, it is characterized in that: The specific process of step S204 is as follows: STEP 1: Wait for the edge devices to upload their respective client models; STEP2: After the client model is uploaded, the loss information of each model is verified and ranked according to the validation set data information. The calculation method is: in, Represents the client model loss. The superscript c represents the ranking of the client model loss among all models. The smaller the c, the smaller the loss. The subscript i represents the current training round. represents the specific model of the cth client, and Loss(·) represents the loss function used to calculate the model in the validation data set. The loss on Represents the validation dataset existing in the cloud server; STEP3: Calculate the Euclidean distance between the weight parameters of each client model and the current round of server model, and perform normalization. The calculation method is: in, represents the weight parameter of the c-th client model, Represents the weight parameter of the current round of server-side model, Represents the distance information of the c-th client model.
9. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 8, it is characterized in that: The specific process of step S205 is as follows: STEP1. Select the number of models n required for aggregation based on loss ranking i The specific client model corresponding to it, where n i The value range of is: Where n i Indicates the number of aggregation models available for selection in the current round; STEP2: According to the selected aggregation model number n i , calculate the personalization factor of each selected client model: In the formula, represents the personalization factor, L c Indicates the length of the training set corresponding to the client model; STEP 3: Based on the weight parameters and personalization factors of the selected client model, aggregate an alternative server model: In the formula, Indicates that the number of aggregated models is n i The aggregate model obtained when STEP4, for n i ∈[1,N c ], polymerize to obtain N c After selecting the server model, the validation set Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server model parameter for the next round. The calculation method is: In the formula, Indicates the server model parameters for the next round.
10. According to the method for evaluating the health status of CNC tools based on federated learning in an edge-cloud collaborative architecture according to claim 3, it is characterized in that: The step S3 is to fine-tune the CNC tool evaluation model. Specifically, after receiving the final server-side model, each edge device freezes most of the neural network layers according to their own data information, and then retrains the last layer or layers of the neural network for a set number of rounds, and uses the fine-tuned model as the final model M of each client. c , the model weight parameter is w c .
Citation Information
Patent Citations
Asynchronous federated learning method, system, device and terminal for mobile vehicle
CN114116198A
Pedestrian re-identification method based on adaptive personalized federal learning
CN115565206A
Bearing fault diagnosis method based on federal local transfer learning
CN116992336A
Safety helmet wearing detection model training method based on federal learning
CN117422979A
Federated learning method and device
WO2023029944A1
