Gearbox incremental fault diagnosis learning method based on task prediction
By using the combined loss and combined distillation loss functions in the incremental fault diagnosis of gearbox, combining cross entropy loss and comparison loss, the feature extraction target is adjusted, and the problem of insufficient feature extraction capability when the fault data is insufficient is solved, and the classification accuracy is improved and anti-forgetfulness.
Patent Information
- Application Number
- CN202411275929.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-01-07
AI Technical Summary
The existing gearbox incremental fault diagnosis method based on neural networks is insufficient when the fault data is insufficient, the feature extraction ability is insufficient, the training is not ideal, and there are normalization problems in the nearest neighbor classification prediction process.
Using the gearbox incremental fault diagnosis learning method based on task prediction, using the joint loss function and the joint distillation loss function, combining the cross entropy loss function and the contrast loss function, introducing distance measurement and feature similarity, adjusting the weight of the contrast loss term, through Task prediction narrows the scope of classified prediction and improves accuracy.
With the small amount of data, better explore public features, improve the model's feature extraction ability and classification accuracy, reduce calculation errors, reduce model forgetting, and improve anti-forgeting ability.
Smart Images

Figure CN119272215A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault diagnosis, and in particular to a gearbox incremental fault diagnosis learning method based on task prediction. Background Art
[0002] Fault diagnosis technology can assist in troubleshooting during industrial production processes, accelerate the recovery of industrial production capacity, and reduce safety accidents and their subsequent risks. Therefore, the development of fault diagnosis technology has also attracted much attention, especially in industries that need to work for a long time in high-load, high-risk environments.
[0003] In recent years, artificial intelligence technology has developed rapidly, and a large number of fault diagnosis methods based on neural networks have been developed, and have achieved excellent results in experimental tests of data sets. Even though these methods have problems such as low interpretability, they stand out from traditional fault diagnosis methods and fault diagnosis methods based on traditional machine learning due to their excellent performance in experiments, low manpower consumption, and simplicity.
[0004] The patent publication number is CN118395252A for the gearbox incremental fault diagnosis learning method based on adaptive distillation. The loss function uses contrast loss, contrast distillation loss and adaptive distillation loss, which can mine rich feature information. However, due to the small amount of data in the fault diagnosis data set itself, the contrast loss is difficult to fully play its role and even damages the feature extraction ability of the neural network. Summary of the invention
[0005] In view of the shortcomings of the existing methods, the present invention solves the problem that when the fault data is insufficient in the LLMFD-AD model, the contrast loss will be overused, resulting in insufficient feature extraction capability of the model and unsatisfactory training; and the normalization problem of the model in the nearest neighbor classification prediction process.
[0006] The technical solution adopted by the present invention is: a gearbox incremental fault diagnosis learning method based on task prediction comprises the following steps:
[0007] Step 1: Collect the gearbox fault vibration signal, add the fault type label, and build the fault gearbox fault data set;
[0008] Step 2: Use the joint loss function to train the initial task model, combine the cross entropy loss function with the contrast loss function, make the playback samples participate in the calculation of the contrast loss value, and increase the weight of the playback samples in the loss value calculation; introduce distance measurement to make the features extracted from the same samples close in distance; use the feature similarity between tasks to adjust the weight of the contrast loss term;
[0009] As a preferred embodiment of the present invention, the formula of the joint loss function is:
[0010]
[0011] Among them, α1 and α2 are hyperparameters; S cur The dataset used for training in the current stage; is the playback sample set of task stage t-1; is the classification prediction result output by the linear classifier at task stage t; y is the fault type label after one-hot encoding; s(S yc ) is the fault data and playback sample set at stage t The mean similarity between i is the same sample set as the i-th sample; |P i | is the total number of similar samples of the i-th sample; τ is a hyperparameter; z is the eigenvalue of the fault data after normalization by the stage 0 model; i, j, k are all sample labels.
[0012] Step 3: Calculate the feature similarity between the fault data at task stage t and the playback samples representing the fault data at the previous t task stages; And playback sample set The fault data is merged and the task stage t model is trained using the comprehensive loss function;
[0013] As a preferred embodiment of the present invention, the formula of the comprehensive loss function is:
[0014]
[0015] in, is the joint loss function, is the joint distillation loss function.
[0016] As a preferred embodiment of the present invention, the formula of the joint distillation loss function is:
[0017]
[0018] in, is the feature similarity distillation loss value, β1 and β2 are hyper parameters; It is the classification prediction result output by the linear classifier in the t-1 task stage.
[0019] Step 4: Using the cross entropy loss function Train the linear classifier in the test phase;
[0020] Step 5: Input the fault data to be diagnosed into the final task stage model, i.e., the task stage T model, to obtain the feature value of the fault data; input the feature value into the linear classifier to obtain the classification prediction result; calculate the cosine similarity of the class feature center of the fault data and each type of playback sample, extract the task identifier corresponding to the class with the largest similarity and encode it to obtain the task prediction result;
[0021] As a preferred implementation of the present invention, the formula for task prediction result is:
[0022]
[0023] Among them, μ j is the feature center of the j-th class sample; C is the total number of categories, enc(·) is the encoding, and sim() is the cosine similarity function.
[0024] Step 6: Perform a Hadamard product between the classification prediction result and the task prediction result to obtain the final classification result;
[0025] As a preferred embodiment of the present invention, the formula for the final classification result is:
[0026]
[0027] Among them, λ1 and λ2 are hyperparameters; is the classification prediction result; p t is the task prediction result; ⊙ is the Hadamard product.
[0028] Beneficial effects of the present invention:
[0029] 1. The present invention uses joint loss and joint distillation loss in the training process. Compared with the simple use of contrast loss, when the amount of data is small, it can better and more mine the common features of the data according to the similarity between tasks, and find a better starting point for the training of the subsequent task stage; the existence of common features not only has a role similar to pre-training, which helps the learning of tasks and improves the accuracy; but also allows the model to focus on the features that play an important role, and limits parameter modification during the training process to retain the common features, and better resist the forgetting of the model; the distance measurement is introduced, requiring the features extracted from the same samples to be close in distance to ensure that the features are more representative; the joint distillation loss and the joint loss can fully cooperate to better play their respective roles;
[0030] 2. Task prediction determines in advance the tasks to which the faulty samples may belong, thereby narrowing the scope of classification prediction and reducing the possibility of the linear classifier misclassifying old class faulty samples as new classes, thereby improving accuracy. Task prediction uses similarity as a measurement standard, and does not require data comparability conversion for various features of the input classifier. There is no need for additional normalization, and there is no need for small number division calculations in calculations, thereby reducing calculation errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of the gearbox incremental fault diagnosis learning method based on task prediction of the present invention. DETAILED DESCRIPTION
[0032] The present invention is further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner, and therefore it only shows the components related to the present invention.
[0033] like Figure 1 As shown, a gearbox incremental fault diagnosis learning method based on task prediction includes the following steps:
[0034] Step 1: Put the gearbox into different fault states to work, collect its vibration signals, and add fault type labels according to the fault states during operation to form a fault data set of the faulty gearbox;
[0035] The method for constructing the fault data set of the faulty gearbox is the same as that in CN118395252A, and will not be repeated here.
[0036] Step 2: Define the task currently being trained as t, t=0 is the initial task stage, t=1, 2, 3 are the subsequent task stages, and the final task stage T, that is, t=3 is the final task stage. In the 0th task stage, to complete the training of task 0, add a projection layer and a linear classifier (softmax) at the end of the ResNet18 network to facilitate the contrast loss and cross entropy loss. The ResNet18 network, the projection layer and the linear classifier together constitute the model of task stage 0 (referred to as the initial task model), and initialize the initial task model; input the fault data into the initial task model, and three data can be obtained, namely, the eigenvalue output by the ResNet18 network itself, the projected eigenvalue output by the projection layer, and the classification prediction result output by the linear classifier.
[0037] Use the training sample set of task stage 0 Train the initial task model and obtain the fault data feature values output by the model Projection layer eigenvalues And the classification prediction results Among them, θ is the parameter of the ResNet18 network, φ is the parameter of the projection layer, and the loss function of the initial task model is the joint loss function The formula is:
[0038]
[0039] in, is the playback sample set of task stage t, when t = 0 is an empty set; s(S yc ) is the fault data and playback sample set at stage t The mean similarity between them is 0 when t=0, that is, when it is in task stage 0; α1 and α2 are hyperparameters, both set to 1; And normalized, x is the image sample converted from the fault sample; when t = 0, z is the eigenvalue of the fault data after normalization through the stage 0 model; i, j, k are all sample labels; is the 512-dimensional feature value output by the ResNet18 network in the model of sample x task stage t; for The 128-dimensional projected feature values output by the projection layer in the model of task stage t are normalized; τ is a hyperparameter set to 0.5; S cur is the dataset used for training in the current stage, and in the initial task stage S cur | is the total number of samples in the dataset used for training in the current stage; P i is the same sample set as the i-th sample, |P i | is the total number of similar samples of the i-th sample; is the classification prediction result output by the linear classifier in task stage t, and y is the fault type label after one-hot encoding.
[0040] The present invention combines the cross entropy loss function The asymmetric contrast loss function is no longer used, so that the playback samples can also participate in the calculation of the contrast loss function value, which indirectly increases the weight of the playback samples in the loss value calculation; in addition, the distance measurement || Z is introduced i -Z j ||, requiring the features extracted from the same samples to be close in distance to ensure that the features are more representative; finally, the feature similarity s(S yc ), further adjust the weight of the contrast loss term so that the model can adjust the feature extraction target according to the specific situation.
[0041] After the training is completed, it is necessary to select some data in the initial task model as playback samples. The herding algorithm of publication number CN118395252A can be used for selection, which will not be described here.
[0042] Step 3: At the t-th task stage of the subsequent task stage, i.e., when t=1, 2, 3, first calculate the feature similarity between the fault data of task stage t and the playback samples representing the fault data of task stage t-1;
[0043] The feature similarity formula can be adopted from s(Syc ), I will not repeat it here.
[0044] In the tth task stage, the training data of task stage t is And playback sample set The fault data of are combined to train the task stage t model. The comprehensive loss function of the t-th task stage model is as follows:
[0045]
[0046] in, is the joint loss function, is the joint distillation loss function.
[0047] Joint Distillation Loss Function The formula is:
[0048]
[0049] in, is the feature similarity distillation loss value, β1 and β2 are hyperparameters, both set to 1. It is the classification prediction result output by the linear classifier in the t-1 task stage.
[0050] The training process of the t-th task stage can adopt the training process in Publication No. CN118395252A and will not be repeated here;
[0051] The loss function of the t-th task stage model in the CN118395252A patent is the contrast loss value Feature similarity distillation loss value Adaptive distillation loss value sum.
[0052] This patent uses a contrast loss function Although calculating the loss value can enable the model to extract more features, the computational complexity is high. The back propagation process of the neural network involves many parameters, and more samples need to be input to make the parameter update direction and size more accurate. Due to the small amount of fault diagnosis data, the possibility of extracting wrong features or redundant features is increased. In addition, due to the use of an asymmetric contrast loss function, the model fails to extract the features of old fault samples.
[0053] Adaptive Distillation Loss Function Although the distillation intensity can be reduced when the similarity between new and old tasks is high, the ability of knowledge transfer is also reduced. When there are fewer fault samples, allowing parameters to be updated to a greater extent may lead to insufficient model training, making it difficult to achieve the goal of reducing forgetting while better distinguishing similar faults.
[0054] The distillation aspect of the present invention introduces a distillation loss function based on cross entropy to form a joint distillation loss function With joint loss The cross entropy loss function and its optimization process correspond to each other, and they can fully cooperate to guide the classification results output by the model to be similar to the previous ones while retaining the model's feature extraction ability, thus retaining the model's classification ability.
[0055] Step 4: Construct a test phase linear classifier containing a linear transformation layer, the output dimension is consistent with the total number of fault categories included in all tasks, and its value is 8 in this specific embodiment; the final task stage, that is, t=3 task stage, is also recorded as task stage T, and the training data of this stage is input into the resnet18 network obtained after the training of this task stage is completed, the characteristic value of the fault data is obtained, and this characteristic value is input into the test phase linear classifier, and the test phase linear classifier is trained using the cross entropy loss function.
[0056] The process of training and testing the linear classifier uses the cross entropy loss function The method is the same as that in CN118395252A and will not be described again.
[0057] Step 5: Input the fault data to be diagnosed into the feature extraction network obtained after the training of the final task stage, that is, the ResNet18 network saved after the training of the t=3 task stage, to obtain the characteristic value h of the fault data; input h into the linear classifier to obtain the classification prediction result Calculate the cosine similarity between the fault data and the class feature centers of various playback samples, extract the task identifier corresponding to the class with the largest similarity and encode it to obtain the task prediction result p t , specifically:
[0058]
[0059] Among them, μ j is the feature center of the j-th sample; C is the total number of categories, enc(·) is the code, indexing the task identifier to which the fault category belongs, and setting the element value of the position corresponding to the label of all fault categories contained in the task to 1.6, and the values of the remaining elements are set to 1. The task identifier has the same meaning as the task stage.
[0060] Step 6: Take the Hadamard product of the classification prediction result and the task prediction result to obtain the final classification result. The formula is:
[0061]
[0062] Among them, λ1 and λ2 are hyperparameters, both set to 1. is the classification prediction result, p tPredict the result for the task, is the final classification prediction result, and ⊙ is the Hadamard product.
[0063] In the publication number CN118395252A, the nearest neighbor classification prediction result is used And the classification prediction results Sum the hyperparameters; this method uses Euclidean distance to determine whether the fault sample is a certain fault type. When the feature centers of each fault type are unevenly distributed, the possibility of misjudgment will increase, and the difference in the distribution range of the features of each fault type will also amplify this defect.
[0064] The present invention uses similarity as a measurement standard, without additional normalization requirements, and does not need to perform division calculations of small numbers in calculations, thereby reducing calculation errors. In addition, the task is predicted based on similarity instead of predicting a certain fault type, which reduces the difficulty of prediction. In a class incremental scenario, fault diagnosis can be made closer to fault diagnosis in a task incremental scenario, thereby indirectly improving the diagnostic accuracy.
[0065] Experimental process:
[0066] Conduct different incremental scenarios and ablation experiments;
[0067] Table 1 Comparison of experimental results under different incremental scenarios
[0068]
[0069] Among them, the method of CN118395252A is referred to as LLMFD-AD. Table 1 uses a test set for experimental testing, and calculates the average accuracy of the fault diagnosis of the model in the class increment and task increment scenarios to verify the effect of the gearbox fault diagnosis model. The learning rate is set to 0.01, and the number of playback samples is limited to 160; the number of training epochs in the initial task stage is 500, and the number of training epochs in the subsequent task stage is 200. The parameter settings in the function are no longer repeated. Compared with some other lifelong learning models, the average accuracy of the fault diagnosis of the model of the present invention in both class increment and task increment scenarios is higher, and the anti-forgetting ability is stronger.
[0070] Table 2 Task prediction ablation experiment
[0071]
[0072] As shown in Table 2, an ablation experiment was conducted, and the experimental settings were consistent with the settings of the corresponding experiments in Table 1. Through the ablation experiment, it can be found that task prediction can provide task identification, narrow the scope of classification prediction, and improve accuracy. If there is a more reliable task prediction scheme, it is expected that the average diagnosis accuracy in the class increment scenario will be improved to be consistent with that in the task increment scenario.
[0073] Table 3 Joint loss function hyperparameter experiment
[0074]
[0075] As shown in Table 3, experiments were conducted on the influence of hyperparameters in the joint loss. The experimental settings are consistent with the settings of the corresponding experiments in Table 1. Through the experiments, it can be found that the two items in the joint loss function are insufficient when they work alone, and they can only play a greater role when they work together. In addition, due to data imbalance, the first loss term, the cross entropy loss term, is more unstable and has a lower diagnostic accuracy when it works alone. The second loss term, the contrast loss term, performs relatively well due to data enhancement and similarity weight.
[0076] Table 4 Joint distillation loss function hyperparameter experiment
[0077]
[0078] As shown in Table 4, an experiment was conducted on the influence of hyperparameters in the joint distillation loss. The experimental settings are consistent with the settings of the corresponding experiments in Table 1. Through the experiment, it can be found that the difference between the two distillation loss items is small, and the first loss item has better stability, and the second loss item has a higher average accuracy. The combination of the two can better improve the overall average accuracy and stability.
[0079] In actual production environments, there are often more and more types of faults, and the types are becoming more and more complicated. If traditional deep learning-based fault diagnosis methods want to overcome forgetting, they need to collect and save a large amount of old data, and spend a lot of time and resources to train the model. Using this method, only a small amount of old data needs to be saved, and less time and resources are spent, which can resist the catastrophic forgetting of traditional deep learning fault diagnosis methods at a lower cost.
[0080] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A gearbox incremental fault diagnosis learning method based on task prediction, characterized in that: The following steps are involved: Step 1: Collect the gearbox fault vibration signal, add the fault type label, and build the fault gearbox fault data set; Step 2: Use the joint loss function to train the initial task model, combine the cross entropy loss function with the contrast loss function, make the playback samples participate in the calculation of the contrast loss value, and increase the weight of the playback samples in the loss value calculation; introduce distance measurement to make the features extracted from the same samples close in distance; use the feature similarity between tasks to adjust the weight of the contrast loss term; Step 3: Calculate the feature similarity between the fault data at task stage t and the playback samples of the fault data at task stage t-1; And playback sample set The fault data is merged and the task stage t model is trained using the comprehensive loss function; Step 4: Use the cross entropy loss function to train the linear classifier in the test phase; Step 5: Input the fault data to be diagnosed into the task stage T model to obtain the characteristic value of the fault data; Input the feature value into the linear classifier to obtain the classification prediction result; Calculate the cosine similarity of the class feature centers of the fault data and various playback samples, extract the task identifier corresponding to the class with the largest similarity and encode it to obtain the task prediction result; Step 6: Perform a Hadamard product between the classification prediction result and the task prediction result to obtain the final classification result.
2. The gearbox incremental fault diagnosis learning method based on task prediction according to claim 1 is characterized in that: The formula of the joint loss function is: Among them, α1 and α2 are hyperparameters; S cur The dataset used for training in the current stage; is the playback sample set of task stage t-1; is the classification prediction result output by the linear classifier at task stage t; y is the fault type label after one-hot encoding; s(S yc ) is the fault data and playback sample set at stage t The mean similarity between i is the same sample set as the i-th sample; |P i | is the total number of similar samples of the i-th sample; τ is a hyperparameter; z is the eigenvalue of the fault data after normalization by the stage 0 model; i, j, k are all sample labels.
3. The gearbox incremental fault diagnosis learning method based on task prediction according to claim 1 is characterized in that: The formula of the comprehensive loss function is: in, is the joint loss function, is the joint distillation loss function.
4. The gearbox incremental fault diagnosis learning method based on task prediction according to claim 3 is characterized in that: The formula of the joint distillation loss function is: in, is the feature similarity distillation loss value, β1 and β2 are hyper parameters; It is the classification prediction result output by the linear classifier in the t-1 task stage.
5. The gearbox incremental fault diagnosis learning method based on task prediction according to claim 1 is characterized in that: The formula for task prediction results is: Among them, μ j is the feature center of the j-th class sample; C is the total number of categories, enc(·) is the encoding, and sim() is the cosine similarity function.
6. The gearbox incremental fault diagnosis learning method based on task prediction according to claim 1 is characterized in that: The formula for the final classification result is: Among them, λ1 and λ2 are hyperparameters; is the classification prediction result; p t is the task prediction result; ⊙ is the Hadamard product.
7. Gearbox incremental fault diagnosis learning system based on task prediction, characterized in that: include: a memory for storing instructions executable by a processor; A processor, configured to execute instructions to implement the gearbox incremental fault diagnosis learning method based on task prediction as described in any one of claims 1-6.
8. A computer readable medium storing a computer program code, characterized in that: When the computer program code is executed by a processor, the method for learning gearbox incremental fault diagnosis based on task prediction is implemented as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Gearbox incremental fault diagnosis learning method based on adaptive distillation
CN118395252A