A federated incremental mechanical fault diagnosis method in a dynamic client environment
By employing a federated learning method combining gradient-balanced weighted loss and relation consistency distillation loss in a dynamic client environment, and combining it with local memory and gradient inversion techniques, a federated learning system adapted to dynamic environments was constructed. This system solves the problems of poor fault diagnosis, data privacy protection, and model optimization bias and forgetting, and achieves high-precision and continuous mechanical fault diagnosis.
Patent Information
- Application Number
- CN202610413394.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies cannot effectively solve the problems of poor fault diagnosis, data privacy protection, model optimization bias, and catastrophic forgetting in dynamic client environments. In particular, in federated learning, the imbalance between new and old fault categories makes it impossible for the model to efficiently learn new knowledge while maintaining the ability to diagnose historical faults.
A federated learning system adapted to dynamic environments is constructed by using a total loss function that combines gradient balancing weighted loss and relation consistency distillation loss to train the model locally on a dynamic client. This is combined with a local memory and gradient inversion method on the cloud server to generate a global diagnostic model. The model is then aggregated using a privacy-preserving validation set.
It enables collaborative, continuous, and high-precision mechanical fault diagnosis across distributed dynamic clients while protecting data privacy. This significantly improves the model's practicality and robustness in real-world industrial dynamic environments and alleviates the model optimization bias and catastrophic forgetting problems caused by the imbalance of old and new fault category data.
Smart Images

Figure CN122286457A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial fault diagnosis technology, and specifically to a method for diagnosing incremental mechanical faults in a dynamic client environment. Background Technology
[0002] Currently, data-driven intelligent fault diagnosis methods have become a key technology for ensuring the safe and stable operation of mechanical equipment. However, in actual industrial scenarios, fault data is usually scattered across different factories, workshops, or equipment terminals (i.e., clients). Due to requirements for protecting trade secrets and data privacy, this geographically dispersed data cannot be centrally uploaded to a unified central server for analysis and modeling, thus creating the "data silo" problem. This severely restricts the ability to train high-performance, highly generalizable diagnostic models using multi-source, cross-domain data.
[0003] Federated learning, as an emerging distributed machine learning paradigm, offers a potential solution to the aforementioned problems. Its core idea is to keep data on the local client and achieve collaborative training only by exchanging and aggregating model parameters, thereby breaking down data silos while protecting data privacy. Existing research has applied federated learning to mechanical fault diagnosis and explored evaluating model performance on the server side through features and other methods. However, most of these methods are based on an ideal static assumption: all fault categories to be diagnosed are known and fixed at the start of training. This assumption is severely inconsistent with the dynamic nature of real industrial environments. In practice, on the one hand, existing clients continuously collect data on new faults during long-term operation; on the other hand, new equipment or factories (i.e., new clients) may bring unknown fault categories into the system. More importantly, limited by the local storage capacity of edge devices, samples of old categories are continuously reduced with the arrival of new data, leading to a severe imbalance between old and new categories in the client's local data. Direct training under these conditions causes the gradient advantage of new category samples to over-bias the model in learning new knowledge, while rapidly forgetting previously learned historical fault knowledge—a phenomenon known as "catastrophic forgetting"—leading to a sharp decline in diagnostic performance for historical faults.
[0004] Incremental learning aims to enable models to continuously learn new knowledge without forgetting old knowledge, providing a solution to the aforementioned problems. Traditional incremental learning methods mitigate forgetting by using strategies such as knowledge distillation and building memory banks on centralized data. However, these methods all rely on the premise that all data can be centrally accessed, ignoring the distributed nature of data and privacy constraints in industrial scenarios, and cannot be directly applied to cross-client collaborative diagnosis. In recent years, federated incremental learning has begun to attract attention, attempting to combine federated learning with incremental learning. For example, some studies have proposed using cost-sensitive loss and knowledge distillation to address data imbalance and forgetting. However, these methods still have limitations: firstly, they fail to fully consider the differences in contribution of different client models during global aggregation; secondly, in terms of knowledge preservation, they only constrain the consistency of the output probability distribution of the old and new models, failing to effectively maintain the crucial relative relationships between categories in the feature space learned by the model, resulting in poor knowledge transfer performance. Summary of the Invention
[0005] To address the aforementioned shortcomings in existing technologies, this invention provides a method for fault diagnosis of federated incremental machinery in a dynamic client environment, which solves the problems of poor fault diagnosis performance, inability to protect the data privacy of each dynamic client, and model optimization bias and catastrophic forgetting in existing methods.
[0006] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows: A method for diagnosing incremental mechanical faults in a federated environment under dynamic client conditions includes the following steps: Construct a federated learning system that includes a cloud server and several dynamic clients, and configure the same shallow neural network for the cloud server and each dynamic client. At the same time, configure a sample dataset, a fault diagnosis model and a local memory for each dynamic client. Input the sample dataset of each dynamic client into the corresponding fault diagnosis model, and use the total loss function based on gradient balance weighted loss and relation consistency distillation loss to adjust the model parameters, thereby generating a trained fault diagnosis model and model parameters. Store the prototype samples of the historical fault categories that have been learned in the sample dataset into the local memory bank; After perturbating the prototype samples of each category in the sample dataset, the samples are input into the shallow neural network of the dynamic client to calculate the gradient vector of the network loss value with respect to the network parameters. Use a dynamic client to transmit gradient vectors, model parameters, and network parameters to the cloud server; The class label of the prototype sample is inferred through gradient vectors within the cloud server. At the same time, a virtual sample of the same size as the prototype sample is constructed. The virtual sample is input into a shallow neural network of the cloud server, and a privacy-preserving verification set is constructed through gradient inversion iteration. The performance of each trained fault diagnosis model is evaluated using a validation set within the cloud server. Based on the validation loss, the aggregate weight of each trained fault diagnosis model is calculated and weighted averaged with the model parameters to generate a global diagnostic model. By utilizing cloud servers, a global diagnostic model is distributed to all dynamic clients that are to participate in fault prediction, thereby enabling fault diagnosis of real-time monitoring data for various mechanical equipment.
[0007] The present invention has the following beneficial effects: 1. The federated incremental mechanical fault diagnosis method proposed in this invention, under the premise of fully protecting the data privacy of each dynamic client, realizes collaborative, continuous and high-precision mechanical fault diagnosis across distributed dynamic clients, and significantly improves the practicality and robustness of the global diagnosis model in real industrial dynamic environments.
[0008] 2. The federated learning system adapted to the dynamic client environment constructed in this invention adopts a gradient balancing weighting strategy and relation consistency distillation loss locally on the dynamic client. This not only effectively alleviates the model optimization bias and catastrophic forgetting problems caused by the severe imbalance of new and old fault category data, but also enables the model to steadily maintain its diagnostic ability for historical faults while continuously learning new faults. 3. The data center-consistent local memory constructed by this invention can retain key historical category knowledge with minimal storage cost; 4. The federated learning system constructed in this invention innovatively utilizes the gradient inversion method to reconstruct a privacy-preserving validation set from privacy-preserving gradient information on the cloud server side, and realizes adaptive weighted aggregation of dynamic client models based on validation loss, generating a powerful global diagnostic model and improving fault diagnosis accuracy. Attached Figure Description
[0009] Figure 1 This is a flowchart illustrating a method for diagnosing incremental mechanical faults in a dynamic client environment, as proposed in this invention. Figure 2 This is a schematic diagram of the fault diagnosis model in the embodiment; Figure 3 This is a schematic diagram illustrating the test set loss and accuracy trends during the training process of the global diagnostic model in this embodiment. Figure 4 This is a schematic diagram of the gradient difference loss reduction process and some inversion results in the gradient inversion process of the embodiment. Figure 5 This is a schematic diagram of the confusion matrix of the diagnostic results in the embodiment; Figure 6 This is a schematic diagram illustrating the time cost of each task in the embodiment; Figure 7 This is a schematic diagram illustrating the process of how diagnostic accuracy changes with loss weight in the example. Detailed Implementation
[0010] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0011] like Figure 1 As shown, a method for diagnosing incremental mechanical faults in a federated environment under a dynamic client environment includes the following steps: Step 1: Construct a federated learning system containing a cloud server and several dynamic clients, and configure the same shallow neural network for the cloud server and each dynamic client. At the same time, configure a sample dataset, a fault diagnosis model and a local memory for each dynamic client.
[0012] In this step, dynamic clients (referring to local clients) include a first type of client that only has historical fault category samples, a second type of client that has both historical fault category samples and new fault category samples, and a third type of client that has been newly added and has new fault category samples.
[0013] The cloud server, comprised of a high-performance computer equipped with an NVIDIA GeForce RTX A6000 GPU, is responsible for model aggregation and distribution. Dynamic clients are simulated by edge computing devices deployed in different physical locations, such as NVIDIA Jetson TX1 modules and industrial computing devices based on 11th-generation Intel Core processors, thus reflecting a real-world heterogeneous industrial computing environment. Each dynamic client stores a private, non-independent, and non-identically distributed sample dataset (containing monitoring data collected during equipment operation and its corresponding fault category labels; the monitoring data is vibration signals), simulating the data silos caused by differences in equipment models, operating conditions, and running times in a factory. Therefore, the definition of a dynamic client can be specified as follows: in a continuous task sequence, some dynamic clients may only participate in some tasks; in a new task, some existing dynamic clients (the second type) collect new fault category data, while others (the first type) do not; simultaneously, the system allows dynamic clients representing new production lines or new equipment (the third type) to join at any time during a task, potentially carrying fault category data never seen by the system before.
[0014] Among them, the shallow neural network is the convolutional neural network LeNet.
[0015] The structure and connection relationships of the fault diagnosis model are as follows: Figure 2 As shown, it includes one feature transformation module, eight cascaded residual modules, and one classification module.
[0016] The feature transformation module is used to perform preliminary feature mapping on the input vibration signal and extract high-dimensional features. It includes a first convolutional layer, a batch normalization layer, and a ReLU activation function layer.
[0017] Each residual module is used to receive the output features of the previous module connected to it and extract deep features related to fault diagnosis. It includes a channel attention module and a spatial attention module.
[0018] The channel attention module receives the output features from the previous module it is connected to. By aggregating the global average pooling and max pooling information of the features, it learns the importance weights of different feature channels. It includes a first adaptive average pooling layer, an adaptive max pooling layer, a first multilayer perceptron, a second multilayer perceptron, and a first sigmoid activation function layer. The working principle of these modules is as follows: the output features of the previous module connected to the channel attention module are respectively input into the first adaptive average pooling layer and the adaptive max pooling layer for average pooling and max pooling operations. Then, the output features of the first adaptive average pooling layer are input into the first multilayer perceptron, and the output features of the adaptive max pooling layer are input into the second multilayer perceptron. The output features of the first multilayer perceptron and the second multilayer perceptron are added together, and then passed through the first sigmoid activation function layer to obtain the channel-level weights. Finally, the channel-level weights are multiplied by the output features of the previous module of the channel attention module to obtain the channel-weighted features.
[0019] The spatial attention module receives the channel-weighted features output by the channel attention module connected to it. By aggregating information from the channel dimension, it focuses on key regions of the signal in the time dimension, enabling the fault diagnosis model to adaptively strengthen fault-related features and suppress background noise. It includes a global average pooling layer, a global max pooling layer, a second convolutional layer, and a second sigmoid activation function layer. The working principle of these modules is as follows: the channel-weighted features output by the channel attention module are input into the global average pooling layer and the global max pooling layer respectively for global average pooling and global max pooling operations. The output features of the global average pooling layer and the global max pooling layer are merged and input into the second convolutional layer for convolution operation. After passing through the second sigmoid activation function layer, spatial weights are obtained. Finally, the spatial weights are multiplied by the channel-weighted features to obtain the spatial-weighted features.
[0020] The classification module outputs the probability distribution for each fault category. It includes a second adaptive average pooling layer and a fully connected layer, and the number of neurons in the fully connected layer is equal to the total number of all fault categories that have been learned.
[0021] Step 2: Input the sample dataset of each dynamic client into the corresponding fault diagnosis model, and adjust the model parameters using the total loss function based on gradient balance weighted loss and relation consistency distillation loss to generate a trained fault diagnosis model and model parameters.
[0022] In this step, during training, the fault diagnosis model employs a gradient balancing weighting strategy to construct a gradient balancing weighting loss function to mitigate the optimization bias caused by the imbalance between old and new fault category data. The implementation process is as follows: For size Each sample in the training batch , For the first One sample, For the first For each sample's fault category label, perform the following operations: First, calculate the binary cross-entropy loss of the sample. Relative to the fully connected layer (i.e., the last layer) of the model, the label corresponding to the fault category. The gradient of the neuron input (which is the true value) is used as the gradient of the sample, i.e.:
[0023] In the formula, For the first Gradient of each sample; For binary cross-entropy loss; Use the Sigmoid activation function; For the model to the first Sample The predicted distribution; For the model to the first Sample The predicted probability distribution; In the fully connected layer of the model, the label corresponds to the fault category. The input to the neurons.
[0024] Secondly, calculate the mean of the absolute values of the gradients of all samples in this batch whose category labels belong to the new category set. And the mean of the absolute values of the gradients of all samples whose category labels belong to the old category (historical fault category) set. Finally, the mean of the dynamically selected class gradient is obtained. That is, when the sample belongs to a new category At that time, When the sample belongs to the old category At that time, .
[0025] Then, the weight factor of the sample is calculated based on the absolute value of the sample's gradient and the mean of the class gradient. .
[0026] Finally, the weighted loss of the samples is calculated based on the sample weighting factors and the binary cross-entropy loss. Finally, the weighted losses of all samples are summed and averaged to obtain the gradient-balanced weighted loss, i.e.: , This is a gradient balancing weighted loss.
[0027] Therefore, this gradient balancing weighting strategy balances the difference in optimization step size between the new and old classes due to the large difference in the number of samples, and alleviates the problem that the model quickly forgets the old class due to overfitting the new class.
[0028] During training, the fault diagnosis model also incorporates a relation consistency distillation loss function to maintain its diagnostic capability for historical fault categories. The implementation process is as follows: In training When developing a fault diagnosis model for a task, retain and freeze the first... The parameters of the old model trained for each task (i.e., the first) (Model parameters for each task). For a batch of data containing samples from both the old and new classes. Batch data Input the current model and the old model respectively, and activate them using the Sigmoid function to obtain the predicted probability distribution. and Because the old model did not learn the new categories, its output dimensions only correspond to the old categories. True labels of new category samples By concatenating the data along the category dimension, a probability distribution for a "soft target" is obtained. Therefore, the relationship consistency distillation loss is used. That is The binary cross-entropy loss between the distribution and this "soft target" is expressed as follows:
[0029] In the formula, Use the Sigmoid activation function; For model parameters Updated to At that time, for batch data The predicted distribution; For model parameters Updated to At that time, for batch data The predicted probability distribution; For model parameters Updated to At that time, for batch data The predicted distribution; For model parameters Updated to At that time, for batch data The predicted probability distribution; This is for splicing operations.
[0030] Therefore, the relation consistency distillation loss function not only forces the current model to maintain consistency with the old model in terms of output on old categories, but more importantly, it constrains the relative relationships (similarity or difference) between the new category and each old category to maintain consistency with the inter-category relationships implied by the old model, thereby achieving more structured and robust knowledge preservation.
[0031] Based on the above description, the total loss function of the fault diagnosis model trained locally on the dynamic client is expressed as follows:
[0032] In the formula, Total loss; Weighted loss for gradient balancing; The weights for balancing the gradient balancing weighted loss and the relation consistency distillation loss are initially set to 1.0; This represents the loss due to the consistency of the relationship during distillation.
[0033] In addition, other parameters during fault diagnosis model training are set as follows: using a stochastic gradient descent optimizer, and the batch size of the training batch. The training rate is set to 128, with each dynamic client performing 30 local training cycles before each communication with the cloud server. The initial learning rate is set to 2, and a segmented decay strategy is employed, with the number of training cycles following the rules below. Update: When When the learning rate is half of the initial value, the learning rate is used. When the learning rate is 1 / 25 of the initial value; when At that time, the learning rate was 1 / 125 of the initial value. The total number of training cycles for the dynamic client is set to 250 in this invention.
[0034] Step 3: Store the prototype samples of the historical fault categories learned in the sample dataset into the local memory bank.
[0035] In this step, after completing local training for a task, the dynamic client extracts feature vectors from all samples belonging to that category in the sample dataset for each learned historical fault category using the currently trained fault diagnosis model. Next, it calculates the mean of these feature vectors and uses it as the prototype vector for that category. Then, it calculates the Euclidean distance from each sample's feature vector to the prototype vector of that category, selecting the vector with the smallest Euclidean distance. One sample ( Each category's sample (i.e., the prototype sample of that category) is selected as the most representative sample for that category (i.e., the prototype sample of that category) and stored in the local memory. .
[0036] Therefore, this step ensures that the samples in the local memory can approximate the overall distribution center of the category in the feature space as closely as possible, thus preserving the most critical category information with limited storage resources.
[0037] Step 4: After perturbing the prototype samples of each category in the sample dataset, input them into the shallow neural network of the dynamic client, and calculate the gradient vector of the network loss value with respect to the network parameters, specifically: Select prototype samples for each category from each dynamic client sample dataset.
[0038] Each prototype sample is perturbed by applying a label based on gradient descent, generating perturbed samples, i.e.:
[0039] In the formula, For perturbation samples; For prototype samples; The learning rate; For prototype samples The gradient operator for finding the gradient; For binary cross-entropy loss; Use the Sigmoid activation function; For model parameters Updated to At that time, for the prototype sample The predicted distribution; For model parameters Updated to At that time, for the prototype sample The predicted probability distribution; The fault category label for the prototype sample.
[0040] In this step, applying a small gradient-based perturbation to the prototype sample aims to protect the privacy of the original data during transmission to the cloud server. The process of generating the perturbation sample involves inputting the prototype sample into the currently trained fault diagnosis model (local model) and calculating its fault category label for that prototype sample. The binary cross-entropy loss is calculated, and the loss value is obtained relative to the input prototype sample. gradient Then, according to the formula Generate perturbation samples, where The learning rate is a very small positive number (e.g., 0.01). Therefore, this process slightly shifts the samples in the feature space towards a region where the model's decision boundary is more certain, preserving their discriminative features while making the original data difficult to reconstruct.
[0041] The perturbation sample is input into a shallow neural network for forward inference, and the predicted result is output. Simultaneously, the fault category label of the perturbation sample is combined with the cross-entropy loss function to calculate the loss value between the predicted result and the true label, and the gradient vector of this loss value with respect to the parameters of the shallow neural network is calculated, i.e.:
[0042] In the formula, The gradient vector; These are the parameters of a shallow neural network; For parameters The gradient operator for finding the gradient; Cross-entropy loss; To perturb the samples Input network parameters are In a shallow neural network, after passing through the SoftMax activation function, the predicted probabilities of each fault category are obtained; The fault category label for the perturbation sample.
[0043] Step 5: Use a dynamic client to transmit gradient vectors, model parameters, and network parameters to the cloud server.
[0044] Step 6: Infer the class label of the prototype sample through gradient vectors within the cloud server. At the same time, construct a virtual sample with the same size as the prototype sample. Input the virtual sample into the shallow neural network of the cloud server and construct a privacy-preserving validation set through gradient inversion iteration.
[0045] This step involves building a privacy-preserving verification set within the cloud server, and its implementation process is as follows: First, the cloud server maintains the same shallow neural network as the dynamic client.
[0046] Secondly, for each set of gradient vectors received from the dynamic client The cloud server first analyzes the distribution pattern of the gradient vector and infers the fault category label most likely corresponding to the prototype sample of the gradient vector. Subsequently, the cloud server randomly initialized a virtual sample of the same size as the prototype sample. And the virtual sample follows a normal distribution. , It follows a normal distribution. For variance, For example, from the normal distribution, it is the identity matrix. Mid-sampling. Then, gradient inversion iterative optimization is performed: in each iteration In the middle, the current virtual sample Input the shallow neural network and calculate its fault category label in the aforementioned inference. The loss is calculated, and the virtual gradient vector is obtained. , means as follows:
[0047] In the formula, For the first The virtual gradient vector at the next iteration; These are the parameters of a shallow neural network; For parameters The gradient operator for finding the gradient; Cross-entropy loss; For the first Virtual samples at the next iteration; To make virtual samples Input network parameters are In a shallow neural network, after passing through the SoftMax activation function, the predicted probabilities of each fault category are obtained.
[0048] The goal of iterative updates is to make the virtual gradient vector... With the received gradient vector To minimize the difference between them, the gradient difference loss is defined as the gradient matching loss, as follows:
[0049] In the formula, For gradient matching loss; This represents the total number of layers in a shallow neural network. For the first During the nth iteration, the shallow neural network... The virtual gradient vector generated by the layer; The shallow neural network uploaded to the dynamic client The gradient vector of the layer; It is an L2 norm.
[0050] Calculate the gradient matching loss for the current virtual sample. The gradient is calculated, and the virtual samples are updated using gradient descent (learning rate set to 0.1), i.e.:
[0051] In the formula, For the first Virtual samples at the next iteration; This is the learning rate.
[0052] The above iterative process continues until the gradient matching loss is reached. Below the threshold ( (or until the maximum number of iterations (30) is reached. The virtual sample obtained from the last iteration and its inferred fault category label are used as the validation set.) One sample; at the same time, the above gradient iteration operation is performed on all gradient vectors uploaded by the dynamic client. Finally, the cloud server can reconstruct a representative, privacy-preserving validation set that can be used for model evaluation without touching any original data.
[0053] Step 7: Evaluate the performance of each trained fault diagnosis model using the validation set within the cloud server, and calculate the aggregate weight of each trained fault diagnosis model based on the validation loss, and perform a weighted average with the model parameters to generate a global diagnostic model.
[0054] In this step, the process of cloud servers aggregating and generating a global diagnostic model is as follows: First, the cloud server uses a verification set. The performance of the fault diagnosis model in each dynamic client that uploaded model parameters was evaluated; the validation set was used. Each sample is sequentially input into the trained fault diagnosis model of the dynamic client, and the average classification loss of each trained fault diagnosis model on the validation set is calculated, denoted as . .
[0055] Then, based on the average classification loss of each model, the aggregate weights of each trained fault diagnosis model are calculated. , For the first The aggregate weights of a fault diagnosis model trained on a dynamic client. For the first The average classification loss of a fault diagnosis model trained on a validation set by a dynamic client. The total number of dynamic clients participating in the aggregation. For the first The average classification loss of a fault diagnosis model trained on a dynamic client on the validation set; the weighting strategy gives higher importance to the model that performs better (lower loss) on the validation set, because it may have learned more generalizable features or has a better model of its local data distribution.
[0056] Finally, the aggregate weights of all models are weighted and averaged with their corresponding model parameters to obtain the parameters of the global diagnostic model. , represented as: This performance-based adaptive aggregation strategy, compared to traditional average aggregation, can more effectively integrate knowledge from different distributed clients to generate a more powerful global diagnostic model.
[0057] Step 8: Use the cloud server to distribute the global diagnostic model to all dynamic clients that need to participate in fault prediction, so as to realize fault diagnosis of real-time monitoring data of various mechanical equipment.
[0058] In this step, after completing one round of global training, the cloud server will aggregate the parameters of the obtained global diagnostic model. The broadcast is sent to all dynamic clients participating in this round of training. The dynamic clients replace their fault diagnosis models with this global diagnostic model for subsequent online fault diagnosis. Furthermore, when the system detects new fault data, signifying a new incremental task, all relevant dynamic clients will, based on the new sample dataset (containing new category samples and old category samples from the memory), begin a new round of local training and global aggregation, starting with the current global diagnostic model. This achieves lifelong learning diagnostic capabilities that can continuously adapt to new fault categories without requiring retraining from scratch.
[0059] To verify the effectiveness of the federated incremental mechanical fault diagnosis method in a dynamic client environment proposed in this invention, the implementation details and effects of the proposed method are further explained using rolling bearing fault diagnosis as a specific application. The operation is as follows: The experiment used a bearing fault simulation dataset, which was placed on a dedicated experimental platform. Seven different rotational frequencies (10 Hz, 15 Hz, 20 Hz, 25 Hz, 30 Hz, 35 Hz, and 40 Hz) were set to simulate different operating conditions. Vibration signals were collected for 11 specific fault states, including outer ring faults, inner ring faults, and rolling element faults. The data collected under each operating condition was treated as a sample dataset for an independent dynamic client, thus constructing seven dynamic clients with distinct data distributions. This rigorously simulated the data silo scenario across equipment and operating conditions in an industrial setting.
[0060] To simulate a realistic federated incremental learning process, a diagnostic scenario comprising six consecutive tasks was designed. Task 0 is the initial task, where the system learns six basic fault categories (RP, RC, IS3, OS3, OP, OC). In subsequent tasks 1 through 5, each task introduces a new fault category (IS2, IS1, IC, OS2, OS1). Samples for the new category may appear in existing dynamic clients (simulating new faults in older devices) or may be provided by a newly added dynamic client (simulating new fault types brought by new devices). Each fault category is provided with 100 samples upon its first appearance, and each dynamic client has a local storage capacity limit of 600 samples (corresponding to the initial six categories). On the cloud server, each dynamic client provides an additional 100 samples for each learned category, collectively forming an independent test set for objectively evaluating the diagnostic performance of the global diagnostic model.
[0061] Meanwhile, the system setup and hardware configuration for this verification process remain unchanged from the above embodiments, and the specific structural parameters, training hyperparameters (learning rate strategy, batch size, number of local training rounds, etc.) and gradient inversion optimization parameters of the diagnostic model are strictly executed according to the settings given in the above embodiments.
[0062] like Figure 3 As shown, the loss and accuracy trends of the global diagnostic model on the independent test set during the entire 6-task incremental learning process using the method proposed in this invention are illustrated. The loss curves show that the model quickly converges to a low, stable value after each training round. Although the final convergence loss value slightly increases with the accumulation of learning tasks, reflecting the increased complexity of the learning problem, there is no loss explosion or failure to converge. Simultaneously, the accuracy curve quickly recovers and stabilizes at a high level after a brief fluctuation at the beginning of each new task (e.g., the average accuracy remains above 90% after all tasks are completed). This fully demonstrates that the proposed method possesses excellent convergence stability, anti-overfitting ability, and continuous learning performance in complex dynamic federated incremental scenarios.
[0063] like Figure 4 As shown, taking a prototype sample of one of the fault categories as an example, the process of gradient inversion on the cloud server side is visualized. From this, it can be seen that the gradient matching loss... (Also referring to gradient difference loss) continuously decreases and eventually converges with the increase of optimization iterations. By observing the inverted signal waveforms and their spectra at the initial, intermediate, and final stages, it can be concluded that as optimization progresses, the inverted signal gradually exhibits impact characteristics similar to the real bearing fault signal in the time domain, and the fault characteristic frequency components become increasingly prominent in the frequency domain. This conclusively proves that the gradient inversion method can effectively "recover" key features that are discriminative for fault diagnosis from privacy-preserving gradient information, thereby constructing a high-quality validation set. Simultaneously, due to the initial randomization and perturbation process, the inverted data is not an exact copy of the original data, effectively preventing the leakage of original data.
[0064] like Figure 5 The diagram shows the final diagnostic confusion matrix after the proposed method completes all six incremental tasks. Rows in the matrix represent the true fault classification labels, columns represent the predicted labels, and the highlighted squares on the diagonal indicate the proportion of correctly classified samples. It can be seen that the model achieves near 100% recognition accuracy for the vast majority of fault categories (such as RP, OP, IS2, etc.). Although the accuracy for a few categories (such as OS3) decreased by approximately 70% in the middle of the task due to the addition of new clients carrying data with different distributions, its final performance was effectively maintained and recovered through continuous learning and optimization of the framework. This intuitively verifies that the proposed method has strong robustness and anti-forgetting ability when dealing with data distribution shifts and imbalances between old and new categories.
[0065] like Figure 6 The diagram illustrates the total training time required for the proposed method to complete all six incremental tasks. Because this method adds gradient calculation and uploading steps on the client side and introduces gradient inversion and validation set-based model weighted evaluation on the server side, its total time cost includes these necessary privacy protection and performance optimization steps. This time overhead is within an acceptable range in this experimental environment and represents the necessary engineering cost for achieving high-precision, highly robust, and continuous diagnostics.
[0066] like Figure 7 As shown, the weights were analyzed through controlled variable experiments. The impact on the model's final diagnostic performance was tested. Four scenarios. Experimental results show that: when At that time, the model achieved the highest average diagnostic accuracy across all six tasks. When the value is too small (e.g., 0.5), the model overemphasizes learning new data, resulting in insufficient retention of historical knowledge, and the overall accuracy decreases due to forgetting; when... When the value is too large, i.e., within the interval (1.5, 2.0), the model update is overly constrained, limiting its ability to learn new categories of knowledge, which also prevents the overall accuracy from reaching its optimum. Therefore, This experimental setup achieves the optimal balance between learning and retaining new and old knowledge. Therefore, in the specific implementation of this invention, the weights will be adjusted accordingly. The value is 1.0.
[0067] In summary, the above experimental analysis and results fully verify the effectiveness, advancement, and practicality of the federated incremental mechanical fault diagnosis method in a dynamic client environment proposed in this invention. This method successfully addresses several core challenges, including dynamic changes in the client, imbalance between old and new category data, and catastrophic forgetting, under strict constraints of data privacy protection. It provides a feasible technical path for constructing a high-performance, sustainably evolving intelligent fault diagnosis system truly suitable for complex industrial environments.
[0068] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
[0069] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A method for diagnosing incremental mechanical faults in a federated environment under a dynamic client environment, characterized in that, Includes the following steps: Construct a federated learning system that includes a cloud server and several dynamic clients, and configure the same shallow neural network for the cloud server and each dynamic client. At the same time, configure a sample dataset, a fault diagnosis model and a local memory for each dynamic client. Input the sample dataset of each dynamic client into the corresponding fault diagnosis model, and use the total loss function based on gradient balance weighted loss and relation consistency distillation loss to adjust the model parameters, thereby generating a trained fault diagnosis model and model parameters. Store the prototype samples of the historical fault categories that have been learned in the sample dataset into the local memory bank; After perturbating the prototype samples of each category in the sample dataset, the samples are input into the shallow neural network of the dynamic client to calculate the gradient vector of the network loss value with respect to the network parameters. Use a dynamic client to transmit gradient vectors, model parameters, and network parameters to the cloud server; The class label of the prototype sample is inferred through gradient vectors within the cloud server. At the same time, a virtual sample of the same size as the prototype sample is constructed. The virtual sample is input into a shallow neural network of the cloud server, and a privacy-preserving verification set is constructed through gradient inversion iteration. The performance of each trained fault diagnosis model is evaluated using a validation set within the cloud server. Based on the validation loss, the aggregate weight of each trained fault diagnosis model is calculated and weighted averaged with the model parameters to generate a global diagnostic model. By utilizing cloud servers, a global diagnostic model is distributed to all dynamic clients that are to participate in fault prediction, thereby enabling fault diagnosis of real-time monitoring data for various mechanical equipment.
2. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 1, characterized in that, The fault diagnosis model includes a feature transformation module, several residual modules, and a classification module; The feature transformation module includes a first convolutional layer, a batch normalization layer, and a ReLU activation function layer; Each residual module includes a channel attention module and a spatial attention module; The channel attention module includes a first adaptive average pooling layer, an adaptive max pooling layer, a first multilayer perceptron, a second multilayer perceptron, and a first sigmoid activation function layer; The spatial attention module includes a global average pooling layer, a global max pooling layer, a second convolutional layer, and a second sigmoid activation function layer; The classification module includes a second adaptive average pooling layer and a fully connected layer.
3. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 2, characterized in that, The process of inputting the sample dataset of each dynamic client into the corresponding fault diagnosis model, and adjusting the model parameters using the total loss function based on gradient balance weighted loss and relation consistency distillation loss to generate the trained fault diagnosis model and model parameters is as follows: The sample dataset is sequentially input into the first convolutional layer, batch normalization layer, and ReLU activation function layer of the feature conversion module of the fault diagnosis model. By performing preliminary feature mapping on the vibration signal, high-dimensional features are extracted to obtain the output features of the feature conversion module. The output features of the feature transformation module are sequentially input into each cascaded residual module. Each residual module first enhances the input features by channel dimension through channel attention mechanism, and then enhances the features after channel weighting by spatial attention mechanism by spatial dimension. Deep features related to fault diagnosis are extracted step by step, and finally the last residual module outputs deep fault features that fuse channel and spatial attention information. The output features of the last residual module are sequentially input into the second adaptive average pooling layer and the fully connected layer of the classification module to output the predicted probability distribution of each fault category. A total loss function based on gradient balance weighted loss and relation consistency distillation loss is constructed, and this total loss function is used to backpropagate the fault diagnosis model to update the model parameters, and finally generate the trained fault diagnosis model and model parameters.
4. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 3, characterized in that, Each residual module first enhances the input features by channel-dimensional weighting through a channel attention mechanism, and then enhances the spatial-dimensional weighting of the channel-weighted features through a spatial attention mechanism. The process is as follows: For each residual module, the output features of the previous module connected to the channel attention module are input into the first adaptive average pooling layer and the adaptive max pooling layer respectively for average pooling and max pooling operations. Then, the output features of the first adaptive average pooling layer are input into the first multilayer perceptron, and the output features of the adaptive max pooling layer are input into the second multilayer perceptron. The output features of the first multilayer perceptron and the output features of the second multilayer perceptron are added together and then passed through the first sigmoid activation function layer to obtain the channel-level weights. Finally, the channel-level weights are multiplied by the output features of the previous module of the channel attention module to obtain the channel-weighted features. Simultaneously, the channel-weighted features are input into the global average pooling layer and global max pooling layer of the spatial attention module connected to the channel attention module, respectively. After global average pooling and global max pooling operations, the output features of the global average pooling layer and global max pooling layer are merged and input into the second convolutional layer for convolution operation. Then, after passing through the second sigmoid activation function layer, spatial weights are obtained. Finally, the spatial weights are multiplied by the channel-weighted features to obtain the spatial-weighted features, which are the output features of the residual module.
5. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 3, characterized in that, The formula for calculating the total loss function based on gradient balancing weighted loss and relation consistency distillation loss is as follows: in, For the total loss, For gradient balancing weighted loss, To balance the weights of gradient balancing loss and relation consistency distillation loss, For consistency distillation loss, For the size of the training batch, For the first Gradient of each sample, The mean of the category gradient is dynamically assigned. For binary cross-entropy loss, It is the Sigmoid activation function. For the model to the first Sample The predicted distribution For the model to the first Sample The predicted probability distribution For the first Fault category labels for each sample For model parameters Updated to At that time, for batch data The predicted distribution For model parameters Updated to At that time, for batch data The predicted probability distribution For model parameters Updated to At that time, for batch data The predicted distribution For model parameters Updated to At that time, for batch data The predicted probability distribution For batch data The true labels of the Chinese and new category samples This is for splicing operations.
6. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 1, characterized in that, The process of storing prototype samples of historical fault categories learned from the sample dataset into the local memory is as follows: For each learned historical fault category, all samples belonging to that category are extracted from the sample dataset, and then input into the trained fault diagnosis model for feature extraction to obtain the feature vector of each sample in that category. Calculate the mean of the feature vectors of all samples in this category, and use it as the prototype vector of this category; From all samples of that category, select the feature vector that is closest to the prototype vector of that category. Each sample is used as a prototype sample for that category and stored in a consistent memory bank in the data center.
7. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 1, characterized in that, After perturbating the prototype samples of each category in the sample dataset, the process of inputting them into the shallow neural network of the dynamic client and calculating the gradient vector of the network loss value with respect to the network parameters is as follows: Select prototype samples for each category from each dynamic client sample dataset; Each prototype sample is perturbed by applying a label based on gradient descent, generating perturbed samples, i.e.: in, For perturbation samples, For prototype samples, For learning rate, For prototype samples The gradient operator for finding the gradient. For binary cross-entropy loss, It is the Sigmoid activation function. For model parameters Updated to At that time, for the prototype sample The predicted distribution For model parameters Updated to At that time, for the prototype sample The predicted probability distribution The fault category label for the prototype sample; The perturbation sample is input into a shallow neural network for forward inference, and the predicted result is output. Simultaneously, the fault category label of the perturbation sample is combined with the cross-entropy loss function to calculate the loss value between the predicted result and the true label, and the gradient vector of this loss value with respect to the parameters of the shallow neural network is calculated, i.e.: in, The gradient vector, These are the parameters of a shallow neural network. For parameters The gradient operator for finding the gradient. For cross-entropy loss, To perturb the samples Input network parameters are In a shallow neural network, after passing through the SoftMax activation function, the predicted probabilities of each fault category are obtained. The fault category label for the perturbation sample.
8. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 1, characterized in that, The process of inferring the class label of a prototype sample using gradient vectors within a cloud server, while simultaneously constructing a virtual sample of the same size as the prototype sample, and inputting the virtual sample into a shallow neural network on the cloud server, involves iterative gradient inversion to build a privacy-preserving validation set. The cloud server infers the fault category label of the prototype sample corresponding to the received gradient vector. ; Randomly initialize a virtual sample with the same size as the prototype sample. And the virtual sample follows a normal distribution. , It follows a normal distribution. For variance, It is the identity matrix; The virtual sample is input into a shallow neural network of the dynamic client to calculate the fault category label of the virtual sample in the prototype sample. The loss is used to obtain the virtual gradient vector, i.e.: in, For the first The virtual gradient vector at the next iteration These are the parameters of a shallow neural network. For parameters The gradient operator for finding the gradient. For cross-entropy loss, For the first Virtual samples at the next iteration To make virtual samples Input network parameters are In a shallow neural network, after passing through the SoftMax activation function, the predicted probabilities of each fault category are obtained; Based on the virtual gradient vector, a gradient matching loss function is constructed, namely: in, For gradient matching loss, This represents the total number of layers in a shallow neural network. For the first During the nth iteration, the shallow neural network... The virtual gradient vector generated by the layer The shallow neural network uploaded to the dynamic client The gradient vector of the layer, It is an L2 norm; The virtual sample is updated through iterative operations; When the gradient matching loss function converges, the virtual sample from the last iteration and its inferred fault category label will be used. As a sample of the validation set, the gradient iteration operation is performed on all gradient vectors uploaded by the dynamic client, and finally a privacy-preserving validation set is obtained.
9. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 8, characterized in that, The formula for updating virtual samples is: in, For the first Virtual samples at the next iteration This is the learning rate.
10. The method for diagnosing federated incremental mechanical faults in a dynamic client environment according to claim 1, characterized in that, The process of calculating the aggregate weights for each trained fault diagnosis model based on the validation loss is as follows: The cloud server uses a validation set to evaluate the performance of the pre-trained fault diagnosis model within each dynamic client. By calculating the average classification loss of each pre-trained fault diagnosis model on the validation set, the aggregate weights of each pre-trained fault diagnosis model are obtained, i.e.: in, For the first The aggregate weights of a fault diagnosis model trained on a dynamic client. For the first The average classification loss of a fault diagnosis model trained on a validation set by a dynamic client. The total number of dynamic clients participating in the aggregation. For the first The average classification loss of a fault diagnosis model trained on a dynamic client on the validation set.
