Multi-task incremental learning fault diagnosis method oriented to non-stationary working condition of rotating machinery
By employing a multi-task incremental learning method, combined with a multi-head self-attention mechanism and dynamic sample replay, and using the knowledge distillation loss of a joint cross-classifier to train the student model, the problem of decreased accuracy in old task diagnosis caused by learning new tasks in fault diagnosis tasks under non-stationary operating conditions of rotating machinery is solved, thereby improving the diagnostic accuracy and reducing data storage pressure.
Patent Information
- Application Number
- CN202511122254.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-11-18
AI Technical Summary
In fault diagnosis tasks under non-stationary operating conditions of rotating machinery, existing technologies suffer from a significant drop in the accuracy of the model's diagnosis of old tasks after learning new tasks, making it difficult to meet the requirements of actual fault diagnosis, and also resulting in huge data storage pressure.
A multi-task incremental learning approach is adopted. By constructing a fault diagnosis model based on a multi-head self-attention mechanism, and combining a cascaded self-attention layer and a dynamic sample replay strategy, the student model is trained using a joint cross-classifier knowledge distillation loss function to retain knowledge of old tasks, thereby achieving learning of new tasks and review of old tasks.
It improves the accuracy of fault diagnosis under non-stationary operating conditions of rotating machinery, alleviates the problem of feature distribution offset, reduces the phenomenon of forgetting old tasks, and reduces data storage requirements.
Smart Images

Figure CN120974237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rotating machinery safety service technology, and more specifically, to a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery. Background Technology
[0002] Rotating machinery, as a core component of power and transmission systems in industrial systems, has wide applications in many fields such as aviation, energy, and chemical engineering. The working environment of rotating machinery is often extremely harsh, making it prone to malfunctions. Once a malfunction occurs, it not only affects production activities and causes economic losses, but in severe cases, it can even endanger the safety of production personnel. Therefore, accurate and continuous monitoring of the health status of rotating machinery is of great significance for maintaining industrial production.
[0003] Traditional data-driven diagnostic methods that differentiate fault types by constructing health indicators are ill-suited to the complex operating environment of rotating machinery with multi-physics coupling. With the rise of artificial intelligence, deep learning-based fault diagnosis methods with adaptive modeling capabilities have attracted increasing attention. Researchers have attempted to construct complex mapping relationships between rotating machinery operating information and fault types using various neural networks such as Multilayer Perceptrons (MLP), Convolutional Neural Networks (CNN), and Long Short-Term Memory (LSTM). However, these studies primarily focus on stationary operating conditions, specifically fault diagnosis for rotating machinery operating at stable speeds and loads. In real industrial systems, due to frequent changes in tasks, the speed and load of rotating machinery can vary significantly. Fluctuations in rotational speed can induce time-varying characteristics in fault feature frequencies, while load fluctuations can lead to vibration amplitude modulation. Therefore, under non-stationary operating conditions, a significant feature distribution shift occurs between the fault type and operating information of rotating machinery. This effect not only weakens the feature space distribution boundary of fault information but also makes it difficult for existing deep learning models to construct robust feature-fault mapping systems during fault classification, hindering high-precision fault diagnosis under non-stationary conditions. Furthermore, it is difficult to collect all non-stationary vibration information of the monitored rotating machinery in a single experiment. New fault diagnosis tasks for non-stationary conditions will continuously emerge as the actual tasks change. The data flow problems caused by the increasing number of new tasks will lead to a catastrophic forgetting of old tasks after learning new ones, thus greatly reducing the diagnostic accuracy of old tasks. If the model is retrained by aggregating all task data every time a new task appears, it will create enormous data storage pressure. For these reasons, existing technologies, when incrementally learning fault diagnosis tasks under multiple non-stationary operating conditions of rotating machinery, not only struggle to adapt to fault diagnosis tasks under non-stationary conditions, but also cause a significant drop in the model's diagnostic accuracy for old tasks after learning new ones, making it difficult to meet the requirements of actual fault diagnosis. Summary of the Invention
[0004] The purpose of this invention is to provide a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery. This method addresses the technical problem in existing technologies where, when incrementally learning fault diagnosis tasks under multiple non-stationary operating conditions of rotating machinery, the accuracy of the model's diagnosis of older tasks drops significantly after learning new tasks, making it difficult to meet the requirements of practical fault diagnosis. Therefore, this invention achieves this through the following solution.
[0005] This invention provides a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery, including: In the initial stage, fault data under non-stationary operating conditions of rotating machinery is acquired and recorded as Task 0 data; To construct a fault diagnosis model, the data from Task 0 is divided into a training set and a test set. After training and validating the fault diagnosis model, the weight parameters of the best model are retained as the model parameters for the initial stage. Forward propagation of the training set for Task 0 data, select example samples and save them as Task 0 examples; When a new task appears for the first time, the process enters the incremental phase 1 and acquires new fault data under non-stationary operating conditions of rotating machinery, which is recorded as task 1 data and divided into training set and test set. The fault diagnosis model for incremental stage 1 is initialized using the model parameters from the initial stage; the fault diagnosis model for incremental stage 1 includes a teacher model and a student model. The training sets of the examples from Task 0 and the data from Task 1 are merged as the training data for incremental phase 1. The joint cross-classifier knowledge distillation loss of the fault diagnosis model in incremental stage 1 is constructed, and the student model is trained using the total loss function. The accuracy of the student model on each task is verified by using the test sets of task 0 and task 1, thus completing the fault diagnosis in incremental stage 1. After the nth new task appears, the process enters incremental phase n and repeats the process of the previous incremental phase to complete the fault diagnosis of incremental phase n.
[0006] Compared with existing technologies, the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, after acquiring task 0 data in the initial stage, constructs a fault diagnosis model, divides the task 0 data into training and testing sets, and after training and validating the fault diagnosis model, retains the weight parameters of the best model as the model parameters for the initial stage; further, the training set of task 0 data is forward propagated, and example samples are selected and saved as task 0 examples; after the first occurrence of a new task, the incremental stage 1 is entered, and new fault data under non-stationary operating conditions of rotating machinery is acquired, denoted as task 1 data, and divided into training and testing sets; further... The fault diagnosis model for incremental stage 1 is initialized using the model parameters from the initial stage. The training sets of the examples from task 0 and the data from task 1 are merged as the training data for incremental stage 1. Furthermore, a joint cross-classifier knowledge distillation loss for the fault diagnosis model of incremental stage 1 is constructed, and the student model is trained using the total loss function. The accuracy of the student model on each task is verified using the test sets of task 0 and task 1, thus completing the fault diagnosis for incremental stage 1. Furthermore, for the remaining incremental stages, after the nth occurrence of a new task, the process of entering incremental stage n is repeated to complete the fault diagnosis for incremental stage n. In the above technical solution, feature extraction of frequency domain information of rotating machinery faults under non-stationary operating conditions can be achieved by constructing a cascaded self-attention layer; the model can construct a mapping relationship between fault form and operating information by adaptively adjusting the correlation weights between each sub-sequence, thus alleviating the feature distribution shift problem caused by changes in operating conditions; furthermore, a dynamic sample replay strategy can be adopted to screen and retain a small number of samples sensitive to model parameters as examples for replay, realizing the model's review of old tasks; by establishing a joint cross-classifier knowledge distillation regularization mechanism, the gradient update direction of the student model learning new task knowledge is restricted in real time using the teacher model that retains knowledge of old tasks, thus realizing knowledge retention at the model parameter level and improving the fault diagnosis accuracy. Through the above technical solution of the present invention, the technical problem of existing technologies, when incrementally learning fault diagnosis tasks under multiple non-stationary operating conditions of rotating machinery, is that the diagnostic accuracy of the model for old tasks drops significantly after learning new tasks, making it difficult to meet the requirements of actual fault diagnosis.
[0007] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the step of selecting example samples and saving them as task 1 examples includes: Construct a sample feature space. After the fault diagnosis model in the first stage completes the training of the corresponding task, forward propagate all training samples to obtain the feature space centroids of various fault samples in the corresponding task. Based on the centroids of the feature space of various fault samples, the distance from the feature space of each sample to the centroid of the feature space of the corresponding category is evaluated, and all task examples of the corresponding task are obtained iteratively based on this distance.
[0008] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the feature space of each sample is represented as follows during the process of constructing the sample feature space: ;in, This represents the i-th sample of fault class k in the training dataset for task t. Indicates sample The average feature space, This represents the model parameters after training on task t, where n represents the number of encoder layers. This represents the samples output by each encoder layer. The feature space.
[0009] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, during the process of obtaining the feature space centroids of various types of fault samples in the corresponding task, the feature space centroid of each type of fault sample is represented as follows: ;in, Let the centroid of the feature space of the k-th type of fault sample in task t be denoted as . This represents the number of samples for fault category k in task t.
[0010] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the evaluation of the distance from the feature space of each sample to the centroid of the corresponding category feature space is expressed as: ; in, This represents the d-th instance selected from the k-th type of fault samples in task t. This represents iterating through all samples of the k-th type of fault and returning the result that... The sample with the smallest value is taken as the d-th instance. Describing the vector norm, Let represent the centroid of the feature space of the k-th type of fault sample in task t, and d represent the order of the selected samples. ,in This represents the total number of examples that need to be filtered out from the k-th type of fault samples. Indicates sample The average feature space, This represents the i-th instance of the k-th type of fault sample in the selected task t. express The average feature space.
[0011] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the complete task examples are represented as follows: ;in, This represents all instances of the selected task t. This represents an example of a type 1 fault sample in task t. This represents an example of the k-th type of fault sample in task t. This represents an example of a fault sample of type c in task t.
[0012] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the joint cross-classifier knowledge distillation loss for constructing the fault diagnosis model in incremental stage 1 includes: Add a temperature coefficient to the output distribution of the teacher and student models to soften the prediction distribution effect; The feature space extracted by the feature extractor of the student model is input into the classifier of the teacher model to obtain the cross-classifier prediction sequence; Construct a joint cross-classifier based on the knowledge distillation loss function; The knowledge distillation loss function of the joint cross-classifier is expressed as: ;in, This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model. This represents the teacher-student cross-classifier prediction sequence generated after inputting the feature space extracted from the teacher model into the classifier of the student model. This represents the student-teacher cross-classifier prediction sequence generated after inputting the feature space extracted from the student model into the classifier of the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequences of the student model and the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequence from the teacher-student cross-classifier and the predicted sequence from the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the student-teacher cross-classifier prediction sequence and the teacher model prediction sequence. This represents the first weighting coefficient. This represents the second weighting coefficient. This represents the third weighting coefficient.
[0013] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the total loss function is expressed as follows during the process of training the student model using the total loss function: ;in, Represents the total loss function. The weighting coefficients of the cross-entropy loss term. This represents the cross-entropy loss calculated using the student model to compare the predicted labels with the true labels of the samples. This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. Indicates the predicted label of the sample. This represents the true label of the sample. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model.
[0014] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the fault diagnosis model is a fault diagnosis model based on a multi-head self-attention mechanism layer; the construction of the fault diagnosis model includes: After constructing the self-attention mechanism and the multi-head attention mechanism, residual connections are added; After each multi-head self-attention layer, a forward propagation network consisting of two linear layers is connected, and residual connections are added to the forward propagation network; An encoder layer is formed by combining a multi-head attention layer with a feedforward network. By stacking multiple encoder layers, a fault information extraction module is constructed. This module is then combined with a classifier to form a non-stationary neural network model based on a multi-head self-attention mechanism. This neural network model is the fault diagnosis model.
[0015] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, after acquiring fault data under non-stationary operating conditions of rotating machinery in the initial stage, the method further includes: After cleaning the fault data of the rotating machinery under non-stationary operating conditions in the initial stage, the data is truncated and converted to the frequency domain to obtain the frequency domain information of task 0. The frequency domain information of task 0 is divided into training set and test set.
[0016] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the retention of the weight parameters of the optimal model as the model parameters in the initial stage includes: The samples in the training set of Task 0 data are randomly divided into small batches and input into the fault diagnosis model in batches. The average loss of each batch is obtained by using the cross-entropy loss function. The optimizer minimizes the loss function through backpropagation, while the encoder layer achieves feature extraction by adaptively adjusting the weight relationship between each subsequence; after training, the model parameters are saved.
[0017] Furthermore, in the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, the cross-entropy loss function is expressed as: ;in, Represents the cross-entropy loss function. This represents the student model's predicted label for the sample. This represents the true label of the sample. This indicates the number of samples in each batch. This indicates the first data in each batch. The true label of each sample This indicates the first data in each batch. Predicted labels for each sample. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a schematic diagram of the multi-task incremental learning fault diagnosis method of the present invention; Figure 2 This is a schematic diagram of the gearbox variable operating condition fault test bench in Embodiment 3 of the present invention; Figure 3 This is a time-varying speed curve of the gearbox in Embodiment 3 of the present invention; Figure 4 This is a BWT bar chart of the non-stationary multi-task incremental learning stage in Embodiment 3 of the present invention; Figure 5 This is a BWT bar chart of the steady-state multi-task incremental learning stage in Embodiment 3 of the present invention. Detailed Implementation
[0019] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0020] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to that other component.
[0021] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified. "Several" means one or more, unless otherwise explicitly specified.
[0022] Traditional data-driven diagnostic methods that differentiate fault types by constructing health indicators are ill-suited to the complex operating environment of rotating machinery with multi-physics coupling. With the rise of artificial intelligence, deep learning-based fault diagnosis methods with adaptive modeling capabilities have attracted increasing attention. Researchers have attempted to construct complex mapping relationships between rotating machinery operating information and fault types using various neural networks such as Multilayer Perceptrons (MLP), Convolutional Neural Networks (CNN), and Long Short-Term Memory (LSTM). However, these studies primarily focus on stationary operating conditions, specifically fault diagnosis for rotating machinery operating at stable speeds and loads. In real industrial systems, due to frequent changes in tasks, the speed and load of rotating machinery can vary significantly. Fluctuations in rotational speed can induce time-varying characteristics in fault feature frequencies, while load fluctuations can lead to vibration amplitude modulation. Therefore, under non-stationary operating conditions, a significant feature distribution shift occurs between the fault type and operating information of rotating machinery. This effect not only weakens the feature space distribution boundary of fault information but also makes it difficult for existing deep learning models to construct robust feature-fault mapping systems during fault classification, hindering high-precision fault diagnosis under non-stationary conditions. Furthermore, it is difficult to collect all non-stationary vibration information of the monitored rotating machinery in a single experiment. New fault diagnosis tasks for non-stationary conditions will continuously emerge as the actual tasks change. The data flow problems caused by the continuous increase of new tasks will lead to a catastrophic forgetting of old tasks after learning new ones, thus greatly reducing the diagnostic accuracy of old tasks. If the model is retrained by aggregating all task data every time a new task appears, it will bring enormous data storage pressure. For these reasons, when existing technologies incrementally learn fault diagnosis tasks under multiple non-stationary operating conditions of rotating machinery, the diagnostic accuracy of the model for old tasks drops significantly after learning new tasks, making it difficult to meet the requirements of actual fault diagnosis.
[0023] To address the above technical problems, this invention provides a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery, comprising: In the initial stage, fault data under non-stationary operating conditions of rotating machinery is acquired and recorded as Task 0 data; To construct a fault diagnosis model, the data from Task 0 is divided into a training set and a test set. After training and validating the fault diagnosis model, the weight parameters of the best model are retained as the model parameters for the initial stage. Forward propagation of the training set for Task 0 data, select example samples and save them as Task 0 examples; When a new task appears for the first time, the process enters the incremental phase 1 and acquires new fault data under non-stationary operating conditions of rotating machinery, which is recorded as task 1 data and divided into training set and test set. The fault diagnosis model for incremental stage 1 is initialized using the model parameters from the initial stage; the fault diagnosis model for incremental stage 1 includes a teacher model and a student model. The training sets of the examples from Task 0 and the data from Task 1 are merged as the training data for incremental phase 1. The joint cross-classifier knowledge distillation loss of the fault diagnosis model in incremental stage 1 is constructed, and the student model is trained using the total loss function. The accuracy of the student model on each task is verified by using the test sets of task 0 and task 1, thus completing the fault diagnosis in incremental stage 1. After the nth new task appears, the process enters incremental phase n and repeats the process of the previous incremental phase to complete the fault diagnosis of incremental phase n.
[0024] In the above-mentioned technical solution, the multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery of the present invention, after acquiring the data of Task 0 in the initial stage, constructs a fault diagnosis model, divides the data of Task 0 into a training set and a test set, and after training and validating the fault diagnosis model, retains the weight parameters of the best model as the model parameters of the initial stage; further, the training set of Task 0 data is forward propagated, and example samples are selected and saved as Task 0 examples; after the first occurrence of a new task, the incremental stage 1 is entered, and new fault data under non-stationary operating conditions of rotating machinery is acquired, which is recorded as Task 1 data, and divided into a training set and a test set; Furthermore, the fault diagnosis model for incremental stage 1 is initialized using the model parameters from the initial stage; the training sets of the examples from task 0 and the data from task 1 are merged as the training data for incremental stage 1; further, a joint cross-classifier knowledge distillation loss for the fault diagnosis model of incremental stage 1 is constructed, and the student model is trained using the total loss function. The accuracy of the student model on each task is verified using the test sets of task 0 and task 1, thus completing the fault diagnosis for incremental stage 1; further, for the remaining incremental stages, after the nth occurrence of a new task, the process of the previous incremental stage is repeated to complete the fault diagnosis for incremental stage n. In the above technical solution, feature extraction of frequency domain information of rotating machinery faults under non-stationary operating conditions can be achieved by constructing a cascaded self-attention layer; the model can construct a mapping relationship between fault form and operating information by adaptively adjusting the correlation weights between each sub-sequence, thus alleviating the feature distribution shift problem caused by changes in operating conditions; furthermore, a dynamic sample replay strategy can be adopted to screen and retain a small number of samples sensitive to model parameters as examples for replay, realizing the model's review of old tasks; by establishing a joint cross-classifier knowledge distillation regularization mechanism, the gradient update direction of the student model learning new task knowledge is restricted in real time using the teacher model that retains knowledge of old tasks, thus realizing knowledge retention at the model parameter level and improving the fault diagnosis accuracy. Through the above technical solution of the present invention, the technical problem of existing technologies, when incrementally learning fault diagnosis tasks under multiple non-stationary operating conditions of rotating machinery, is that the diagnostic accuracy of the model for old tasks drops significantly after learning new tasks, making it difficult to meet the requirements of actual fault diagnosis.
[0025] To better understand the present invention, the following specific embodiments further illustrate the content of the present invention, but the content of the present invention is not limited to the following embodiments.
[0026] Example 1 Please see Figure 1 This embodiment provides a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery, including: Step 1: In the initial stage, acquire fault data under non-stationary operating conditions of rotating machinery and record it as Task 0 data; Step 2: Construct a fault diagnosis model. Divide the data from Task 0 into a training set and a test set. After training and validating the fault diagnosis model, retain the weight parameters of the best model as the model parameters for the initial stage. Step 3: Forward propagation of the training set for Task 0 data, select example samples and save them as Task 0 examples; Step 4: When a new task appears for the first time, enter incremental phase 1 and acquire new fault data under non-stationary operating conditions of rotating machinery, which is recorded as task 1 data, and divide it into training set and test set. Step 5: Initialize the fault diagnosis model for incremental stage 1 using the model parameters from the initial stage; the fault diagnosis model for incremental stage 1 includes a teacher model and a student model. Step 6: Merge the training sets of Task 0 examples and Task 1 data as training data for incremental phase 1. Step 7: Construct the joint cross-classifier knowledge distillation loss of the fault diagnosis model for incremental stage 1, and train the student model using the total loss function. Validate the accuracy of the student model on each task using the test sets of task 0 and task 1 to complete the fault diagnosis for incremental stage 1. Step 8: After the nth new task appears, enter incremental phase n and repeat the process of the previous incremental phase to complete the fault diagnosis of incremental phase n.
[0027] Example 2 This embodiment provides a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery, including: S100: In the initial stage, acquire fault data under non-steady operating conditions of rotating machinery and record it as Task 0 data.
[0028] S200, construct a fault diagnosis model. After cleaning the fault data of the rotating machinery under non-stationary working conditions in the initial stage, the data is truncated and converted to the frequency domain to obtain the frequency domain information of Task 0. The frequency domain information of Task 0 is divided into training set and test set. After training and validating the fault diagnosis model, the weight parameters of the best model are retained as the model parameters in the initial stage. Furthermore, the fault diagnosis model is a fault diagnosis model based on a multi-head self-attention mechanism layer; the construction of the fault diagnosis model includes: S201, after constructing the self-attention mechanism and the multi-head attention mechanism, adds residual connections; S202, after each multi-head self-attention layer, connects a forward propagation network consisting of two linear layers, and adds residual connections to the forward propagation network; S203 combines a multi-head attention layer with a forward propagation network to form an encoder layer. By stacking multiple encoder layers, a fault information extraction module is constructed. This module, along with a classifier, forms a non-stationary working condition neural network model based on a multi-head self-attention mechanism. This neural network model is the fault diagnosis model.
[0029] Furthermore, the retention of the optimal model's weight parameters as model parameters in the initial stage includes: The samples in the training set of Task 0 data are randomly divided into small batches and input into the fault diagnosis model in batches. The average loss of each batch is obtained by using the cross-entropy loss function. The optimizer minimizes the loss function through backpropagation, while the encoder layer achieves feature extraction by adaptively adjusting the weight relationship between each subsequence; after training, the model parameters are saved. Furthermore, the cross-entropy loss function is expressed as: ;in, Represents the cross-entropy loss function. This represents the student model's predicted label for the sample. This represents the true label of the sample. This indicates the number of samples in each batch. This indicates the first data in each batch. The true label of each sample This indicates the first data in each batch. Predicted labels for each sample.
[0030] S300, the training set of forward propagation task 0 data, select example samples and save them as task 0 examples; Furthermore, step S300 includes: S301, Construct the sample feature space. After the fault diagnosis model in the initial stage completes the training of the corresponding task, propagate all training samples forward to obtain the feature space centroids of various fault samples in the corresponding task. Furthermore, in the process of constructing the sample feature space, the feature space of each sample is represented as follows: ;in, This represents the i-th sample of fault class k in the training dataset for task t. Indicates sample The average feature space, This represents the model parameters after training on task t, where n represents the number of encoder layers. This represents the samples output by each encoder layer. The feature space; Furthermore, in the process of obtaining the feature space centroids of various types of fault samples in the corresponding task, the feature space centroid of each type of fault sample is represented as follows: ;in, Let the centroid of the feature space of the k-th type of fault sample in task t be denoted as . This represents the number of samples for fault category k in task t; S302, based on the centroids of the feature spaces of various fault samples, evaluate the distance from the feature space of each sample to the centroid of the feature space of the corresponding category, and iteratively obtain all task examples for the corresponding task based on this distance. Furthermore, the distance from the feature space of each sample to the centroid of the corresponding class feature space is expressed as: ; in, This represents the d-th instance selected from the k-th type of fault samples in task t. This represents iterating through all samples of the k-th type of fault and returning the result that... The sample with the smallest value is taken as the d-th instance. Describing the vector norm, Let represent the centroid of the feature space of the k-th type of fault sample in task t, and d represent the order of the selected samples. ,in This represents the total number of examples that need to be filtered out from the k-th type of fault samples. Indicates sample The average feature space, This represents the i-th instance of the k-th type of fault sample in the selected task t. express The average feature space; Furthermore, all the task examples are represented as follows: ;in, This represents all instances of the selected task t. This represents an example of a type 1 fault sample in task t. This represents an example of the k-th type of fault sample in task t. This represents an example of a fault sample of type c in task t.
[0031] S400: When a new task appears for the first time, it enters incremental phase 1 and acquires fault data under non-stationary operating conditions of the rotating machinery, which is recorded as task 1 data and divided into training set and test set.
[0032] S500, Initialize the fault diagnosis model of incremental stage 1 using the model parameters of the initial stage; the fault diagnosis model of incremental stage 1 includes a teacher model and a student model.
[0033] S600, merge the training sets of Task 0 examples and Task 1 data as training data for incremental phase 1.
[0034] S700, construct the joint cross classifier knowledge distillation loss of the fault diagnosis model of incremental stage 1, and train the student model using the total loss function. The accuracy of the student model on each task is verified by using the test sets of task 0 and task 1, thereby completing the fault diagnosis of incremental stage 1. Furthermore, the joint cross-classifier knowledge distillation loss for constructing the fault diagnosis model in incremental stage 1 includes: S701, add a temperature coefficient to the output distribution of the teacher model and student model to soften the effect of the prediction distribution; S702, input the feature space extracted by the feature extractor of the student model into the classifier of the teacher model to obtain the cross-classifier prediction sequence; S703, construct the joint cross-classifier knowledge distillation loss function based on knowledge distillation loss; The knowledge distillation loss function of the joint cross-classifier is expressed as: ;in, This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model. This represents the teacher-student cross-classifier prediction sequence generated after inputting the feature space extracted from the teacher model into the classifier of the student model. This represents the student-teacher cross-classifier prediction sequence generated after inputting the feature space extracted from the student model into the classifier of the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequences of the student model and the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequence from the teacher-student cross-classifier and the predicted sequence from the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the student-teacher cross-classifier prediction sequence and the teacher model prediction sequence. This represents the first weighting coefficient. This represents the second weighting coefficient. Indicates the third weighting coefficient; Furthermore, in the process of training the student model using the total loss function, the total loss function is expressed as: ;in, Represents the total loss function. The weighting coefficients of the cross-entropy loss term. This represents the cross-entropy loss calculated using the student model to compare the predicted labels with the true labels of the samples. This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. Indicates the predicted label of the sample. This represents the true label of the sample. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model.
[0035] S800: When a new task appears for the nth time, it enters the incremental stage n. After acquiring the data for task n, it repeats the training process of incremental stage 1 and finally verifies the accuracy of the student model of incremental stage n on each task on the test set of n+1 tasks, thereby completing the fault diagnosis of incremental stage n.
[0036] Example 3 This embodiment provides a multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery, including: S100: Collect fault data of various health states under the first non-steady operating condition of rotating machinery as task 0 data. This stage is defined as the initial stage. In this embodiment, by arranging sensors on rotating machinery, one-dimensional time series raw fault data generated by different health states of rotating machinery operating under non-steady conditions can be collected using the sensors. The sample length of the one-dimensional time series raw data segment is L, that is, it contains L data points; the health state of the rotating machinery is set to N health states, including one normal state and N-1 fault states. The original one-dimensional time series of Task 0 is preprocessed with data cleaning, and then the data is truncated and transformed to the frequency domain based on the sliding window sampling method to obtain frequency domain information. In this embodiment, since the collected raw data may contain outliers, the data is first preprocessed, such as cleaning, and then the truncation window length and window sliding length are set to truncate the data. In non-stationary operating conditions, the rotational speed or load of rotating machinery changes over time, causing fault information to drift continuously in the time domain, making diagnosis difficult. However, the drift in the frequency domain is smaller and more conducive to diagnosis. Therefore, Fast Fourier Transform is used to extract the frequency domain components of the fault features; expressed as: ;in, Given a complex sequence, is the frequency domain representation of the original signal, each... Corresponding to the signal at the 1st (Value range 0 to) The complex amplitude and phase of each frequency component, where N is the length of the sequence. This represents the nth sample of the signal in the time domain. Represents the imaginary unit. Represents pi; The frequency domain information is divided into training sets. and test set ; In this embodiment, all frequency domain information samples of Task 0 are proportionally divided into training sets. and test set , Used to train the fault diagnosis model in stage 0. This is used to verify the model's diagnostic accuracy for task 0 at each stage; the ratio of training set to test set can be 4:1.
[0037] S200, constructing a fault diagnosis model based on a multi-head self-attention mechanism layer; In this embodiment, the attention mechanism adaptively assigns corresponding attention levels to different positions by calculating the correlation between different positions in long sequence data, greatly improving the ability to understand the contextual information of the input sequence; the formula for the self-attention mechanism is expressed as: ;in, express The output after calculating the correlation at each position of the three sequences. , and These are the three learnable parameter matrices, queries, keys, and values, to which the input sequence is mapped through a linear transformation. Indicates will and The attention weights between them are mapped to [0, 1], and T represents the matrix transpose. express Dimensions It is typically used to maintain gradient stability; Furthermore, multi-head self-attention is developed based on the self-attention mechanism. Each head is a self-attention mechanism, similar to the multi-channel convolutional kernel in a convolutional neural network. The multi-head attention mechanism aims to map the input sequence to different subspaces through multiple self-attention mechanisms, thereby increasing the model's receptive field and enhancing its ability to understand global information. The formula for the multi-head attention mechanism is expressed as: ; in, Represents computation of multiple self-attention layers The joint output of the correlation between them This indicates that the subspace outputs of each header are stacked together. This represents the h-th self-attention layer. This represents a learnable matrix that maps the multi-head attention mechanism into an output sequence; Furthermore, to mitigate the degradation of neural networks as the number of layers increases, residual connections are added to ensure the effectiveness of information transmission within the deep learning model, represented as: ; in, Indicates the first The residual connection representation between the output and input of a multi-head attention layer. Indicates the first Multi-head self-attention layer computation The joint output of the correlation between them Indicates the first Input from a multi-head attention layer; Furthermore, to effectively integrate the fault features extracted from multiple angles by the multi-head self-attention layer, each multi-head self-attention layer is followed by a forward propagation network consisting of two linear layers, represented as: ;in, This represents the output of the i-th forward propagation network layer. Represents the activation function layer. This represents the parameter matrix of the second linear layer. This represents the parameter matrix of the first linear layer. This represents the feature space output by the (i-1)th multi-head self-attention layer. This represents the bias of the first linear layer. This indicates the bias of the second linear layer; Similarly, residual connections are added to the forward propagation network, represented as: A multi-head attention layer and a forward propagation network constitute an encoder layer, wherein, Indicates the first The output of each encoder layer, This indicates that the output of the i-th multi-head self-attention layer is forward-propagated. This represents the output of the i-th multi-head self-attention layer. In this embodiment, a fault information extraction module is constructed by superimposing multiple encoder layers, which are then combined with a classifier to form a non-stationary working condition neural network model based on the multi-head self-attention mechanism, thus obtaining the above-mentioned fault diagnosis model. Please refer to Table 1 below. The specific parameters of the model are shown in Table 1. The feature extraction module mainly consists of 6 encoder layers based on the multi-head self-attention mechanism and the forward propagation network. The classifier is composed of a fully connected network. Finally, a softmax layer is used to obtain the class prediction probability value of each sample.
[0038] Table 1. Parameters of the fault diagnosis model based on the multi-head self-attention mechanism layer
[0039] The input frequency domain sample length is 2560, which is divided into 5 subsequences of length 512. Each multi-head self-attention layer has 8 heads, and the dimensions of the Q and K sequences are set to 64. The forward propagation network consists of two fully connected layers and one activation function layer, with a median dimension of 2048. ReLU is used as the activation function. Residual connections are added to each multi-head self-attention layer and the forward propagation network layer to prevent gradient vanishing. After the features are output from the sixth encoder layer, they are expanded through a flattening layer, and finally, the fault features are input into the classifier to obtain the predicted probabilities of each category. The neural network parameters are randomly initialized in stage 0.
[0040] S300 uses the training set data from Task 0 to train the fault diagnosis model and uses the test set data from Task 0 to validate it, saving the weight parameters of the best model. As model parameters for stage 0; Specifically, The samples are randomly divided into small batches and input into the fault diagnosis model in batches. The average loss of each batch is calculated using the cross-entropy loss function; the formula for the cross-entropy loss function is: ;in, Represents the cross-entropy loss function. This represents the student model's predicted label for the sample. This represents the true label of the sample. This indicates the number of samples in each batch. This indicates the first data in each batch. The true label of each sample This indicates the first data in each batch. The model extracts predicted labels for each sample; the optimizer minimizes the loss function through backpropagation, while the encoder layer adaptively adjusts the weight relationships between subsequences to achieve stable and efficient feature extraction; after training, the model parameters are saved. .
[0041] S400, forward propagation training set Furthermore, a dynamic selection strategy based on feature space sensitivity analysis is used to select exemplary samples and save them as Task 0 examples. This embodiment achieves the preservation of knowledge data at the level of old tasks by designing a dynamic screening sample paradigm strategy that compares and evaluates the sensitivity of the feature space. Specifically, step S400 includes: S401, Construct the sample feature space. After the model in stage t has completed training on task t, propagate all training samples forward. The feature space of each sample is represented as follows: ;in, This represents the i-th sample of fault class k in the training dataset for task t. Indicates sample The average feature space, This represents the model parameters after training on task t, where n represents the number of encoder layers. This represents the samples output by each encoder layer. The feature space; S402, Calculate the feature space centroids of various fault samples in task t. Since the sample selection process is performed separately for each type of fault, the feature space centroids of the samples for each type of fault are calculated separately, as follows: ;in, Let the centroid of the feature space of the k-th type of fault sample in task t be denoted as . This represents the number of samples for fault category k in task t; S403, Dynamic screening of sample examples based on feature space sensitivity analysis, evaluates the distance of each sample's feature space from the sample itself based on the centroid of the feature space of each category; the sample screening formula is: ; in, This represents the d-th instance selected from the k-th type of fault samples in task t. This represents iterating through all samples of the k-th type of fault and returning the result that... The sample with the smallest value is taken as the d-th instance. Describing the vector norm, Let represent the centroid of the feature space of the k-th type of fault sample in task t, and d represent the order of the selected samples. ,in This represents the total number of examples that need to be filtered out from the k-th type of fault samples. Indicates sample The average feature space, This represents the i-th instance of the k-th type of fault sample in the selected task t. express The average feature space; All task examples are represented as follows: ;in, This represents all instances of the selected task t. This represents an example of a type 1 fault sample in task t. This represents an example of the k-th type of fault sample in task t. This represents an example of the c-th type of failure sample in task t; Therefore, after completing step S300, the model parameters in step S300 are frozen. , in turn The samples are re-inputted into the model, and the feature space of each sample is recorded. ; Calculate the feature space centroid of each category of samples using step S401. Then, using steps S402 and S403, the samples are iteratively filtered and saved as example samples for Task 0. .
[0042] S500: When a new non-stationary operating condition fault diagnosis task occurs, the model enters stage 1. Stage 1 and subsequent stages are defined as incremental learning stages. Fault data of rotating machinery under the second non-stationary operating condition is collected as task 1 data. Only the operating condition of rotating machinery is changed, and step S100 is repeated to collect one-dimensional time-series fault data under the new operating condition. Data preprocessing, data truncation and data segmentation are performed on the data under the new operating condition.
[0043] S600 utilizes the saved model parameters from stage 0. Initialization Phase 1: Model; Set model parameters The parameters are assigned to two models, one of which is frozen as the teacher model and the other as the student model. In subsequent training and updates, only the student model parameters are updated.
[0044] S700 utilizes a joint cross-classifier knowledge distillation loss constructed using teacher and student models; Knowledge distillation is a technique that transfers knowledge from the teacher model to the student model by constraining the output of the student model and the output of the teacher model. When learning a new task, the model that retains the knowledge of the old task is used as the initial model and teacher model when training the new task. This allows the model to maintain its diagnostic ability for the old task while learning the new task. Specifically, step S700 includes: S701 softens the output distributions of the teacher and student models. Adding a temperature coefficient to the output distributions of both models softens the prediction distribution, helping the student model learn deeper knowledge from the teacher model. The softening formula is expressed as: ;in, This represents the predicted probability of the diagnostic model for fault category i. This represents an exponential function with the natural constant as its base. This represents the original output value (logits) of the diagnostic model for fault category i. This represents the raw output value of the diagnostic model for fault category j, where j = 1, 2, ... , This represents the total number of fault categories predicted by the model. This represents the temperature coefficient. A suitable temperature coefficient can smooth the output distribution of the teacher model and help the student model better learn the relationships between the categories in the teacher model. S702, Knowledge Distillation of Cross-Classifiers; For teacher and student models, the prediction sequence obtained by inputting the feature space extracted by the feature extractor of one model into the classifier of the other model is called the cross-classifier prediction sequence. For example, the prediction sequence obtained by inputting the feature space extracted by the feature extractor of the student model into the classifier of the teacher model is called the cross-classifier prediction sequence. Traditional knowledge distillation methods limit the distance between the prediction sequences of the student model and the teacher model, generally by calculating the KL divergence. The knowledge distillation loss formula is expressed as: ; in, This represents the knowledge distillation loss function of the cross-classifier. This represents the softened prediction sequence of the student model. This represents the softened prediction sequence of the teacher model. Indicates the temperature coefficient. It can compensate for gradient scaling. Indicates batch size. This represents the total number of fault categories predicted by the model. Indicates the i-th fault; S703, Construct the knowledge distillation loss function for the joint cross-classifier; Through the loss function... While effective transfer of knowledge from the teacher model to the student model can be achieved, the classifier parameters of the student model are not optimized during backpropagation, which affects the training of the student model to some extent. Therefore, this embodiment proposes a joint cross-classifier knowledge distillation loss function, expressed as: ;in, This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model. This represents the teacher-student cross-classifier prediction sequence generated after inputting the feature space extracted from the teacher model into the classifier of the student model. This represents the student-teacher cross-classifier prediction sequence generated after inputting the feature space extracted from the student model into the classifier of the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequences of the student model and the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequence from the teacher-student cross-classifier and the predicted sequence from the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the student-teacher cross-classifier prediction sequence and the teacher model prediction sequence. This represents the first weighting coefficient. This represents the second weighting coefficient. Indicates the third weighting coefficient; Therefore, after completing step S600, the training samples of Task 1 are... The inputs are fed into the teacher model and the student model respectively, and the output sequences of the teacher and student models are obtained. and The feature spaces output by the feature extraction modules of the teacher model and the student model are input into the classifiers of the student and teacher models, respectively, to obtain the cross-classifier prediction sequences. and ; calculate using step S701 respectively , and and Distillation loss between , and The knowledge distillation loss function of the joint cross-classifier is constructed through step S702.
[0045] S800, Construct the total loss function Train the student model, then validate the model using the test set data of Task 0 and Task 1, and save the weight parameters of the best model as the model parameters for Stage 1. For Phase 1 and any subsequent incremental learning phase The total number of training samples is In this embodiment, the number of old task examples saved is far less than that of new task samples. To mitigate the imbalance between old and new task samples, each batch of data during training includes data from all tasks, allocated according to a certain ratio. Except for the replay sample examples, a new loss function is constructed to better preserve knowledge from old tasks, expressed as: ;in, Represents the total loss function. The weight coefficients representing the cross-entropy loss term. This represents the cross-entropy loss calculated using the student model to compare the predicted labels with the true labels of the samples. This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. Indicates the predicted label of the sample. This represents the true label of the sample. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model; By fusing the cross-entropy loss function with the joint cross-classifier knowledge distillation loss function, the student model can learn new tasks while retaining knowledge of old tasks during the incremental learning phase; and the model parameters are saved after Phase 1 training is completed. And using the test data from Phase 1 Verify the accuracy of the student model on each task, which is equal to the accuracy of fault diagnosis.
[0046] S900: Forward propagation of Task 1 samples, and selection of exemplary samples using a dynamic selection strategy based on feature space sensitivity analysis, saving them as examples for Task 1; freezing the model parameters in step S800, and sequentially processing the training samples of Task 1. Re-input into the model and record the feature space of each sample. Step S402 is used to calculate the centroid of the feature space for each category of samples. Then, step S403 is used to iteratively filter and save the samples as example samples for Task 1. .
[0047] S1000: After a new non-stationary operating condition fault diagnosis task appears again, the model enters stage 2, collecting fault data of the rotating machinery under the third non-stationary operating condition as task 2 data; only the operating condition of the rotating machinery is changed, and S100 is repeated to collect one-dimensional time-series fault data under the new operating condition, and S600 to S900 are repeated to complete the fault diagnosis of stage 2; the fault diagnosis of the remaining stages is repeated in sequence.
[0048] Furthermore, to verify the multi-task incremental learning capability of this embodiment under non-stationary operating conditions of rotating machinery, the following experiments were conducted. The test bench is as follows: Figure 2 As shown, the test bench consists of a motor, a torque sensor, a two-stage parallel gearbox, and a vibration sensor; the gear module is 1.5mm, the tooth surface width is 10mm, the sampling frequency of the vibration sensor is 12.8kHz, and the acquisition time for each experiment is 60 seconds; the accuracy of the model is verified by selecting data from five different gear faults and one healthy gear, and the detailed fault type settings are shown in Table 2.
[0049] Table 2 Fault Types and Label Settings
[0050] Furthermore, the dataset contains gearbox data under various variable speed and load conditions. In this embodiment, data from three time-varying speed conditions—10 Nm torque and speeds of 0-500-1000 rpm, 0-1500-2000 rpm, and 0-2500-3000 rpm—are selected as the three tasks for sequential learning. The time-varying speed curves for the three conditions are shown below. Figure 3 As shown, taking a speed of 0-500-1000rpm as an example, during the first 0-10 seconds of equipment operation, the speed is uniformly accelerated from 0rpm to 1000rpm. Between 10-20 seconds, the equipment speed is maintained at 1000rpm. Between 20-25 seconds, the speed is uniformly decelerated from 1000rpm to 500rpm and remains stable between 25-35 seconds. Between 35-40 seconds, the equipment is uniformly accelerated to 1000rpm and maintained for 50 seconds. After that, it is uniformly decelerated to 0rpm between 50-60 seconds. Because the amplitude of the vibration signal decays to near 0 rpm during the initial and final operation phases of the equipment, and the fault information becomes blurred, only vibration data within the range of 1.5s to 56.5s is retained. A sliding sampling window with a window length of 5120 points is used to truncate the time domain data, with a sliding step size of 2560 points. The task distribution for each stage is shown in Table 3. As the stage increases, new tasks are constantly generated, and the model needs to continuously learn new tasks and maintain excellent diagnostic performance on all tasks. The total number of samples for each task is 4932, the original sample length is 5120, and the sample length after conversion to frequency domain information is 2560.
[0051] Table 3 Task settings under non-stationary operating conditions
[0052] Furthermore, the training set for each task consists of 3600 samples, and the test set consists of 1332 samples. After training for each task, 24 examples are retained for each fault category. The batch size is 36, the epoch is set to 200, and gradient tuning is performed using the SGD optimizer. The learning rate in the initial stage is set to 0.001 with a decay rate of 0.99, and the learning rate in subsequent incremental stages is set to 0.0002. The weight alpha in the total loss function is 0.9991. To improve distillation efficiency and smooth the output of the teacher model, the temperature coefficient of the knowledge distillation term is set to T=2. In the incremental stage, the number of new task samples in each batch is set to 24, and the remaining 12 consist of samples from the old tasks. For example, in the Phase 2 training batch, the training samples for task 2 account for 24, and the examples for task 0 and task 1 each account for 6.
[0053] Furthermore, to better evaluate the comprehensive diagnostic performance of the fault diagnosis model during incremental learning and the forgetting rate of old tasks, this embodiment introduces two metrics for evaluating the model: (a) Average Accuracy (Accs): The average accuracy of the model on all tasks in stage i (i>=1) is used as the metric Accs to evaluate the comprehensive performance of each method at each stage. Its mathematical expression is: ;in, (a) Diagnostic accuracy of the model for task n in stage i; (b) Backward transfer rate (BWT): Backward transfer rate is a widely used indicator for evaluating the forgetting rate of a model for old tasks, expressed as: ;in, BWT represents the diagnostic accuracy of the model for task i in stage i. The theoretical range of BWT is [-1, 1]. When BWT > 0, it means that the model has improved its diagnostic accuracy on the old task by learning the new task. When BWT = 0, it means that learning the new task will not cause the model to forget the old task. When BWT < 0, it means that the model has forgotten the old task after learning the new task. The smaller the BWT, the more the model forgets the old task.
[0054] Furthermore, to verify the superiority of the fault diagnosis method in non-stationary operating condition diagnosis, this embodiment not only compares with joint training methods that characterize the upper limit of model capabilities, but also with existing incremental learning-based fault diagnosis methods, such as the LwF algorithm and the IL-VOC algorithm. An ablation experiment control group is also set up. The baseline model is a basic diagnostic model without any incremental learning methods; the sample replay + baseline model adds old task example replay to the baseline model; and the knowledge distillation + baseline model adds a joint cross-classifier knowledge distillation method to the baseline model. The obtained accuracy rates for each task and the average accuracy rates for each stage are shown in Table 4.
[0055] Table 4. Accuracy and average accuracy (Accs) of different methods under non-stationary variable operating conditions (%)
[0056] Because fault characteristics shift significantly under non-stationary operating conditions, the diagnostic difficulty increases considerably. Compared with the IL-VOC and LwF algorithms, the fault diagnosis method in this embodiment demonstrates significant superiority across all tasks. Notably, compared with the baseline model, sample replay + baseline model, and knowledge distillation + baseline model, the fault diagnosis method in this embodiment performs significantly better on the old tasks in the incremental phase, and has a higher average accuracy in phases 1 and 2, proving that it has better comprehensive diagnostic capabilities and knowledge retention capabilities for old tasks.
[0057] Furthermore, the inverse transfer rate (BWT) of each model in multi-task incremental learning under non-stationary conditions is as follows: Figure 4 As shown in the figure. Compared with this embodiment, the LwF algorithm and the IL-VOC algorithm still show relatively obvious knowledge forgetting. Compared with the baseline model, sample replay + baseline model and knowledge distillation + baseline model, the BWT value of this embodiment is higher and closer to the joint training, indicating that it has less forgetting of old tasks. At the same time, the BWT value of the sample replay + baseline model is higher than that of the knowledge distillation + baseline model, which is the same as the performance on stationary tasks, further confirming that the sample replay method is more effective than the joint cross-head knowledge distillation method in mitigating knowledge forgetting of old tasks. The training time and storage resource consumption required by different methods in the multi-task incremental learning process are shown in Table 5. As can be seen from the table, this embodiment has the advantages of short training time and small data storage space consumption in all three stages, proving the superiority of this embodiment in multi-task incremental learning under non-stationary conditions.
[0058] Table 5 Training time and resource consumption of different methods under non-stationary variable conditions
[0059] To further demonstrate the universality of the fault diagnosis method in this embodiment for multi-task incremental learning under steady operating conditions, the method was further applied to the diagnosis of constant speed fault data in a university bearing dataset. The motor bearing test bench consisted of a motor, a torque measurement shaft, and a rolling bearing module. An accelerometer collected vibration information at a sampling frequency of 64kHz. The dataset mainly included three fault categories: bearing health, inner race fault, and outer race fault. These were further subdivided into 32 fine-label faults based on the degree and form of damage. Twelve fault types, including both real fatigue damage and artificial damage, were selected for fault diagnosis experiments. The fault category settings are shown in Table 6. This dataset contained various steady-running conditions of the motor; therefore, the fault data was divided into three tasks according to different operating conditions, as shown in Table 7. Each time-domain vibration signal was truncated into non-overlapping samples of length 5120, with a total of 6000 samples for each task.
[0060] Table 6 Fault Types and Label Settings
[0061] Table 7 Task settings for each stage under stable operating conditions
[0062] Furthermore, the data for each task is divided into a training set and a test set, with 4800 samples in the training set and 1200 samples in the test set. After training for each task, 24 examples are retained for each fault category. The batch size is 30, and in the incremental phase, each batch contains 20 new task samples, with the remaining 10 consisting of samples from older tasks. For example, in the training batch of phase 2, 20 training samples are from task 2, and 5 examples each are from task 0 and task 1. The remaining settings are consistent with those in Example 1.
[0063] After conducting multi-task incremental learning experiments under stable operating conditions, the accuracy rates for each task and the average accuracy rates for each stage are shown in Table 8. Since stage 0 does not involve incremental learning, the accuracy rates of various methods are similar. However, in the subsequent incremental stages represented by stages 1 and 2, compared to incremental learning models such as the LwF algorithm and the IL-VOC algorithm, the fault diagnosis method in this embodiment not only demonstrates excellent accuracy on the new tasks learned in each stage, but also maintains high accuracy on the old tasks as new tasks are added. Compared to the other two incremental learning methods, there is no significant forgetting of old tasks. Compared to the baseline model, sample replay + baseline model, and knowledge distillation + baseline model, the fault diagnosis method in this embodiment still maintains the best performance, proving that sample replay and joint cross-head knowledge distillation effectively improve the performance of the baseline model in multi-task incremental learning problems under varying operating conditions.
[0064] Table 8. Accuracy and Accs (%) of different methods under steady operating conditions
[0065] The BWT values of each method during the incremental learning phase are as follows: Figure 5 As shown, compared to the LwF and IL-VOC algorithms, the fault diagnosis method in this embodiment exhibits the largest BWT value, indicating that it has the smallest forgetting of old tasks in stages 1 and 2. Furthermore, compared to the baseline model, sample replay + baseline model, and knowledge distillation + baseline model, the fault diagnosis method in this embodiment shows performance closest to joint training. The baseline model, due to the lack of any incremental learning measures, exhibits significant forgetting in stages 1 and 2. Compared to the knowledge distillation + baseline model, the sample replay + baseline model shows less forgetting, demonstrating that sample replay has a better effect on mitigating forgetting than the joint cross-head knowledge distillation method.
[0066] In summary, the results show that the fault diagnosis method provided by this invention achieves superior diagnostic accuracy and low back-transfer rate in multi-task incremental learning under both non-stationary and stationary operating conditions of rotating machinery. This invention requires no manual feature extraction and does not require operators to master complex advanced signal processing techniques. The entire diagnostic process is completed automatically without human intervention. It can automatically perform intelligent, efficient, and rapid data fusion and diagnosis of one-dimensional time-series data collected by rotating machinery under non-stationary operating conditions. Furthermore, it can achieve efficient multi-task incremental learning as the equipment's operating conditions change. It not only has a short training time but also occupies little data storage space, exhibiting better universality and operability, making multi-task continuous learning and diagnosis of rotating machinery under varying operating conditions more intelligent, convenient, and efficient.
[0067] In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0068] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery, characterized in that, include: In the initial stage, fault data under non-stationary operating conditions of rotating machinery is acquired and recorded as Task 0 data; To construct a fault diagnosis model, the data from Task 0 is divided into a training set and a test set. After training and validating the fault diagnosis model, the weight parameters of the best model are retained as the model parameters for the initial stage. Forward propagation of the training set for Task 0 data, select example samples and save them as Task 0 examples; When a new task appears for the first time, the process enters the incremental phase 1 and acquires new fault data under non-stationary operating conditions of rotating machinery, which is recorded as task 1 data and divided into training set and test set. The fault diagnosis model for incremental stage 1 is initialized using the model parameters from the initial stage; the fault diagnosis model for incremental stage 1 includes a teacher model and a student model. The training sets of the examples from Task 0 and the data from Task 1 are merged as the training data for incremental phase 1. The joint cross-classifier knowledge distillation loss of the fault diagnosis model in incremental stage 1 is constructed, and the student model is trained using the total loss function. The accuracy of the student model on each task is verified by using the test sets of task 0 and task 1, thus completing the fault diagnosis in incremental stage 1. After the nth new task appears, the process enters incremental phase n and repeats the process of the previous incremental phase to complete the fault diagnosis of incremental phase n.
2. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 1, characterized in that, The process of selecting an example sample and saving it as the task 0 example includes: Construct a sample feature space. After the fault diagnosis model in the initial stage has completed the training of the corresponding task, forward propagate all training samples to obtain the feature space centroids of various fault samples in the corresponding task. Based on the centroids of the feature space of various fault samples, the distance from the feature space of each sample to the centroid of the feature space of the corresponding category is evaluated, and all task examples of the corresponding task are obtained iteratively based on this distance.
3. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 2, characterized in that, In the process of constructing the sample feature space, the feature space of each sample is represented as follows: ;in, This represents the i-th sample of fault class k in the training dataset for task t. Indicates sample The average feature space, This represents the model parameters after training on task t, where n represents the number of encoder layers. This represents the samples output by each encoder layer. The feature space; And / or, in the process of obtaining the feature space centroids of various types of fault samples in the corresponding task, the feature space centroid of each type of fault sample is represented as: ;in, Let the centroid of the feature space of the k-th type of fault sample in task t be denoted as . This represents the number of samples for fault category k in task t.
4. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 3, characterized in that, The distance from the feature space of each sample to the centroid of the corresponding class feature space is expressed as: ; in, This represents the d-th instance selected from the k-th type of fault samples in task t. This represents iterating through all samples of the k-th type of fault and returning the result that... The sample with the smallest value is taken as the d-th instance. Describing the vector norm, Let represent the centroid of the feature space of the k-th type of fault sample in task t, and d represent the order of the selected samples. ,in This represents the total number of examples that need to be filtered out from the k-th type of fault samples. Indicates sample The average feature space, This represents the i-th instance of the k-th type of fault sample in the selected task t. express The average feature space; And / or, all of the above task examples are represented as follows: ;in, This represents all instances of the selected task t. This represents an example of a type 1 fault sample in task t. This represents an example of the k-th type of fault sample in task t. This represents an example of a fault sample of type c in task t.
5. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 4, characterized in that, The joint cross-classifier knowledge distillation loss for constructing the fault diagnosis model in incremental stage 1 includes: Add a temperature coefficient to the output distribution of the teacher and student models to soften the predicted distribution effect; The feature space extracted by the feature extractor of the student model is input into the classifier of the teacher model to obtain the cross-classifier prediction sequence; Construct a joint cross-classifier based on the knowledge distillation loss function; The knowledge distillation loss function of the joint cross-classifier is expressed as: ; in, This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model. This represents the teacher-student cross-classifier prediction sequence generated after inputting the feature space extracted from the teacher model into the classifier of the student model. This represents the student-teacher cross-classifier prediction sequence generated after inputting the feature space extracted from the student model into the classifier of the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequences of the student model and the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the predicted sequence from the teacher-student cross-classifier and the predicted sequence from the teacher model. This represents the knowledge distillation loss calculated using KL divergence between the student-teacher cross-classifier prediction sequence and the teacher model prediction sequence. This represents the first weighting coefficient. This represents the second weighting coefficient. This represents the third weighting coefficient.
6. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 5, characterized in that, In the process of training the student model using the total loss function, the total loss function is expressed as: ;in, Represents the total loss function. The weight coefficients representing the cross-entropy loss term. This represents the cross-entropy loss calculated using the student model to compare the predicted labels with the true labels of the samples. This represents the knowledge distillation loss of the joint cross-classifier constructed using the prediction sequences of the teacher model and the student model, as well as the prediction sequences of their cross-classifiers. Indicates the predicted label of the sample. This represents the true label of the sample. This represents the predicted sequence of the student model. This represents the prediction sequence of the teacher model.
7. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 6, characterized in that, The fault diagnosis model is a fault diagnosis model based on a multi-head self-attention mechanism layer. The construction of the fault diagnosis model includes: After constructing the self-attention mechanism and the multi-head attention mechanism, residual connections are added; After each multi-head self-attention layer, a forward propagation network consisting of two linear layers is connected, and residual connections are added to the forward propagation network; An encoder layer is formed by combining a multi-head attention layer with a feedforward network. By stacking multiple encoder layers, a fault information extraction module is constructed. This module is then combined with a classifier to form a non-stationary neural network model based on a multi-head self-attention mechanism. This neural network model is the fault diagnosis model.
8. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 7, characterized in that, After acquiring fault data under non-stationary operating conditions of rotating machinery in the initial stage, the process also includes: After cleaning the fault data of the rotating machinery under non-stationary operating conditions in the initial stage, the data is truncated and converted to the frequency domain to obtain the frequency domain information of task 0. The frequency domain information of task 0 is divided into training set and test set.
9. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 8, characterized in that, The weight parameters that retain the optimal model as the initial model parameters include: The samples in the training set of Task 0 data are randomly divided into small batches and input into the fault diagnosis model in batches. The average loss of each batch is obtained by using the cross-entropy loss function. The optimizer minimizes the loss function through backpropagation, while the encoder layer achieves feature extraction by adaptively adjusting the weight relationship between each subsequence; after training, the model parameters are saved.
10. The multi-task incremental learning fault diagnosis method for non-stationary operating conditions of rotating machinery according to claim 9, characterized in that, The cross-entropy loss function is expressed as: ;in, Represents the cross-entropy loss function. This represents the student model's predicted label for the sample. This represents the true label of the sample. This indicates the number of samples in each batch. This indicates the first data in each batch. The true label of each sample This indicates the first data in each batch. Predicted labels for each sample.