Equipment fault prediction method based on federated learning

By introducing a weighted aggregation algorithm with contribution degree mechanism and data set weights in federated learning, the problem of uneven distribution of equipment failure data is solved, and the accuracy and generalization ability of the model are improved, especially in identifying special faults.

CN119723177AInactive Publication Date: 2025-03-28JILIN NORMAL UNIV

Patent Information

Application Number
CN202411778623.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art fails to achieve ideal results in the problem of uneven distribution of equipment failure data, resulting in the model being overfitted during training, making it difficult to identify data of special fault types.

Method used

A device failure prediction method based on federated learning is proposed. By introducing a contribution degree mechanism and a weighted aggregation algorithm of data set weights, FedAvg-ContribData is optimized to optimize the training process of the global model and improve the accuracy and generalization ability of the model.

Benefits of technology

By dynamically adjusting the weights of each client, the limited and unbalanced fault data are effectively utilized, the accuracy and generalization capabilities of the global model are improved, and the ability to identify special faults is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723177A_ABST
    Figure CN119723177A_ABST
Patent Text Reader

Abstract

The invention provides an equipment fault prediction method based on federated learning. According to the method, the weight adaptability of the fault data in the aggregation process under different distribution dimensions is guaranteed by dynamically adjusting the aggregation weight. According to the method, firstly, a contribution degree mechanism is put forward, then the contribution degree of each client and the weight of a data set are combined for model aggregation, and a FedAvg-ContribData algorithm is put forward. Experimental data show that compared with FedAvg and FedAvg-Data algorithms, the method disclosed by the invention has the advantages that the accuracy is improved by 39.67% and 7.87% in the aspect of accuracy; in the aspect of accuracy, the accuracy is improved by 40.43% and 9.06%; in the aspect of recall rate, the recall rate is increased by 41.00% and 7.86%; and in the aspect of the F1 coefficient, the F1 coefficient is increased by 46.62% and 9.34%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of industrial manufacturing technology, and in particular relates to a method for predicting equipment failures based on federated learning. Background Art

[0002] With the development of Industry 4.0 and Internet of Things technology, intelligent equipment plays an increasingly important role in the manufacturing industry. Many experts and scholars have conducted extensive research on the reliability and stability of equipment, and gradually established an intelligent operation and maintenance system based on condition monitoring. For example, bearing fault diagnosis based on thermal imaging uses thermal imaging under different working conditions combined with ANN (Artificial Neural Network) and CNN (Convolutional Neural Network) to achieve fault diagnosis; the TL-Densenet-GAP-FCM (Transfer Learning Dense Network with Global Average Pooling and F uzzy c-Means) model is used for bearing fault diagnosis, reducing the demand for training samples; based on the multi-layer hypergraph convolutional neural network method, faults in industrial processes are diagnosed, which improves the detection accuracy of some fault data sets; based on the deep neural network, a smart grid intelligent fault detection and classification scheme is proposed to effectively detect and classify faults in the power grid.

[0003] Federated learning can effectively protect data privacy and security, reduce the risk of data leakage, overcome the problem of data islands, reduce the burden on central servers, and improve data utilization. For example, robots are used as edge clients to coordinate the inspection of construction project quality; the training scheme of the traffic detection model under federated learning and the model update scheme for identifying new abnormal traffic detection based on honey fields have improved the robustness of the model, have a stronger ability to identify abnormal traffic, and continuously improve the detection performance of new abnormal traffic. However, federated learning cannot achieve ideal results when solving the problem of uneven data distribution. Summary of the invention

[0004] The purpose of this invention is to solve the problem of uneven distribution of fault data in the prior art, and propose a method for predicting equipment faults based on federated learning. This method improves the multi-dimensional consideration mechanism during aggregation, incorporates more consideration points related to complex situations, and fully considers the impact of aspects such as client data sets on the model, so that more rational results can be achieved when dealing with data heterogeneity problems.

[0005] The present invention is implemented by the following technical scheme. The present invention proposes a device fault prediction method based on federated learning, which includes four steps: data preprocessing, feature extraction, global model training and fault prediction;

[0006] Data preprocessing improves data quality and consistency by cleaning, organizing and converting raw equipment failure data;

[0007] Feature extraction extracts valuable information from preprocessed data and improves global model training efficiency and prediction capabilities through feature transformation and selection;

[0008] Global model training: The local sub-models are aggregated into a global model using the FedAvg-ContribData aggregation algorithm. The global model is trained by adjusting parameters to continuously improve the performance of the global model in terms of accuracy, stability, and generalization ability, so that the global model can better adapt to complex data environments and diverse practical application scenarios.

[0009] Fault detection: Use the trained global model to output device fault prediction results.

[0010] Furthermore, the federated learning includes N clients, represented as C = {C 1 , C 2 , …, C N}, for each client C in the set i , all have corresponding local datasets D i , and the local dataset D i The size is n i ;

[0011]

[0012] Formula (1) is the global loss function, L(θ) is the global loss function, n is the sum of the sizes of N client datasets, L i (θ) is the client C i Based on the local dataset D i and the local loss function of the model parameters θ;

[0013] Formula (3) is the local loss function of the client, where y is the true label, is the predicted label, f = (x; θ) is the learning model, x is the input data, and θ is the model parameter.

[0014] Furthermore, the client uses stochastic gradient descent to update local parameters; the client's local parameter update formula is:

[0015]

[0016] Formula (5) is the client's local parameter update formula, For client C i The updated local parameters oft The central server sends the current global model parameters to each client, ▽L i (θ t ) is the local gradient, τ is the learning rate;

[0017] Formula (6) is the global model update formula, For client C i The aggregation coefficient at round t;

[0018] Formula (7) is the global model fusion weight coefficient formula; η is the weighting factor of the data set weight, is the weighting factor of the client contribution; r i t For client C i The accuracy rate in round t, R t It is the sum of the accuracy of each client in the tth round.

[0019] Furthermore, the data preprocessing specifically includes:

[0020] Step 1: Query the data of each client, count the size of the data set, and divide it into training set, test set, and validation set;

[0021] Step 2: Resize the image to the input size required by the model;

[0022] Step 3: Flip the image horizontally with a predetermined probability, so that the model can learn features in different directions and improve its robustness;

[0023] Step 4: Randomly rotate the image to simulate images from different perspectives, helping the global model learn richer features;

[0024] Step 5: Convert the image to Tensor format to facilitate processing and calculation of the global model.

[0025] Furthermore, the feature extraction is specifically as follows:

[0026] (1) Convolutional layer: extracts features from the input image;

[0027] (2) Batch normalization layer: normalizes the feature map output by the convolutional layer;

[0028] (3) Activation function layer: Use the activation function to introduce nonlinearity and realize nonlinear transformation of feature maps;

[0029] (4) Maximum pooling layer: selects the maximum value in the pooling window as the output to reduce the size of the feature map and reduce the dimension;

[0030] (5) Adaptive average pooling layer: converts feature maps of any size into feature maps of fixed size;

[0031] (6) Fully connected layer: The input features are linearly transformed through the weight matrix and bias term, transforming the features from one space to another space;

[0032] (7) Output layer: Maps the input units to N * Output units, N * is the number of categories for classification.

[0033] Furthermore, the global model training is specifically as follows:

[0034] Step 1: The central server sends the global model to each client;

[0035] Step 2: Each client uses the received global model to train the local sub-model based on the preprocessed local data set;

[0036] Step 3: The client returns the trained local sub-model parameters to the central server;

[0037] Step 4: The central server collects the sub-model parameters sent by all clients, calculates the contribution of each client in the previous round, and uses FedAvg-ContribData to aggregate the local sub-models and update the global model;

[0038] Step 5: The central server sends the updated global model to each client;

[0039] Step 6: After receiving the updated global model, the client continues to train on the local dataset to obtain a new local sub-model and outputs four evaluation indicators;

[0040] Step 7: Determine whether the maximum number of iterations has been reached; if yes, output the best accuracy, precision, recall, and F1 coefficient; if no, send the trained local sub-model parameters back to the central server for further iteration.

[0041] Furthermore, the four evaluation indicators include accuracy, precision, recall and F1 coefficient.

[0042] Furthermore, the Tensor format is a tensor format in PyTorch.

[0043] The present invention also proposes an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the device fault prediction method based on federated learning when executing the computer program.

[0044] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the device fault prediction method based on federated learning.

[0045] The beneficial effects of the present invention are:

[0046] (1) The present invention proposes a "contribution" strategy, which calculates the contribution of each client and adjusts the weight according to the size of the client's contribution, thereby more effectively utilizing limited and unbalanced fault data.

[0047] (2) Combining the contribution degree with the weight of its dataset, the FedAvg-ContribData (FederatedAveraging-ContributionData) algorithm is proposed. The weight of the dataset is dynamically adjusted according to factors such as the size and category distribution of the dataset, so that it can more accurately reflect the actual impact of the data on the global model training and improve the accuracy and generalization ability of the global model. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0049] Figure 1 This is a flow chart of the device failure prediction method based on federated learning according to the present invention;

[0050] Figure 2 Provide a technical roadmap for data preprocessing;

[0051] Figure 3 Provide a technical roadmap for feature extraction;

[0052] Figure 4 Flowchart for global model training;

[0053] Figure 5 Schematic diagram of the performance of each algorithm in the training set, test set and validation set. (a) is the training set bar graph, (b) is the test set bar graph, and (c) is the validation set bar graph.

[0054] Figure 6 Schematic diagram of the confusion matrix of the FedAvg-Data and FedAvg-ContribData algorithms; (a) is the FedAvg-ContribData confusion matrix, and (b) is the FedAvg-Data confusion matrix;

[0055] Figure 7 It is the change curve of each evaluation index; Among them, (a) is the accuracy, (b) is the precision, (c) is the recall rate, and (d) is the F1 coefficient. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] In the equipment failure data set, there are significant differences in the amount of data for different types of failures. The amount of data for some common failure types may be very large, while the data for some special failure types is very scarce (such as hydraulic press plunger rod surface strain failure, etc.). The data for special failures accounts for less than 1% of the total data volume, while the data for common failures occupies the vast majority, forming a long-tail distribution. The imbalance in proportion makes the data seriously biased towards common failures in terms of statistical characteristics, resulting in overfitting. It shows a high accuracy rate on the training set, but when facing a test set with special failures, due to the small amount of data, its unique features have relatively weak signals in the data set, and it is difficult for the model to extract key features from a large amount of noise (common failure features), resulting in a sharp drop in performance.

[0058] Because the data of common faults dominates the training process, their characteristics have a greater influence on the model parameter update. The model will spend a lot of energy on optimizing the recognition of common faults, while ignoring the characteristics of special faults. Since the model has not fully learned the essential characteristics of special faults, it cannot accurately identify the data of special fault types. Based on this, combined with Figure 1-Figure 7 ,The present invention proposes a device fault prediction method based on federated learning, which includes four steps: data preprocessing, feature extraction, global model training and fault prediction;

[0059] Data preprocessing improves data quality and consistency by cleaning, organizing and converting raw equipment failure data;

[0060] Feature extraction extracts valuable information from preprocessed data and improves global model training efficiency and prediction capabilities through feature transformation and selection;

[0061] Global model training: The local sub-models are aggregated into a global model using the FedAvg-ContribData aggregation algorithm. The global model is trained by adjusting parameters to continuously improve the performance of the global model in terms of accuracy, stability, and generalization ability, so that the global model can better adapt to complex data environments and diverse practical application scenarios.

[0062] Fault detection: Use the trained global model to output device fault prediction results.

[0063] Federated learning includes N clients, represented by C = {C 1 , C 2 , …, C N}, for each client C in the set i , all have corresponding local datasets D i , and the local dataset D i The size is n i ;

[0064]

[0065]

[0066] Formula (1) is the global loss function, L(θ) is the global loss function, n is the sum of the sizes of N client datasets, L i (θ) is the client C i Based on the local dataset D i and the local loss function of the model parameters θ;

[0067] Formula (3) is the local loss function of the client, where y is the true label, is the predicted label, f = (x; θ) is the learning model, x is the input data, and θ is the model parameter.

[0068] The client uses stochastic gradient descent to update local parameters; the client's local parameter update formula is:

[0069]

[0070] Formula (5) is the client's local parameter update formula, For client C i The updated local parameters of t The central server sends the current global model parameters to each client, ▽L i (θ t ) is the local gradient, τ is the learning rate;

[0071] Formula (6) is the global model update formula, For client C i The aggregation coefficient at round t;

[0072] Formula (7) is the global model fusion weight coefficient formula; η is the weighting factor of the data set weight, is the weighting factor of the client contribution; r i t For client C i The accuracy rate in round t, R t It is the sum of the accuracy of each client in the tth round.

[0073] Data preprocessing is a crucial part of data analysis and machine learning. By artificially expanding the data set to increase the diversity of training data, the model is exposed to more variations during training, thereby improving data quality and consistency and enhancing the generalization ability of the model. Data preprocessing and data enhancement are key steps to ensure efficient and accurate operation of the model, and are of great significance to improving model performance. The specific steps of data preprocessing include:

[0074] Step 1: Query the data of each client, count the size of the data set, and divide it into training set, test set, and validation set;

[0075] Step 2: Resize the image to the input size required by the model;

[0076] Step 3: Flip the image horizontally with a predetermined probability, so that the model can learn features in different directions and improve its robustness;

[0077] Step 4: Randomly rotate the image to simulate images from different perspectives, helping the global model learn richer features;

[0078] Step 5: Convert the image to Tensor format to facilitate the processing and calculation of the global model. The Tensor format is the tensor format in PyTorch.

[0079] Feature extraction compresses the data volume and reduces computational complexity by selecting the most representative information. With the help of the extracted representative features, the model can be more easily adapted to different image changes, significantly improving the performance and generalization ability of the model's classification, detection and other tasks; the feature extraction is specifically:

[0080] (1) Convolutional layer: extracts features from the input image;

[0081] (2) Batch normalization layer: normalizes the feature map output by the convolutional layer;

[0082] (3) Activation function layer: Use the activation function to introduce nonlinearity and realize nonlinear transformation of feature maps;

[0083] (4) Maximum pooling layer: selects the maximum value in the pooling window as the output to reduce the size of the feature map and reduce the dimension;

[0084] (5) Adaptive average pooling layer: converts feature maps of any size into feature maps of fixed size;

[0085] (6) Fully connected layer: The input features are linearly transformed through the weight matrix and bias term, transforming the features from one space to another space;

[0086] (7) Output layer: Maps the input units to N * Output units, N * is the number of categories for classification.

[0087] Global model training occupies a core position in the entire invention and has a vital impact on the effectiveness and practicality of the invention. Through global model training, the model can be optimized, the model structure and parameters can be adjusted, and it can be improved from the initial to the optimal state to adapt to the data; it can help improve performance, enhance generalization capabilities, improve the accuracy and stability of prediction and classification, and provide guarantees for applications; it can mine data value, reveal hidden relationships and patterns, and promote knowledge innovation; it can adapt to complex scenarios and cope with diverse data and different task requirements; the global model training is specifically:

[0088] Step 1: The central server sends the global model to each client;

[0089] Step 2: Each client uses the received global model to train the local sub-model based on the preprocessed local data set;

[0090] Step 3: The client returns the trained local sub-model parameters to the central server;

[0091] Step 4: The central server collects the sub-model parameters sent by all clients, calculates the contribution of each client in the previous round, and uses FedAvg-ContribData to aggregate the local sub-models and update the global model;

[0092] Step 5: The central server sends the updated global model to each client;

[0093] Step 6: After receiving the updated global model, the client continues to train on the local data set to obtain a new local sub-model, and outputs four evaluation indicators at the same time; the four evaluation indicators include accuracy, precision, recall rate and F1 coefficient.

[0094] Step 7: Determine whether the maximum number of iterations has been reached; if yes, output the best accuracy, precision, recall, and F1 coefficient; if no, send the trained local sub-model parameters back to the central server for further iteration.

[0095] The present invention makes the data more consistent with the assumptions of the model through operations such as normalization in data preprocessing, thereby improving the performance of the model. The original consideration criteria only consider the size of the data set, and the contribution mechanism is integrated into it. By designing the calculation method of contribution and data set weight, the aggregation weight of each data set is optimized. And the dynamic adaptability of the consideration criteria is enhanced. With the continuous addition of new clients and changes in the data environment, the contribution mechanism can automatically adjust the weight of each client to ensure that the entire evaluation system always maintains sensitivity to the latest data situation and avoids evaluation deviations caused by client updates.

[0096] Simulation experiment data analysis

[0097] The experimental environment uses an AMD Ryzen 75800H eight-core processor, an NVIDIA GeForce RTX3060 graphics card, 16GB DDR4 memory, and a fast 512GB PCIe NVMe SSD solid-state drive, running on the Windows 11 Home Basic 64-bit operating system.

[0098] The present invention uses a university's NEU dataset (steel surface defects), a DAGM2007 dataset (automatic guided vehicle surface defects), and a GC10-DET dataset (10 common metal surface defects) to improve its ability to identify and classify equipment failures based on the characteristics and patterns of different data.

[0099] In order to comprehensively and deeply evaluate the performance of the model, a variety of aggregation strategies were adopted for systematic comparative analysis, including the classic FedAvg aggregation algorithm (i.e., basic average aggregation to build a global model), the FedAvg-Data (FederatedAveraging-Data) aggregation algorithm (this method fully considers the size of each client data set during the aggregation process and performs weighted aggregation according to the size of the data set) and the FedAvg-ContribData aggregation algorithm proposed in this invention.

[0100] In the process of evaluating model performance, we focus on core indicators such as accuracy, precision, recall, and F1 coefficient, and show the model performance from different angles. Accuracy is used to measure the model's prediction ability; precision shows the accuracy of the model's prediction of the positive class; recall highlights the model's recognition level of positive samples; F1 coefficient is the harmonic mean of precision and recall, which is effective in dealing with class imbalance problems and can comprehensively measure the performance of the model. By comprehensively considering key indicators, we can more accurately grasp the advantages and disadvantages of the model and provide strong support for further model optimization and application.

[0101] Table 1. Weighted validation set results

[0102]

[0103] Table 1 shows the performance of the present invention, FedAvg, FedAvg-Data and three algorithms in multiple key evaluation dimensions, including accuracy, precision, recall and F1 coefficient. In addition, Table 1 also lists in detail the relative improvement rate of the present invention compared with the above two algorithms in various evaluation indicators, providing intuitive and rich data support for comprehensive evaluation and comparison of the performance of each algorithm.

[0104] (1) Accuracy

[0105] It can be seen from Table 1 that the accuracy of FedAvg, FedAvg-Data and FedAvg-ContribData are 49.72%, 81.52% and 89.39% respectively. FedAvg-ContribData has a significant improvement in overall prediction ability compared with the other two algorithms.

[0106] When faced with uneven data distribution, the average aggregation method used by FedAvg has limitations and is difficult to guarantee accuracy; FedAvg-Data uses a data set weight aggregation method, which cannot fully consider the data quality and diversity of each client, resulting in its performance being less than expected; FedAvg-ContribData combines data set weights and contribution consideration mechanisms to achieve better performance. Compared with FedAvg and FedAvg-Data, its relative accuracy improvement rates reached 39.67% and 7.87% respectively.

[0107] (2) Accuracy

[0108] The precision rates of FedAvg, FedAvg-Data and FedAvg-ContribData are 50.65%, 82.02% and 91.08% respectively. It can be found that the accuracy of the present invention in predicting positive samples is significantly improved compared with the other two algorithms.

[0109] FedAvg cannot fully consider the characteristics of different client data, and is prone to confusion when distinguishing positive and negative samples, resulting in low precision; FedAvg-Data assigns weights based on the size of the data set, and to a certain extent takes into account the imbalance of the data, which improves the accuracy of the model when predicting the positive class, but only assigning weights based on the size of the data set does not pay attention to the importance of the data set; FedAvg-ContribData adopts a combination of multiple consideration mechanisms to more accurately capture positive features and make a more detailed distinction between positive and negative samples, which is 40.43% and 9.06% higher than FedAvg and FedAvg-Data, respectively.

[0110] (3) Recall rate

[0111] The recall rates of FedAvg, FedAvg-Data and FedAvg-ContribData are 42.53%, 75.67% and 83.53% respectively. It can be found that the ability of the present invention to identify positive samples is significantly improved compared with the other two algorithms.

[0112] FedAvg's average aggregation method misses a large amount of positive sample information, resulting in poor ability to recall positive samples; FedAvg-Data only allocates weights based on the size of the data set and does not fully consider the importance of the data set, resulting in some key data being ignored, thus affecting the overall performance of the model; FedAvg-ContribData dynamically adjusts weights based on the size of the data set and the value of client data, and more comprehensively mines the positive sample features in the data, which is 41.00% and 7.86% higher than FedAvg and FedAvg-Data respectively.

[0113] (4) F1 coefficient

[0114] The F1 coefficients of FedAvg, FedAvg-Data and FedAvg-ContribData are 37.37%, 74.65% and 83.99% respectively. It can be found that the present invention has a significant improvement in the comprehensive balance performance of precision and recall compared with the other two algorithms.

[0115] FedAvg performs poorly in both precision and recall, with a very low F1 coefficient and poor overall performance. FedAvg-Data assigns weights based on the size or importance of the dataset, and takes data imbalance into account to a certain extent, but still does not fully consider the complex characteristics of client data, resulting in limited improvements in precision and recall, and failing to optimize the overall performance of the model. FedAvg-ContribData combines multiple consideration mechanisms such as contribution and dataset weight to achieve a better balance between precision and recall, improving by 46.62% and 9.34% respectively compared to FedAvg and FedAvg-Data.

[0116] In summary, FedAvg-ContribData has excellent performance in processing complex data distribution scenarios, and is more suitable for application scenarios that require higher comprehensive model performance.

[0117] Figure 5 It is the performance of each algorithm in the training set, test set and validation set. Figure 5 It can be clearly observed that since the aggregation method of FedAvg is not suitable for dealing with data imbalance problems, its performance on various data sets is not ideal. FedAvg-Data has significantly improved in various indicators compared to the average aggregation method of FedAvg by weighting according to the size of the data set. However, FedAvg-Data only focuses on the number of data sets, but ignores other key characteristics of the data sets, making it impossible to achieve the ideal performance level. Although the accuracy of FedAvg-ContribData on the test set is slightly lower than that of FedAvg-Data, it shows excellent performance in other indicators of all data sets. It proves its strong advantage in processing heterogeneous data, and can use data information more comprehensively and effectively, so as to perform well in overall performance, making the present invention more adaptable and reliable when facing complex data environments.

[0118] In summary, FedAvg-ContribData performs well on all datasets, further demonstrating its superiority in handling heterogeneous data.

[0119] Figure 6These are the confusion matrices of the FedAvg-Data and FedAvg-ContribData algorithms. There is a category imbalance problem in the data set. When the FedAvg-Data algorithm processes some categories (such as categories 25 and 26), the model performance is not ideal due to the small number of category samples. The performance of the present invention in each category is better than that of FedAvg-Data. For example, in categories 17 and 18, the accuracy of the present invention is 73.91% and 80.65%, while the accuracy of FedAvg-Data is 47.83% and 22.58%. Compared with the FedAvg-Data algorithm, it shows better performance when processing difficult categories.

[0120] Comprehensively considering the performance of each category, the present invention is superior to FedAvg-Data in terms of accuracy and other indicators, and has obvious advantages in dealing with heterogeneous data sets. Since the algorithm takes data imbalance into better consideration during design, it can maintain good classification performance even when facing categories with fewer samples.

[0121] Figure 7 The change curves of each evaluation indicator provide a detailed view of how the performance of each algorithm changes with the number of iterations.

[0122] Since the FedAvg algorithm does not fully consider the differences between client data, it performs poorly when faced with large data dispersion. When the data distribution between clients shows significant differences, the FedAvg algorithm cannot effectively aggregate the data, resulting in a decline in model performance.

[0123] The FedAvg-Data algorithm aggregates data according to data weights and can achieve better results in the case of heterogeneous data. By assigning different weights to data from different clients, the contribution of each client to the global model can be better balanced, thereby improving the performance of the model. However, determining weights only by data size or importance may ignore other important characteristics of the data, resulting in limited performance improvement of the model, and may not achieve ideal levels in indicators such as precision and recall.

[0124] The present invention combines the weight of the data set and the contribution of the client to the total model. Good results were achieved on the training set and the test set, and significant advantages were shown on the validation set. Due to its careful consideration of the weight of the data set and the contribution of the client, the model is more robust when facing unknown data distribution. The present invention not only has good fitting ability, but also shows stronger versatility and adaptability. The present invention can transfer and apply the knowledge learned from the training data to a new, independent data set, thereby maintaining a high prediction performance on unseen data.

[0125] In summary, the present invention has obvious advantages in processing data heterogeneity. It can not only effectively utilize the data of each client during the training process, but also show good prediction ability on new data.

[0126] The device fault prediction method based on federated learning proposed in this paper performs well in dealing with data heterogeneity. By combining the contribution mechanism with the data set weight, the aggregation coefficient of each data set is dynamically considered, and better results can be achieved when facing the problem of uneven data distribution. The experimental results show that the model not only has good fitting ability, but also can show strong generalization ability on new data.

[0127] The present invention proposes a method for predicting equipment failures based on federated learning. For example, the present invention allows each machine tool to act as a client, and without leaking its own original production data (such as specific processing parameters, parts processing sequence and other privacy information), encrypts and transmits sensor data to the server for model aggregation training. Through this invention, various types of failures such as tool wear, spindle failure, screw drive abnormality, etc. can be accurately detected, early warning can be given, machine tool downtime can be reduced, production efficiency can be improved, and processing accuracy and product quality can be guaranteed.

[0128] The present invention also proposes an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the device fault prediction method based on federated learning when executing the computer program.

[0129] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the device fault prediction method based on federated learning.

[0130] The memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DRRAM). It should be noted that the memory of the method described in the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0131] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disc (SSD)).

[0132] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0133] It should be noted that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined and performed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0134] The above is a detailed introduction to the device fault prediction method based on federated learning proposed in the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. The equipment failure prediction method based on federated learning is characterized by: The method includes four steps: data preprocessing, feature extraction, global model training and fault prediction; Data preprocessing improves data quality and consistency by cleaning, organizing and converting raw equipment failure data; Feature extraction extracts valuable information from preprocessed data and improves global model training efficiency and prediction capabilities through feature transformation and selection; Global model training: The local sub-models are aggregated into a global model using the FedAvg-ContribData aggregation algorithm. The global model is trained by adjusting parameters to continuously improve the performance of the global model in terms of accuracy, stability, and generalization ability, so that the global model can better adapt to complex data environments and diverse practical application scenarios. Fault detection: Use the trained global model to output device fault prediction results.

2. The method according to claim 1, characterized in that Federated learning includes N clients, represented by C = {C1, C2, ..., C N }, for each client C in the set i , all have corresponding local datasets D i , and the local dataset D i The size is n i ; Formula (1) is the global loss function, L(θ) is the global loss function, n is the sum of the sizes of N client datasets, L i (θ) is the client C i Based on the local dataset D i and the local loss function of the model parameters θ; Formula (3) is the local loss function of the client, where y is the true label, is the predicted label, f = (x; θ) is the learning model, x is the input data, and θ is the model parameter.

3. The method according to claim 2, characterized in that The client uses stochastic gradient descent to update local parameters; the client's local parameter update formula is: Formula (5) is the client's local parameter update formula, For client C i The updated local parameters of t The central server sends the current global model parameters to each client. is the local gradient, τ is the learning rate; Formula (6) is the global model update formula, For client C i The aggregation coefficient at round t; Formula (7) is the global model fusion weight coefficient formula; η is the weighting factor of the data set weight, is the weighting factor of the client's contribution; For client C i The accuracy rate at round t, R t It is the sum of the accuracy of each client in the tth round.

4. The method according to claim 3, characterized in that The specific steps of data preprocessing include: Step 1: Query the data of each client, count the size of the data set, and divide it into training set, test set, and validation set; Step 2: Resize the image to the input size required by the model; Step 3: Flip the image horizontally with a predetermined probability, so that the model can learn features in different directions and improve its robustness; Step 4: Randomly rotate the image to simulate images from different perspectives, helping the global model learn richer features; Step 5: Convert the image to Tensor format to facilitate processing and calculation of the global model.

5. The method according to claim 4, characterized in that The feature extraction is specifically as follows: (1) Convolutional layer: extracts features from the input image; (2) Batch normalization layer: normalizes the feature map output by the convolutional layer; (3) Activation function layer: Use the activation function to introduce nonlinearity and realize nonlinear transformation of feature maps; (4) Maximum pooling layer: selects the maximum value in the pooling window as the output to reduce the size of the feature map and reduce the dimension; (5) Adaptive average pooling layer: converts feature maps of any size into feature maps of fixed size; (6) Fully connected layer: The input features are linearly transformed through the weight matrix and bias term, transforming the features from one space to another space; (7) Output layer: Maps the input units to N * Output units, N * is the number of categories for classification.

6. The method according to claim 5, characterized in that The global model training is specifically as follows: Step 1: The central server sends the global model to each client; Step 2: Each client uses the received global model to train the local sub-model based on the preprocessed local data set; Step 3: The client returns the trained local sub-model parameters to the central server; Step 4: The central server collects the sub-model parameters sent by all clients, calculates the contribution of each client in the previous round, and uses FedAvg-ContribData to aggregate the local sub-models and update the global model; Step 5: The central server sends the updated global model to each client; Step 6: After receiving the updated global model, the client continues to train on the local dataset to obtain a new local sub-model and outputs four evaluation indicators; Step 7: Determine whether the maximum number of iterations has been reached; If yes, the best accuracy, precision, recall, and F1 coefficient are output; if no, the trained local sub-model parameters are sent back to the central server for further iteration.

7. The method according to claim 6, characterized in that The four evaluation indicators include accuracy, precision, recall and F1 coefficient.

8. The method according to claim 4, characterized in that The Tensor format is the tensor format in PyTorch.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium for storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Mechanical fault diagnosis method and system based on federal domain generalization

    CN114818996A

  • Fault diagnosis method and system based on model difference, storage medium and equipment

    CN115328691A

  • Personalized federal aggregation algorithm based on local self-attention mechanism

    CN117350373A

  • Weight dynamic aggregation federal learning method based on momentum method

    CN118821977A

Cited By

  • Numerical control machining equipment state monitoring system based on big data analysis

    CN120335390A

  • Multi-mode sensing partial discharge monitoring device and method

    CN120847574A