A numerical control tool health state evaluation system and method based on federated learning under edge cloud cooperation architecture
Patent Information
- Application Number
- CN202410847302.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2044-06-27
AI Technical Summary
中国专利CN 115345199 A公开了一种基于残差网络的刀具故障诊断手段,该方案能够一定程度上提高刀具故障诊断的准确率,但并未考虑现实生产场景应用时存在的数据难以收集、模型训练需要较大算力资源等问题,存在应用困难的局限
[0063]本发明建立以云服务器作为服务端,边缘设备作为客户端的中心化横向联邦学习体系框架,能够在保护数据隐私并解决数据孤岛问题的同时,一定程度上降低了传输资源的消耗;此外,综合考虑全局最优性与用户公平性,本发明在传统联邦平均算法的基础上,引入个性化因子、动态聚合与模型微调手段进行优化改进,能够提高全局模型准确性、同时确保用户公平性。由此能够高效、准确地针对各数控刀具进行健康状态识别,有利于提高数控机床加工质量和精度。
Smart Images

Figure CN118734167B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CNC tool health performance monitoring technology, and in particular to a CNC tool health status assessment system and method based on federated learning under an edge-cloud collaborative architecture. Background Technology
[0002] With the continuous development of science and technology, modern industrial production places higher demands on the proper operation of mechanical equipment. CNC machine tools are crucial equipment in production workshops, and their complexity and operational uncertainties are gradually increasing. CNC cutting tools, as core components of machine tool processing, directly affect the quality and precision of machined parts due to their health status. Therefore, how to reasonably assess the health performance of CNC cutting tools has become a critical issue in the production field. Currently, the mainstream assessment method for the health performance of CNC cutting tools is data-driven deep learning.
[0003] With the continuous development of Industrial Internet technology, modern industrial production is increasingly interconnected with Industrial Internet platforms, and edge-cloud collaboration technology is being widely applied. For example, Chinese patent CN 112858901 A discloses a monitoring system for real-time tool status and life prediction based on an edge-cloud architecture. By deploying a life prediction module at the gateway, it reduces the data transmission time between the cloud and the device. However, because all data needs to be transmitted to the cloud for processing and calculation, privacy issues arise. Chinese patent CN 115345199 A discloses a tool fault diagnosis method based on residual networks. This solution can improve the accuracy of tool fault diagnosis to a certain extent, but it does not consider the difficulties in data collection and the large computing resources required for model training in real-world production scenarios, thus limiting its application. Chinese patent CN115587543 A discloses a tool remaining life prediction method and system combining federated learning and LSTM. This solution improves the model's generalization ability to a certain extent, but it does not consider the performance degradation caused by the federated learning framework. In addition, Chinese patent CN 114818476 A discloses a federated learning lifetime 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 the prediction model to predict lifetime in order to enhance accuracy. Therefore, it is necessary to train two models, the encoder and the lifetime prediction model, which undoubtedly increases the data transmission burden. Furthermore, it does not consider the fairness of users, that is, it does not optimize and improve the user model for each user's data information.
[0004] In summary, existing technologies have explored and applied deep learning methods to improve the accuracy of CNC tool evaluation and in edge-cloud collaboration and distributed frameworks. However, considering production costs, the computing units connected to CNC machine tools are often edge devices with limited computing power, and it is difficult to collect sufficient effective data for a single tool in a single machine tool, resulting in data silos and difficulties in applying deep learning methods. Although using 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 silo 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 addressing the data silo problem, can provide a new approach to the application of deep learning in edge-cloud collaborative environments. However, traditional federated averaging algorithms still suffer from poor global accuracy and poor detection accuracy of individual user models. Furthermore, there is a lack of consistency in accuracy between the global model and individual users, i.e., insufficient user fairness. Therefore, further optimization and improvement are urgently needed. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a CNC tool health status assessment system and method based on federated learning under an edge-cloud collaborative architecture. This system can protect data privacy, solve the data silo problem, and reduce the consumption of transmission resources. At the same time, it optimizes and improves the framework of the traditional federated averaging algorithm to improve global accuracy and ensure user fairness.
[0006] The objective of this invention can be achieved through the following technical solution: 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 the server and the edge devices are the clients, the cloud server is used to store CNC tool health assessment model information; acquire and distribute each round of server-side models, receive client-side models uploaded by edge devices and evaluate them; and perform personalized dynamic aggregation based on client-side models to form a new round of server-side models;
[0007] The edge device is connected to the CNC machine tool and is used to process and store tool-related data; acquire each round of server-side models sent by the cloud server; train and upload models based on their respective client-side data; receive and fine-tune the final server-side model; and apply the fine-tuned model to identify the health status of the CNC tool.
[0008] Furthermore, the cloud server is equipped with a model information database, a server-side model acquisition module, a client-side model evaluation module, and a personalized dynamic aggregation module. The model information database is used to store CNC tool health status evaluation models.
[0009] The server-side model acquisition module is used to acquire server-side model information for the current round.
[0010] The client model evaluation module is used to evaluate the client models uploaded by each edge device;
[0011] The personalized dynamic aggregation module, based on the output of the client-side model evaluation module, introduces personalized factors to influence the global model weights and uses a dynamic aggregation mechanism to filter 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. The data information library is used to preprocess, save, and divide the raw sensor data on the CNC machine tool into datasets.
[0013] The client model acquisition module obtains the server-side model distributed by the cloud server as the initial model for the current round of the client.
[0014] The client model training module uses the dataset provided by the data information database to train the client's initial model for the current round, thereby obtaining an updated client model.
[0015] The client model fine-tuning module performs personalized data fine-tuning operations on the updated client model to obtain the final client model, which is used for the health status identification of CNC tools.
[0016] A method for assessing the health status of CNC cutting tools based on federated learning under 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 dataset information in the cloud server, and initialize client data information in the edge device;
[0018] S2. Training of CNC tool evaluation model based on federated learning framework under edge-cloud architecture;
[0019] S3. Fine-tune the CNC tool evaluation model in the edge device, and use the fine-tuned CNC tool evaluation model to identify the health status of the CNC tool and obtain the corresponding health status detection result of the CNC tool.
[0020] Furthermore, step S1, which involves initializing information on the cloud server, includes the following steps:
[0021] Collect CNC tool health assessment models based on deep learning network models;
[0022] Based on different evaluation methods, the collected different model architectures are classified and stored according to their categories;
[0023] Each model in different categories is assigned different address information, so that there is a one-to-one correspondence between the model and the address;
[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 are required to be completely consistent with the data information attributes used during edge device training, and the data volume reaches a preset threshold.
[0026] Since each evaluation method may have multiple sets of validation datasets, after assigning the same address header to each category, different address information is assigned to each set of validation data and they are matched one by one.
[0027] Furthermore, step S1, in which the edge device completes information initialization, includes the following steps:
[0028] Collect raw sensor data from CNC machine tools, preprocess the data using feature extraction and data fusion techniques, and then save the data.
[0029] Based on different evaluation methods and the current tool operating status, different label information is assigned to the preprocessed data;
[0030] The training set, validation set, and test set are obtained by dividing the dataset according to the ratio {a:b:c}, where a>b>c.
[0031] Further, step S2 includes the following steps:
[0032] S201, Cloud Server: Obtains the current round of server-side model information and sends it to each edge device;
[0033] S202, Edge device: Receives the server model as the initial model for the current round of clients;
[0034] S203, Edge Devices: Train and update the initial model for the current round of clients, and upload it to the cloud server;
[0035] S204, Cloud Server: Evaluate the updated client models;
[0036] S205, Cloud Server: The server-side model is updated using a personalized dynamic aggregation mechanism;
[0037] S206, Cloud Server: Determine whether the preset maximum training round has been reached. If yes, end the training process and use the current round server model as the CNC tool evaluation model; otherwise, return to step S201.
[0038] Furthermore, step S203 specifically involves each edge device iteratively updating the weight parameters of the current round client initial model based on 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] STEP 1: Wait for the edge devices to upload their respective client models;
[0041] STEP 2: After the client-side models are uploaded, the loss information of each model is verified and ranked based on the validation set data. The calculation method is as follows:
[0042]
[0043] in, This represents the client-side model loss. The superscript 'c' indicates the rank of this client-side model's loss among all models; a smaller 'c' indicates a smaller loss. The subscript 'i' indicates the current training epoch. Let c be the specific model for the client, and Loss(·) represents the calculation of the model's performance on the validation dataset based on the loss function. The losses on This represents the verification dataset that exists on the cloud server;
[0044] STEP 3: Calculate the Euclidean distance between the weight parameters of each client model and the current round server model, and perform normalization processing. The calculation method is as follows:
[0045]
[0046]
[0047] in, This represents the weight parameters of the c-th client model. This represents the weight parameters of the server-side model in the current round. This represents the distance information of the c-th client model.
[0048] Furthermore, the specific process of step S205 is as follows:
[0049] STEP 1: Based on the loss ranking, select the number of models n required for aggregation. i Its corresponding specific client model, where n i The range of values for is:
[0050] {n i |1≤n i ≤N c ,n i ∈N}
[0051] In the formula, n i This indicates the number of aggregation models available in the current round;
[0052] STEP2, Based on the selected number of aggregation models n i Calculate the personalization factor for each selected client model:
[0053]
[0054] In the formula, L represents the personalization factor. c This 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-side models, aggregate to obtain a candidate server-side model:
[0056]
[0057] In the formula, This indicates that the number of aggregation models is n. i The aggregation model obtained at that time;
[0058] STEP4, For n i ∈[1,N c ], aggregate to obtain N c After selecting several alternative server-side models, the validation set was used. Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server-side model parameter for the next round. The calculation method is as follows:
[0059]
[0060] In the formula, This indicates the server-side model parameters for the next round.
[0061] Furthermore, step S3, which involves fine-tuning the CNC tool evaluation model, specifically involves each edge device, after receiving the final server model, freezing most layers of the neural network based on its own data information, retraining the last one or a few layers for a set number of rounds, and using the fine-tuned model as the final model M for each client. c The model weight parameter is w c .
[0062] Compared with the prior art, the present invention has the following advantages:
[0063] This invention establishes a centralized, horizontally federated learning framework with cloud servers as the server-side and edge devices as the client-side. This framework protects data privacy and addresses the data silo problem while reducing transmission resource consumption to some extent. Furthermore, considering both global optimality and user fairness, this invention optimizes the traditional federated averaging algorithm by introducing personalized factors, dynamic aggregation, and model fine-tuning techniques. This improves the accuracy of the global model while ensuring user fairness. Consequently, it enables efficient and accurate health status identification for each CNC tool, which is beneficial for improving the machining quality and precision of CNC machine tools.
[0064] This invention fully considers the distributed production system in the industrial environment and combines modern deep learning methods to provide an application device for centralized horizontal federated learning in the edge-cloud collaborative environment. It establishes a correspondence between "cloud server - server" and "edge device - client". Due to the introduction of the federated learning method framework, it can coordinate various data silos without transmitting any original data information to the cloud server, thus protecting user data privacy and reducing the loss of transmission resources.
[0065] This invention addresses the problem that traditional federated averaging algorithms can lead to poor global model accuracy. Therefore, it introduces personalized factors to different client models to influence the global model weights and uses a dynamic aggregation mechanism to select the optimal model. In other words, by combining personalized dynamic selection and aggregation mechanisms, it comprehensively considers the need for global model optimality and the impact of different client models on the global model, which can effectively improve the global model accuracy.
[0066] This invention also takes into account that each user's data information has its own characteristics. Therefore, a model fine-tuning mechanism is introduced. After the final global model training is completed, the model is fine-tuned using each user's individual data information. This results in the unique model customization for each user. Through model fine-tuning, each user can better fit their own data characteristics, thus improving the accuracy of each user's model while ensuring fairness for all users. Attached Figure Description
[0067] Figure 1 This is a schematic diagram of the system structure of the present invention;
[0068] Figure 2 This is a schematic diagram of the federated learning architecture in the edge-cloud system environment constructed in the embodiment.
[0069] Figure 3 This 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 5This is a schematic diagram of the model training process;
[0072] Figure 6 This is a schematic diagram of the personalized dynamic aggregation process;
[0073] Figure 7 This is a schematic diagram of the model fine-tuning process;
[0074] The markings in the diagram are as follows: 1. Cloud server; 2. Edge device; 11. Model information database; 12. Server-side model acquisition module; 13. Client-side model evaluation module; 14. Personalized dynamic aggregation module; 21. Data information database; 22. Client-side model acquisition module; 23. Client-side model training module; 24. Client-side model fine-tuning module. Detailed Implementation
[0075] The present invention will now be described in detail 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 to it. The cloud server 1 is the server, and the edge devices 2 are the clients. The cloud server 1 is used to store CNC tool health assessment model information; obtain and distribute the server model for each round; receive and evaluate the client model uploaded by the edge devices 2; and perform personalized dynamic aggregation based on the client model to form a new round of server model.
[0078] Edge device 2 is connected to the CNC machine tool to process and store tool-related data; obtain each round of server-side models sent by cloud server 1; train and upload models based on their respective client-side data; receive and fine-tune the final server-side model; and use the fine-tuned model to identify the health status of the CNC tool.
[0079] The cloud server 1 is equipped 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 CNC tool health status evaluation models.
[0080] Server-side model acquisition module 12 is used to acquire server-side model information for the current round;
[0081] The client model evaluation module 13 is used to evaluate the client models uploaded by each edge device 2;
[0082] The personalized dynamic aggregation module 14 takes the output of the client model evaluation module, introduces personalized factors to influence the global model weights, and uses a dynamic aggregation mechanism to filter and obtain a new round of server-side models.
[0083] 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 preprocess, save, and divide the raw sensor data on the CNC machine tool into datasets.
[0084] The client model acquisition module 22 obtains the server-side model distributed by the cloud server 1 as the initial model for the current round of the client;
[0085] The client model training module 23 uses the dataset provided by the data information library 21 to train the client's initial model for the current round, and obtains the updated client model;
[0086] The client model fine-tuning module 24 performs personalized data fine-tuning operations on the updated client model to obtain the final client model, which is used for the health status identification of CNC tools.
[0087] This embodiment applies the above-described scheme to construct as follows: Figure 2 The diagram illustrates a federated learning architecture in an edge-cloud system environment, where the cloud server serves as 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 that interacts with multiple clients, enabling data usage and machine learning modeling while ensuring the privacy and data security of each client. This invention applies this basic idea to an edge-cloud collaborative environment, establishing a correspondence between "cloud server – server" and "edge device – client," and optimizing and improving upon the original architecture. Its basic 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 repository SA, a server-side model acquisition module SB, a client-side model evaluation module SC, and a personalized dynamic aggregation module SD; the edge device module C includes a data information repository CA, a client-side model acquisition module CB, a client-side model training module CC, and a client-side model fine-tuning module CD.
[0088] Specifically:
[0089] (1) Cloud Server S
[0090] The cloud server primarily functions to store CNC tool health assessment model information, acquire and distribute server-side models for each round, receive and evaluate client-side models uploaded from edge devices, and dynamically aggregate client-side models to form a new round of server-side models. The cloud server includes the following modules:
[0091] 1) Model Information Base (SA)
[0092] This module comprises two parts: a model collection and construction module (SA1) and a model classification and storage module (SA2). Its main function is to store CNC tool health status assessment models, primarily using deep learning models. Model attribute information can be defined as follows:
[0093] Model attributes = {Evaluation method, model architecture, weight parameters, other attributes}
[0094] ① Assessment methods = {State identification, state prediction, lifetime estimation, other methods}
[0095] State recognition: An evaluation method that classifies and identifies the operating state of CNC cutting tools, such as normal operation, idle running, or chipping, based on data information at the current running time. The models used are mainly CNNs (Convolutional Neural Networks), which perform well in classification problems.
[0096] State prediction: In the machining process, this is an evaluation method that predicts the operating state of the CNC tool at the next moment based on the data information at the current operating moment. Since the key to prediction lies in the accurate simulation of data signals, the models used are mainly RNNs (Recurrent Neural Networks) and TCNs (Temporal Convolutional Networks), which perform well in the field of sequence prediction, for signal simulation, and are combined with state recognition models for state prediction.
[0097] Tool life estimation: A method for assessing the tool life or wear amount based on current data throughout the entire life cycle of a CNC tool, from the start of machining to failure. The models used are primarily based on architectures such as RNN and TCN.
[0098] Other methods include, but are not limited to, diagnosing the fault status of the tool and analyzing the degree of tool wear.
[0099] ② Model Architecture: Based on the different evaluation methods mentioned above, after literature review and practical testing, a targeted deep learning model network architecture is 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 during network initialization.
[0101] ④ Other attributes: Model storage address, model training results, and specific application scenarios, etc.
[0102] 2) Server-side model acquisition module SB
[0103] This module consists of two parts: a model acquisition module (SB1) and a parameter update module (SB2). Its main function is to acquire the server-side model information for the current round. The model information comes from two sources: 1) selecting a suitable model structure from the model information database and using it as the initial server-side model for the first round; 2) updating the new server-side model information obtained after the previous round of aggregation and using it as the initial server-side model for the current round. The model attribute definitions are the same as in SA.
[0104] 3) Client-side model evaluation module SC
[0105] This module comprises two parts: a model loss calculation module (SC1) and a parameter distance calculation module (SC2). Its main function is to evaluate the client-side models uploaded by each edge device. Traditional federated averaging algorithms aggregate all models uploaded by each client to obtain a new round of server-side models, without considering the impact of outliers. Therefore, this invention introduces an evaluation mechanism to evaluate and filter each client-side model. The evaluation criteria can be defined as follows:
[0106] Evaluation criteria = {Current round server-side model, validation dataset}
[0107] ① Current round server-side model: The server-side model obtained from the model information library or the previous round of aggregation, where the model attributes are the same as those defined in SA.
[0108] ② Validation Dataset: A representative dataset used to validate and evaluate the performance of various client-side models. The data attributes are the same as defined in CA.
[0109] The evaluation method involves calculating the client-side model validation loss based on the validation set data and ranking them, then calculating and saving the distance between the weight parameters of each client-side model and the current round's server-side model. The client-side model metrics after evaluation and filtering can be defined as follows:
[0110] Model metric = {loss, parameter distance}
[0111] ①Loss: Loss information obtained after model validation using validation datasets.
[0112] ② Parameter distance: This is obtained by calculating and normalizing the Euclidean distance between the weight parameters of the current client model and the current round server model.
[0113] 4) Personalized Dynamic Aggregation Module SD
[0114] This module includes a personalized factor calculation module (SD1), a dynamic aggregation and validation module (SD2), and a server-side model parameter update module (SD3). Its main function is to aggregate the models to obtain the next round of server-side models. After model evaluation, a common practice is to aggregate several models with lower losses to obtain the parameters for a new round of server-side models. However, a fixed number of aggregated models can easily lead to information redundancy or missing information. To address these issues, this invention introduces a personalized factor calculation module (SD1) and a dynamic aggregation and validation module (SD2). First, module SD1 filters the client-side models based on the evaluated metrics and introduces personalized factors into the filtered models. Then, module SD2 uses a dynamic aggregation mechanism to obtain multiple candidate models. Finally, based on the validation dataset, the candidate model with the best accuracy and performance is selected as the next round of server-side models.
[0115] (2) Edge device C
[0116] In this invention, the edge device refers to an intelligent device deployed in the workshop and connected to a single CNC machine tool. Its main functions include processing and storing tool-related data, acquiring each round of server-side models from the cloud server, training and uploading models based on client-side data, and receiving and fine-tuning the final server-side model. The edge device includes the following modules:
[0117] 1) Data Information Database (CA)
[0118] This module includes a data collection and processing module CA1 and a dataset partitioning and storage module CA2. Its main functions are to preprocess, save, and partition the raw sensor data. The processed data attribute information can be defined as follows:
[0119] Data attribute = {data type, dataset, specific data, other attributes}
[0120] ① Data type = {sensor data, feature data, other data}
[0121] Sensor data: Raw data information collected by sensors, such as vibration data, current data, etc.
[0122] Feature data: Data processed from raw sensor data using common feature extraction techniques such as Fourier transform and wavelet transform.
[0123] Other data: including but not limited to data information generated using filtering, data augmentation, image or point cloud generation, data fusion and other methods.
[0124] ②Dataset = {training set, validation set, test set}
[0125] Training set: Data used for model training.
[0126] Validation set: Data used for model validation.
[0127] Test set: Data information used for model testing.
[0128] ③Specific data = {data format, data length, features, labels}
[0129] Data Format: Depending on the evaluation method and model architecture, the data format has its own characteristics. Taking one-dimensional sequence data as the model input as an example, state identification requires a "sequence-state" data type, state prediction requires a "sequence-sequence" data type, and lifetime estimation requires a "sequence-lifetime value" data type.
[0130] Data length: The specific number of data entries included.
[0131] Features: Specific feature information for each data point.
[0132] Tags: Specific tag information for each data entry.
[0133] ④ Other attributes: definition information such as the number of feature channels and data dimensions, and data address information.
[0134] 2) Client-side model acquisition module CB
[0135] This module includes a model acquisition module CB1 and a parameter update module CB2. Its main function is to obtain the model information for each client in the current round. Specifically, it waits for the cloud server to send the server-side model for each round and uses it as the initial model for the client in the current round.
[0136] 3) Client-side model training module CC
[0137] This module mainly includes the model training module CC1, whose primary function is to train and upload client models. Based on the data information from each client and the initial client model for the current round, each client trains and updates its model weight parameters, and then uploads the updated client model information to the cloud server.
[0138] 4) Client-side model fine-tuning module CD
[0139] This module mainly includes the model fine-tuning module CD1, whose primary function is to fine-tune the model to obtain the final client model. In the traditional federated averaging algorithm, each client directly applies the final server-side model after receiving it, without considering the influence of each client's personalized data. This invention introduces the model fine-tuning module CD1, which, after each client waits for the cloud server to send the final server-side model information, fine-tunes the model based on its own data information to obtain the final model.
[0140] Based on the above system, a method for assessing the health status of CNC tools based on federated learning under an edge-cloud collaborative architecture is implemented, such as... Figure 3 As shown, it includes the following steps:
[0141] S1. Complete information initialization in the cloud server and edge device respectively: initialize CNC tool evaluation model information and verification dataset information in the cloud server, and initialize client data information in the edge device;
[0142] S2. Training of CNC tool evaluation model based on federated learning framework under edge-cloud architecture;
[0143] S3. Fine-tune the CNC tool evaluation model in the edge device, and use the fine-tuned CNC tool evaluation model to identify the health status of the CNC tool and obtain the corresponding health status detection result of the 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, before the federated learning architecture can perform its actual work, basic information needs to be initialized. On the cloud server side, the initialization of specific models in the model information repository and the validation dataset needs to be completed; on the edge devices, the initialization of data information for each client needs to be completed. The information initialization process is as follows: Figure 4 As shown.
[0146] S101: Cloud Server Module; S: Initialize Model Information
[0147] In the model information database SA, CNC tool health assessment models are collected, classified and stored according to different assessment methods, and assigned corresponding address information. Then, the model weight parameters are initialized to complete the initialization of the assessment model information.
[0148] STEP 1: After searching relevant literature or conducting actual development and verification, collect CNC tool health assessment models based on deep learning network models.
[0149] STEP2: Based on different evaluation methods such as state identification, state prediction, and lifetime estimation, classify the collected different model architectures and store them according to the categories.
[0150] STEP3: Assign different address information to each model in different categories, so that there is a one-to-one correspondence between the model and the address.
[0151] STEP4: Initialize the parameters of each node in each model architecture.
[0152] S102: Cloud Server Module S: Initialize and Verify Dataset Information
[0153] This section initializes the validation dataset information used in the client-side evaluation model module SC. It collects representative CNC tool datasets for different evaluation methods, assigns them corresponding address information, and then uses this data for performance evaluation of models uploaded by each client.
[0154] STEP 1: Based on the category requirements of the model information base, collect and store representative data information in a targeted manner. The data information attributes must be completely consistent with the data information attributes used during edge device training, and the data volume must reach 20% or more of the total data volume of all clients.
[0155] STEP2: Since there may be multiple sets of verification datasets for each evaluation method, after assigning the same address header to each category, assign different address information to each set of verification data and match them one by one.
[0156] S103: Edge device C: Initialization data information
[0157] In the data information repository (CA), edge devices preprocess the raw data, classify and reconstruct the data according to different evaluation methods, and construct training sets, validation sets, and test sets.
[0158] STEP 1: After collecting raw sensor data, perform data preprocessing using feature extraction, data fusion, and other methods, and then save the data.
[0159] STEP2: Based on different evaluation methods and the current tool running status, assign different label information to the preprocessed data.
[0160] STEP 3: Divide the training set, validation set, and test set according to the ratio of {a:b:c}, generally with a>b>c. In this embodiment, 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 step S2, after information initialization, model training can begin according to the federated learning architecture. This part optimizes and improves the traditional federated averaging algorithm's training process, which involves sending, training, and aggregating models, by introducing a personalized dynamic aggregation mechanism. The specific training process of the improved algorithm is as follows: Figure 5 As shown. The number of training rounds is Epoch, and the number of edge devices is N. c .
[0162] S201: Cloud Server S: Obtain current round server-side model information
[0163] In the server-side model acquisition module SB, the architecture parameters of the current round of server-side models are updated.
[0164] STEP 1: If it is the first round, obtain the required model architecture from the model information database; if it is an intermediate round, wait for the previous round of training to complete and obtain the updated model information.
[0165] STEP2: Send the current round of server model information to each edge device.
[0166] S202: Edge device C: Obtain current round client model information
[0167] In the Client Model Acquisition Module (CB), the architecture parameters of the current round of client models are obtained.
[0168] STEP 1: Wait for the cloud server to send the current round of server-side model information.
[0169] STEP2: Set the initial model of each client in the current round to the server model.
[0170] S203: Edge device; C: Client model training and update
[0171] In the client-side model training module CC, each client iteratively updates the model weight parameters based on its own data information.
[0172] STEP 1: Each client performs an iterative update of the weight parameters based on its own data.
[0173] STEP2: Upload the updated client models to the cloud server.
[0174] S204: Cloud Server S: Evaluate the updated client model
[0175] Traditional federated averaging algorithms aggregate parameters from all client models, neglecting the impact of outliers. This invention aims to select superior client model parameters by evaluating and comparing each model through an assessment mechanism. The basic idea is to evaluate each updated client model within the client model evaluation module (SC), primarily through the calculation of model loss. After ranking based on loss information, distance information is calculated.
[0176] STEP 1: Wait for the edge devices to upload their respective client models.
[0177] STEP 2: After the client-side models are uploaded, the loss information of each model is verified and ranked based on the validation set data. The specific calculation method is as follows:
[0178]
[0179] in This represents the client-side model loss. The superscript c indicates the ranking of the client-side model loss among all models. The smaller the c, the smaller the loss. The subscript i indicates the current training epoch. Let c be the specific model for the client, and Loss(·) represents the calculation of the model's performance on the validation dataset based on the loss function. The losses on This represents the verification dataset that exists on the cloud server.
[0180] STEP3: Calculate the Euclidean distance between the weight parameters of each client model and the current round server model, and then normalize it. The specific calculation method is shown in equations (2) to (3).
[0181]
[0182] In the formula, This represents the weight parameters of the c-th client model. This represents the weight parameters of the server-side model in the current round. This represents the distance information of the c-th client model.
[0183] S205: Cloud Server S: Update Server-Side Model Information
[0184] After completing the client-side model evaluation, a new round of server-side model aggregation needs to be completed and distributed to various edge devices. The existing aggregation method selects a fixed number of aggregations to aggregate the best-performing client-side models, which in practical applications results in the inclusion of poor model parameters or the omission of some key model parameters. This invention improves upon this method by introducing SD1 and SD2 modules into the SD personalized dynamic aggregation module for model aggregation. The specific process is as follows: Figure 6 As shown.
[0185] STEP 1: Based on the loss ranking, select the number of models n required for aggregation. i Its corresponding specific client model, where n i The range of values for is:
[0186] {n i |1≤n i ≤N c ,n i ∈N} (4)
[0187] In the formula, n i This indicates the number of aggregation models available in the current round.
[0188] STEP2: Based on the selected number of aggregation models n i Calculate the personalization factor for each selected client model. The specific calculation method is as follows:
[0189]
[0190] In the formula, L represents the personalization factor. c This indicates the length of the training set corresponding to this client model.
[0191] STEP 3: Based on the weight parameters and personalization factors of the selected client-side models, an alternative server-side model is generated. The specific calculation method is as follows:
[0192]
[0193] In the formula, This indicates that the number of aggregation models is n. i The aggregation model obtained at that time.
[0194] STEP4: For n i ∈[1,N c ], aggregate to obtain N c After selecting several alternative server-side models, the validation set was used. Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server-side model parameter for the next round. The specific calculation method is as follows:
[0195]
[0196] In the formula, This indicates the server-side model parameters for the next round.
[0197] S206: Cloud server S: Determines whether the maximum training rounds have been reached.
[0198] Determine if the current training epoch is the maximum number of training epochs. If so, stop training and send the final server-side model w to the edge device. s If not, update the server-side model and return to S201 to continue training.
[0199] S3: Edge Devices C: Model Fine-tuning
[0200] After receiving the final server-side model, each edge device, within the SD client's model fine-tuning module, fine-tunes the model architecture based on its own data before applying it. The model fine-tuning process is as follows: Figure 7 As shown.
[0201] S301: Waiting for the cloud server to send the final server-side model
[0202] S302: Fine-tuning of client-side models
[0203] After receiving the final server model, each edge device, based on its own data, freezes most of the neural network layers, then retrains the last one or a few layers for a certain number of rounds, and uses the fine-tuned model as the final model M for each client. c The model weight parameter is w c .
[0204] S303: Practical Application of the Model
[0205] The trained final model is then put into application to complete the health performance evaluation of CNC cutting tools.
[0206] To verify the effectiveness of this solution, this embodiment uses CNC tool status recognition as an example to illustrate a typical implementation process:
[0207] CNC tool status recognition requires real-time identification of the tool's operating status based on relevant data. Following the specific method described above, after initializing the model and data, the model is trained using an improved federated learning process, fine-tuned, and then applied.
[0208] A typical process for evaluating the health performance of CNC cutting tools using state recognition as an example is as follows:
[0209] Corresponding to the aforementioned step S1: complete the initialization of the state recognition model, state verification dataset, and datasets for each edge device.
[0210] Corresponding to the aforementioned step S101: Build a model based on a common convolutional neural network architecture, store the model, and initialize it.
[0211] STEP 1: Search relevant literature, collect and construct commonly used convolutional neural network architectures such as AlexNet, VGG16, GoogLeNet, ResNet18, etc. During the specific construction, adjust according to the amount and form of input data. Here, a one-dimensional convolutional architecture is adopted. After scaling down each node proportionally according to the amount of data, the model architecture is adjusted according to the form of input data.
[0212] STEP2: Store the network architecture constructed above in the category "State Recognition Model".
[0213] STEP3: Assign an address header such as 0x00E1 to the category "State Recognition Model", and assign different address information to different models, such as AlexNet as 0x00E10000 and VGG16 as 0x00E11000.
[0214] STEP 4: Initialize the model weight parameters, such as the initial weight parameters w for AlexNet. A The initial weight parameters of VGG16 are wV .
[0215] Taking AlexNet as the baseline model, a typical state recognition model attribute can be represented as:
[0216] Evaluation method: State recognition; Model architecture: AlexNet; Weight parameters: w A}
[0217] Corresponding to the aforementioned step S102: Use the vibration signal dataset as the verification dataset information and initialize it.
[0218] STEP 1: Collect dataset information of the "vibration signal - operating status" pair type, such as machining data information of the same tool under the same working conditions corresponding to the machine tools of each edge device. A typical validation dataset. An attribute can be represented as:
[0219] Data type: Sensor data (vibration data),
[0220] Dataset: Validation set
[0221] Specific data: data format ("sequence - state"), data length (2000 records), features (1×1024), labels (idle, broken edge, normal, etc.)
[0222] STEP2: Store the dataset in the category "State Recognition Dataset", assigning an address header such as 0x00E2 to the category, with the actual data address being 0x00E20000.
[0223] Corresponding to the aforementioned step S103: Each edge device initializes its own vibration data information, taking one edge device 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, so the data format is 1000×1024.
[0225] STEP2: Assign labels to all valid data. Assuming there are 300, 300, and 400 records of idling, blade breakage, and normal data respectively, the data after labeling will be in the form of idling (300×1024), blade breakage (300×1024), and normal (400×1024).
[0226] STEP 3: Divide the dataset according to a certain ratio. In this example, we use {7:2:1}. The resulting dataset will be in the form of a training set (700×1024; 210 idle, 210 broken, 280 normal), a validation set (200×1024; 60 idle, 60 broken, 80 normal), and a test set (100×1024; 30 idle, 30 broken, 40 normal). The data attributes of the training set can be represented as follows:
[0227] Data type: Sensor data (vibration data),
[0228] Dataset: Training set,
[0229] Specific data: data format ("sequence - state"), data length (700 records), features (1×1024), labels (idle, broken edge, normal, etc.)
[0230] Corresponding to step S2 above: Taking the AlexNet model as an example, complete the training process of the state recognition model. Assume the training epoch = 100 and the number of edge devices N. c =10.
[0231] Corresponding to the aforementioned step S201: Assuming the current training round i = 20, obtain the server-side model information. And send it to each edge device. When training round i=1, let...
[0232] Corresponding to the aforementioned step S202: After receiving the server-side model, set the parameters of each client-side model.
[0233] Corresponding to the aforementioned step S203: Each edge device updates the client model parameters according to its own data information.
[0234] Corresponding to step S204 above: Evaluating the parameters of the current round of client models using the validation dataset, the evaluation criteria adopted here can be expressed as follows:
[0235] Current round server-side model: Validate the dataset: }
[0236] STEP 1: Wait for each edge device to upload the updated client model.
[0237] STEP2: Calculate the loss of each client model. This case uses cross-entropy loss as the loss function for model validation, and its specific calculation method is as follows:
[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 using the above formula, for example...
[0240] STEP3: Calculate the distance between each client model For example
[0241] The client-side model metric with a ranking of 1 can be represented as:
[0242] {loss: distance: }
[0243] S205: Dynamic aggregation yields the next round of server-side model.
[0244] STEP 1: Select the number of models to be aggregated, assuming n i =3.
[0245] STEP2: Calculate n i When = 3, the personalization factor of the top 3 client models
[0246] A typical personalized factor calculation is shown below:
[0247] Assume the metrics for the top 3 client-side models are:
[0248] {loss: distance: The training set length L1 = 100
[0249] {loss: distance: The training set length L2 = 150
[0250] {loss: distance: The training set length L3 = 100
[0251] but
[0252] STEP 3: Aggregate to obtain the third alternative server-side model
[0253] STEP 4: After obtaining 10 candidate server models, according to... To verify the loss of each model, assuming that the ninth candidate server model among all the models has the smallest loss, let...
[0254] S206: The maximum training epoch has not been reached. Return to S201 to continue training. When training epoch i = 100, training ends, and the final server model w is sent to each edge device. s ,in
[0255] S3: Application after model fine-tuning of each edge device.
[0256] S301: Received final server-side model information w s , making w c =w s .
[0257] S302: Fine-tune the model based on the respective data information. This fine-tuning method involves freezing all feature extraction layers and training only the classifier layer (i.e., the module containing only fully connected layers), with 30 training epochs. After continuously updating the model parameters, the final model parameters w for each client are obtained. c With model M c .
[0258] S303: Each edge device will send its corresponding final client model M c It has been put into application to realize the status recognition of CNC cutting tools.
[0259] In summary, this solution addresses the real-world edge-cloud collaborative environment in industrial production by utilizing federated learning to construct a distributed learning framework. This protects data privacy, solves the data silo problem, and reduces transmission resource consumption to some extent. Furthermore, considering the shortcomings of traditional federated averaging algorithms, it introduces personalized factors, dynamic aggregation, and model fine-tuning mechanisms to optimize and improve the framework, thereby enhancing the accuracy of the global model while resolving the issue of user fairness.
Claims
1. A CNC tool health status assessment system based on federated learning under an edge-cloud collaborative architecture, characterized in that, Includes a cloud server (1) and multiple edge devices (2) connected to it. The cloud server (1) is the server and the edge devices (2) are the clients. The cloud server (1) is used to store CNC tool health assessment model information; obtain the server model for each round and send it down, receive the client model uploaded by the edge devices (2) and evaluate it; And based on the client model, a new round of server-side models are formed by personalized dynamic aggregation; 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 and upload the models based on 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 CNC cutting tools; The process by which the cloud server (1) receives and evaluates the client model uploaded by the edge device (2) includes: Waiting for edge devices to upload their respective client models; After the client-side models are uploaded, the loss information of each model is verified and ranked based on the validation set data. The calculation method is as follows: in, Indicates the client-side model loss, superscript This indicates the ranking of the client-side model's loss among all models. The smaller the value, the smaller the loss. (Subscript) Indicates the current training round. Indicates the first A specific client-side model, This indicates that the model's performance on the validation dataset is calculated based on the loss function. The losses on This represents the verification dataset that exists on the cloud server; Calculate the Euclidean distance between the weight parameters of each client model and the current round server model, and then normalize it. The calculation method is as follows: in, Indicates the first Weight parameters of each client-side model. This represents the weight parameters of the server-side model in the current round. Indicates the first Distance information for each client model; The process by which the cloud server (1) performs personalized dynamic aggregation based on the client model to form a new round of server-side model includes: Based on the loss ranking, select the number of models required for aggregation. Its corresponding specific client model, in which The range of values for is: In the formula, This indicates the number of aggregation models available in the current round; Based on the number of aggregation models selected Calculate the personalization factor for each selected client model: In the formula, Indicates the individualization factor, This indicates the length of the training set corresponding to the client model; Based on the weight parameters and personalization factors of the selected client-side models, an alternative server-side model is obtained through aggregation: In the formula, Indicates the number of aggregation models. The aggregation model obtained at that time; for Aggregation yields After selecting several alternative server-side models, the validation set was used. Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server-side model parameter for the next round. The calculation method is as follows: In the formula, This indicates the server-side model parameters for the next round.
2. The CNC tool health status assessment system based on federated learning under an edge-cloud collaborative architecture as described in claim 1, characterized in that, The cloud server (1) is equipped with a model information database (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 database (11) is used to store CNC tool health status evaluation models. The server-side model acquisition module (12) is used to acquire the server-side model information for the current round; The client model evaluation module (13) is used to evaluate the client models uploaded by each edge device (2); The personalized dynamic aggregation module (14) takes the output of the client model evaluation module (13) as an example, introduces personalized factors to influence the global model weights, and uses the dynamic aggregation mechanism to filter and obtain a new round of server-side models. 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 preprocess, save, and divide the raw sensor data on the CNC machine tool. The client model acquisition module (22) obtains the server-side model issued by the cloud server (1) as the initial model for the current round of the client; The client model training module (23) uses the dataset provided by the data information library (21) to train the client's current round initial model and obtain the updated client model; The client model fine-tuning module (24) performs personalized data fine-tuning operations on the updated client model to obtain the final client model, which is used for the health status identification of CNC tools.
3. A method for assessing the health status of CNC cutting tools based on federated learning under an edge-cloud collaborative architecture, characterized in that, Includes the following steps: S1. Complete information initialization in the cloud server and edge device respectively: initialize CNC tool evaluation model information and verification dataset information in the cloud server, and initialize client data information in the edge device; S2. Training of CNC tool evaluation model based on federated learning framework under edge-cloud architecture; S3. Fine-tune the CNC tool evaluation model in the edge device, and use the fine-tuned CNC tool evaluation model to identify the health status of the CNC tool and obtain the corresponding health status detection result of the CNC tool. Step S2 includes the following steps: S201, Cloud Server: Obtains the current round of server-side model information and sends it to each edge device; S202, Edge device: Receives the server model as the initial model for the current round of clients; S203, Edge Devices: Train and update the initial model for the current round of clients, and upload it to the cloud server; S204, Cloud Server: Evaluate the updated client models; S205, Cloud Server: The server-side model is updated using a personalized dynamic aggregation mechanism; S206, Cloud Server: Determine whether the preset maximum training round has been reached. If yes, end the training process and use the current round server model as the CNC tool evaluation model; otherwise, return to step S201. The specific process of step S204 is as follows: Waiting for edge devices to upload their respective client models; After the client-side models are uploaded, the loss information of each model is verified and ranked based on the validation set data. The calculation method is as follows: in, Indicates the client-side model loss, superscript This indicates the ranking of the client-side model's loss among all models. The smaller the value, the smaller the loss. (Subscript) Indicates the current training round. Indicates the first A specific client-side model, This indicates that the model's performance on the validation dataset is calculated based on the loss function. The losses on This represents the verification dataset that exists on the cloud server; Calculate the Euclidean distance between the weight parameters of each client model and the current round server model, and then normalize it. The calculation method is as follows: in, Indicates the first Weight parameters of each client-side model. This represents the weight parameters of the server-side model in the current round. Indicates the first Distance information for each client model; The specific process of step S205 is as follows: Based on the loss ranking, select the number of models required for aggregation. Its corresponding specific client model, in which The range of values for is: In the formula, This indicates the number of aggregation models available in the current round; Based on the number of aggregation models selected Calculate the personalization factor for each selected client model: In the formula, Indicates the individualization factor, This indicates the length of the training set corresponding to the client model; Based on the weight parameters and personalization factors of the selected client-side models, an alternative server-side model is obtained through aggregation: In the formula, Indicates the number of aggregation models. The aggregation model obtained at that time; for Aggregation yields After selecting several alternative server-side models, the validation set was used. Verify the loss of each aggregation model, and use the model parameter with the smallest loss as the server-side model parameter for the next round. The calculation method is as follows: In the formula, This indicates the server-side model parameters for the next round.
4. The method for assessing the health status of CNC tools based on federated learning under an edge-cloud collaborative architecture as described in claim 3, characterized in that, Step S1, which involves initializing information on the cloud server, includes the following steps: Collect CNC tool health assessment models based on deep learning network models; Based on different evaluation methods, the collected different model architectures are classified and stored according to their categories; Each model in different categories is assigned different address information, so that there is a one-to-one correspondence between the model and the address; 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 are required to be completely consistent with the data information attributes used during edge device training, and the data volume reaches a preset threshold. Since each evaluation method may have multiple sets of validation datasets, after assigning the same address header to each category, different address information is assigned to each set of validation data and they are matched one by one.
5. The method for assessing the health status of CNC tools based on federated learning under an edge-cloud collaborative architecture as described in claim 3, characterized in that, Step S1, which involves information initialization at the edge device, includes the following steps: Collect raw sensor data from CNC machine tools, preprocess the data using feature extraction and data fusion techniques, and then save the data. Based on different evaluation methods and the current tool operating status, different label information is assigned to the preprocessed data; The training set, validation set, and test set are obtained by dividing the dataset according to the ratio {a:b:c}, where a>b>c.
6. The method for assessing the health status of CNC tools based on federated learning under an edge-cloud collaborative architecture as described in claim 3, characterized in that, Specifically, step S203 involves each edge device iteratively updating the weight parameters of the current round client initial model based on its own data information, and then uploading the updated client models to the cloud server.
7. The method for assessing the health status of CNC tools based on federated learning under an edge-cloud collaborative architecture as described in claim 3, characterized in that, Step S3, which involves fine-tuning the CNC tool evaluation model, specifically involves each edge device, after receiving the final server model, freezing most of the neural network layers based on its own data information, retraining the last one or a few layers for a set number of rounds, and using the fine-tuned model as the final model for each client. The model weight parameters are .
Citation Information
Patent Citations
System and method for monitoring operation state of cutter in real time and predicting service life
CN112858901A
Federal learning system and method applied to life prediction of rotary mechanical equipment
CN114818476A
Tool fault diagnosis method based on signal conversion and deep residual network
CN115345199A
Cutter residual life prediction method and system based on federated learning and LSTM
CN115587543A
Asynchronous federated learning method, system, device and terminal for mobile vehicle
CN114116198A