Bearing fault diagnosis method and system for Meta-Transform driven multi-working-condition equipment
The Meta-Transformer-driven multi-condition bearing fault diagnosis method utilizes deep causal feature learning and meta-learning optimization frameworks to solve the problems of data scarcity and poor cross-condition adaptability in bearing fault diagnosis. It achieves high-precision and fast adaptive fault diagnosis and is suitable for CNC machine tool bearing condition monitoring in aerospace manufacturing.
Patent Information
- Application Number
- CN202511572999.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-02-17
AI Technical Summary
Existing bearing fault diagnosis methods in aerospace manufacturing suffer from problems such as data scarcity, poor adaptability across operating conditions, and neglect of physical causal constraints in the fault evolution process, resulting in low diagnostic accuracy and insufficient generalization ability under varying operating conditions.
A multi-condition equipment bearing fault diagnosis method driven by Meta-Transformer is proposed. Through deep causal feature learning and meta-learning optimization framework, combined with signal acquisition, causal Transformer encoder and multilayer perceptron classifier, it can achieve fast adaptive and high-precision fault diagnosis across operating conditions.
It significantly improves the accuracy of bearing fault diagnosis under small sample conditions, enhances the interpretability and generalization ability of the model, and solves the problem of decreased diagnostic performance caused by feature distribution shift and sample scarcity under multiple working conditions. It is particularly suitable for CNC machine tool bearing condition monitoring and fault prediction in the aerospace manufacturing field.
Smart Images

Figure CN121542830A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial equipment state monitoring and fault diagnosis, in particular to a Meta-Transformer driven multi-working-condition equipment bearing fault diagnosis method and system, which is suitable for the variable working condition bearing fault diagnosis scene under the small sample condition in the aerospace structure processing workshop. BACKGROUND
[0002] As a core component of high-end manufacturing equipment, the health status of high-precision computer numerical control systems directly affects the machining precision and production line stability. In the field of aerospace manufacturing, numerical control systems need to machine high-value alloy parts (such as turbine blades and structural parts) to micron-level tolerances, at which time bearing defects are often highly concealed and spread rapidly. Undetected faults can lead to catastrophic scrap of parts during expensive machining and disrupt production schedules. Therefore, accurate diagnosis of bearing faults is crucial for maintaining the efficient operation of numerical control machine tools.
[0003] The existing bearing fault diagnosis methods mainly have the following limitations: (1) In aerospace production, it is extremely expensive and dangerous to collect enough vibration-based fault data, and this data scarcity problem limits the training and generalization ability of deep learning models; (2) Most methods assume that training and testing data conform to the same distribution, making it difficult to adapt to changes in working conditions in actual production, lacking effective cross-condition knowledge transfer mechanisms, and unable to achieve true few-shot rapid adaptation. Numerical control machine tools often exhibit multi-condition characteristics in actual operation due to factors such as diverse machining tasks, numerous material types, and varying cutting parameters. Under different working conditions, the operating state and fault mode of the equipment may differ significantly, and effective and accurate knowledge transfer and fault diagnosis under variable working conditions are necessary. (3) Existing methods often ignore the physical causal constraints in the fault evolution process, and dynamic adjustments of process parameters in aerospace manufacturing introduce time-varying nonlinear characteristics in bearing contact fatigue damage, which makes the above-mentioned traditional data-based models unreliable under different operating conditions.
[0004] Therefore, there is an urgent need to develop an intelligent bearing fault diagnosis technology that can effectively adapt to multi-condition changes under small sample conditions to meet the high requirements of modern intelligent manufacturing for equipment reliability and safety. SUMMARY
[0005] In view of the low precision and poor generalization ability of existing related technologies for bearing fault diagnosis under variable working conditions and small sample conditions, a Meta-Transformer driven multi-working-condition equipment bearing fault diagnosis method and system is proposed. This technology effectively realizes rapid adaptation and high-precision fault diagnosis across working conditions by integrating deep causal feature learning and meta-learning optimization frameworks.
[0006] The technical scheme of the present application is: A Meta-Transformer driven multi-working condition equipment bearing fault diagnosis method, comprising: Signal acquisition and preprocessing step: collect the vibration signal of the equipment bearing through the vibration sensor, segment and normalize the vibration signal, and generate a two-dimensional time-frequency image through time-frequency transformation; Causal feature extraction step: input the two-dimensional time-frequency image into the causal Transformer encoder to extract deep features, and the causal Transformer encoder adopts a strict lower triangular attention mask mechanism to ensure that the feature extraction process conforms to the time causality law; Fault classification step: input the extracted deep features into the classifier to output the probability distribution of the fault type; Meta-learning optimization step: use a model-independent meta-learning framework to meta-train the causal Transformer encoder and the classifier, learn the model meta-parameters through the construction of a multi-working condition task set and the use of an internal-external double-loop optimization mechanism; Meta-task construction step: construct multiple meta-tasks from multi-working condition data, each meta-task containing a support set and a query set; Internal loop adaptive step: for each meta-task, perform gradient descent calculation on the current meta-parameters using its support set, use an adaptive gradient pruning strategy to clip the gradient, and obtain the parameters adapted to the task; External loop meta-optimization step: based on the loss of the adapted parameters of each meta-task on its query set, calculate the meta-gradient, and update the meta-parameters after clipping the meta-gradient with a fixed threshold; Cross-condition adaptive step: for a new target working condition, quickly adapt the meta-parameters obtained by meta-training using a small number of samples to obtain a fault diagnosis model suitable for the working condition.
[0007] Further, specifically comprising: Step 1) Signal acquisition and time-frequency feature reconstruction: the input of this step is the original one-dimensional vibration signal of the numerical control machine tool bearing under multiple working conditions; the original vibration signal is collected through the vibration sensor installed on the bearing seat of the numerical control machine tool; the signal is segmented by sliding window and normalized by maximum absolute value preprocessing; then, the one-dimensional vibration signal is converted into a two-dimensional time-frequency image by using the complex Morlet wavelet basis function for continuous wavelet transform CWT, and a multi-scale time-frequency feature space for fault diagnosis is constructed as the input of the subsequent deep network; Step 2) Causal Feature Extraction: The two-dimensional time-frequency image obtained in Step 1) is segmented into fixed-size image blocks and mapped into embedding vectors through linear projection. Sine-cosine position coding is introduced into the embedding vectors to preserve the temporal order information of the signal. Subsequently, the embedding sequence is input into a causal Transformer encoder with a strict lower triangular attention masking mechanism for deep feature extraction. This masking mechanism ensures that when the fault diagnosis model calculates the attention weights of the current time step, it can only access information from the current and historical moments and cannot see information from future moments. The output of this step is a fault deep feature sequence with causal relationships. Step 3) Fault Classification: The fault depth feature sequence extracted in Step 2) is input into a classifier network composed of a three-layer multilayer sensing mechanism. Finally, the probability distribution of bearing fault categories is output through the Softmax function to achieve end-to-end fault diagnosis. The fault categories include inner ring fault, outer ring fault, rolling element fault, cage fault, and normal state. Step 4) Meta-learning optimization and cross-condition adaptation: The fault diagnosis model based on causal Transformer is embedded into the model-independent meta-learning (MAML) framework. By simulating the changing working conditions of CNC machine tools processing different products, a large number of cross-condition diagnostic tasks are constructed for meta-learning. The model-independent meta-learning framework includes two stages: meta-training and meta-testing. In the meta-training stage, the input is the original vibration signals and two-dimensional time-frequency images under multiple known working conditions. An inner-outer double-loop optimization mechanism is adopted, and the output is the model meta-parameters with strong generalization ability. In the meta-testing stage, the input is a very small number of samples under the target new working condition. By using the very small number of samples under this working condition to perform one or several steps of gradient update of the meta-parameters for rapid adaptation, the initialization parameters for updating the fault diagnosis model for this working condition can be obtained, and finally, the rapid deployment and fault diagnosis of the model under unknown working conditions can be achieved.
[0008] Furthermore, meta-learning optimization specifically includes: The model is divided into a meta-training phase and a meta-testing phase. In the meta-training phase, the model systematically learns to master the core principles of cross-task generalization. First, a large number of simulated diagnostic tasks are constructed from data containing various working conditions. Each task includes a support set and a query set. Then, the model enters the core inner-outer double-loop optimization process. In the inner loop, the model rapidly fine-tunes with a small number of samples for a single task, learning the specific features of that task. In the outer loop, the initial parameters of the model are optimized inversely based on the overall performance of the model after fine-tuning across multiple tasks. This phase iterates repeatedly, with the ultimate goal of obtaining a set of initial model parameters, i.e., meta-parameters. These parameters form the basis for the model's ability to quickly adapt to new tasks. The meta-testing phase is used to verify the model's rapid adaptability to real new tasks. First, the optimal initial parameters obtained in the meta-training phase are loaded. Then, facing a completely new target task, the model quickly adapts using only a very small number of samples provided by that task, i.e., the support set. Finally, the model's diagnostic performance on the new task is ultimately evaluated using the samples from that task that were not used in training, i.e., the query set.
[0009] Furthermore, the causal Transformer encoder specifically includes: The encoder employs a four-layer stacked architecture. The input is a time-frequency map generated by continuous wavelet transform. These image patches are converted into 256-dimensional embedding vectors through linear projection and superimposed with sine and cosine position codes to preserve temporal information. The core of the encoder is a causal self-attention module with eight attention heads, which ensures that each time step can only focus on features of the current and historical moments through a strict lower triangular mask matrix, thereby maintaining the physical causal relationship of fault propagation. The input is fed into a feedforward neural network, normalized by layers, and regularized by dropout with a value of 0.1. Finally, the extracted deep features are used to achieve end-to-end fault classification through three fully connected layers.
[0010] Furthermore, its characteristics specifically include: Step 1: Data acquisition and preprocessing; converting the raw vibration signal into a time-frequency image that can characterize the impact features of the fault; Step 1.1) Signal Acquisition and Segmentation: The original vibration signal is acquired by a vibration acceleration sensor installed on the bearing housing of the CNC machine tool; the continuous signal is segmented using a sliding window with a window length of 1024 sampling points and a step size of 512 sampling points to fully preserve the transient information of the fault impact; Step 1.2) Data normalization: Perform maximum absolute value normalization on the signal segment within each window to unify the amplitude of all data to the range of [-1, 1] and eliminate the influence of dimensions; Step 1.3) Continuous Wavelet Transform: To extract the time-frequency features of the non-stationary signal, a continuous wavelet transform (CWT) is performed on the normalized signal segment using the complex Morlet wavelet basis function to generate a two-dimensional time-frequency graph; where the bandwidth parameter B=1, the center frequency C=3, and the scale parameter... The value range is from 1 to 64; this transformation reconstructs the one-dimensional vibration signal into a multi-scale time-frequency feature space, providing a high-information-density input for subsequent deep feature extraction; the CWT calculation formula is:
[0011] in, It is a one-dimensional vibration signal. For wavelet basis functions, For scale parameters, For translation parameters, t The time variable of the original signal; It represents the result after continuous wavelet transform, reflecting the energy distribution of the signal at different times and scales; Step 2: Feature extraction and fault classification based on causal Transformer; This step utilizes a deep learning model with physical causal constraints to construct a fault diagnosis model, extracting deep features from the time-frequency graph and achieving fault classification; Step 2.1) Image Patch Embedding and Position Encoding: The two-dimensional time-frequency image obtained in Step 1 is divided into 8×8 image patches, and each image patch is converted into a 256-dimensional embedding vector through linear projection; subsequently, sine-cosine position encoding is added to embed temporal sequence information into the fault diagnosis model; the position encoding calculation formula is as follows:
[0012] in, Indicates the time step index. Indicates a dimension index. =256 is the hidden dimension; Step 2.2) Causal self-attention feature extraction: Input the embedding vector into a 4-layer stacked Transformer encoder; the mask matrix is defined as follows:
[0013] i This represents the row index of the matrix, corresponding to the current time step; j Represents the column index of the matrix, corresponding to the historical time step; Therefore, the formula for calculating causal self-attention in Transformer is:
[0014] in, Q, K , V These are the query, key, and value matrices, respectively, obtained by linear projection of the input vector; It represents the Hadamardi (or Hadama) stack; The dimension of the key vector. d This indicates the total dimension of the model, which is 512. h The number of heads representing multi-head attention is 8; Finally, the output is a fault depth feature sequence with causal relationships; Step 2.3) Fault Classification: Input the fault depth feature sequence output by the Transformer encoder into a 3-layer multilayer perceptron classifier, and finally output the probability distribution of fault type through the Softmax function to achieve end-to-end fault diagnosis; Step 3: Adaptive optimization across working conditions based on model-independent meta-learning (MAML); By utilizing meta-learning strategies, the fault diagnosis model established in step two can quickly adapt to unknown new working conditions. Step 3.1) Meta-training Task Construction: Simulate varying operating conditions when CNC machine tools process different products, and construct a large number of meta-tasks; each meta-task simulates a specific operating condition, from which a certain type of fault is randomly selected, and each type of fault is randomly sampled. Each sample constitutes a support set. Used for rapid model adaptation; additional extraction The query set consists of 10 samples. This is used to evaluate the adaptation effect and update the meta parameters; Step 3.2) Inner Loop Adaptation: For each meta-task, load the initial values of the meta-parameters. ; Use its support set The loss is calculated, and an adaptive gradient pruning strategy is used to perform 1 to 5 rounds of iterative gradient descent to obtain the parameters adapted for this task. Adaptive threshold The gradient norm is dynamically calculated from the 90th percentile of the historical gradient norm to suppress abnormally large gradients and balance convergence and stability. The inner loop update formula is:
[0015] in It is the learning rate of the inner loop; This represents the gradient clipping operation, which restricts the norm of the gradient vector to within a threshold. Indicates loss For parameters The gradient; Step 3.3) Outer Loop Meta-Optimization: Compute based on the query set of each meta-task. The loss is calculated, and the gradient of this loss is backpropagated back to the initial metaparameters using the chain rule. To avoid instability in cross-task optimization, a fixed threshold is used. Prune the meta-gradient; finally update the meta-parameters:
[0016] in It is the learning rate of the outer loop; Step 3.4) Meta-testing and rapid deployment: For unknown new operating conditions, construct an n-way k-shot support set from the data of that operating condition; load the optimal meta-parameters obtained from meta-training. Only a single-step inner loop adaptive operation is needed to obtain the optimized model parameters for this new operating condition. This can then be used for the accurate diagnosis of bearing failures under this operating condition.
[0017] A Meta-Transformer-driven multi-condition equipment bearing fault diagnosis system, used in the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method as described above, includes: The signal preprocessing module is used to receive vibration sensor signals, perform segmentation, normalization, and time-frequency transformation processing, and output a two-dimensional time-frequency image. The causal feature extraction module includes a causal Transformer encoder, which is used to extract deep features that conform to the time causality law from time-frequency images; The fault classification module includes a multilayer perceptron classifier, which is used to output the probability distribution of fault types based on deep features. The meta-learning optimization module is used to manage the construction of meta-tasks, the optimization of internal and external loops of meta-training, and the rapid adaptive process for new working conditions.
[0018] A storage medium storing a computer program that, when executed by a processor, implements the steps of the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method as described.
[0019] A computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method as described above.
[0020] The beneficial effects of this invention are as follows: 1) A multimodal collaborative diagnosis framework for bearing faults was constructed: integrating time-frequency analysis, causal Transformer and meta-learning techniques, a collaborative diagnosis solution for bearing faults with small sample variable operating conditions was proposed, which significantly improved the accuracy of bearing fault diagnosis under few sample conditions.
[0021] 2) A bearing fault feature extraction mechanism with physical causal constraints was designed: the identifiability of weak bearing fault features was enhanced by wavelet transform, and a causal Transformer architecture with strict lower triangular attention mask was adopted to ensure that the bearing fault feature extraction process conforms to the causal temporal law of the physical system, thereby improving the interpretability and generalization ability of the model.
[0022] 3) A dynamic meta-learning optimization strategy for bearing fault diagnosis was developed: Based on the meta-training-meta-testing closed-loop mechanism, a dynamic meta-learning strategy specifically for bearing fault diagnosis with few samples was constructed. While ensuring model stability, it significantly improved the cross-working condition adaptability in the data-scarce environment and achieved true rapid adaptation with few samples.
[0023] 4) Improved the practicality of bearing fault diagnosis in industrial applications: This invention effectively solves the problem of decreased diagnostic model performance caused by feature distribution shift and sample scarcity under multiple working conditions. It is particularly suitable for bearing condition monitoring and fault prediction of CNC machine tools in the aerospace manufacturing field and has important engineering application value. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of the overall framework of the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method of the present invention; Figure 2 This is a schematic diagram of the algorithm flow of the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method of the present invention; Figure 3 This is a schematic diagram of the causal Transformer encoder of the present invention; Figure 4 This is a schematic diagram of the meta-learning framework structure of the present invention. Detailed Implementation
[0025] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0026] This invention addresses the risk of bearing fatigue damage in CNC machine tools during aerospace manufacturing due to dynamic adjustments in process parameters, as well as challenges such as characteristic distribution shifts and scarcity of fault samples caused by varying operating conditions. This invention constructs a diagnostic system through three core modules, such as... Figure 1 As shown: First, continuous wavelet transform is used to reconstruct the original bearing signal into a multi-scale time-frequency feature space; then, a causal Transformer architecture with a strict lower triangular attention mask is designed to achieve feature extraction and classification based on the physical causality of fault propagation; finally, the above mechanism is integrated into a model-independent meta-learning framework, and fast adaptation across operating conditions is achieved through an adaptive gradient pruning strategy. A Meta-Transformer-driven multi-operating-condition equipment bearing fault diagnosis method includes: Step 1) Signal Acquisition and Time-Frequency Feature Reconstruction: The input for this step is the original one-dimensional vibration signal of the CNC machine tool bearing under multiple operating conditions. The original vibration signal is acquired by a vibration sensor installed on the CNC machine tool bearing housing; the signal is preprocessed by sliding window segmentation and maximum absolute value normalization; subsequently, the one-dimensional vibration signal is converted into a two-dimensional time-frequency image by continuous wavelet transform (CWT) using complex Morlet wavelet basis functions, constructing a multi-scale time-frequency feature space for fault diagnosis, which serves as the input for subsequent deep networks.
[0027] Step 2) Causal Feature Extraction: The two-dimensional time-frequency image obtained in Step 1) is segmented into fixed-size image blocks and mapped to embedding vectors through linear projection. Sine-cosine position coding is introduced into the embedding vectors to preserve the temporal order information of the signal. Subsequently, the embedding sequence is input into a causal Transformer encoder with a strict lower triangular attention masking mechanism for deep feature extraction. This masking mechanism ensures that when the fault diagnosis model calculates the attention weights at the current time step, it can only access information from the current and historical moments, and cannot glimpse future information, thus strictly guaranteeing that the feature extraction process conforms to the physical causal law of fault evolution. The output of this step is a fault deep feature sequence with causal relationships.
[0028] Step 3) Fault Classification: The fault depth feature sequence extracted in Step 2) is input into a classifier network composed of a three-layer multilayer sensing mechanism. Finally, the probability distribution of bearing fault categories is output through the Softmax function to achieve end-to-end fault diagnosis. The fault categories include inner ring faults, outer ring faults, rolling element faults, cage faults, and normal conditions.
[0029] Step 4) Meta-learning Optimization and Cross-Condition Adaptation: The fault diagnosis model based on causal Transformer is embedded into a model-independent meta-learning (MAML) framework. By simulating varying operating conditions when CNC machine tools process different products, a large number of cross-condition diagnostic tasks are constructed for meta-learning. This MAML framework consists of two phases: meta-training and meta-testing. In the meta-training phase, the input consists of raw vibration signals and two-dimensional time-frequency images under multiple known operating conditions. An inner-outer dual-loop optimization mechanism is used, and the output is model meta-parameters with strong generalization ability. In the meta-testing phase, the input consists of a very small number of samples (e.g., 1-5 samples per class) under the target new operating condition. Using these very small samples under this operating condition, the meta-parameters are rapidly adapted through one or several gradient updates, thus obtaining the initial parameters for updating the high-precision fault diagnosis model for this operating condition. Ultimately, this achieves rapid deployment and high-precision fault diagnosis of the model under unknown operating conditions.
[0030] The specific implementation is as follows: A Meta-Transformer-driven multi-condition bearing fault diagnosis method addresses the challenge of diagnosing bearing faults in CNC machine tools during aerospace manufacturing caused by varying operating conditions. This method constructs a three-module diagnostic system—signal preprocessing, causal feature extraction, and meta-learning adaptive processing—to achieve high-precision and highly generalized fault diagnosis. Figure 2 As shown, firstly, based on the original bearing signal, the vibration signal is converted into a time-frequency diagram as input through continuous wavelet transform (CWT); secondly, according to the causal relationship of the fault propagation time series, a causal Transformer layer is designed for feature extraction and classification; finally, a two-stage meta-learning strategy combining meta-training and meta-testing is adopted to achieve rapid adaptation of parameters across working conditions, thereby enhancing the performance of small-sample fault diagnosis under varying working conditions.
[0031] Specifically, the following steps are included: Step 1: Data Acquisition and Preprocessing. This step aims to convert the raw vibration signal into a time-frequency image that can characterize the impact features of the fault.
[0032] Step 1.1) Signal Acquisition and Segmentation: The raw vibration signal is acquired by a vibration acceleration sensor installed on the bearing housing of the CNC machine tool. The continuous signal is segmented using a sliding window, with the window length set to 1024 sampling points and the step size set to 512 sampling points, to fully preserve the transient information of the fault impact.
[0033] Step 1.2) Data normalization: Perform maximum absolute value normalization on the signal segment within each window to unify the amplitude of all data to the range of [-1, 1] and eliminate the influence of dimensions.
[0034] Step 1.3) Continuous Wavelet Transform: To extract the time-frequency features of the non-stationary signal, the complex Morlet wavelet basis functions (cmor1-3) are used to perform a continuous wavelet transform (CWT) on the normalized signal segment, generating a two-dimensional time-frequency graph. The bandwidth parameter B=1, the center frequency C=3, and the scale parameter... The value range is from 1 to 64. This transformation reconstructs the one-dimensional vibration signal into a multi-scale time-frequency feature space, providing a high-information-density input for subsequent deep feature extraction. The CWT calculation formula is:
[0035] in, It is a one-dimensional vibration signal. For wavelet basis functions, For scale parameters, For translation parameters, t The time variable of the original signal; It represents the result after continuous wavelet transform, reflecting the energy distribution of the signal at different times and scales (frequency).
[0036] Step 2: Feature extraction and fault classification based on causal Transformer. For example... Figure 3 As shown, this step utilizes a deep learning model with physical causal constraints to construct a fault diagnosis model, extracts deep features from the time-frequency graph, and achieves fault classification.
[0037] Step 2.1) Image Patch Embedding and Position Encoding: The two-dimensional time-frequency map obtained in Step 1 is divided into 8×8 image patches, and each image patch is converted into a 256-dimensional embedding vector through linear projection. Subsequently, sine-cosine position encoding is added to embed temporal sequence information into the fault diagnosis model. The position encoding calculation formula is as follows:
[0038] in, Indicates the time step index. Indicates a dimension index. =256 is the hidden dimension.
[0039] Step 2.2) Causal self-attention feature extraction: Input the embedding vector into a 4-layer stacked Transformer encoder. For example... Figure 3As shown, the encoder employs a four-layer stacked architecture, with the input being a time-frequency map generated by continuous wavelet transform. These image patches are transformed into 256-dimensional embedding vectors through linear projection and superimposed with sine and cosine positional codes to preserve temporal information. The core of the encoder is a causal self-attention module comprising eight attention heads, which ensures, through a strict lower triangular mask matrix, that each time step only focuses on features from the current and historical moments (the weights for future moments are forced to be negative infinity), thereby maintaining the physical causal relationship of fault propagation. The data is fed into a feedforward neural network, normalized through layers, and regularized using a dropout rate of 0.1. Finally, the extracted deep features are used to achieve end-to-end fault classification through three fully connected layers.
[0040] The mask matrix is defined as follows:
[0041] i This represents the row index of the matrix, corresponding to the current time step; j Represents the column index of the matrix, corresponding to the historical time step; Therefore, the formula for calculating causal self-attention in Transformer is:
[0042] in, Q , K , V These are the query, key, and value matrices, respectively, obtained by linear projection of the input vector; It represents the Hadamardi (or Hadama) stack; The dimension of the key vector. d The total dimension of the model is 512 in this invention; h The number of heads representing multi-head attention is 8 in this invention.
[0043] Finally, the output is a fault depth feature sequence with causal relationships.
[0044] Step 2.3) Fault Classification: Input the fault depth feature sequence output by the Transformer encoder into a 3-layer multilayer perceptron (MLP) classifier, and finally output the probability distribution of fault types through the Softmax function to achieve end-to-end fault diagnosis.
[0045] Step 3: Adaptive optimization across operating conditions based on Model-Independent Meta-Learning (MAML). For example... Figure 4As shown, the core process of meta-learning technology consists of two main stages: the meta-training stage and the meta-testing stage. Its purpose is to enable the model to acquire a general ability to quickly adapt to new and unknown tasks through learning from a large number of related tasks. In the meta-training stage, the model undergoes systematic learning to master the core principles of cross-task generalization. First, a large number of simulated diagnostic tasks are constructed from data containing various working conditions. Each task includes a support set (for rapid model adaptation) and a query set (for evaluating adaptation effectiveness). Subsequently, the model enters the core inner-outer double-loop optimization process. In the inner loop, the model is rapidly fine-tuned with a small number of samples for a single task, learning the specific features of that task; in the outer loop, the initial parameters of the model are optimized backward based on the overall performance of the model after fine-tuning across multiple tasks. This stage iterates repeatedly, with the ultimate goal of obtaining a set of "sensitive and excellent" initial model parameters (i.e., meta-parameters). This set of parameters forms the basis for the model's ability to quickly adapt to new tasks. The meta-testing stage is used to verify the model's rapid adaptation ability on real new tasks. First, the optimal initial parameters obtained in the meta-training stage are loaded. Next, when faced with a completely new target task, the model can quickly adapt by using only a very small number of samples (support set) provided by the task for a simple one-step inner loop adaptation. Finally, the model's diagnostic performance on the new task is evaluated using samples that were not used in training in the previous task (query set). Through this process, the model can efficiently complete knowledge transfer and rapid deployment from an old domain to a new domain without requiring a large amount of data or long training time.
[0046] This step aims to utilize meta-learning strategies to enable the fault diagnosis model established in step two to quickly adapt to unknown new operating conditions.
[0047] Step 3.1) Meta-training Task Construction: Simulate varying operating conditions when CNC machine tools process different products, and construct a large number of meta-tasks. Each meta-task simulates a specific operating condition, from which a certain type of fault is randomly selected. For each type of fault, random sampling is performed. Each sample constitutes a support set. Used for rapid model adaptation; additional extraction The query set consists of 10 samples. This is used to evaluate the adaptation effect and update the meta parameters.
[0048] Step 3.2) Inner Loop Adaptation: For each meta-task, load the initial values of the meta-parameters. Using its support set The loss is calculated, and an adaptive gradient pruning strategy is used to perform 1 to 5 rounds of iterative gradient descent to obtain the parameters adapted for this task. Adaptive threshold The gradient norm is dynamically calculated from the 90th percentile of the historical gradient norm to suppress abnormally large gradients and balance convergence and stability.
[0049] The inner loop update formula is:
[0050] in It is the learning rate of the inner loop. This represents the gradient clipping operation, which restricts the norm of the gradient vector to within a threshold. Indicates loss For parameters The gradient (partial derivative vector).
[0051] Step 3.3) Outer Loop Meta-Optimization: Compute based on the query set of each meta-task. The loss is calculated, and the gradient of this loss is backpropagated back to the initial metaparameters using the chain rule. To avoid instability in cross-task optimization, a fixed threshold is used ( The meta-gradient is pruned. Finally, the meta-parameters are updated.
[0052] in It is the learning rate of the outer loop.
[0053] Step 3.4) Meta-testing and rapid deployment: For unknown new operating conditions (test conditions), construct an n-way k-shot support set from the data of that operating condition. Load the optimal meta-parameters obtained from meta-training. Only a single-step inner loop adaptive operation is needed to obtain the optimized model parameters for this new operating condition. This can then be used for the accurate diagnosis of bearing failures under this operating condition.
[0054] A bearing fault diagnosis system, comprising: The signal preprocessing module is used to receive vibration sensor signals, perform segmentation, normalization, and time-frequency transformation processing, and output a two-dimensional time-frequency image. The causal feature extraction module includes a causal Transformer encoder, which is used to extract deep features that conform to the time causality law from time-frequency images; The fault classification module includes a multilayer perceptron classifier, which is used to output the probability distribution of fault types based on deep features. The meta-learning optimization module is used to manage the construction of meta-tasks, the optimization of internal and external loops of meta-training, and the rapid adaptive process for new working conditions.
[0055] A storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method.
[0056] A computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method.
[0057] The above-described embodiments are merely one implementation of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention should be determined by the appended claims.
Claims
1. A method for diagnosing bearing faults in multi-condition equipment driven by Meta-Transformer, characterized in that, include: Signal acquisition and preprocessing steps: The vibration signal of the equipment bearing is acquired by a vibration sensor, and the vibration signal is segmented and normalized. Then, a two-dimensional time-frequency image is generated by time-frequency transformation. Causal feature extraction step: The two-dimensional time-frequency image is input into a causal Transformer encoder to extract depth features. The causal Transformer encoder adopts a strict lower triangular attention mask mechanism to ensure that the feature extraction process conforms to the temporal causality law. Fault classification steps: Input the extracted deep features into the classifier and output the probability distribution of fault types; Meta-learning optimization steps: The causal Transformer encoder and classifier are meta-trained using a model-independent meta-learning framework. By constructing a multi-condition task set, the model meta-parameters are learned using an inner and outer double-loop optimization mechanism. Meta-task construction steps: Construct multiple meta-tasks from multi-condition data, each meta-task containing a support set and a query set; Inner loop adaptive steps: For each meta-task, perform gradient descent calculation on the current meta-parameters using its support set, and use an adaptive gradient pruning strategy to prune the gradients to obtain the parameters adapted for the task. The outer loop meta-optimization steps are as follows: Based on the loss of the parameters adapted by each meta-task on its query set, calculate the meta gradient, and update the meta parameters after pruning the meta gradient with a fixed threshold. Cross-condition adaptive steps: For a new target condition, the meta-parameters obtained from meta-training are quickly adapted using a small number of samples to obtain a fault diagnosis model suitable for that condition.
2. The method for diagnosing bearing faults in multi-condition equipment driven by Meta-Transformer according to claim 1, characterized in that, Specifically, it includes: Step 1) Signal Acquisition and Time-Frequency Feature Reconstruction: The input for this step is the original one-dimensional vibration signal of the CNC machine tool bearing under multiple working conditions; the original vibration signal is acquired by a vibration sensor installed on the CNC machine tool bearing housing; the signal is preprocessed by sliding window segmentation and maximum absolute value normalization; then, the one-dimensional vibration signal is converted into a two-dimensional time-frequency image by continuous wavelet transform (CWT) using complex Morlet wavelet basis functions, and a multi-scale time-frequency feature space for fault diagnosis is constructed as the input for subsequent deep networks; Step 2) Causal Feature Extraction: The two-dimensional time-frequency image obtained in Step 1) is segmented into fixed-size image blocks and mapped into embedding vectors through linear projection. Sine-cosine position coding is introduced into the embedding vectors to preserve the temporal order information of the signal. Subsequently, the embedding sequence is input into a causal Transformer encoder with a strict lower triangular attention masking mechanism for deep feature extraction. This masking mechanism ensures that when the fault diagnosis model calculates the attention weights of the current time step, it can only access information from the current and historical moments and cannot see information from future moments. The output of this step is a fault deep feature sequence with causal relationships. Step 3) Fault Classification: The fault depth feature sequence extracted in Step 2) is input into a classifier network composed of a three-layer multilayer sensing mechanism. Finally, the probability distribution of bearing fault categories is output through the Softmax function to achieve end-to-end fault diagnosis. The fault categories include inner ring fault, outer ring fault, rolling element fault, cage fault, and normal state. Step 4) Meta-learning optimization and cross-condition adaptation: The fault diagnosis model based on causal Transformer is embedded into the model-independent meta-learning (MAML) framework. By simulating the changing working conditions of CNC machine tools processing different products, a large number of cross-condition diagnostic tasks are constructed for meta-learning. The model-independent meta-learning framework includes two stages: meta-training and meta-testing. In the meta-training stage, the input is the original vibration signals and two-dimensional time-frequency images under multiple known working conditions. An inner-outer double-loop optimization mechanism is adopted, and the output is the model meta-parameters with strong generalization ability. In the meta-testing stage, the input is a very small number of samples under the target new working condition. By using the very small number of samples under this working condition to perform one or several steps of gradient update of the meta-parameters for rapid adaptation, the initialization parameters for updating the fault diagnosis model for this working condition can be obtained, and finally, the rapid deployment and fault diagnosis of the model under unknown working conditions can be achieved.
3. The method for diagnosing bearing faults in multi-condition equipment driven by Meta-Transformer according to claim 1, characterized in that, Meta-learning optimization specifically includes: The model is divided into a meta-training phase and a meta-testing phase. In the meta-training phase, the model systematically learns to master the core principles of cross-task generalization. First, a large number of simulated diagnostic tasks are constructed from data containing various working conditions. Each task includes a support set and a query set. Then, the model enters the core inner-outer double-loop optimization process. In the inner loop, the model rapidly fine-tunes with a small number of samples for a single task, learning the specific features of that task. In the outer loop, the initial parameters of the model are optimized inversely based on the overall performance of the model after fine-tuning across multiple tasks. This phase iterates repeatedly, with the ultimate goal of obtaining a set of initial model parameters, i.e., meta-parameters. These parameters form the basis for the model's ability to quickly adapt to new tasks. The meta-testing phase is used to verify the model's rapid adaptability to real new tasks. First, the optimal initial parameters obtained in the meta-training phase are loaded. Then, facing a completely new target task, the model quickly adapts using only a very small number of samples provided by that task, i.e., the support set. Finally, the model's diagnostic performance on the new task is ultimately evaluated using the samples from that task that were not used in training, i.e., the query set.
4. The method for diagnosing bearing faults in multi-condition equipment driven by Meta-Transformer according to claim 1, characterized in that, The causal Transformer encoder specifically includes: The encoder employs a four-layer stacked architecture. The input is a time-frequency map generated by continuous wavelet transform. These image patches are converted into 256-dimensional embedding vectors through linear projection and superimposed with sine and cosine position codes to preserve temporal information. The core of the encoder is a causal self-attention module with eight attention heads, which ensures that each time step can only focus on features of the current and historical moments through a strict lower triangular mask matrix, thereby maintaining the physical causal relationship of fault propagation. The input is fed into a feedforward neural network, normalized by layers, and regularized by dropout with a value of 0.
1. Finally, the extracted deep features are used to achieve end-to-end fault classification through three fully connected layers.
5. The method for diagnosing bearing faults in multi-condition equipment driven by Meta-Transformer according to claim 1, characterized in that, Specifically, it includes: Step 1: Data acquisition and preprocessing; converting the raw vibration signal into a time-frequency image that can characterize the impact features of the fault; Step 1.1) Signal Acquisition and Segmentation: The original vibration signal is acquired by a vibration acceleration sensor installed on the bearing housing of the CNC machine tool; the continuous signal is segmented using a sliding window with a window length of 1024 sampling points and a step size of 512 sampling points to fully preserve the transient information of the fault impact; Step 1.2) Data normalization: Perform maximum absolute value normalization on the signal segment within each window to unify the amplitude of all data to the range of [-1, 1] and eliminate the influence of dimensions; Step 1.3) Continuous Wavelet Transform: To extract the time-frequency features of the non-stationary signal, a continuous wavelet transform (CWT) is performed on the normalized signal segment using the complex Morlet wavelet basis function to generate a two-dimensional time-frequency graph; where the bandwidth parameter B=1, the center frequency C=3, and the scale parameter... The value range is from 1 to 64; this transformation reconstructs the one-dimensional vibration signal into a multi-scale time-frequency feature space, providing a high-information-density input for subsequent deep feature extraction; the CWT calculation formula is: in, It is a one-dimensional vibration signal. For wavelet basis functions, For scale parameters, For translation parameters, t The time variable of the original signal; It represents the result after continuous wavelet transform, reflecting the energy distribution of the signal at different times and scales; Step 2: Feature extraction and fault classification based on causal Transformer; This step utilizes a deep learning model with physical causal constraints to construct a fault diagnosis model, extracting deep features from the time-frequency graph and achieving fault classification; Step 2.1) Image Patch Embedding and Position Encoding: The two-dimensional time-frequency image obtained in Step 1 is divided into 8×8 image patches, and each image patch is converted into a 256-dimensional embedding vector through linear projection; subsequently, sine-cosine position encoding is added to embed temporal sequence information into the fault diagnosis model; the position encoding calculation formula is as follows: in, Indicates the time step index. Indicates a dimension index. =256 is the hidden dimension; Step 2.2) Causal self-attention feature extraction: Input the embedding vector into a 4-layer stacked Transformer encoder; the mask matrix is defined as follows: i This represents the row index of the matrix, corresponding to the current time step; j Represents the column index of the matrix, corresponding to the historical time step; Therefore, the formula for calculating causal self-attention in Transformer is: in, Q , K , V These are the query, key, and value matrices, respectively, obtained by linear projection of the input vector; It represents the Hadamardi (or Hadama) stack; The dimension of the key vector. d This indicates the total dimension of the model, which is 512. h The number of heads representing multi-head attention is 8; Finally, the output is a fault depth feature sequence with causal relationships; Step 2.3) Fault Classification: Input the fault depth feature sequence output by the Transformer encoder into a 3-layer multilayer perceptron classifier, and finally output the probability distribution of fault type through the Softmax function to achieve end-to-end fault diagnosis; Step 3: Adaptive optimization across working conditions based on model-independent meta-learning (MAML); By utilizing meta-learning strategies, the fault diagnosis model established in step two can quickly adapt to unknown new working conditions. Step 3.1) Meta-training Task Construction: Simulate varying operating conditions when CNC machine tools process different products, and construct a large number of meta-tasks; each meta-task simulates a specific operating condition, from which a certain type of fault is randomly selected, and each type of fault is randomly sampled. Each sample constitutes a support set. Used for rapid model adaptation; additional extraction The query set consists of 10 samples. This is used to evaluate the adaptation effect and update the meta parameters; Step 3.2) Inner Loop Adaptation: For each meta-task, load the initial values of the meta-parameters. ; Use its support set The loss is calculated, and an adaptive gradient pruning strategy is used to perform 1 to 5 rounds of iterative gradient descent to obtain the parameters adapted for this task. Adaptive threshold The gradient norm is dynamically calculated from the 90th percentile of the historical gradient norm to suppress abnormally large gradients and balance convergence and stability. The inner loop update formula is: in It is the learning rate of the inner loop; This represents the gradient clipping operation, which restricts the norm of the gradient vector to within a threshold. Indicates loss For parameters The gradient; Step 3.3) Outer Loop Meta-Optimization: Compute based on the query set of each meta-task. The loss is calculated, and the gradient of this loss is backpropagated back to the initial metaparameters using the chain rule. To avoid instability in cross-task optimization, a fixed threshold is used. Prune the meta-gradient; finally update the meta-parameters: in It is the learning rate of the outer loop; Step 3.4) Meta-testing and rapid deployment: For unknown new operating conditions, construct an n-way k-shot support set from the data of that operating condition; load the optimal meta-parameters obtained from meta-training. Only a single-step inner loop adaptive operation is needed to obtain the optimized model parameters for this new operating condition. This can then be used for the accurate diagnosis of bearing failures under this operating condition.
6. A Meta-Transformer-driven multi-condition equipment bearing fault diagnosis system, characterized in that, The method for diagnosing bearing faults in multi-condition equipment driven by Meta-Transformer as described in any one of claims 1-3 includes: The signal preprocessing module is used to receive vibration sensor signals, perform segmentation, normalization, and time-frequency transformation processing, and output a two-dimensional time-frequency image. The causal feature extraction module includes a causal Transformer encoder, which is used to extract deep features that conform to the time causality law from time-frequency images; The fault classification module includes a multilayer perceptron classifier, which is used to output the probability distribution of fault types based on deep features. The meta-learning optimization module is used to manage the construction of meta-tasks, the optimization of internal and external loops of meta-training, and the rapid adaptive process for new working conditions.
7. A storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the steps of the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method as described in any one of claims 1-3.
8. A computing device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the Meta-Transformer-driven multi-condition equipment bearing fault diagnosis method as described in any one of claims 1-3.
Citation Information
Cited By
Method and device for predicting dynamic mechanical property of damaged concrete in complex environment
CN121809299A
Bearing fault diagnosis method for new working condition limited data scene and related device
CN121959309A
Elevator predictive fault early diagnosis method based on data driving
CN122072699A
Apparatus fault diagnosis method based on causal residual learning and invariant risk minimization
CN122333119A
Apparatus fault diagnosis method based on causal residual learning and invariant risk minimization
CN122333119B