Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty
By designing a sample filter based on uncertainty metrics under small sample conditions, the problem of insufficient generalization ability of the meta-learning fault diagnosis model under small sample conditions is solved, and effective identification and rejection of out-of-distribution data is achieved, enhancing The generalization ability of the model.
Patent Information
- Application Number
- CN202411599369.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-11
AI Technical Summary
In the prior art, under small sample conditions, there are boundaries in the generalization ability of the meta-learning fault diagnosis model, making it difficult to effectively identify unknown anomaly data outside the distribution.
A sample filter based on uncertainty metrics is designed to detect out-of-distributed data and provide a benchmark for rejection diagnosis, introduce rejection options to identify unknown anomaly data, and enhance the generalization ability of meta-learning fault diagnosis models.
By introducing sample filters with rejection options and uncertainty metrics, it is possible to reasonably reject the diagnosis of current monitoring samples, identify unknown anomalies outside the distribution, and significantly enhance the generalization ability of the meta-learning fault diagnosis model.
Smart Images

Figure CN119167210B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty, and belongs to the technical field of electrical data processing. Background Art
[0002] The Chinese invention patent application with publication number CN116049748 A discloses a small sample switch machine fault intelligent diagnosis method based on meta-learning, which includes: collecting and preprocessing small sample switch machine action current or power data; constructing a small sample switch machine fault diagnosis model with a Bayesian learning algorithm as a training framework and including a meta-learner and a basic learner; using the meta-training set to train the small sample switch machine fault diagnosis model to obtain an optimized meta-learner parameter distribution; adjusting the basic learner parameters to obtain a trained small sample switch machine fault diagnosis model; inputting the switch machine action current or power data to be diagnosed into the trained small sample switch machine fault diagnosis model to obtain a fault diagnosis result. However, although the meta-learning method can learn meta-knowledge through cross-task, it is limited by the small sample condition of the current task and its generalization ability is still limited. Summary of the invention
[0003] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty. The present invention designs a sample filter based on uncertainty measurement to solve the problem of out-of-distribution data detection and provide a benchmark for rejection diagnosis. It introduces rejection options for fault diagnosis models of bearings, gearboxes, motors, electric actuators, etc., so that they can reasonably reject the diagnosis of current monitoring samples and identify unknown abnormal data outside the distribution, rather than predicting an unreliable label, thereby enhancing the generalization ability of the meta-learning fault diagnosis model.
[0004] To achieve the above-mentioned object of the invention, the present invention provides a Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty, which comprises the following steps:
[0005] Step 1: Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks ;
[0006] Step 2: Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task ;
[0007] Step 3: For a given small sample of the target to be diagnosed , using a sample filter for the target diagnostic task Inferring a small sample of the target to be diagnosed Is it an unknown abnormal sample? If it is an unknown abnormal sample, end the reasoning and output the unknown abnormality as the result; if it is not an unknown abnormal sample, proceed to the next step;
[0008] Step 4: Obtain a small sample of the target to be diagnosed The prediction confidence , determine the prediction confidence Is it less than the threshold? , if it is less than the threshold , the diagnosis is rejected and manual treatment is triggered; if it is greater than or equal to the threshold , then proceed to the next step;
[0009] Step 5: Use the template to diagnose the model for the task Inferring a small sample of the target to be diagnosed Failure Mode , and take it as the confidence level not less than the threshold The diagnostic results are output.
[0010] Compared with the prior art, the Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty provided by the present invention has the following beneficial effects:
[0011] The present invention designs a sample filter based on uncertainty measurement to solve the problem of out-of-distribution data detection and provide a benchmark for rejection diagnosis, and introduces rejection options for fault diagnosis models of bearings, gearboxes, motors, electric actuators, etc., so that they can reasonably reject the diagnosis of current monitoring samples and identify unknown abnormal data outside the distribution instead of predicting an unreliable label, thereby enhancing the generalization ability of the meta-learning fault diagnosis model. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a flow chart of the Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty provided by the present invention.
[0013] Figure 2 It is a flow chart of training a Bayesian learner into a sample filter for a target diagnosis task provided by the present invention. DETAILED DESCRIPTION
[0014] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0015] First embodiment
[0016] Figure 1: is a flow chart of the Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty provided by the present invention, such as Figure 1 As shown, the Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty provided by the present invention includes the following steps:
[0017] Step 1: Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks ;
[0018] Step 2: Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task ;
[0019] Step 3: For a given small sample of the target to be diagnosed , using a sample filter for the target diagnostic task Inferring a small sample of the target to be diagnosed Is it an unknown abnormal sample? If it is an unknown abnormal sample, end the reasoning and output the unknown abnormality as the result; if it is not an unknown abnormal sample, proceed to the next step;
[0020] Step 4: Obtain a small sample of the target to be diagnosed The prediction confidence , determine the prediction confidence Is it less than the threshold? , if it is less than the threshold , the diagnosis is rejected and manual treatment is triggered; if it is greater than or equal to the threshold , then proceed to the next step;
[0021] Step 5: Use the template to diagnose the model for the task Inferring a small sample of the target to be diagnosed Failure Mode , and take it as the confidence level not less than the threshold The diagnostic results are output.
[0022] In the present invention, a sample filter for a target diagnostic task is used Inferring a small sample of the target to be diagnosed Whether it is an unknown abnormal sample, specifically to determine the small sample of the target to be diagnosed Whether it is an out-of-distribution (OOD) sample.
[0023] The present invention achieves the following beneficial effects through the above-mentioned technical scheme: the sample filter and the task adaptive balancing method together constitute a small sample diagnosis Bayesian meta-learning framework that incorporates uncertainty. This framework is independent of the specific network structure and can be combined with different meta-learning methods to enhance the credible diagnostic capabilities of data-driven models under small sample conditions.
[0024] Figure 2 : is a flow chart of training the Bayesian learner into a sample filter for a target diagnosis task provided by the present invention, such as Figure 2 As shown, for the Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks The steps include:
[0025] S1-01: Using initialization parameters Initialize the Bayesian learner Parameters Get the initial sample filter ;
[0026] S1-02 Sample Meta-Training Set The sample screening training set data vector of sample screening subtask i in And sample screening test set data vector ;
[0027] S1-03 Use the sample screening training set data vector of sample screening subtask i , the first hyperparameter and the second hyperparameter Bayesian learner Perform sample screening training and use sample screening test set data vector Test to obtain the loss function of sample screening subtask i , and filter the loss function of the subtask based on all samples Calculate the optimal parameters ;
[0028] S1-04: Calculate the error of each sample screening subtask i in the current meta-training ;
[0029] S1-05: Update according to the following formula , complete a meta-training:
[0030] ,
[0031] In the formula, Express The gradient of ; η is the learning rate of meta-training; The test set data vector is selected by samples Mapping to Bayesian learner The vector of the input layer; i=1,…,N, N is the total number of subtasks in the meta-training phase;
[0032] S1-06 Repeat steps S1-01 to S1-05 to perform meta-training of the sample filter. Perform sample screening verification on the filter until the stopping condition is reached, complete the meta-training of the sample filter, and obtain the optimal initialization parameters of the sample filter. .
[0033] In the present invention, the sample screening training set data vector of the sample screening subtask i is used , the first hyperparameter and the second hyperparameter Bayesian learner Perform sample screening training and use sample screening test set data vector Test to obtain the loss function of sample screening subtask i The specific steps include:
[0034] S1-03-1: Use the following formula to calculate the training loss;
[0035] ,
[0036] In the formula, To filter the training set data vector by samples Mapping to Bayesian learner The vector of the input layer; Bayesian learner Parameters; The input vector is , Bayesian learner The parameters are The output posterior probability is y; c is the fault mode; C is the total number of fault modes; When the failure mode is c The logarithmic function of ; is a symbolic function; About data expectations;
[0037] S1-03-2: The training set data vector of sample screening subtask i Labeled as abnormal sample label, use the sample to filter the training set data vector Perform unknown anomaly detection training and use the following formula to calculate the training loss: ,
[0038] In the formula, is the cross entropy, For uniform distribution; Represents data expectations;
[0039] S1-03-3: Use samples to filter test set data vectors Sample Filter Perform the test and calculate the test loss using the following formula :
[0040] ,
[0041] in, The test set data vector is selected by samples Mapping to Bayesian learner The vector of the input layer;
[0042] and Hyperparameters for balancing unknown anomaly detection loss and calibration loss; represents the adaptive static calibration error;
[0043] S1-03-4: Repeat steps S1-03-1 to S1-03-3 until all training tasks are sampled and the test loss of each sample screening subtask is obtained. .
[0044] In the present invention, the error of each sample screening task i in the current meta-training is calculated by the following formula: :
[0045] ,
[0046] In the formula, , N is the total number of tasks in the meta-training phase, T represents transposition, and h is the Bayesian learner The feature layer hidden vector.
[0047] In the present invention, the Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks The following steps are also included:
[0048] S1-07: Using a meta-training set Sample screening target training set data vector in As the in-distribution data, the meta-training set The training set data vector of the sample screening subtask i in As an abnormal sample, use the following formula to filter the sample Conduct on-task training;
[0049] ,
[0050] In the formula, Filter target set data vector for samples Mapping to Bayesian learner The vector of the input layer;
[0051] S1-08: Using a meta-test set Sample screening target validation set data vector in and meta-training set The validation set data vector of similar tasks in Evaluate to determine whether the training termination conditions have been met, and finally obtain the sample filter for the target diagnostic task .
[0052] Compared with the prior art, the present invention achieves the following beneficial effects through the above technical solution:
[0053] The Bayesian learner is trained as a sample filter for the target diagnosis task. Through cross-task episodic meta-learning, the model uses differential entropy to measure distribution uncertainty in the inner-layer training and adds the calibration error to the loss function to improve the judgment of unknown anomalies. In the outer-layer training, the cosine similarity between latent codes is measured in the feature space to adjust the differences between tasks, ultimately providing a benchmark for unknown anomaly detection and rejection diagnosis for the current task.
[0054] In the present invention, the Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task The steps include:
[0055] Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task The steps include:
[0056] S2-01 Use the current meta-training to initialize parameters Parameterized Bayesian Learner Parameters Get the diagnostic model ;
[0057] S2-02: In the meta-training set Above, the sampled diagnostic training set data vector and diagnostic test task data vector ;
[0058] S2-03: Pass Parameterized two-layer statistical encoder , get the task balance coefficient of diagnostic task T and failure mode balance factor ,in, , L is the Bayesian learner The number of layers; , C is the total number of failure modes; is the diagnostic training set data vector The vector that maps to the encoder’s input layer;
[0059] S2-04: Using diagnostic test task data vectors Calculate test loss :
[0060] ;
[0061] In the formula, The diagnostic test task set data vector Mapping to Bayesian learner The vector of the input layer; Bayesian learner Parameters; The input vector is , Bayesian learner The parameters are The output posterior probability is y; c is the fault mode; C is the total number of fault modes; is the vector of failure mode c The logit function of ; is a symbolic function; About data expectations;
[0062] S2-05: Using the Diagnostic Test Task Data Vector Update the Bayesian learner according to the following formula Parameters :
[0063] ,
[0064] In the formula, It means representing Hadamard; The current learning rate learned by Meta-SGD; Express The gradient of
[0065] S2-06: Repeat steps s2-02 to S2-05 until all training tasks are sampled and the diagnostic task T is obtained. ;
[0066] S2-07: Update according to the following formula , complete a meta-training;
[0067] ,
[0068] in, is the learning rate hyperparameter for meta-training, The error of the outer training for the diagnostic task T;
[0069] S2-08: Repeat steps S2-01 to S2-07 to perform meta-training of the diagnostic model and meta-validation The diagnostic verification is performed until the stop condition is reached and the , complete the meta-training of the diagnostic model and obtain the diagnostic model The optimal initialization parameters for , It represents the average accuracy of the interval.
[0070] In the present invention, the Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task The following steps are also included:
[0071] S2-09: Use optimal initialization parameters Initialize the diagnostic model Get the diagnostic model ; Use the meta-training set Sample screening target set data vector in As internal distribution data, the diagnostic model is obtained using the following formula Conduct in-mission training:
[0072] ,
[0073] S2-10 uses the meta-test set Sample screening target validation set data vector in Evaluate the diagnostic model to determine whether the termination conditions are met and whether ,Finally, the diagnostic model of the template diagnosis task is obtained ; Filter target set data vector for samples Mapping to Bayesian learner The vector of input layer.
[0074] In the present invention,
[0075] ,
[0076] In the formula, is the mean prediction confidence of failure mode c on the entire sample set; The real failure mode in the sample set is The number of samples, The hyperparameters that contribute to tuning the hard and easy samples, and ; ; ; and The samples are The predicted labels and confidences of As its real health status label, is the indicator function, Indicates falling The number of samples in the interval.
[0077] The present invention achieves the following beneficial effects through the above technical solution: it is used to balance the imbalance of different failure modes within a task and the differences between tasks in a cross-task meta-learning model. The method designs two statistical encoders at the failure mode level and the task level, and infers the distribution of task balance coefficients and failure mode coefficients through cross-task Bayesian meta-learning to obtain meta-knowledge about adaptive balance. Therefore, during diagnostic reasoning, the two coefficients are sampled to achieve task adaptive balance.
[0078] Second embodiment
[0079] A second embodiment of the present invention provides a computer program product, which includes a computer program code. The computer program code can be called by a processor to execute the method described in the first embodiment.
[0080] The beneficial effects of the second embodiment are the same as those of the first embodiment, and will not be described again here.
[0081] Third embodiment
[0082] A third embodiment of the present invention provides a computer storage medium for storing computer program codes, wherein the computer program codes can be called by a processor to execute the method described in the first embodiment.
[0083] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined. The meaning of "several" is one or more, unless otherwise clearly and specifically defined.
[0084] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A Bayesian meta-learning fault diagnosis generalization enhancement method under small sample uncertainty, characterized in that: The steps include: Step 1: Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks ; Step 2: Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task ; Step 3: For a given small sample of the target to be diagnosed , using a sample filter for the target diagnostic task Inferring a small sample of the target to be diagnosed Is it an unknown abnormal sample? If it is an unknown abnormal sample, end the reasoning and output the unknown abnormality as the result; if it is not an unknown abnormal sample, proceed to the next step; Step 4: Predict a small sample of the target to be diagnosed Confidence , judge the confidence Is it less than the threshold? , if it is less than the threshold , the diagnosis is rejected and manual treatment is triggered; if it is greater than or equal to the threshold , then proceed to the next step; Step 5: Use the template to diagnose the model for the task Inferring a small sample of the target to be diagnosed Failure Mode , and take it as the confidence level not less than the threshold The diagnostic result output is Among them, for the Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks The steps include: S1-01: Using initialization parameters Initialize the Bayesian learner Parameters Get the initial sample filter ; S1-02: Sampling Meta-Training Set The sample screening training set data vector of sample screening subtask i in And sample screening test set data vector ; S1-03: Use the sample screening training set data vector of sample screening subtask i , the first hyperparameter and the second hyperparameter Bayesian learner Perform sample screening training and use sample screening test set data vector Test to obtain the loss function of sample screening subtask i , and filter the loss function of the subtask based on all samples Calculate the optimal parameters ; S1-04: Calculate the error of each sample screening subtask i in the current meta-training ; S1-05: Update according to the following formula , complete a meta-training: , In the formula, Express The gradient of ; η is the learning rate of meta-training; The test set data vector is selected by samples Mapping to Bayesian learner The vector of the input layer; i=1,…,N, N is the total number of subtasks in the meta-training phase; S1-06: Repeat steps S1-01 to S1-05 to perform meta-training of the sample filter on the meta-validation set. Perform sample screening verification on the filter until the stopping condition is reached, complete the meta-training of the sample filter, and obtain the optimal initialization parameters of the sample filter. .
2. The method according to claim 1, characterized in that Sample screening training set data vector using sample screening subtask i , the first hyperparameter and the second hyperparameter Bayesian learner Perform sample screening training and use sample screening test set data vector Test to obtain the loss function of sample screening subtask i The specific steps include: S1-03-1: Use the following formula to calculate the training loss; , In the formula, To filter the training set data vector by samples Mapping to Bayesian learner The vector of the input layer; Bayesian learner Parameters; The input vector is , Bayesian learner The parameters are The output posterior probability is y; c is the fault mode; C is the total number of fault modes; When the failure mode is c The logit function of ; is a symbolic function; About data expectations; S1-03-2: The training set data vector of sample screening subtask i Labeled as abnormal sample label, use the sample to filter the training set data vector Perform unknown anomaly detection training and use the following formula to calculate the training loss: , In the formula, is the cross entropy, For uniform distribution; Represents data expectations; S1-03-3: Use samples to filter test set data vectors Sample Filter Perform the test and calculate the test loss using the following formula : , in, The test set data vector is selected by samples Mapping to Bayesian learner The vector of the input layer; and are the hyperparameters for balancing the unknown anomaly detection loss and the calibration loss, respectively; represents the adaptive static calibration error; S1-03-4: Repeat steps S1-03-1 to S1-03-3 until all training tasks are sampled and the test loss of each sample screening subtask is obtained. .
3. The method according to claim 2, characterized in that The error of each sample screening subtask i in the current meta-training is calculated by the following formula : , In the formula, , N is the total number of subtasks in the meta-training phase, T represents transposition, and h is the Bayesian learner The feature layer hidden vector.
4. The method according to claim 3, characterized in that Bayesian learner Meta-training to obtain sample filters for target diagnostic tasks The following steps are also included: S1-07: Using a meta-training set Sample screening target training set data vector in As the in-distribution data, the meta-training set The training set data vector of the sample screening subtask i in As an abnormal sample, use the following formula to filter the sample Conduct in-mission training: , In the formula, Filter target set data vector for samples Mapping to Bayesian learner The vector of the input layer; S1-08: Using a meta-test set Sample screening target validation set data vector in and meta-training set The validation set data vector of similar tasks in Evaluate to determine whether the training termination conditions have been met, and finally obtain the sample filter for the target diagnostic task .
5. The method according to claim 4, characterized in that Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task The steps include: S2-01: Initialize parameters using current meta-training Parameterized Bayesian Learner Parameters Get the diagnostic model ; S2-02: In the meta-training set Above, the sampled diagnostic training set data vector and diagnostic test task data vector ; S2-03: Pass Parameterized two-layer statistical encoder , get the task balance coefficient of diagnostic task T and failure mode balance factor ,in, , L is the Bayesian learner The number of layers; , C is the total number of failure modes; is the diagnostic training set data vector The vector that maps to the encoder’s input layer; S2-04: Using diagnostic test task data vectors Calculate test loss : , In the formula, The diagnostic test task set data vector Mapping to Bayesian learner The vector of the input layer; Bayesian learner Parameters; The input vector is , Bayesian learner The parameters are The output posterior probability is y; c is the fault mode; C is the total number of fault modes; is the quantity when the failure mode is c The logit function of ; is a symbolic function; About data expectations; S2-05: Using the Diagnostic Test Task Data Vector Update the Bayesian learner according to the following formula Parameters : , In the formula, It means representing Hadamard; The current learning rate learned by Meta-SGD; Express The gradient of S2-06: Repeat steps s2-02 to S2-05 until all training tasks are sampled and the diagnostic task T is obtained. ; S2-07: Update according to the following formula , complete a meta-training; , in, is the learning rate hyperparameter for meta-training, The error of the outer layer training for the diagnostic task T; S2-08: Repeat steps S2-01 to S2-07 to perform meta-training of the diagnostic model and meta-validation The diagnostic verification is performed until the stop condition is reached and the , complete the meta-training of the diagnostic model and obtain the diagnostic model The optimal initialization parameters for , Represents the average accuracy of the interval.
6. The method according to claim 5, characterized in that Bayesian learner Perform meta-training to obtain the diagnostic model for the template diagnosis task The following steps are also included: S2-09: Use optimal initialization parameters Initialize the diagnostic model Get the diagnostic model ; Use the meta-training set Sample screening target set data vector in As internal distribution data, the diagnostic model is obtained using the following formula Conduct in-mission training: , S2-10: Using the meta-test set Sample screening target validation set data vector in Evaluate the diagnostic model to determine whether the termination conditions are met and whether ,Finally, the diagnosis model of the template diagnosis task is obtained ; Filter target set data vector for samples Mapping to Bayesian learner The vector of input layers.
Citation Information
Patent Citations
Metalearning-based small sample point switch fault intelligent diagnosis method
CN116049748A
Cross-device incremental bearing fault diagnosis method based on continuous learning
WO2024021246A1