Rolling bearing small sample fault diagnosis method and system based on online soft label gaussian prototype network
The rolling bearing fault diagnosis method based on online soft-label Gaussian prototype network solves the problems of generalization ability and stability in fault diagnosis under small sample conditions, and realizes high-precision fault identification under variable working conditions, which is applicable to the fault diagnosis of rolling bearings.
Patent Information
- Application Number
- CN202610070213.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-01
- Estimated Expiration
- 2046-01-20
AI Technical Summary
Existing intelligent fault diagnosis methods have limited generalization ability under small sample conditions, are easily affected by label noise, and lack diagnostic stability under varying operating conditions such as different loads and speeds, making it difficult to adapt to the drift of fault feature distribution in industrial scenarios.
A rolling bearing few-sample fault diagnosis method based on an online soft-label Gaussian prototype network is adopted. By constructing an initial dataset, dividing it into a meta-training set and a meta-test set, multiple meta-learning tasks are generated. Fault diagnosis is performed using an embedding module, a prototype calculation module, and a classification module. Multi-task iterative training is carried out in combination with an online soft-label strategy, and the Gaussian prototype parameters are fine-tuned in the meta-test stage to adapt to cross-operating condition diagnosis.
With a limited number of labeled samples, it significantly improves the accuracy and stability of fault diagnosis, can quickly adapt to changes in working conditions, and enhances the model's generalization ability and diagnostic stability. It is suitable for small-sample fault diagnosis of rolling bearings.
Smart Images

Figure CN121561610B_ABST
Abstract
Description
A Method and System for Small-Sample Fault Diagnosis of Rolling Bearings Based on Online Soft-Label Gaussian Prototype Network Technical Field
[0001] This application relates to the field of mechanical fault diagnosis technology, specifically to a method and system for small-sample fault diagnosis of rolling bearings based on an online soft-label Gaussian prototype network. Background Technology
[0002] As a core component of rotating machinery, the fault diagnosis of rolling bearings is crucial to ensuring the safe operation of equipment. Existing intelligent fault diagnosis methods mostly rely on a large number of high-quality labeled samples. In industrial scenarios, the generalization ability is limited under small sample conditions where fault samples are sparse and labeling costs are high. Furthermore, they are easily affected by label noise, which leads to a decrease in diagnostic reliability. At the same time, when facing different operating conditions such as different loads and speeds, the drift of fault feature distribution can easily cause insufficient diagnostic stability. There is an urgent need for a fault diagnosis technology that can adapt to small sample scenarios, resist the influence of label noise, and have cross-operating condition adaptability. Summary of the Invention
[0003] To solve, or at least partially solve, the above-mentioned technical problems, this application provides a method and system for small-sample fault diagnosis of rolling bearings based on online soft-label Gaussian prototype networks.
[0004] Firstly, this application provides a method for small-sample fault diagnosis of rolling bearings based on an online soft-label Gaussian prototype network, comprising the following steps:
[0005] S1. Collect raw vibration signals of rolling bearings under various working conditions, preprocess them, and label them with fault type to construct an initial dataset;
[0006] S2. Divide the initial dataset into a meta-training set and a meta-test set, and generate multiple meta-learning tasks, each including a data support set and a data query set; the meta-learning tasks include training tasks and testing tasks, and the data support set and the data query set have no intersection in the same meta-learning task;
[0007] S3. Construct a small-sample fault diagnosis model based on a Gaussian prototype network. The small-sample fault diagnosis model includes an embedding module, a prototype calculation module, and a classification module connected in sequence. The embedding module uses a one-dimensional convolutional neural network to map the vibration signal in the meta-learning task into embedding vectors and generate confidence regions represented by Gaussian covariance matrices. The prototype calculation module is used to calculate the Gaussian prototypes of each category and the overall covariance matrix based on the data support set samples. The classification module is used to achieve fault classification by calculating the Euclidean distance between the embedding vectors of the data query set samples and the Gaussian prototypes of each category and converting the classification probabilities.
[0008] S4. Based on the training task and the small sample fault diagnosis model, perform meta-training, dynamically generate soft labels using an online soft label strategy, and perform multi-task iterative training by combining hard label and soft label loss to obtain the optimal initial parameters of the model and the fault diagnosis prior knowledge shared between tasks.
[0009] S5. Based on the test task and the trained small sample fault diagnosis model, conduct meta-testing. Calculate a Gaussian prototype using the data support set samples of the test task. Achieve fault classification by calculating the Euclidean distance between the embedding vector of the data query set samples of the test task and the Gaussian prototype of each category. When the sample feature distribution of the test task drifts, fine-tune the Gaussian prototype parameters to adapt to cross-condition diagnosis.
[0010] Optionally, S2 specifically includes:
[0011] S21. Split the initial dataset to obtain the meta-training set and the meta-test set, wherein the meta-training set is used to generate multiple training tasks and the meta-test set is used to generate multiple test tasks;
[0012] S22. For the meta-training set, generate the training task based on the N-way K-shot paradigm: randomly select N categories, randomly extract K samples from each selected category to form the data support set of the training task, and then extract at least one sample from each of the N categories to form the data query set of the training task, and the data support set and the data query set of the training task have no intersection.
[0013] S23. For the meta-test set, generate the test task based on the N-way K-shot paradigm: randomly select N categories, randomly extract K samples from each selected category to form the data support set of the test task, and the remaining samples form the data query set of the test task, and the data support set and the data query set of the test task have no intersection.
[0014] S24. Repeat S22 and S23 to generate multiple meta-learning tasks with different content in batches.
[0015] Optionally, the specific structure of the embedded module in S3 is as follows:
[0016] The embedding module includes four convolutional layers connected in sequence, each of which is followed by a batch normalization layer, a ReLU activation function layer, and a max pooling layer in sequence.
[0017] The number of convolution kernels in the four convolutional layers are 32, 64, 128, and 256 respectively along the signal processing direction, and the kernel sizes are 1×9, 1×6, 1×4, and 1×2 respectively along the signal processing direction.
[0018] Optionally, the specific calculation rules of the prototype calculation module described in S3 are as follows:
[0019] The prototype calculation module calculates the Gaussian prototype and the overall covariance matrix for each category based on the embedding vectors of the data support set samples and the corresponding Gaussian covariance matrix output.
[0020] For category The formula for calculating its corresponding Gaussian prototype is:
[0021] ;
[0022] in, Indicates category The corresponding Gaussian prototype, This indicates that the data supports a set belonging to a category. The embedding vector corresponding to the sample, This indicates that the output of the embedded module is related to... The corresponding Gaussian covariance matrix output, This represents the dot product operation;
[0023] category The formula for calculating the overall covariance matrix is:
[0024] ;
[0025] in, Indicates category The overall covariance matrix.
[0026] Optionally, the specific calculation rules for the classification module in S3 are as follows:
[0027] The classification module calculates the weighted Euclidean distance between the feature vectors of the data query set samples and the Gaussian prototypes of each category, and then converts the distance into classification probability using the softmax function to achieve fault classification.
[0028] The formula for calculating the weighted Euclidean distance is as follows:
[0029] ;
[0030] in, This represents the feature vector corresponding to the sample in the data query set. Indicates category The corresponding Gaussian prototype, Indicates category The overall covariance matrix, This represents the matrix transpose operation;
[0031] The formula for calculating classification probability is:
[0032] ;
[0033] in, Indicates sample Category The probability, This represents an exponential function.
[0034] Optionally, the specific methods and multi-task iterative training process of the online soft-labeling strategy described in S4 include:
[0035] S41. Based on the data support set samples of the training task, the Gaussian prototype and the overall covariance matrix of each category in the feature space are obtained through the prototype calculation module, forming the Gaussian distribution of each category.
[0036] S42. Input the data query set samples of the training task into the embedding module to obtain the corresponding feature vector;
[0037] S43. Calculate the Euclidean distance between the feature vector and each category of Gaussian prototypes, and generate soft labels based on the Euclidean distance distribution. The soft labels are used to quantify the similarity probability of the data query set samples relative to each category of Gaussian prototypes.
[0038] S44. The soft label is used to replace the hard label to calculate the cross-entropy loss, and the cross-entropy loss corresponding to the hard label is combined to construct the total training loss;
[0039] S45. Minimize the total training loss using gradient descent and update the parameters of the small sample fault diagnosis model;
[0040] S46. Iterate through S41 to S45 to complete multi-task iterative training, and obtain the shared prior knowledge of fault diagnosis and the optimal initial parameters of the model among the tasks.
[0041] Optionally, the specific implementation steps for fine-tuning the Gaussian prototype parameters in S5 include:
[0042] S51. In the meta-testing phase, the classification confidence of the data query set samples of the test task is calculated by the classification module, and the classification confidence is determined based on the classification probability output by the classification module.
[0043] S52. Set a confidence threshold. If the classification confidence is lower than the confidence threshold, it is determined that the sample feature distribution of the test task has drifted.
[0044] S53. Based on the deviation direction between the feature vector of the data query set sample below the confidence threshold and the corresponding category Gaussian prototype, adjust the mean parameter and the overall covariance matrix parameter of the category Gaussian prototype in a directional manner.
[0045] S54. Using the adjusted Gaussian prototype, recalculate the weighted Euclidean distance and classification probability between the data query set samples and each category of Gaussian prototype to complete the fault classification.
[0046] Optionally, before constructing the Gaussian distributions for each category in S41, steps such as support set sample confidence screening and prototype pre-optimization are also included, specifically:
[0047] S401. Input the data support set samples of the training task into the embedding module to obtain the embedding vector and Gaussian covariance matrix output corresponding to each data support set sample;
[0048] S402. Calculate the similarity between the embedding vector of each data support set sample and the embedding vector of other data support set samples of the same category. Combine the feature dispersion reflected by the output of the Gaussian covariance matrix to determine the category classification confidence of each data support set sample.
[0049] S403. Set a sample confidence threshold, and filter out high-confidence samples with a category classification confidence higher than the threshold, and low-confidence samples with a category classification confidence lower than the threshold;
[0050] S404. Calculate the initial Gaussian prototype and the overall covariance matrix based on the high-confidence samples. Then, use the deviation between the feature distribution of the low-confidence samples and the initial Gaussian prototype to locally correct the initial Gaussian prototype and the overall covariance matrix, and obtain the optimized Gaussian prototype and the overall covariance matrix, which are used for the construction of the Gaussian distribution in S41.
[0051] Optionally, after generating multiple training tasks in S2 and before executing S401, the method further includes a step of training task reliability assessment and priority allocation, specifically including:
[0052] S91. For each training task, based on the same class assignment confidence calculation logic as in S402, the average class assignment confidence of all data support set samples within that training task is obtained.
[0053] S92. Calculate the class boundary clarity between the optimized Gaussian prototypes of each class within the training task. The class boundary clarity is determined by the ratio of the feature distance between different class Gaussian prototypes to the degree of feature dispersion within the class.
[0054] S93. Combining the average class attribution confidence and the class boundary clarity, a task reliability scoring model is constructed to obtain the reliability score for each training task.
[0055] S94. Set a task reliability threshold and filter out high-quality training tasks with reliability scores higher than the task reliability threshold and low-quality training tasks with scores lower than the task reliability threshold.
[0056] S95. Assign a first training weight to the high-quality training task and a second training weight to the low-quality training task. The second training weight is lower than the first training weight. In the multi-task iterative training in S46, adjust the contribution of each training task to the model parameter update according to the first training weight and the second training weight.
[0057] Secondly, this application also provides a rolling bearing small-sample fault diagnosis system based on an online soft-label Gaussian prototype network, including:
[0058] The acquisition module is used to collect raw vibration signals of rolling bearings under various working conditions, preprocess them, and label them with fault types to build an initial dataset;
[0059] A generation module is used to divide the initial dataset into a meta-training set and a meta-test set, and generate multiple meta-learning tasks, including a data support set and a data query set, respectively; the meta-learning tasks include training tasks and testing tasks, and the data support set and the data query set have no intersection in the same meta-learning task;
[0060] A construction module is used to build a small-sample fault diagnosis model based on a Gaussian prototype network. The small-sample fault diagnosis model includes an embedding module, a prototype calculation module, and a classification module connected in sequence. The embedding module uses a one-dimensional convolutional neural network to map the vibration signal in the meta-learning task into embedding vectors and generate confidence regions represented by Gaussian covariance matrices. The prototype calculation module is used to calculate the covariance matrix of each category of Gaussian prototypes and the overall covariance matrix based on the data support set samples. The classification module is used to achieve fault classification by calculating the Euclidean distance between the embedding vectors of the data query set samples and each category of Gaussian prototypes and converting the classification probabilities.
[0061] The training module is used to perform meta-training based on the training task and the small sample fault diagnosis model. It adopts an online soft label strategy to dynamically generate soft labels, and performs multi-task iterative training by combining hard label and soft label loss to obtain the optimal initial parameters of the model and the fault diagnosis prior knowledge shared between tasks.
[0062] The testing module is used to conduct meta-testing based on the test task and the trained small-sample fault diagnosis model. It calculates a Gaussian prototype using the data support set samples of the test task, and achieves fault classification by calculating the Euclidean distance between the embedding vector of the data query set samples of the test task and the Gaussian prototype of each category. When the sample feature distribution of the test task drifts, the parameters of the Gaussian prototype are fine-tuned to adapt to cross-operating condition diagnosis.
[0063] The method provided in this application has the following beneficial effects:
[0064] The method provided in this application collects raw vibration signals under various working conditions and constructs an initial dataset, providing basic data covering diverse working conditions for small-sample fault diagnosis models. This avoids the limitations of model adaptation caused by single-condition data and enables small-sample fault diagnosis models to access more comprehensive fault characteristic manifestations. The initial dataset is divided into a meta-training set and a meta-test set, generating a meta-learning task containing a data support set and a data query set. This task construction mode aligns with the practical needs of "a small number of samples corresponding to multiple types of faults" in small-sample scenarios, providing a reasonable training and validation framework for small-sample fault diagnosis models to learn general diagnostic knowledge.
[0065] The diagnostic model, built upon a Gaussian prototype network, utilizes a one-dimensional convolutional neural network with embedded modules to adapt to the temporal characteristics of vibration signals. This enables accurate extraction of key fault features from the signals, and the synchronously generated Gaussian covariance matrix confidence region provides a basis for subsequent feature reliability assessment. The Gaussian prototype and overall covariance matrix generated by the prototype calculation module better reflect the distribution patterns of category features compared to traditional prototypes. The classification module combines the distance calculation logic between the two, making the fault classification results more closely reflect the actual correlation between features.
[0066] The online soft-label strategy in the meta-training phase dynamically generates soft labels that quantify the true similarity between samples and category prototypes. Combined with a training method using hard-label loss, this effectively mitigates potential label noise interference in training samples, preventing erroneous labels from misleading model training and helping the small-sample fault diagnosis model accumulate more reliable prior knowledge for fault diagnosis. The fine-tuning mechanism in the meta-testing phase addresses feature distribution drift, allowing for rapid adaptation to new operating conditions without retraining the small-sample fault diagnosis model, thus avoiding the problem of decreased diagnostic accuracy under varying operating conditions.
[0067] In summary, this method can still ensure high fault diagnosis accuracy when the number of labeled samples is limited. By controlling the reliability of features and adjusting the working conditions, it significantly improves the generalization ability and diagnostic stability of the small sample fault diagnosis model, providing a more industrially relevant solution for small sample fault diagnosis of rolling bearings. Attached Figure Description
[0068] Figure 1 is a schematic flowchart of a rolling bearing small-sample fault diagnosis method based on an online soft-label Gaussian prototype network provided in an embodiment of this application;
[0069] Figure 2 is a schematic diagram of an embedded module structure provided in an embodiment of this application. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0071] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0072] Referring to Figures 1 and 2, this application provides a method for small-sample fault diagnosis of rolling bearings based on an online soft-label Gaussian prototype network, including the following steps:
[0073] S1. Collect raw vibration signals of rolling bearings under various working conditions, preprocess them, and label them with fault type to construct an initial dataset;
[0074] S2. Divide the initial dataset into a meta-training set and a meta-test set, and generate multiple meta-learning tasks, each including a data support set and a data query set. The meta-learning tasks include training tasks and test tasks, and the data support set and data query set have no intersection in the same meta-learning task.
[0075] S3. Construct a small-sample fault diagnosis model based on a Gaussian prototype network. The small-sample fault diagnosis model includes an embedding module, a prototype calculation module, and a classification module connected in sequence. The embedding module uses a one-dimensional convolutional neural network to map the vibration signal in the meta-learning task into embedding vectors and generate the confidence region represented by the Gaussian covariance matrix. The prototype calculation module is used to calculate the covariance matrix of each category of Gaussian prototypes and the overall covariance matrix based on the data support set samples. The classification module is used to achieve fault classification by calculating the Euclidean distance between the embedding vectors of the data query set samples and each category of Gaussian prototypes and converting the classification probabilities.
[0076] S4. Based on the training task and the small sample fault diagnosis model, meta-training is carried out. Online soft label strategy is used to dynamically generate soft labels. The hard label and soft label loss are combined to carry out multi-task iterative training to obtain the optimal initial parameters of the model and the fault diagnosis prior knowledge shared between tasks.
[0077] S5. Based on the test task and the trained small sample fault diagnosis model, conduct meta-testing. Calculate the Gaussian prototype using the data support set samples of the test task. Achieve fault classification by calculating the Euclidean distance between the embedding vector of the data query set samples of the test task and the Gaussian prototype of each category. When the sample feature distribution of the test task drifts, fine-tune the Gaussian prototype parameters to adapt to cross-operating condition diagnosis.
[0078] Rolling bearings are core load-bearing components in rotating machinery such as wind turbines and industrial motors. Their operating status directly affects equipment safety and production efficiency. Achieving accurate fault diagnosis based on small sample data is a key requirement in the field of mechanical fault diagnosis. Raw vibration signals are a direct representation of the bearing's operating status. By collecting these signals through sensors and preprocessing them, fault-related features can be retained. After labeling the corresponding fault types, an initial dataset is formed, providing basic data support for subsequent diagnosis.
[0079] To address the challenges of sparse fault samples, high annotation costs, label noise, and feature distribution variations under changing operating conditions in industrial scenarios, this implementation method combines a meta-learning framework with a Gaussian prototype network. This approach not only solves the problem of insufficient model training with small sample sizes but also improves the model's robustness to interference and adaptability to different operating conditions. The specific implementation process is as follows:
[0080] First, an initial dataset is constructed by collecting raw vibration signals of the bearing under different operating conditions using sensors. These conditions cover common operating scenarios such as different loads, speeds, and operating environments, ensuring the dataset's comprehensive coverage. The collected raw vibration signals are preprocessed, including removing environmental noise and normalizing the signals to eliminate irrelevant interference. Finally, fault type labels are applied based on the actual bearing fault conditions, forming a complete initial dataset.
[0081] The initial dataset was then partitioned and task-constructed, splitting into a meta-training set and a meta-test set. The meta-training set was used for model parameter training, while the meta-test set was used to validate the model's diagnostic performance. Furthermore, the meta-training and meta-test sets were further split into support sets and query sets. The support sets were used to construct category feature prototypes, and the query sets were used to validate the prototypes' classification effectiveness. The support and query sets, split from the same dataset, have no sample overlap, ensuring the objectivity of the validation results.
[0082] Next, a small-sample fault diagnosis model based on a Gaussian prototype network is constructed. This model consists of an embedding module, a prototype calculation module, and a classification module connected sequentially. The embedding module adopts a one-dimensional convolutional neural network structure. Its core function is to map the input vibration signal into a low-dimensional, high-discrimination embedding vector, while generating a quality estimate reflecting the reliability of the features and a confidence region represented by the Gaussian covariance matrix, providing accurate feature support for subsequent prototype construction. The prototype calculation module calculates the Gaussian prototype and the overall covariance matrix corresponding to each category based on the sample features in the support set. The Gaussian prototype can comprehensively reflect the central tendency of the category features, while the covariance matrix reflects the dispersion of the feature distribution. The classification module calculates the Euclidean distance between the embedding vector of the query set sample and the Gaussian prototype of each category, quantifies the similarity between the sample and each category, and then obtains the classification result through probability transformation to achieve fault type discrimination.
[0083] In the meta-training phase, an online soft-labeling strategy is employed to optimize the model training process. Soft labels are dynamically generated by analyzing the Gaussian distribution of the data support set samples. These soft labels reflect the true similarity between the data query set samples and the prototypes of each category, effectively mitigating the interference of erroneous hard labels. The training loss is calculated by combining soft and hard labels, guiding the few-sample fault diagnosis model through multi-task iterative training. This continuously updates the model parameters, ultimately obtaining the optimal initial model parameters. This allows the model to learn shared fault diagnosis prior knowledge across different tasks, improving its learning ability under limited sample conditions.
[0084] After entering the meta-testing phase, a corresponding Gaussian prototype is constructed using the data support set samples from the meta-test set. The data query set samples from the meta-test set are then input into the trained small-sample fault diagnosis model. The feature vector is obtained through the embedding module, and the classification module calculates the Euclidean distance between this feature vector and the Gaussian prototypes of each category. Fault classification is then performed based on the distance results. When changes in test conditions cause a drift in the sample feature distribution, the parameters of the Gaussian prototypes corresponding to the support set are fine-tuned, enabling the small-sample fault diagnosis model to quickly adapt to the new operating environment and achieve small-sample fault diagnosis across different operating conditions.
[0085] This implementation effectively mitigates the adverse effects of label noise in training samples on diagnostic results through reasonable dataset construction, model design, and training and testing strategies, maintaining high fault diagnosis accuracy even with a limited number of labeled samples. Simultaneously, the model, through dynamic adjustment of the Gaussian prototype, can adapt to changes in feature distribution under different operating conditions, significantly improving the model's generalization ability and diagnostic stability in real-world industrial scenarios, providing a reliable solution for small-sample fault diagnosis of rolling bearings.
[0086] In some implementations, S2 specifically includes:
[0087] S21. Split the initial dataset to obtain a meta-training set and a meta-test set. The meta-training set is used to generate multiple training tasks, and the meta-test set is used to generate multiple test tasks.
[0088] S22. For the meta-training set, generate training tasks based on the N-way K-shot paradigm: randomly select N categories, randomly extract K samples from each selected category to form the data support set of the training task, and then extract at least one sample from each of the N categories to form the data query set of the training task, and the data support set and the data query set of the training task have no intersection.
[0089] S23. For the meta-test set, generate test tasks based on the N-way K-shot paradigm: randomly select N categories, randomly extract K samples from each selected category to form the data support set of the test task, and the remaining samples form the data query set of the test task, and the data support set and the data query set of the test task have no intersection.
[0090] S24. Repeat S22 and S23 to generate multiple meta-learning tasks with different content in batches.
[0091] After the initial dataset is constructed, in order to adapt to the training and testing logic of the meta-learning framework, the initial dataset needs to be reasonably divided and standardized meta-learning tasks generated to ensure that the small sample fault diagnosis model can master the general rules of fault diagnosis through the "learning tasks".
[0092] The core construction paradigm of the meta-learning task is N-way K-shot, where "N-way" refers to the number of fault categories included in each task, and "K-shot" refers to the number of samples used to construct feature prototypes in each category. This paradigm can accurately simulate the small-sample diagnosis scenario in industrial settings where "a small number of samples correspond to multiple types of faults." Specifically, the initial dataset is first split into a meta-training set and a meta-test set. The meta-training set provides diverse training tasks for the small-sample fault diagnosis model, helping it learn the feature association patterns of different fault categories. The meta-test set is used to verify the diagnostic performance of the small-sample fault diagnosis model on new tasks and to test the model's generalization ability.
[0093] For the meta-training set, training tasks are generated according to the N-way K-shot paradigm: N different fault categories are randomly selected from the meta-training set, and then K samples are randomly drawn from each selected category. These samples together form the data support set for the training task. The core function of the data support set is to construct an initial feature prototype for each fault category. Then, samples are randomly drawn again from the aforementioned N selected categories to form the data query set for the training task. The samples in the data query set must not overlap with the samples in the data support set to avoid sample reuse that could distort the training results. The purpose of the data query set is to verify whether the feature prototypes constructed based on the data support set possess classification capabilities.
[0094] For the meta-test set, the same construction logic as the meta-training set is used to generate test tasks: N fault categories are randomly selected, and K samples are extracted from each category to form the data support set of the test task. The remaining samples constitute the data query set of the test task, and the data support set and data query set of the test task also remain separate. This consistent task construction method ensures the consistency of the training and testing scenarios, enabling the small-sample fault diagnosis model to quickly adapt to the structure of new tasks during the testing phase.
[0095] To ensure that the small-sample fault diagnosis model fully learns the diagnostic patterns under different fault combinations and sample distributions, the generation process of the training and testing tasks described above needs to be repeated to generate multiple meta-learning tasks with different content in batches. The category combination and sample selection for each meta-learning task are randomized to ensure the diversity of the meta-learning tasks. This allows the small-sample fault diagnosis model to access more comprehensive fault scenario features and avoids overfitting due to a single task.
[0096] This dataset partitioning and task generation method ensures the independence of the training and test sets while providing ample learning material for the small-sample fault diagnosis model through batches of diverse tasks. The design of an overlap between the support and query sets objectively verifies the core capability of the small-sample fault diagnosis model to build prototypes and perform classification based on a limited number of samples. This aligns with the practical needs of small-sample fault diagnosis, providing a fundamental guarantee for the effectiveness of subsequent model training and testing. Furthermore, it makes the general diagnostic knowledge accumulated by the small-sample fault diagnosis model across diverse tasks more practical.
[0097] Referring to Figure 2, in some embodiments, the specific structure of the embedded module in S3 is as follows:
[0098] The embedding module consists of four convolutional layers connected in sequence, each followed by a batch normalization layer, a ReLU activation function layer, and a max pooling layer in sequence.
[0099] The number of convolutional kernels in the four convolutional layers are 32, 64, 128, and 256 respectively along the signal processing direction, and the kernel sizes are 1×9, 1×6, 1×4, and 1×2 respectively along the signal processing direction.
[0100] The embedding module is the core component of the Gaussian prototype network for signal feature extraction. Its structural design directly affects the quality of the embedded vectors, thus determining the accuracy of subsequent prototype construction and classification diagnosis. This embedding module adopts a one-dimensional convolutional neural network structure, specifically adapted to the temporal characteristics of rolling bearing vibration signals, and can accurately capture local fault features in the vibration signals.
[0101] The core architecture of the embedding module consists of four sequentially connected convolutional layers. Each convolutional layer is followed by a batch normalization layer, a ReLU activation function layer, and a max pooling layer, forming a complete processing unit of "convolution-normalization-activation-pooling". The core function of the convolutional layer is to extract fault features of different dimensions through sliding convolution operations between the convolutional kernel and the input signal. The batch normalization layer can standardize the feature map output by convolution, reducing the risk of gradient vanishing or exploding and accelerating model training convergence. The ReLU activation function layer enhances the model's ability to learn complex nonlinear features by introducing nonlinear transformations and filtering out irrelevant and redundant information. The max pooling layer downsamples the feature map, retaining key features while reducing the number of model parameters, reducing computational complexity, and improving the model's generalization ability.
[0102] The design of the four convolutional layers follows the logic of "gradual feature deepening and scale refinement." The number of convolutional kernels increases sequentially along the signal processing direction, at 32, 64, 128, and 256 respectively. This increase in the number of kernels enables the small-sample fault diagnosis model to extract richer and more advanced fault features, gradually transitioning from basic temporal features to abstract fault features. The size of the convolutional kernels decreases sequentially along the signal processing direction, at 1×9, 1×6, 1×4, and 1×2 respectively. This design aligns with the characteristic distribution patterns of vibration signals. In the early stages, larger convolutional kernels capture global temporal correlations in the signal, while in the later stages, smaller convolutional kernels focus on local key fault features, achieving accurate extraction of features at different scales.
[0103] Through this structured design, the embedding module can efficiently map the input raw vibration signal into a low-dimensional, high-discrimination embedding vector, while simultaneously generating a quality estimate reflecting feature reliability and a confidence region characterized by a Gaussian covariance matrix. This confidence region quantifies the distributional uncertainty of the embedding vector, providing a feature reliability reference for the subsequent prototype calculation module and ensuring that the constructed Gaussian prototype is more representative. The overall structural design of the embedding module adapts to the temporal characteristics of the vibration signal while balancing feature extraction capability and computational efficiency, providing a high-quality feature input foundation for small-sample fault diagnosis models.
[0104] In some implementations, the specific calculation rules of the prototype calculation module in S3 are as follows:
[0105] The prototype calculation module calculates the Gaussian prototype and the overall covariance matrix for each category based on the embedding vectors of the data support set samples and the corresponding Gaussian covariance matrix output.
[0106] For category The formula for calculating its corresponding Gaussian prototype is:
[0107] ;
[0108] in, Indicates category The corresponding Gaussian prototype, This indicates that the data supports a centralized category. The embedding vector corresponding to the sample, Indicates the output of the embedded module, and The corresponding Gaussian covariance matrix output, This represents the dot product operation;
[0109] category The formula for calculating the overall covariance matrix is:
[0110] ;
[0111] in, Indicates category The overall covariance matrix.
[0112] The core function of the prototype calculation module is to construct a Gaussian prototype and an overall covariance matrix that accurately represent the characteristics of each type of fault, based on the feature information output by the embedding module, thus providing a reliable category feature benchmark for the subsequent classification module. The calculation logic of the prototype calculation module is closely integrated with the feature quality of the embedding vectors, avoiding prototype bias caused by simply relying on the number of samples.
[0113] The calculation process is based on the data support set samples. First, the embedding vector of each data support set sample is obtained after processing by the embedding module, along with the synchronously generated Gaussian covariance matrix output. The embedding vector carries the core fault characteristics of the data support set sample, while the Gaussian covariance matrix output reflects the reliability and dispersion of the embedding vector's characteristics. Together, they provide data support for the prototype calculation.
[0114] For each fault category, the Gaussian prototype is not simply calculated by averaging the embedding vectors of all samples in that category. Instead, the Gaussian covariance matrix output is introduced as a weighting factor, and the embedding vectors are correlated with the reliability of the corresponding features through a dot product operation. Specifically, the embedding vector of each data support set sample is first multiplied by the corresponding Gaussian covariance matrix output to obtain a weighted feature vector. Then, all weighted feature vectors are summed, and finally, the result is normalized by dividing by the sum of all Gaussian covariance matrix outputs, thus obtaining the Gaussian prototype for that category. This weighted calculation method allows the features of high-confidence samples to have greater weight in the prototype, while weakening the interference of low-confidence samples, making the constructed Gaussian prototype more reflective of the true distribution of category features.
[0115] The overall covariance matrix corresponding to a category is calculated by summing the Gaussian covariance matrices of all samples within that category. This matrix quantifies the dispersion of the category's feature distribution, intuitively reflects the consistency of sample features within the category, and provides a confidence reference for distance calculation in subsequent classification modules.
[0116] The Gaussian prototype and overall covariance matrix obtained through this calculation method fully utilize the feature information of the data support set and combine it with feature reliability assessment, avoiding the shortcomings of traditional prototype calculations that treat all samples equally. The constructed Gaussian prototype can accurately capture the core features of the category, while the overall covariance matrix can reflect the feature distribution characteristics. Together, they provide a more discriminative category benchmark for the classification module, effectively improving the ability to represent fault categories in small sample scenarios and laying a solid foundation for subsequent accurate classification.
[0117] In some implementations, the specific calculation rules for the classification module in S3 are as follows:
[0118] The classification module calculates the weighted Euclidean distance between the feature vectors of the data query set samples and the Gaussian prototypes of each category, and then converts it into classification probabilities using the softmax function to achieve fault classification.
[0119] The formula for calculating the weighted Euclidean distance is:
[0120] ;
[0121] in, This represents the feature vector corresponding to the sample in the data query set. Indicates category The corresponding Gaussian prototype, Indicates category The overall covariance matrix, This represents the matrix transpose operation;
[0122] The formula for calculating classification probability is:
[0123] ;
[0124] in, Indicates sample Category The probability, This represents an exponential function.
[0125] The classification module is the core component for fault type identification. Its calculation logic is directly related to the accuracy of the diagnostic results. The core idea is to convert the similarity between the query set samples and the Gaussian prototypes of each category into classification probabilities to complete fault identification.
[0126] The calculation process uses the query set sample feature vectors output by the embedding module, the Gaussian prototypes of each category obtained by the prototype calculation module, and the overall covariance matrix as the basic data. Unlike traditional Euclidean distance calculation, the distance metric in this implementation introduces the overall covariance matrix as a weighting factor to form a weighted Euclidean distance. The core logic of this weighted design is that the overall covariance matrix can reflect the dispersion of the feature distribution of the corresponding category. Integrating it into the distance calculation allows the distance value to not only reflect the physical distance in the vector space, but also take into account the confidence differences of the category features. For categories with concentrated feature distribution and low dispersion, the weight will enhance the effective discrimination; for categories with relatively dispersed feature distribution, the weight will adapt to this dispersion characteristic, avoiding misjudgment caused by simple physical distance.
[0127] In the specific calculation, the difference between the feature vector of the data query set sample and the corresponding Gaussian prototype of the category is first calculated using matrix operations. This difference is then weighted in conjunction with the overall covariance matrix of the category to obtain the weighted Euclidean distance, which accurately reflects the true correlation between the data query set sample and the category prototype. The smaller the distance value, the higher the fit between the sample features and the category prototype, and the greater the probability that the sample belongs to that category.
[0128] Subsequently, the weighted Euclidean distances of all categories are converted into classification probabilities using the softmax function. During the conversion, an exponential function is used to process negative distance values, and then a normalization operation is performed to ensure that the sum of the probabilities of all categories is 1. This yields the specific probability value for each query set sample belonging to each category of fault. The category with the highest probability value is the fault diagnosis result corresponding to that sample.
[0129] This calculation rule retains the intuitiveness of distance metrics while adapting to the distribution characteristics of class features through weighted design, avoiding the shortcomings of traditional classification calculations that neglect feature confidence. The combination of weighted distance and probability transformation makes the classification results more consistent with the feature distribution patterns in small sample scenarios, effectively improving the accuracy of fault classification. At the same time, it enhances the adaptability of small sample fault diagnosis models to feature fluctuations, providing reliable classification logic support for small sample fault diagnosis.
[0130] In some implementations, the specific methods and multi-task iterative training process of the online soft-label strategy in S4 include:
[0131] S41. Based on the data support set samples of the training task, the Gaussian prototype and the overall covariance matrix of each category in the feature space are obtained through the prototype calculation module, forming the Gaussian distribution of each category.
[0132] S42. Input the data query set samples of the training task into the embedding module to obtain the corresponding feature vector;
[0133] S43. Calculate the Euclidean distance between the feature vector and the Gaussian prototype of each category, and generate soft labels based on the Euclidean distance distribution. The soft labels are used to quantify the similarity probability of the data query set samples relative to the Gaussian prototype of each category.
[0134] S44. Use soft labels instead of hard labels to calculate cross-entropy loss, and combine the cross-entropy loss corresponding to the hard labels to construct the total training loss;
[0135] S45. Minimize the total training loss using gradient descent and update the parameters of the small-sample fault diagnosis model.
[0136] S46. Iterate through S41 to S45 to complete multi-task iterative training, and obtain the shared prior knowledge of fault diagnosis and the optimal initial parameters of the model among the tasks.
[0137] The core objective of the meta-training phase is to optimize model parameters through an online soft-labeling strategy, enabling the few-shot fault diagnosis model to learn reliable fault diagnosis knowledge in few-shot scenarios while resisting the interference of label noise. The entire training process relies on the training task and the already constructed few-shot fault diagnosis model to ensure that the learned prior knowledge has universality and stability.
[0138] After training begins, the prototype calculation module first uses the support set samples from the training task to calculate the Gaussian prototypes and overall covariance matrix for each category. These data collectively constitute the Gaussian distribution of each category in the feature space, providing a category feature benchmark for subsequent soft label generation. Then, the query set samples from the training task are input into the embedding module. Feature extraction yields the feature vector corresponding to each query set sample. This feature vector accurately carries the fault feature information of the query set sample and is the core basis for subsequent similarity judgment.
[0139] The generation of soft labels follows a dynamic adaptation principle, rather than using fixed pre-set rules. Instead, it is achieved by calculating the Euclidean distance between the feature vectors of the data query set samples and the Gaussian prototypes of each category. The Euclidean distance value can intuitively reflect the degree of fit between the data query set samples and the prototypes of different categories. Based on this distance distribution, soft labels can be quantitatively generated. These soft labels clearly characterize the similarity probability of the data query set samples relative to the prototypes of each category. Compared with black-and-white hard labels, they are more in line with the ambiguity of sample features and the influence of label noise in real-world scenarios.
[0140] The training loss is calculated using a combination of hard and soft labels, rather than relying solely on one type of label. By replacing hard labels with soft labels in calculating the cross-entropy loss, the misleading effect of erroneous hard labels on model training can be mitigated. At the same time, retaining the cross-entropy loss corresponding to the hard labels ensures that the model obtains clear class boundary information. The total training loss constructed by combining the two approaches balances noise resistance and class certainty, and guides the small-sample fault diagnosis model towards better optimization.
[0141] The model parameters are updated using gradient descent, with the goal of minimizing the total training loss, continuously adjusting the parameters of the small-sample fault diagnosis model. To enable the small-sample fault diagnosis model to fully learn the common patterns among different tasks, the entire process from Gaussian distribution construction and feature vector extraction to parameter updates needs to be iteratively executed. Through multi-task iterative training, the small-sample fault diagnosis model can gradually accumulate shared prior knowledge of fault diagnosis across tasks, ultimately obtaining the optimal initial model parameters, providing a foundation for accurate diagnosis in the subsequent meta-testing stage.
[0142] This training method effectively solves the overfitting problem of traditional single-label training in noisy label scenarios. The dynamically generated soft labels and joint loss design enable the small-sample fault diagnosis model to maintain stable learning ability under small-sample conditions. The acquired prior knowledge has stronger generalization ability and can quickly adapt to different fault diagnosis tasks.
[0143] In some implementations, the specific steps for fine-tuning the Gaussian prototype parameters in S5 include:
[0144] S51. In the meta-testing phase, the classification confidence of the data query set samples of the test task is calculated through the classification module. The classification confidence is determined based on the classification probability output by the classification module.
[0145] S52. Set a confidence threshold. If the classification confidence is lower than the confidence threshold, it is determined that the sample feature distribution of the test task has drifted.
[0146] S53. Based on the deviation direction between the feature vector of the data query set sample below the confidence threshold and the corresponding category Gaussian prototype, adjust the mean parameter and the overall covariance matrix parameter of the category Gaussian prototype in a targeted manner.
[0147] S54. Using the adjusted Gaussian prototype, recalculate the weighted Euclidean distance and classification probability between the data query set samples and each category of Gaussian prototype to complete the fault classification.
[0148] The core of the meta-testing phase is to utilize the optimal initial parameters of the trained model to achieve accurate fault diagnosis in new test tasks, while addressing the feature distribution drift problem that may occur under varying operating conditions, ensuring the condition adaptability of the small-sample fault diagnosis model. The entire process is based on the test task and the trained small-sample fault diagnosis model, following the logic of "classification evaluation → drift judgment → parameter fine-tuning → reclassification".
[0149] After the meta-test is initiated, the data query set samples of the test task are first input into the trained small-sample fault diagnosis model. The feature vectors of the data query set samples are extracted through the embedding module, and then the classification module calculates the classification probability of each data query set sample. The classification confidence is determined based on these classification probabilities and can intuitively reflect the reliability of the model's classification result for the current sample—the higher the confidence, the better the fit between the feature vector and the corresponding class Gaussian prototype, and the more reliable the classification result; conversely, there may be a mismatch in feature distribution.
[0150] To accurately determine whether the feature distribution has drifted, a reasonable confidence threshold needs to be set. When the classification confidence of multiple data query set samples in a certain test task is consistently lower than the confidence threshold, it can be determined that the feature distribution of the samples in the current test task has drifted. This drift is usually caused by changes in operating conditions (such as load adjustment, speed change, etc.). If no adaptation adjustment is made, it will directly affect the accuracy of diagnosis.
[0151] Parameter fine-tuning employs a targeted adjustment strategy rather than a full update. First, the deviation direction between the feature vectors of query set samples below the confidence threshold and the corresponding Gaussian prototype is analyzed to clarify the specific dimensions and trends of feature distribution drift. Based on this deviation direction, the mean parameter and overall covariance matrix parameter of the Gaussian prototype for that category are adjusted specifically—the mean parameter adjustment adapts to the shift in the central tendency of the features, while the overall covariance matrix parameter adjustment adapts to changes in the degree of feature dispersion, ensuring that the adjusted Gaussian prototype accurately matches the sample feature distribution under the current operating conditions.
[0152] After parameter adjustment, the data query set samples are re-input into the small-sample fault diagnosis model. Feature vectors are obtained through the embedding module, and then the weighted Euclidean distance and classification probability between the feature vectors and the adjusted Gaussian prototypes of each category are calculated to complete the fault classification. This "evaluation → adjustment → re-evaluation" process can effectively offset the influence of feature distribution drift caused by changing operating conditions, allowing the small-sample fault diagnosis model to quickly adapt to new operating environments.
[0153] This fine-tuning method avoids the parameter chaos caused by traditional blind fine-tuning. The targeted adjustment strategy ensures both adaptation efficiency and preservation of the general diagnostic knowledge already learned by the model. Through this dynamic adaptation approach, the diagnostic stability of the small-sample fault diagnosis model under different operating conditions is significantly improved. Even when faced with fluctuations in feature distribution, it can still achieve accurate fault diagnosis based on a small number of support set samples, fully meeting the actual needs of changing operating conditions in industrial scenarios.
[0154] In some implementations, before constructing the Gaussian distributions for each category in S41, the steps of supporting set sample confidence screening and prototype pre-optimization are also included, specifically including:
[0155] S401. Input the data support set samples of the training task into the embedding module to obtain the embedding vector and Gaussian covariance matrix output corresponding to each data support set sample.
[0156] S402. Calculate the similarity between the embedding vector of each data support set sample and the embedding vector of other data support set samples of the same category. Combine the feature dispersion reflected by the output of the Gaussian covariance matrix to determine the category classification confidence of each data support set sample.
[0157] S403. Set a sample confidence threshold to filter out high-confidence samples with a class attribution confidence higher than the threshold and low-confidence samples with a class attribution confidence lower than the threshold.
[0158] S404. Calculate the initial Gaussian prototype and the overall covariance matrix based on the high-confidence samples. Then, use the deviation between the feature distribution of the low-confidence samples and the initial Gaussian prototype to locally correct the initial Gaussian prototype and the overall covariance matrix, and obtain the optimized Gaussian prototype and the overall covariance matrix, which are used for the construction of the Gaussian distribution in S41.
[0159] Before constructing Gaussian distributions for each category based on the data support set samples from the training task, confidence screening and prototype pre-optimization are performed on the support set samples. The core purpose is to improve the reliability of the category Gaussian prototypes, avoid the adverse effects of low-quality samples on the subsequent training process, and fully explore the effective feature value of the support set samples.
[0160] First, the data support set samples for the training task are input one by one into the embedding module. The embedding module uses a one-dimensional convolutional neural network structure to extract features, obtaining the embedding vector corresponding to each data support set sample. Simultaneously, a Gaussian covariance matrix is generated and output. The embedding vector carries the core fault feature information of the data support set samples, while the Gaussian covariance matrix output reflects the feature dispersion of the corresponding embedding vector. Together, they constitute the basic data for sample quality assessment.
[0161] Next, the similarity between the embedding vector of each data support set sample and the embedding vectors of other data support set samples of the same category is calculated. Higher similarity indicates a stronger fit between the sample and the core features of the same category. Simultaneously, the feature dispersion reflected in the Gaussian covariance matrix output is considered; lower dispersion indicates higher feature reliability. Through this comprehensive analysis of these two dimensions, the class assignment confidence of each data support set sample is quantitatively determined. This class assignment confidence directly reflects the reliability of a data support set sample belonging to the current category.
[0162] Next, a sample confidence threshold is set, and all data support set samples are filtered based on this threshold. Data support set samples with a class attribution confidence higher than the sample confidence threshold are classified as high-confidence samples, whose features have high reliability and strong representativeness. Samples with a class attribution confidence lower than the sample confidence threshold are classified as low-confidence samples, which may have ambiguous features or be affected by noise, but may still contain some effective feature information.
[0163] Finally, prototype pre-optimization is performed: First, based on the selected high-confidence samples, the core logic of the prototype calculation module calculates the initial Gaussian prototype and the overall covariance matrix to ensure that the initial prototype accurately reflects the central tendency and distribution pattern of the core features of the categories. Then, the deviation between the feature distribution of the low-confidence samples and the initial Gaussian prototype is analyzed to clarify the direction and degree of difference between the effective features and the core features of the categories in the low-confidence samples. This deviation information is used to locally correct the initial Gaussian prototype and the overall covariance matrix. During the correction process, only parameters related to the effective deviation are adjusted, without changing the core feature structure of the initial prototype. Finally, the optimized Gaussian prototype and the overall covariance matrix are obtained, which are used for the subsequent construction of Gaussian distributions for each category.
[0164] This process avoids the biases that may arise from directly using the original support set samples to build the prototype, while maximizing the preservation of effective features in low-confidence samples, thus avoiding waste of valuable data resources in small-sample scenarios. The optimized Gaussian prototype can more accurately represent the distribution of class features, providing a more reliable foundation for subsequent steps such as dynamic generation of online soft labels and joint loss training, further improving the model's learning performance and diagnostic stability in small-sample, noisy scenarios.
[0165] In some implementations, after generating multiple training tasks in S2 and before executing S401, a step of training task reliability assessment and priority allocation is also included, specifically including:
[0166] S91. For each training task, based on the same class assignment confidence calculation logic as S402, obtain the average class assignment confidence of all data support set samples within that training task.
[0167] S92. Calculate the class boundary clarity between the optimized Gaussian prototypes of each class within the training task. The class boundary clarity is determined by the ratio of the feature distance between different class Gaussian prototypes to the degree of feature dispersion within the class.
[0168] S93. Combine the average class attribution confidence and class boundary clarity to construct a task reliability scoring model, and then obtain the reliability score for each training task.
[0169] S94. Set a task reliability threshold to filter out high-quality training tasks with reliability scores higher than the task reliability threshold and low-quality training tasks with scores lower than the task reliability threshold.
[0170] S95. Assign the first training weight to high-quality training tasks and the second training weight to low-quality training tasks. The second training weight is lower than the first training weight. In the multi-task iterative training in S46, adjust the contribution of each training task to the model parameter update according to the first training weight and the second training weight.
[0171] After generating multiple training tasks in batches, and before performing confidence screening on the data support set samples for each training task, a step of training task reliability assessment and priority allocation can be added. The core purpose of this step is to distinguish the quality differences between different training tasks, avoid low-quality tasks from transmitting misleading knowledge to the model, allow high-quality tasks to play a leading role in training, and improve the overall efficiency of multi-task training.
[0172] First, for each generated training task, the same calculation logic as for the class assignment confidence of the support set samples is used to evaluate all data support set samples within that training task one by one. The average of the class assignment confidence of each training support set sample is then taken as the average class assignment confidence of the training task. This metric directly reflects the overall reliability of the samples within the task; the higher the average value, the better the quality of the task's underlying data.
[0173] Next, the clarity of class boundaries for this training task is calculated. First, following the logic of support set sample confidence screening and prototype pre-optimization, optimized Gaussian prototypes for each class within the training task are pre-calculated. Then, the feature distance between different class Gaussian prototypes is calculated to quantify the degree of class distinction. Simultaneously, the intra-class feature dispersion of each class is considered, i.e., the feature distribution range reflected by the overall covariance matrix. The inter-class feature distance is compared to the intra-class feature dispersion; a larger ratio indicates clearer boundaries between different class features, and higher classification training value for the training task.
[0174] Subsequently, a task reliability scoring model is constructed by combining the average class assignment confidence and class boundary clarity. The two metrics each have their own emphasis: the former reflects the basic quality of the samples, while the latter reflects the task's classification value. By comprehensively considering both, a reliability score is obtained for each training task. The scoring results can demonstrate the potential contribution of the training task to model training.
[0175] Based on the set task reliability threshold, training tasks are divided into high-quality training tasks and low-quality training tasks. High-quality training tasks are those with scores higher than the reliability threshold. These training tasks have reliable samples and good class discrimination, and can provide effective knowledge for small-sample fault diagnosis models. Low-quality training tasks are those with scores lower than the reliability threshold. Their sample quality or class discrimination is insufficient, but they still contain some usable information.
[0176] Finally, training weights are assigned, with the first training weight allocated to high-quality training tasks and the second training weight allocated to low-quality training tasks, with the second training weight being lower than the first. During multi-task iterative training, the contribution of each training task is adjusted based on these weights when the model parameters are updated—the parameter updates of high-quality training tasks have a greater impact, while the impact of low-quality training tasks is weakened. This differentiated allocation avoids interference from low-quality training tasks without completely discarding the information they contain, maximizing the preservation of the advantage of the number of tasks.
[0177] This process, through quality screening and weight optimization of training tasks, allows the small-sample fault diagnosis model to focus on high-value tasks during training, reducing knowledge interference at the task level. This "selective learning" training logic aligns with the precious nature of data in small-sample scenarios, making the prior knowledge learned by the small-sample fault diagnosis model more accurate and more generalizable, further improving the diagnostic performance of the small-sample fault diagnosis model in subsequent test tasks.
[0178] This application also provides a rolling bearing small-sample fault diagnosis system based on an online soft-label Gaussian prototype network, including:
[0179] The acquisition module is used to collect raw vibration signals of rolling bearings under various working conditions, preprocess them, and label them with fault types to build an initial dataset;
[0180] The generation module is used to divide the initial dataset into a meta-training set and a meta-test set and generate multiple meta-learning tasks, including a data support set and a data query set, respectively. The meta-learning tasks include training tasks and test tasks, and the data support set and data query set have no intersection in the same meta-learning task.
[0181] The construction module is used to build a small-sample fault diagnosis model based on a Gaussian prototype network. The small-sample fault diagnosis model includes an embedding module, a prototype calculation module, and a classification module connected in sequence. The embedding module uses a one-dimensional convolutional neural network to map the vibration signal in the meta-learning task into embedding vectors and generate the confidence region represented by the Gaussian covariance matrix. The prototype calculation module is used to calculate the covariance matrix of each class of Gaussian prototypes and the overall covariance matrix based on the data support set samples. The classification module is used to achieve fault classification by calculating the Euclidean distance between the embedding vectors of the data query set samples and each class of Gaussian prototypes and converting the classification probabilities.
[0182] The training module is used to perform meta-training based on training tasks and small sample fault diagnosis models. It adopts an online soft label strategy to dynamically generate soft labels, and performs multi-task iterative training by combining hard label and soft label loss to obtain the optimal initial parameters of the model and the fault diagnosis prior knowledge shared between tasks.
[0183] The testing module is used to conduct meta-testing based on the test task and the trained small sample fault diagnosis model. It uses the data support set samples of the test task to calculate the Gaussian prototype, and realizes fault classification by calculating the Euclidean distance between the embedding vector of the data query set samples of the test task and the Gaussian prototype of each category. When the sample feature distribution of the test task drifts, the Gaussian prototype parameters are fine-tuned to adapt to cross-operating condition diagnosis.
[0184] The system provided in this application has the same technical features as the above-described method embodiments, and therefore can solve the same technical problems and achieve the same technical effects, which will not be repeated here.
[0185] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.
Claims
1. A method for small-sample fault diagnosis of rolling bearings based on online soft-label Gaussian prototype networks, characterized in that, Includes the following steps: S1. Collect raw vibration signals of rolling bearings under various working conditions, preprocess them, and label them with fault type to construct an initial dataset; S2. Divide the initial dataset into a meta-training set and a meta-test set, and generate multiple meta-learning tasks, including a data support set and a data query set, respectively. The meta-learning task includes a training task and a testing task, and the data support set and the data query set have no intersection in the same meta-learning task; S3, construct a small-sample fault diagnosis model based on a Gaussian prototype network, the small-sample fault diagnosis model includes an embedding module, a prototype calculation module and a classification module connected in sequence; the embedding module uses a one-dimensional convolutional neural network to map the vibration signal in the meta-learning task into an embedding vector and generate a confidence region represented by a Gaussian covariance matrix; the prototype calculation module is used to calculate the Gaussian prototype and the overall covariance matrix of each category based on the data support set samples; the classification module is used to achieve fault classification by calculating the Euclidean distance between the embedding vector of the data query set samples and the Gaussian prototype of each category and converting the classification probability; the specific calculation rule of the prototype calculation module is: the prototype calculation module calculates the Gaussian prototype and the overall covariance matrix of each category based on the embedding vector and the corresponding Gaussian covariance matrix output of the data support set samples; for each category The formula for calculating its corresponding Gaussian prototype is: ;in, Indicates category The corresponding Gaussian prototype, This indicates that the data supports a set belonging to a category. The embedding vector corresponding to the sample, This indicates that the output of the embedded module is related to... The corresponding Gaussian covariance matrix output, Represents dot product operation; category The formula for calculating the overall covariance matrix is: ;in, Indicates category S4. Based on the training task and the small sample fault diagnosis model, perform meta-training, dynamically generate soft labels using an online soft label strategy, and perform multi-task iterative training by combining hard label and soft label loss to obtain the optimal initial model parameters and fault diagnosis prior knowledge shared between tasks; S5. Based on the test task and the trained small sample fault diagnosis model, perform meta-testing, calculate Gaussian prototypes using the data support set samples of the test task, and achieve fault classification by calculating the Euclidean distance between the embedding vectors of the data query set samples of the test task and the Gaussian prototypes of each category; when the sample feature distribution of the test task drifts, fine-tune the Gaussian prototype parameters to adapt to cross-condition diagnosis.
2. The method according to claim 1, characterized in that, S2 specifically includes: S21, splitting the initial dataset to obtain the meta-training set and the meta-test set, wherein the meta-training set is used to generate multiple training tasks, and the meta-test set is used to generate multiple test tasks; S22, generating the training tasks based on the N-way K-shot paradigm for the meta-training set: randomly selecting N categories, randomly selecting K samples from each selected category to form the data support set of the training task, and then selecting at least one sample from each of the N categories to form the data query set of the training task, wherein the data support set and the data query set of the training task have no intersection; S23, generating the test tasks based on the N-way K-shot paradigm for the meta-test set: randomly selecting N categories, randomly selecting K samples from each selected category to form the data support set of the test task, and the remaining samples to form the data query set of the test task, wherein the data support set and the data query set of the test task have no intersection; S24, repeating S22 and S23 to generate multiple meta-learning tasks with different content in batches.
3. The method according to claim 1, characterized in that, The specific structure of the embedding module in S3 is as follows: The embedding module includes four convolutional layers connected in sequence, and each convolutional layer is followed by a batch normalization layer, a ReLU activation function layer and a max pooling layer in sequence; the number of convolutional kernels of the four convolutional layers are 32, 64, 128 and 256 in sequence along the signal processing direction, and the kernel size is 1×9, 1×6, 1×4 and 1×2 in sequence along the signal processing direction.
4. The method according to claim 1, characterized in that, The specific calculation rule of the classification module in S3 is as follows: The classification module calculates the weighted Euclidean distance between the feature vectors of the data query set samples and the Gaussian prototypes of each category, and converts it into classification probabilities using the softmax function to achieve fault classification; the formula for calculating the weighted Euclidean distance is: ;in, This represents the feature vector corresponding to the sample in the data query set. Indicates category The corresponding Gaussian prototype, Indicates category The overall covariance matrix, This represents the matrix transpose operation; the formula for calculating the classification probability is: ;in, Indicates sample Category The probability, This represents an exponential function.
5. The method according to claim 1, characterized in that, The specific method and multi-task iterative training process of the online soft label strategy described in S4 include: S41, based on the data support set samples of the training task, obtaining the Gaussian prototypes and overall covariance matrix of each category in the feature space through the prototype calculation module, forming the Gaussian distribution of each category; S42, inputting the data query set samples of the training task into the embedding module to obtain the corresponding feature vectors; S43, calculating the Euclidean distance between the feature vectors and the Gaussian prototypes of each category, generating soft labels based on the Euclidean distance distribution, the soft labels being used to quantify the similarity probability of the data query set samples relative to the Gaussian prototypes of each category; S44, using the soft labels to replace the hard labels to calculate the cross-entropy loss, and combining the cross-entropy loss corresponding to the hard labels to construct the total training loss; S45, minimizing the total training loss using the gradient descent method, and updating the parameters of the small sample fault diagnosis model; S46, iteratively executing S41 to S45 to complete the multi-task iterative training, obtaining the shared fault diagnosis prior knowledge and optimal initial parameters of the model among the tasks.
6. The method according to claim 1, characterized in that, The specific implementation steps for fine-tuning the Gaussian prototype parameters in S5 include: S51, in the meta-testing stage, calculating the classification confidence of the data query set samples of the test task through the classification module, wherein the classification confidence is determined based on the classification probability output by the classification module; S52, setting a confidence threshold, and determining that the sample feature distribution of the test task has drifted if the classification confidence is lower than the confidence threshold; S53, adjusting the mean parameter and overall covariance matrix parameter of the Gaussian prototype of the corresponding category based on the deviation direction between the feature vector of the data query set samples that are lower than the confidence threshold and the corresponding category Gaussian prototype; S54, using the adjusted Gaussian prototype, recalculating the weighted Euclidean distance and classification probability between the data query set samples and each category Gaussian prototype to complete the fault classification.
7. The method according to claim 5, characterized in that, Before constructing the Gaussian distribution for each category in S41, the steps include support set sample confidence screening and prototype pre-optimization, specifically including: S401, inputting the data support set samples of the training task into the embedding module to obtain the embedding vector and Gaussian covariance matrix output corresponding to each data support set sample; S402, calculating the similarity between the embedding vector of each data support set sample and the embedding vector of other data support set samples of the same category, and determining the category belonging confidence of each data support set sample by combining the feature dispersion reflected by the output of the Gaussian covariance matrix; S403, setting a sample confidence threshold, and filtering out high-confidence samples with category belonging confidence higher than the threshold and low-confidence samples with confidence lower than the threshold; S404, calculating the initial Gaussian prototype and overall covariance matrix based on the high-confidence samples, and then using the deviation between the feature distribution of the low-confidence samples and the initial Gaussian prototype to locally correct the initial Gaussian prototype and overall covariance matrix to obtain the optimized Gaussian prototype and overall covariance matrix, which are used for Gaussian distribution construction in S41.
8. The method according to claim 7, characterized in that, After generating multiple training tasks in S2 and before executing S401, the process further includes a step of training task reliability assessment and priority allocation, specifically including: S91, for each training task, based on the same class assignment confidence calculation logic as in S402, obtaining the average class assignment confidence of all data support set samples within that training task; S92, calculating the class boundary clarity between the optimized Gaussian prototypes of each class within that training task, wherein the class boundary clarity is determined by the ratio of the feature distance between different class Gaussian prototypes to the intra-class feature dispersion; S93, combining the average class assignment confidence and the... S94. Clarity of category boundaries is used to construct a task reliability scoring model, thereby obtaining a reliability score for each training task; S95. A task reliability threshold is set to filter out high-quality training tasks with reliability scores higher than the task reliability threshold and low-quality training tasks with reliability scores lower than the task reliability threshold; S96. A first training weight is assigned to the high-quality training tasks, and a second training weight is assigned to the low-quality training tasks, wherein the second training weight is lower than the first training weight. In the multi-task iterative training in S46, the contribution of each training task to the model parameter update is adjusted according to the first training weight and the second training weight.
9. A rolling bearing small-sample fault diagnosis system based on an online soft-label Gaussian prototype network, characterized in that, include: The acquisition module is used to collect raw vibration signals of rolling bearings under various working conditions, preprocess them, and label them with fault types to build an initial dataset; The generation module is used to divide the initial dataset into a meta-training set and a meta-test set, and generate multiple meta-learning tasks, including a data support set and a data query set, respectively. The meta-learning task includes a training task and a testing task, and the data support set and the data query set have no intersection in the same meta-learning task; the construction module is used to construct a small-sample fault diagnosis model based on a Gaussian prototype network, the small-sample fault diagnosis model including an embedding module, a prototype calculation module and a classification module connected in sequence; the embedding module uses a one-dimensional convolutional neural network to map the vibration signal in the meta-learning task into an embedding vector and generate a confidence region represented by a Gaussian covariance matrix; the prototype calculation module is used to calculate the Gaussian prototype and the overall covariance matrix of each category based on the data support set samples; the classification module is used to achieve fault classification by calculating the Euclidean distance between the embedding vector of the data query set samples and the Gaussian prototype of each category and converting the classification probability; the specific calculation rule of the prototype calculation module is: the prototype calculation module calculates the Gaussian prototype and the overall covariance matrix of each category based on the embedding vector and the corresponding Gaussian covariance matrix output of the data support set samples; for each category The formula for calculating its corresponding Gaussian prototype is: ;in, Indicates category The corresponding Gaussian prototype, This indicates that the data supports a set belonging to a category. The embedding vector corresponding to the sample, This indicates that the output of the embedded module is related to... The corresponding Gaussian covariance matrix output, Represents dot product operation; category The formula for calculating the overall covariance matrix is: ;in, Indicates category The overall covariance matrix; the training module is used to perform meta-training based on the training task and the small sample fault diagnosis model, dynamically generate soft labels using an online soft label strategy, and perform multi-task iterative training by combining hard label and soft label loss to obtain the optimal initial model parameters and fault diagnosis prior knowledge shared between tasks; the testing module is used to perform meta-testing based on the test task and the trained small sample fault diagnosis model, calculate Gaussian prototypes using the data support set samples of the test task, and achieve fault classification by calculating the Euclidean distance between the embedding vectors of the data query set samples of the test task and the Gaussian prototypes of each category; when the sample feature distribution of the test task drifts, the parameters of the Gaussian prototypes are fine-tuned to adapt to cross-condition diagnosis.
Citation Information
Patent Citations
Rotary machinery fault diagnosis method based on distributed projection playback
CN118114140A
Rolling bearing few-sample cross-domain fault diagnosis method based on fine tuning prototype network
CN118551164A
