Group diffusion transformer-based rv reducer small sample fault diagnosis method and system
By combining Group Diffusion Transformer and ResNet-18, local-global hierarchical feature extraction was achieved in small-sample fault diagnosis of RV reducers, which solved the problem of insufficient diagnostic performance in the existing technology and improved the accuracy of fault type and severity identification.
Patent Information
- Application Number
- CN202611701388.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-30
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies for RV reducer fault diagnosis, especially under small sample conditions, struggle to effectively extract local-global hierarchical fault features, resulting in insufficient diagnostic performance. This is particularly true when the differences in fault severity are subtle, making accurate identification difficult.
The group diffusion Transformer method is adopted, which introduces cross-sample attention mechanism and dual constraint information, uses ViT to extract hierarchical fault features for data augmentation, and uses ResNet-18 fault refinement classifier to simultaneously classify fault type and severity.
It significantly improves the fine-grained performance of small-sample fault diagnosis for RV reducers, enabling accurate identification of fault types and severity, and improving the accuracy and efficiency of diagnosis.
Smart Images

Figure CN123178987A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated equipment monitoring, and specifically to a method and system for small-sample fault diagnosis of RV reducers based on group diffusion Transformer. Background Technology
[0002] Industrial robots are core equipment in modern manufacturing, widely used in automobile manufacturing, electronic assembly, welding, painting, and cargo handling. The reliability of industrial robot operation directly affects production efficiency and safety. RV reducers (rotary vector reducers), as core transmission components of industrial robot joint drive systems, are widely used in the high-load joints of six-axis industrial robots, such as the waist, shoulder, and elbow joints, due to their high precision, high rigidity, large transmission ratio, and long service life. Statistics show that RV reducers account for more than one-third of the total cost of an industrial robot, and their performance directly determines the robot's positioning accuracy and repeatability. The internal structure of an RV reducer is complex, including precision components such as the input gear, cycloidal wheel, pin gear housing, crankshaft, output bearing, and planetary carrier. These components have complex kinematic and dynamic coupling relationships. Under long-term high-speed, high-torque operating conditions, RV reducers are prone to typical failures such as tooth surface pitting and wear, cycloidal wheel cracks, pin gear housing surface fatigue spalling, and output bearing rolling element defects. If an RV reducer fails, it will severely reduce the robot's positioning accuracy, decrease transmission efficiency, and abnormally increase operating noise. In severe cases, it can even cause the entire machine to shut down and the production line to be interrupted, resulting in huge economic losses and safety hazards for enterprises. Therefore, timely and accurate fault diagnosis of RV reducers is a key link in ensuring the safe and reliable operation of industrial robots and improving the overall efficiency of the equipment.
[0003] Vibration signal analysis is the most commonly used and effective technique for fault diagnosis of RV reducers. By installing accelerometers on the surface of the reducer housing, vibration signals containing rich fault characteristic information can be collected. Different fault types and severity defects will produce different time-domain and frequency-domain characteristic changes in the vibration signal. For example, wear on the tooth surface of a cycloidal gear will cause amplitude changes at a specific meshing frequency, while bearing defects will produce impact components at characteristic frequencies. Traditional vibration signal analysis methods include time-domain statistical analysis, such as root mean square value, kurtosis, and peak value; and frequency-domain analysis, such as spectrum analysis, envelope demodulation, and time-frequency domain analysis, such as short-time Fourier transform and wavelet transform. However, traditional methods rely on manual feature extraction and expert experience. When dealing with complex devices like RV reducers with cross-coupled fault characteristics, their diagnostic accuracy and generalization ability often fail to meet practical needs.
[0004] In recent years, deep learning-based fault diagnosis methods have attracted widespread attention due to their powerful automatic feature extraction capabilities. Convolutional Neural Networks (CNNs) can automatically extract local features and hierarchical representations from input data through convolutional kernels; Recurrent Neural Networks (RNNs) and their variant, Long Short-Term Memory (LSTM), excel at capturing temporal dependencies in time series data; and Deep Belief Networks (DBNs) extract high-level abstract features through unsupervised learning strategies involving layer-by-layer pre-training. These deep learning models have been applied to the fault diagnosis of rotating machinery such as rolling bearings and gearboxes. However, the high performance of deep learning models heavily relies on a large amount of high-quality labeled training data, typically requiring thousands or even tens of thousands of labeled samples to achieve the desired diagnostic effect.
[0005] In real-world industrial scenarios, RV reducer failures are sudden and rare. After a failure, equipment is typically shut down quickly for repair, making it difficult to collect sufficient vibration data. Furthermore, the operating environment of RV reducers is usually accompanied by strong background noise interference, resulting in a low signal-to-noise ratio for effective fault signals. Annotating vibration data requires manual interpretation and labeling by engineers with expertise in mechanical fault diagnosis, which is costly and inefficient, leading to a very limited number of usable labeled fault samples. More importantly, the severity of RV reducer failures often exhibits a gradual change, with very subtle differences in vibration characteristics between minor and moderate faults, further increasing the difficulty of diagnosis. This scarcity of training data fundamentally contradicts the reliance of deep learning models on massive amounts of data, severely limiting the effectiveness of fault diagnosis models in practical engineering applications.
[0006] For the Few-Shot Fault Diagnosis (FSFD) problem, existing solutions mainly focus on two directions: algorithm improvement and data augmentation. Regarding algorithm improvement, meta-learning is one of the mainstream few-shot learning paradigms. Meta-learning learns common knowledge across tasks on a large number of auxiliary tasks, enabling the model to quickly adapt to new fault diagnosis tasks. For example, task-sequential meta-learning methods enhance the model's adaptability and knowledge transfer ability by reasonably ranking the training tasks; multi-scale weighted ensemble methods based on lightweight gradient boosting machines achieve effective few-shot diagnosis without requiring cross-domain data. Furthermore, metric-based learning methods, such as prototype networks and matching networks, achieve few-shot classification by learning similarity metrics between samples. However, these methods essentially still extract fault features from a limited number of samples, and insufficient information naturally limits the model's generalization performance, especially when there are many fault categories and subtle differences in fault severity.
[0007] In terms of data augmentation, traditional methods such as noise addition, translation, and scaling have limited applicability to mechanical vibration signals and easily destroy fault feature information in the signal. Resampling-based methods, such as SMOTE (Synthetic Minority Over-sampling Technique) and its improved versions, generate new samples by interpolating in the feature space, but the interpolation quality in high-dimensional nonlinear feature spaces is difficult to guarantee. Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs) are currently more advanced data generation methods. VAEs map input data to the latent space through an encoder and then reconstruct data from the latent space through a decoder; however, VAE-generated samples often exhibit blurring and limited diversity. GANs generate realistic samples through adversarial training between the generator and discriminator. While this improves generation quality, it suffers from pattern collapse and training instability, leading to significant deviations between the generated samples and the distribution of real data. Vector Quantized-Variational AutoEncoder (VQ-VAE) improves the representational ability of VAE by introducing a discrete latent space, but it is still difficult to fully learn the data distribution under conditions of a very small number of samples.
[0008] The Denoising Diffusion Probabilistic Model (DDPM), an emerging generative model inspired by nonequilibrium thermodynamics, generates data through an iterative process of progressively adding and denoising noise. DDPM outperforms VAEs and GANs in terms of sample quality and pattern coverage, generating high-fidelity and highly diverse samples with stable training and no pattern collapse problem. In recent years, variants of the diffusion model have been applied to data augmentation tasks in the field of mechanical fault diagnosis, including classifier-free diffusion models for weakly supervised health indicator derivation and latent diffusion models in compressed representation spaces. However, existing fault diagnosis data augmentation methods based on diffusion models still have the following shortcomings: First, the distribution alignment problem between generated data and real data has not been fully resolved. When the sample size is extremely small, the diffusion model is unable to fully capture the multimodal fault distribution and non-stationary characteristics in real mechanical signals, resulting in insufficient representativeness of the generated samples. Second, traditional FSFD models often focus on expanding the diversity of fault types, ignoring hierarchical diversity, especially the difference in fault severity. The characteristics of the same fault type differ significantly under different fault severity levels, and insufficient hierarchical diversity will hinder the accurate description and identification of faults. Third, existing methods denoise each sample independently during the generation process, ignoring the semantic association information between samples, and failing to make full use of the common features between similar fault samples to improve the generation quality.
[0009] The core of the Transformer is its self-attention mechanism, which enables the modeling of dependencies between arbitrary positions in a sequence regardless of distance. The Vision Transformer (ViT) inherits the Transformer's ability to efficiently extract local and global features by segmenting an image into a sequence of fixed-size patches and utilizing multi-head self-attention. However, existing Transformer-based diagnostic methods still generate patches independently for each sample during the inference phase. Patches from different samples within the same batch cannot interact, limiting the model's ability to learn common intra-class features.
[0010] It is evident that how to generate high-quality, highly diverse synthetic fault data using a diffusion model under conditions of extremely limited labeled samples, and how to improve the generation quality through a cross-sample collaborative mechanism, thereby achieving accurate fault diagnosis for RV reducers of industrial robots, is a technical challenge that urgently needs to be solved.
[0011] The existing invention patent application document CN118469374A, entitled "A Method and System for Predicting the Quality of Continuously Casting Billets Based on Data Augmentation of Diffusion Model," describes a method that includes: integrating continuous casting billet production parameters into a tabular structured dataset; obtaining the data type of each column in the dataset; parsing continuous and discrete data to obtain the numerical range of continuous columns and the category information of discrete columns; using continuous and discrete features as inputs to Gaussian and multinomial diffusion models, respectively, to train the overall diffusion model; applying the trained diffusion model to perform data augmentation, generating a synthetic dataset; combining the generated data with real data to train a machine learning-based quality prediction model; and applying continuous casting production feature parameters to the trained billet quality prediction model to output the quality grade result. This existing technology employs a single-sample independent diffusion inference mode, lacking a collaborative learning mechanism for feature exchange between similar samples. In scenarios where labeled samples are scarce, this can lead to insufficient feature diversity in the generated data and a tendency for distribution shifts. Furthermore, the multilayer perceptron's shallow fitting capability is insufficient, lacking the hierarchical global feature modeling capability brought by multi-head self-attention.
[0012] In summary, existing technologies suffer from several technical problems: the independent denoising method for each sample only focuses on other patches within its own image; the extraction capability of local-global hierarchical fault features is poor; and the fine-grained diagnostic performance is poor. Summary of the Invention
[0013] The technical problem to be solved by this invention is: how to solve the technical problems of the existing technology where each sample is denoised independently, focusing only on other patches in its own image, having poor ability to extract local-global hierarchical fault features, and poor fine-grained diagnostic performance.
[0014] This invention solves the above-mentioned technical problems by employing the following technical solution: A small-sample fault diagnosis method for RV reducers based on group diffusion Transformer includes: S1. Use the RV reducer vibration sensor to collect the original vibration signal, perform segmentation processing and short-time Fourier transform on the original vibration signal to obtain a standardized time-frequency image, which is used as the model input image; S2. Using a group diffusion Transformer that integrates dual constraint information, data augmentation is performed on the model input image to obtain augmented image samples. Specifically, the dual constraint information is used to simultaneously encode the fault type and fault severity. Hierarchical fault features are extracted from the augmented image samples using ViT. Group attention operation is performed on the augmented image samples to complete tensor reshaping and obtain generated samples. S3. Using a multi-dimensional comprehensive quality assessment framework, the generated samples are screened, and high-quality samples that meet the preset threshold are retained to obtain an enhanced dataset. S4. Train a ResNet-18-based fault refinement classifier using the augmented dataset, and perform simultaneous classification of fault type and fault severity through a joint loss function to obtain the fault diagnosis results of the RV reducer.
[0015] This invention introduces a cross-sample attention mechanism during the training and inference process of the diffusion model, enabling multiple fault samples within the same group to collaboratively denoise. By sharing attention, feature interaction between samples is achieved, thereby generating higher-quality synthetic data for small-sample fault diagnosis. Unlike the independent denoising approach of traditional diffusion models, the group attention mechanism employed in this invention targets each image patch, focusing not only on other patches within the model's input image itself but also on semantically relevant patches in other model input images within the same group, establishing a dual feature correspondence both within and between images.
[0016] In a more specific technical solution, in S1, the original one-dimensional vibration time sequence of the original vibration signal is segmented into segments of a fixed length, with each segment including a preset number of sampling points. For each segment of the original vibration signal, a short-time fourier transform (STFT) is applied to convert the one-dimensional time-domain vibration signal in the original one-dimensional vibration time series into a time-frequency image, which characterizes the frequency variation of the signal over time. The time-frequency image is reshaped and normalized to obtain a standard-sized model input image.
[0017] In a more specific technical solution, S2 utilizes the group diffusion Transformer that integrates dual-constraint information and employs the Denoising Diffusion Probability Model (DDPM). The Denoising Diffusion Probability Model (DDPM) includes: a forward diffusion process and a reverse denoising process. During the forward diffusion process, Gaussian noise is gradually added to the input image of the model:
[0018]
[0019] in, This represents the data distribution at step t of the noise addition process. , This indicates the total number of steps in the noise addition process. The mean is The variance is Gaussian distribution , For the sample at step t , It is the identity matrix. For the sample at step t-1, For samples with added noise, The original data, This represents the noise variance at step t. Indicates the forward diffusion process; The original data is recovered from pure noise through a reverse denoising process:
[0020] In the formula, Represents probability density, It is a mean function. This represents the mean at step t. , Represents the variance scalar. Represents variance. This indicates the reverse denoising process; During the learning process, through neural networks Predict the addition of standard Gaussian noise to the data Among these, the mean square error between the predicted noise and the actual noise will be minimized. Et As the optimization objective:
[0021] In the formula, t is sampled uniformly between 1 and T. For the parameters of the noise prediction network, This indicates taking the minimum value. This represents the square of the L2 norm.
[0022] This invention proposes introducing a group diffusion mechanism into the diffusion transformer. Through cross-sample attention, multiple samples within the same fault category collaborate during the denoising process, breaking the limitation of traditional diffusion models that generate samples independently one by one. It leverages common intra-class features to improve the quality and consistency of generated samples. As the group size increases, cross-sample attention strengthens, and the generation quality continuously improves, exhibiting a significant scaling effect.
[0023] In a more specific technical solution, S2 employs a dual-constraint diffusion mechanism, based on a Diffusion Transformer (DiT), introducing dual-constraint information. , }, where, Conditional information indicating the type of encoded fault. Conditional information indicating the severity of the fault; using dual-constraint conditional information to guide the formation of fault features during the reverse denoising process; The forward diffusion process is set as an unconditional process, and the dual-constraint information is applied to the reverse process. A classifier-free guidance strategy is used during sampling, and conditional and unconditional score estimates are fused. The i-th sample data in the training set... The forward diffusion process is represented as:
[0024] In the formula, This indicates the introduction of dual constraint information. , The forward diffusion process of} Indicates data distribution, The mean is The variance is Gaussian distribution , For the i-th sample in step t , It is the identity matrix. For the i-th sample in step t-1, This represents the noise variance at step t; In the reverse denoising process, the true reverse transition distribution is approximated through constrained score estimation. The parameters of the noise prediction network are represented by the following logic, defining the i-th sample at step t. Corresponding constraint score :
[0025] In the formula, Indicates the first sample The corresponding variance, This indicates the introduction of dual constraint information. , The reverse denoising process of} Represents probability density; During the sampling phase, the constrained and unconstrained model score estimates are fused:
[0026] In the formula, The parameters used to control the classifier's guidance strength, This indicates the introduction of dual constraint information. , The first one sample Parameters of the corresponding noise prediction network The estimated value, Indicates standard Gaussian noise; The objective function of the noise prediction network can be expressed using the following logic:
[0027] In the formula, Indicates the first sample The corresponding noise mean square error, For the parameters of the noise prediction network, This indicates taking the minimum value. This represents the square of the L2 norm.
[0028] In a more specific technical solution, S2 employs a group attention mechanism to construct groups from the input images of the model, completing the grouping operation; specifically, during the training phase, for the dataset... D Sample of the image Define the query function and construct the relevant sample group. :
[0029] The sim function returns the first... Sample With sample The similarity between the corresponding two images, Indicates the image similarity threshold. Represents an image. The data distribution is represented, and image features are extracted using an encoder based on label constraints and domain adaptation. Cosine similarity is then calculated based on the image features. Perform group attention operations; where the hidden state h is extracted from the model input image X, and before the attention operation, the hidden state h is... Remodeling In the formula, L is the patch sequence length of a single image, C is the number of channels, and N is the number of images in the group. R is the product of the number of images in the group and the length of the patch sequence for a single image; R represents the reshaping operation. After multi-head self-attention operation, the hidden state h is reshaped back to its original shape; For all patches of the same model input image X, add the same learnable sample embedding vector to establish a dual feature correspondence between images, both within and between images. The Fault Severity Attention Module (FSAM) uses the ViT backbone and incorporates time step t and dual-constraint information during the embedding phase. , As a marker injection, it forms a fault severity-aware attention; The input time-spectrum graph is segmented into patch markers, and time step markers and conditional information encoding fault types are appended. Condition information on the severity of the fault The mark.
[0030] In a more specific technical solution, the i-th sample The corresponding image segmentation is image block P=(H) W) / Each image block contains a patch, where H, W, and U represent the image height, width, and patch size, respectively. After linear embedding, a positional encoding PosEmb(p) is added to preserve spatial information, resulting in a labeled sequence: = Linear( ) +
[0031] in, This is the embedding vector for the final i-th image and the j-th patch. This represents the image patch of the i-th image and the j-th patch. Represents probability density; Linear represents linear embedding operation. The labeled sequence is processed through at least two stacked Transformer modules. Let the input be... Let represent the original input at position i. The following logic is used to compute the i-th Transformer module:
[0032]
[0033]
[0034]
[0035] in, and They are respectively The mean and variance, b are learnable parameters. This represents the normalized feature vector at position i. Indicates the offset parameter. This represents the result of multi-head attention at position i. This represents the attention head corresponding to the hidden state h. This indicates a splicing operation. Second normalized output, Representation layer normalization, The output of the i-th sublayer of the feedforward network, This indicates taking the maximum value. These are the parameters for controlling the guidance strength of the classifier corresponding to layer 1. These are the parameters for controlling the guidance strength of the classifier corresponding to the second layer. Level 1 bias, Second layer bias; The noise prediction errors of all samples within a group are summed to obtain the training loss function of GDiT (Graph-prior-guided Diffusion Transformer). :
[0036] Where c represents conditional information, t represents the denoising time step, and N represents the group size. This loss function allows the model to refer to the information of other samples within the group when predicting noise for each sample. Denotes the square of the L2 norm. This represents the i-th constraint score corresponding to the model input image X at step t. , For the parameters of the noise prediction network, Represents the i-th constraint score , This indicates that the input image X of the model follows a Gaussian distribution. The noise parameters at step t , Represents the identity matrix. Indicates a Gaussian distribution. This indicates noise error.
[0037] In a more specific technical solution, in S2, cross-sample attention analysis is defined and performed based on image-level cross-attention weights and cross-sample attention scores. Let the i-th... sample The corresponding images include a set of patch indices. For querying patches The key patch k has an attention weight of . , Represents the weight parameter, defining the i-th... sample The first sample The cross-sample attention weights for the corresponding image are: :
[0038] In the formula, Indicates the first Sample up to the first sample Cross-sample operations, Indicates cross-sample, Represents the probability density, the i-th sample up to the first sample The probability density corresponding to cross-sample operations for: ;
[0039]
[0040] in, and These are the maximum and mean values of cross-sample attention, respectively. Represents the mean function, This indicates taking the maximum value.
[0041] This invention designs a diffusion Transformer architecture that integrates dual-constraint information and group attention. During noise prediction, it simultaneously encodes fault type and severity information and captures hierarchical feature differences between different fault severities through cross-sample feature interaction. Replacing the traditional U-Net with ViT (vision transformer) as the noise predictor enhances the model's ability to extract local-global hierarchical fault features.
[0042] In a more specific technical solution, the S3 multi-dimensional comprehensive quality assessment framework includes: PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity Index), NMSE (Normalized Mean Square Error), and GAN training and testing modules. Image quality metrics, including peak signal-to-noise ratio (PSNR), structural similarity index (SSIM), and normalized mean square error (NMSE), are evaluated on a category-by-category basis.
[0043] In a more specific technical solution, in S4, the augmented dataset is used to extract deep features through ResNet residual network blocks; The deep features are input into the Fault Refinement Classifier (FRC), which employs a custom joint loss function that simultaneously optimizes the cross-entropy loss for fault type and fault severity. :
[0044] in, ; ; ; and These are the actual labels for fault type and fault severity, respectively. and These represent the predicted probabilities corresponding to fault type and fault severity, respectively. and These are the loss weights corresponding to the fault type and the fault severity, respectively. and These are the losses corresponding to the type and severity of the fault, respectively. Conditional information indicating the type of encoded fault. Conditional information indicating the severity of the fault.
[0045] This invention constructs a complete small-sample fault diagnosis process for RV reducers, forming an end-to-end solution from vibration signal preprocessing, group diffusion data enhancement, multi-dimensional quality assessment to refined fault classification. The refined fault classifier optimizes the classification of fault type and fault severity simultaneously through a joint loss function, significantly improving the model's fine-grained diagnostic performance.
[0046] In a more specific technical solution, the RV reducer small-sample fault diagnosis system based on group diffusion Transformer includes: The data processing module is used to collect the original vibration signal using the RV reducer vibration sensor, perform segmented processing and short-time Fourier transform on the original vibration signal to obtain a standardized time-frequency image, which is used as the model input image. The group diffusion data augmentation module is used to augment the model input image using a group diffusion Transformer that integrates dual constraint information, and obtain augmented image samples. The dual constraint information is used to simultaneously encode the fault type and fault severity. The ViT is used to extract hierarchical fault features from the augmented image samples. The group attention operation is performed on the augmented image samples to complete tensor reshaping and obtain generated samples. The group diffusion data augmentation module is connected to the data processing module. The quality assessment module is used to screen the generated samples through a multi-dimensional comprehensive quality assessment framework, retaining high-quality samples that meet the preset thresholds to obtain an enhanced dataset. The quality assessment module is connected to the group diffusion data enhancement module. The fault diagnosis module is used to train a ResNet-18-based fault refinement classifier using the augmented dataset. It performs simultaneous classification of fault type and fault severity through a joint loss function to obtain the fault diagnosis results of the RV reducer. The fault diagnosis module is connected to the quality assessment module.
[0047] The present invention has the following advantages over the prior art: This invention introduces a cross-sample attention mechanism during the training and inference process of the diffusion model, enabling multiple fault samples within the same group to collaboratively denoise. By sharing attention, feature interaction between samples is achieved, thereby generating higher-quality synthetic data for small-sample fault diagnosis. Unlike the independent denoising approach of traditional diffusion models, the group attention mechanism employed in this invention targets each image patch, focusing not only on other patches within the model's input image itself but also on semantically relevant patches in other model input images within the same group, establishing a dual feature correspondence both within and between images.
[0048] This invention proposes introducing a group diffusion mechanism into the diffusion transformer. Through cross-sample attention, multiple samples within the same fault category collaborate during the denoising process, breaking the limitation of traditional diffusion models that generate samples independently one by one. It leverages common intra-class features to improve the quality and consistency of generated samples. As the group size increases, cross-sample attention strengthens, and the generation quality continuously improves, exhibiting a significant scaling effect.
[0049] This invention designs a diffusion Transformer architecture that integrates dual-constraint information and group attention. During noise prediction, it simultaneously encodes fault type and severity information and captures hierarchical feature differences between different fault severities through cross-sample feature interaction. Replacing the traditional U-Net with ViT (vision transformer) as the noise predictor enhances the model's ability to extract local-global hierarchical fault features.
[0050] This invention constructs a complete small-sample fault diagnosis process for RV reducers, forming an end-to-end solution from vibration signal preprocessing, group diffusion data enhancement, multi-dimensional quality assessment to refined fault classification. The refined fault classifier optimizes the classification of fault type and fault severity simultaneously through a joint loss function, significantly improving the model's fine-grained diagnostic performance.
[0051] This application employs a complete solution with superior technical performance. It selects a diffusion transformer instead of a multilayer perceptron as the backbone for diffusion noise prediction, and establishes a segmentation, STFT (Short Time Fourier Transform), and image standardization preprocessing link adapted to the original one-dimensional vibration time series. This transforms the original one-dimensional vibration signal into a time-frequency image that retains complete fault features, i.e., a two-dimensional time-frequency spectrum, to adapt to image generation tasks. Based on a query function, it groups similar samples and constructs a cross-sample multi-head attention mechanism and a group-accumulated diffusion loss. This allows samples in the same group to share prior fault features during the reverse denoising stage, significantly improving the diversity and distribution fidelity of generated samples in small-sample scenarios. Simultaneously, it embeds dual-layer labels for fault type and severity to construct a dual-condition guided diffusion mechanism that encodes fault type and severity, achieving directional diffusion of fault maps at different degradation levels. Controllable generation relies on multi-layer Transformer blocks to extract shallow local impact features and deep global temporal coupling features from time-frequency images, accurately capturing low-frequency and high-frequency impact components corresponding to weak and minor faults. By integrating image pixel fidelity quantization indicators and global distribution consistency checks, a multi-dimensional comprehensive quality assessment framework is constructed to screen multi-dimensional generated samples and automatically filter low-quality maps with texture distortion and loss of fault features. The backend is equipped with a dual-branch ResNet-18 fault refinement classifier and a weighted cross-entropy loss based on a joint loss function, simultaneously completing the dual classification tasks of fault category identification and fine-grained classification of fault degradation levels. A full-link method is designed, including feature modeling, generation logic, constraint control, loss optimization, quality verification, and diagnostic output. It has superior modeling performance and engineering adaptability in scenarios such as small sample data augmentation and fine-grained multi-task diagnosis.
[0052] This invention solves the technical problems of existing technologies where the independent denoising method for each sample only focuses on other patches within its own image, has poor extraction capability of local-global hierarchical fault features, and has poor fine-grained diagnostic performance. Attached Figure Description
[0053] Figure 1 This is a schematic diagram of the basic steps of the small-sample fault diagnosis method for RV reducers based on group diffusion Transformer in Embodiment 1 of the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] Example 1 like Figure 1 As shown, this invention provides a small-sample fault diagnosis method for RV reducers based on group diffusion Transformer, including the following basic steps: S1. Use the RV reducer vibration sensor to collect the original vibration signal, perform segmentation processing and short-time Fourier transform on the original vibration signal to obtain a standardized time-frequency image, which is used as the model input image; In this embodiment, the original one-dimensional vibration time sequence of the original vibration signal is segmented into segments of a fixed length, with each segment including a preset number of sampling points; For each segment of the original vibration signal, a short-time fourier transform (STFT) is applied to convert the one-dimensional time-domain vibration signal in the original one-dimensional vibration time series into a time-frequency image, which characterizes the frequency variation of the signal over time. The time-frequency image is reshaped and normalized to obtain a standard-sized model input image.
[0056] Specifically, the original vibration signal collected by the vibration sensor of the RV reducer is segmented and processed. Each segment of the original vibration signal is converted into a two-dimensional time-frequency image through short-time Fourier transform (STFT). After normalization, it is used as the input image of the model. Then, the dataset after being converted into two-dimensional time-frequency images is divided: 10 samples per class in the training set and 100 samples per class in the test set.
[0057] Preprocessing the vibration signal of the RV reducer is the first step in the entire fault diagnosis process. Its purpose is to transform the original one-dimensional time-domain vibration signal into a two-dimensional time-frequency image, while preserving the fault feature information contained in the one-dimensional time-domain vibration signal to the greatest extent.
[0058] Specifically, during data processing, the one-dimensional time-domain vibration signal in the original one-dimensional vibration time series is segmented into fixed-length segments, each containing 1024 sampling points. For example, under normal operating conditions, the RV reducer operates at 1500 rpm, or a rotational frequency of 25 Hz. At a sampling rate of 12.8 kHz, 1024 sampling points cover 0.08 seconds of vibration signal, including vibration information from two complete rotation cycles, which is sufficient to capture typical fault characteristic frequency components. A non-overlapping segmentation method is used to ensure statistical independence between each segment and avoid information leakage in the training data. Specifically, a Short-Time Fourier Transform (STFT) is applied to each segment of the one-dimensional time-domain vibration signal. For example, a Hanning window function can be used to reduce spectral leakage. The Hanning window function has a good trade-off between main lobe width and side lobe attenuation, balancing time-domain localization and frequency-domain anti-interference capability while ensuring a certain frequency resolution. This improves the smoothness and accuracy of time-frequency analysis results, making it suitable for time-frequency analysis of mechanical vibration signals. In this embodiment, the window length is set to 64 sampling points, corresponding to a time resolution of 5ms, and the overlap rate between adjacent windows is set to 50%. The STFT converts the one-dimensional time-domain vibration signal into a time-frequency image reflecting the frequency variation of the signal over time. The resulting time-frequency image is reshaped and normalized to a standard size of 64×64 to eliminate the influence of sensor sensitivity differences and signal amplitude fluctuations on model training. Choosing a 64×64 image size is the optimal balance between image resolution and computational cost, preserving sufficient time-frequency detail while ensuring the feasibility of diffusion model training.
[0059] S2. Using a group diffusion Transformer that integrates dual constraint information, data augmentation is performed on the model input image to obtain augmented image samples. The dual constraint information is used to simultaneously encode the fault type and fault severity. Hierarchical fault features are extracted from the augmented image samples using ViT. Group attention operation is performed on the augmented image samples to complete tensor reshaping and obtain generated samples. In this embodiment, a group diffusion Transformer that integrates dual-constraint information is used to perform data augmentation and enhancement operations on the original vibration signal after it has been converted into a time-frequency image. The dual-constraint information simultaneously encodes the fault type and fault severity. ViT is used instead of U-Net to extract hierarchical fault features. The group attention operation uses tensor reshaping to make patches of samples in the same group visible to each other in the attention calculation, thereby improving the quality of the generated samples. In the group diffusion data augmentation module of this embodiment, a cross-sample attention mechanism is introduced into the training and inference process of the diffusion model to achieve collaborative denoising of multiple related samples. This group diffusion data augmentation module integrates the denoising diffusion probability model DDPM with dual-constraint information and a fault severity attention module. Specifically, the denoising diffusion probability model DDPM guides the consistency of fault type and fault severity in the generated samples through dual-constraint information; the fault severity attention module enhances the extraction capability of hierarchical fault features through the ViT backbone network; and the group attention mechanism further improves the quality of the generated samples through cross-sample feature interaction.
[0060] The Denoising Diffusion Probability Model (DDPM) is a probabilistic generation model inspired by nonequilibrium thermodynamics. It progressively adds random noise to the original vibration signal through a series of Markov steps, then recovers the original vibration signal in reverse. Utilizing the group diffusion Transformer process that fuses information under dual constraints, the DDPM model is employed. The DDPM model includes: a forward diffusion process and a reverse denoising process.
[0061]
[0062] in, This represents the data distribution at step t of the noise addition process. , This indicates the total number of steps in the noise addition process. The mean is The variance is Gaussian distribution , For the sample at step t , It is the identity matrix. For the sample at step t-1, For samples with added noise, The original data, This represents the noise variance at step t. Indicates the forward diffusion process; Specifically, by using the reparameterization technique, noisy data at any t-step can be directly represented as the original data. and standard Gaussian noise Linear combination:
[0063] Among them, the cumulative signal retention coefficient Single-step signal retention coefficient ; The original data is recovered from pure noise through a reverse denoising process:
[0064] in, Represents probability density, It is a mean function. This represents the mean at step t. , Represents the variance scalar. Represents variance. This indicates the reverse denoising process; Therefore, the learning process can be reduced to learning through neural networks. Predicting noise added to the data .
[0065] During the learning process, through neural networks Predict the addition of standard Gaussian noise to the data Among these, the mean square error between the predicted noise and the actual noise will be minimized. Et As the optimization objective:
[0066] Where t is sampled uniformly between 1 and T. For the parameters of the noise prediction network, This indicates taking the minimum value. This represents the square of the L2 norm.
[0067] In this embodiment, a dual-constraint diffusion mechanism is employed, based on a diffusion transformer (DiT), to introduce dual-constraint information. , }, where, Conditional information indicating the type of encoded fault. The conditional information represents the severity of the fault; by using the dual constraint information, the fault features are guided to be formed during the reverse denoising process, so that the generated samples are consistent with the real data in both the fault type and fault severity dimensions.
[0068] In this embodiment, the forward diffusion process is set as an unconditional process, and the dual-constraint information is applied to the reverse process. A classifier-free guidance strategy is used during sampling, fusing conditional and unconditional score estimations. The forward diffusion process is set as an unconditional process, completely consistent with the standard denoising diffusion probability model DDPM. The dual-constraint information is only applied to the reverse denoising process. The i-th sample data in the training set... The forward diffusion process is represented as:
[0069] in, This indicates the introduction of dual constraint information. , The forward diffusion process of} Indicates data distribution, The mean is The variance is Gaussian distribution , For the i-th sample in step t , It is the identity matrix. For the i-th sample in step t-1, This represents the noise variance at step t; In the reverse denoising process, the true reverse transition distribution is approximated through constrained score estimation. The parameters of the noise prediction network are represented by the following logic, defining the i-th sample at step t. Corresponding constraint score :
[0070] in, Indicates the first Sample The corresponding variance, This indicates the introduction of dual constraint information. , The reverse denoising process of} Represents probability density; During the sampling phase, the constrained and unconstrained model score estimates are fused. To balance generation quality and diversity, the following logic is used to fuse the constrained and unconstrained model score estimates during the sampling phase:
[0071] in, The parameters used to control the classifier's guidance strength, This indicates the introduction of dual constraint information. , The first one sample Parameters of the corresponding noise prediction network The estimated value, Indicates standard Gaussian noise; The objective function of the noise prediction network can be expressed using the following logic:
[0072] In the formula, Indicates the first Sample The corresponding noise mean square error, For the parameters of the noise prediction network, This indicates taking the minimum value. This represents the square of the L2 norm.
[0073] In this embodiment, the proposed GDViT (Group-level Decorrelation-based Vision Transformer) model is trained on the training samples. Through the collaborative work of group attention mechanism and dual constraint information, generated samples are obtained through a denoising process.
[0074] In this embodiment, a cross-sample attention mechanism is introduced into the diffusion Transformer, enabling samples within the same group to collaborate during the denoising process. This mechanism is called group diffusion. Traditional diffusion models denoise each sample independently during inference, with no information exchange between samples. Group diffusion breaks this limitation, allowing samples within the same group to share feature information through an attention mechanism, thereby achieving collaborative denoising.
[0075] In this embodiment, the input images to the model are grouped to complete the grouping operation. The premise of group diffusion is that images within the same group are semantically or visually related and can assist each other in the denoising process. Specifically, during the training phase, for samples of images in dataset D... Define the query function and construct the relevant sample group. :
[0076] The sim function returns the first... Sample With sample The similarity between the corresponding two images, Indicates the image similarity threshold. Represents an image. The data distribution is represented, and image features are extracted using an encoder based on label constraints and domain adaptation. Cosine similarity is then calculated based on the image features. Specifically, cosine similarity is calculated after extracting image features using an encoder based on label constraints and domain adaptation. When the number of samples is extremely small, a direct label grouping strategy can be prioritized, that is, samples with the same fault type and the same fault severity are grouped together, ensuring semantic consistency of samples within the same group. For noisy time steps of different samples in the same group, each sample is sampled independently, but the variance of time steps within the group is limited to within a preset threshold.
[0077] Group attention operation; wherein, the hidden state h is extracted from the model input image X, and before the attention operation, the hidden state h is... Remodeling In the formula, L is the patch sequence length of a single image, C is the number of channels, and N is the number of images in the group. R is the product of the number of images in the group and the length of the patch sequence for a single image; R represents the reshaping operation. Specifically, through multi-head self-attention operations, the hidden state h is reshaped back to its original shape.
[0078] For all patches of the same input image X, the same learnable sample embedding vector is added to establish a dual feature correspondence within and between images; specifically, in order to enable the diffusion model to distinguish different image samples, the same learnable sample embedding vector is added to all patches of the same image.
[0079] In this embodiment, the same learnable sample embedding vector is added to all patches of the same model input image X to establish a dual feature correspondence relationship within and between images; Specifically, this operation enables each patch in each image to not only pay attention to other patches within its own image (i.e., intra-image attention), but also to related patches in other images within the same group (i.e., inter-image attention), thereby establishing a dual feature correspondence between images. Through the cross-sample attention mechanism, the model can discover and utilize common feature patterns in similar fault samples, providing additional semantic guidance for the denoising process of each sample.
[0080] In this embodiment, the Fault Severity Attention Module (FSAM) uses the ViT backbone, and during the embedding phase, it integrates time step t and dual constraint information. , As a marker injection, it forms a fault severity-aware attention; Specifically, in the design of the noise prediction network, this invention uses ViT as the backbone network to replace the U-Net commonly used in the traditional denoising diffusion probability model DDPM as the noise predictor. In this embodiment, the input time-spectrum graph is segmented into patch markers, and time step markers and conditional information encoding fault types are appended. Condition information on the severity of the fault The mark; Specifically, the input time-frequency image is segmented into patch markers and appended with time step markers and dual constraint information. , The label}. The i-th sample. The corresponding image segmentation is image block P=(H) W) / Each image block contains a patch, where H, W, and U represent the image height, width, and patch size, respectively. After linear embedding, a positional encoding PosEmb(p) is added to preserve spatial information, resulting in a labeled sequence: = Linear( ) +
[0081] in, This is the embedding vector for the final i-th image and the j-th patch. This represents the image patch of the i-th image and the j-th patch. Represents probability density; Linear represents linear embedding operation. The labeled sequence is processed through at least two stacked Transformer modules. Specifically, each module includes two normalization layers, one multi-head self-attention layer, and one MLP layer. Let the input be... Let represent the original input at position i. The following logic is used to compute the i-th Transformer module:
[0082]
[0083]
[0084]
[0085] in, and Inputs The mean and variance, b are learnable parameters. This represents the normalized feature vector at position i. Indicates the offset parameter. This represents the result of multi-head attention at position i. This represents the attention head corresponding to the hidden state h. This indicates a splicing operation. Second normalized output, Representation layer normalization, The output of the i-th sublayer of the feedforward network, This indicates taking the maximum value. These are the parameters for controlling the guidance strength of the classifier corresponding to layer 1. These are the parameters for controlling the guidance strength of the classifier corresponding to the second layer. Level 1 bias, Second layer bias; Specifically, each attention head The calculation formula is:
[0086] Where Q, K, and V represent the inputs respectively. The resulting query matrix, key matrix, and value matrix; LayerNorm represents the layer normalization operation, consistent with Norm1.
[0087] The noise prediction errors of all samples within a group are summed to obtain the training loss function of GDiT. :
[0088] Where c represents conditional information, t represents the denoising time step, and N represents the group size. This loss function allows the model to refer to the information of other samples within the group when predicting noise for each sample. Denotes the square of the L2 norm. This represents the i-th constraint score corresponding to the model input image X at step t. , For the parameters of the noise prediction network, Represents the i-th constraint score , This indicates that the input image X of the model follows a Gaussian distribution. The noise parameters at step t , Represents the identity matrix. Indicates a Gaussian distribution. This indicates noise error.
[0089] In this embodiment, cross-sample attention analysis is performed. Image-level cross-attention weights and cross-sample attention scores are defined and applied. Specifically, to quantitatively measure the strength of cross-sample attention and elucidate its impact mechanism on generation quality, this invention defines image-level cross-attention weights and cross-sample attention scores. Let the i-th... sample The corresponding images include a set of patch indices. For querying patches The key patch k has an attention weight of . , Represents the weight parameter, defining the i-th... sample The first sample The cross-sample attention weights for the corresponding image are: :
[0090] in, Indicates the first Sample up to the first sample Cross-sample operations, Indicates cross-sample, Represents the probability density, the i-th sample up to the first sample The probability density corresponding to cross-sample operations for: ;
[0091]
[0092] in, and These are the maximum and mean values of cross-sample attention, respectively. Represents the mean function, The value is taken as the maximum. The aforementioned probability density is used as an indicator to measure the degree to which the attention distribution is focused on the most similar image. A value close to 0 indicates a uniform attention pattern, while a value close to 1 indicates a highly focused attention pattern on a single most similar image. Experiments show that this probability density is strongly positively correlated with generation quality, providing quantitative evidence for the effectiveness of the group attention mechanism. In this embodiment, FID (Fréchet Inception Distance) is used to measure generation quality.
[0093] S3. Using a multi-dimensional comprehensive quality assessment framework, the generated samples are screened, and high-quality samples that meet the preset threshold are retained to obtain an enhanced dataset. In this embodiment, the generated samples are rigorously screened using a multi-dimensional comprehensive quality assessment framework that includes PSNR, SSIM, NMSE, and GAN-train / GAN-test. In the quality assessment module of this embodiment, the generated samples are subjected to a multi-dimensional comprehensive quality assessment, including image fidelity indices for each category and a cross-category diversity-realism comprehensive assessment, and only high-quality samples that meet the preset threshold are retained. Specifically, in the quality assessment module, a multi-dimensional comprehensive evaluation framework is established to comprehensively evaluate the quality of the generated samples, including image fidelity assessment indicators for each category and overall assessment of cross-category diversity and authenticity.
[0094] The image fidelity assessment for each category uses three widely used image quality metrics: Peak Signal-to-Noise Ratio (PSNR), which quantifies image fidelity. The higher the PSNR value, the smaller the pixel difference between the generated sample and the original image, and the lower the distortion.
[0095]
[0096] Where R and G represent the real image and the generated image, respectively, and H represents the total number of pixels. This represents the maximum intensity value between the two images.
[0097] The Structural Similarity Index (SSIM) assesses structural similarity from three dimensions: brightness, contrast, and texture alignment. The higher the SSIM value, the higher the quality of the image corresponding to the generated sample.
[0098]
[0099] in, , These are the mean values of the real image and the generated image, respectively. , The standard deviations of the real image and the generated image are respectively. The covariance of the real image and the generated image. and To prevent the stability constant from having a denominator of zero.
[0100] Normalized mean square error (NMSE) is used to quantify the global error by calculating the normalized squared difference between images.
[0101] In this embodiment, the overall evaluation of cross-category diversity and authenticity adopts the GAN-train / GAN-test method: In GAN-train, the classifier is trained on real data and tested on the dataset of generated samples, and low accuracy indicates insufficient diversity; in GAN-test, the classifier is trained on the dataset of generated samples and tested on real data, and a significant drop in accuracy indicates that the generated samples lack authenticity.
[0102] The generated samples are screened by combining the above evaluation metrics with preset thresholds. Specifically, the fixed threshold provides conservative outlier filtering, removing obviously low-quality generated samples without changing the overall distribution structure, thus ensuring that the augmented dataset used for training has sufficient quality assurance.
[0103] S4. Train a ResNet-18-based fault refinement classifier using the augmented dataset, and perform simultaneous classification of fault type and fault severity through a joint loss function to obtain the fault diagnosis results of the RV reducer.
[0104] In this embodiment, the filtered augmented dataset is mixed into the original training dataset to train a fault refinement classifier, thereby achieving joint classification of different fault types and fault severity.
[0105] In the fault diagnosis module of this embodiment, a classification network is trained using an augmented dataset to achieve joint diagnosis of fault type and fault severity. Specifically, the augmented dataset includes: original real samples and generated samples that have undergone quality screening; In this embodiment, the augmented dataset undergoes deep feature extraction using ResNet residual network blocks. The ResNet residual network addresses the vanishing gradient problem in deep networks through skip connections, enabling the extraction of implicit features crucial for identifying fault modes and their severity. This invention employs a ResNet-18 residual network as the feature extraction backbone, whose 18 layers achieve a good balance between feature representation capability and computational efficiency.
[0106] After extracting the deep features, these features are input into the Fault Refinement Classifier (FRC). The FRC employs a two-branch structure, classifying fault type and fault severity separately. Each branch includes a linear layer and a softmax activation function. The FRC uses a custom joint loss function, simultaneously optimizing the cross-entropy loss for both fault type and fault severity. :
[0107] in, ; ; ; and These are the actual labels for fault type and fault severity, respectively. and These represent the predicted probabilities corresponding to fault type and fault severity, respectively. and These are the loss weights corresponding to the fault type and the fault severity, respectively. and These are the losses corresponding to the type and severity of the fault, respectively. Conditional information indicating the type of encoded fault. Conditional information indicating the severity of the fault.
[0108] Example 2 In this embodiment, experimental verification is conducted. The experimental platform used in this embodiment includes: an RV-20E type RV reducer body, an AC servo motor drive system, a triaxial vibration acceleration sensor, a high-speed data acquisition system, and a magnetic powder brake load device. Specifically, the servo motor in the AC servo motor drive system is connected to the input shaft of the RV reducer via a flexible coupling. The magnetic powder brake is installed at the output end of the reducer, providing adjustable load torque to simulate the load conditions under actual working conditions. The triaxial vibration acceleration sensor is magnetically attached to the measurement points on the top and side surfaces of the RV reducer housing. The sensitivity of the triaxial vibration acceleration sensor can be set to 100 mV / g, and the measurement frequency range is set to [0.5 Hz, 10 kHz], acquiring raw vibration signals in the radial, axial, and tangential directions respectively. The data acquisition system uses an NI-9234 high-speed acquisition card in conjunction with LabVIEW host computer software to achieve synchronous acquisition and storage of multi-channel signals, with an acquisition accuracy of 24 bits.
[0109] The failure types of the RV reducer are set according to the typical failure modes in actual engineering, including: normal state N, cycloid wheel wear (CW), cycloid crack (CC), pin wheel wear (PW), and output bearing defect (BD). Specifically, the cycloidal gear tooth surface wear (CW) is simulated by using electrical discharge machining (EDM) to uniformly remove material at different depths on the cycloidal gear tooth surface, thus effectively simulating the wear degradation of the cycloidal gear tooth surface under different fault severity levels under actual working conditions. The cycloidal gear crack (CC) is simulated by creating cuts of different lengths (e.g., 1 mm, 2 mm, 3 mm) at the tooth root using a uniform cutting technique to simulate different degrees of cracking. The pin tooth shell wear (PW) is simulated by grinding the pin tooth surface with sandpaper of different grits, respectively simulating mild, moderate, and severe surface wear degradation. The output bearing defect (BD) is simulated by creating pits of different diameters (e.g., 0.5 mm, 1.0 mm, 1.5 mm) on the bearing inner ring raceway using EDM. Each fault is classified into three severity levels: mild, moderate, and severe, based on the defect size. A total of 13 working conditions are set, including: 1 normal state + 4 fault types × 3 fault severity levels.
[0110] In this embodiment, the data acquisition parameters are set as follows: sampling frequency 12.8 kHz, motor speed 1500 rpm, and load torque 10 Nm. Specifically, 10 training samples are acquired for each operating condition to support the small sample generation task. Each sample includes 1024 sampling points. After short-time Fourier transform, a 64×64 normalized time-frequency image is obtained for data augmentation. Specifically, the short-time Fourier transform uses a Hanning window with a window length of 64 sampling points. The sampling frequency follows the original sampling rate of each dataset, and other STFT parameters remain at their default settings.
[0111] The training parameter settings for the GDViT model in this embodiment include: noise variance scheduling using: head noise variance = 0.0001, Ending noise variance A linear decreasing strategy with a learning rate of 0.02 was used, with a total number of diffusion steps set to T = 1000, and the diffusion model was trained for 600 epochs. The optimizer used was Adamw, with an initial learning rate of 0.0001, weight decay of 0.001, and a training batch size of 16. The classifier-free bootstrapping parameter was uniformly set to 0.3 across all datasets and sampling runs. The group size for group diffusion was set to 4, meaning each group included 4 related images, and the image similarity threshold was set to... = 0.7. The variance of the noise time step within the group is limited to no more than 50.
[0112] During the fault diagnosis phase, the baseline classifier uses a ResNet-18 residual network, and the weight parameters of FRC are set as follows: fault type loss weights. = 0.6 and the weight of the failure severity = 0.4. Based on the test set size, 190 quality-screened generated samples were added for each operating condition. To reduce experimental randomness, each method was run independently 10 times, and the average of four metrics—diagnostic accuracy, macro F1 score, precision, and recall—was used as the final evaluation result.
[0113] In this embodiment, to comprehensively evaluate the effectiveness of the method of the present invention, GDiT is compared with the following ten methods: (1) Direct training without data augmentation (Original-only), that is, directly training the classifier using only the original 10-sample training set; (2) Time Series Machine Learning (TSML), which enhances the model's adaptability and knowledge transfer ability through task ranking; (3) Multi-scale Weighted Entropy (MWE-LightGBM) based on LightGBM (Light Gradient Boosting Machine), an ensemble learning method that does not require cross-domain data; (4) Improved SMOTE method, namely K-Means-Locality Preserving Projection (KMS-LPP), which combines k-medoids clustering and oversampling methods of locality preserving projection; (5) Vector Quantization Autoencoder (VQVAE). (6) Quantised-VariationalAutoEncoder, a VAE variant using discrete latent space; (7) Deep Convolutional Generative Adversarial Networks (DCGAN), a GAN variant with CNN as its core architecture; (8) Standard DDPM, the original denoising diffusion probability model using U-Net noise predictor; and (9) Conditional Diffusion Vision Transformer (CDViT), a model that uses dual-constraint DDPM and fault severity attention modules but does not include group attention mechanisms. Among them, VAE and GAN methods are trained for 1000 epochs to ensure sufficient convergence, while DDPM methods are trained for 600 epochs.
[0114] In summary, the beneficial effects of this invention compared to the prior art include: (1) Cross-sample collaborative denoising was achieved through the group diffusion mechanism, breaking the limitation of independent generation of samples by traditional diffusion models. Experimental results show that the group attention mechanism enables similar faulty samples to share semantic features during the denoising process. The quality of the generated samples continues to improve with the increase of group size, showing a significant scaling effect and significantly improving the fidelity and consistency of the synthesized samples.
[0115] (2) The dual-constraint diffusion mechanism effectively solves the problem of distribution alignment of generated samples in both the fault type and fault severity dimensions. By simultaneously injecting constraint information of fault type and fault severity during the reverse denoising process, the generated samples can accurately reflect the characteristic differences of different fault states. The comprehensive evaluation results of GAN-train / GAN-test are close to the performance of real data, which verifies the effectiveness of distribution alignment.
[0116] (3) Compared with the traditional diffusion model, ViT is used instead of U-Net as the noise predictor. Through the multi-head self-attention mechanism, local and global hierarchical features are captured at the same time, which enhances the model's ability to distinguish subtle differences between faults of different severity.
[0117] (4) The fault refinement classifier optimizes the classification of fault type and fault severity by using a joint loss function, and reasonably handles the relationship between normal state and fault state. It achieves high classification accuracy in 13 fine-grained classification tasks, which is significantly better than the single-branch classifier.
[0118] (5) The complete diagnostic process constructed in this invention has good engineering applicability. Under the extremely small sample condition of only 10 training samples per class, it can achieve a very high diagnostic accuracy, which greatly reduces the dependence of industrial robot RV reducer fault diagnosis on a large amount of labeled data, and provides a practical and feasible technical solution for intelligent operation and maintenance in actual industrial scenarios.
[0119] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A small-sample fault diagnosis method for RV reducers based on group diffusion Transformer, characterized in that, The method includes: S1. Use the RV reducer vibration sensor to collect the original vibration signal, perform segmentation processing and short-time Fourier transform on the original vibration signal to obtain a standardized time-frequency image, which is used as the model input image; S2. Using a group diffusion Transformer that integrates dual constraint information, data augmentation is performed on the model input image to obtain augmented image samples. Specifically, the dual constraint information is used to simultaneously encode the fault type and fault severity. Hierarchical fault features are extracted from the augmented image samples using ViT. Group attention operation is performed on the augmented image samples to complete tensor reshaping and obtain generated samples. S3. Using a multi-dimensional comprehensive quality assessment framework, the generated samples are screened, and high-quality samples that meet the preset threshold are retained to obtain an enhanced dataset. S4. Train a ResNet-18-based fault refinement classifier using the augmented dataset, and perform simultaneous classification of fault type and fault severity through a joint loss function to obtain the fault diagnosis results of the RV reducer.
2. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, In step S1, the original one-dimensional vibration time sequence of the original vibration signal is segmented into segments of a fixed length, with each segment including a preset number of sampling points. For each segment of the original vibration signal, a short-time Fourier transform (STFT) is applied to convert the one-dimensional time-domain vibration signal in the original one-dimensional vibration time series into a time-frequency image, which characterizes the frequency variation of the signal over time. The time-frequency image is reshaped and normalized to obtain the model input image of standard size.
3. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, In the process of S2 utilizing the group diffusion Transformer that integrates dual constraint information, a denoising diffusion probability model DDPM is adopted. The denoising diffusion probability model DDPM includes: a forward diffusion process and a reverse denoising process. During the forward diffusion process, Gaussian noise is gradually added to the input image of the model: in, This represents the data distribution at step t of the noise addition process. , This indicates the total number of steps in the noise addition process. The mean is The variance is Gaussian distribution , For the sample at step t , It is the identity matrix. For the sample at step t-1, For samples with added noise, The original data, This represents the noise variance at step t. This represents the forward diffusion process; The original data is recovered from pure noise through the reverse denoising process described above. In the formula, Represents probability density, It is a mean function. This represents the mean at step t. , Represents the variance scalar. Represents variance. This indicates the reverse denoising process; During the learning process, through neural networks Predict the addition of standard Gaussian noise to the data Among these, the mean square error between the predicted noise and the actual noise will be minimized. Et As the optimization objective: In the formula, t is sampled uniformly between 1 and T. For the parameters of the noise prediction network, This indicates taking the minimum value. This represents the square of the L2 norm.
4. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, In S2, a dual-constraint diffusion mechanism is adopted, based on the diffusion transformer DiT, and dual-constraint information is introduced { , }, where, Condition information indicating the type of encoded fault. Conditional information indicating the severity of the fault; Using the aforementioned dual-constraint information, fault features are guided to form during the reverse denoising process; The forward diffusion process is set as an unconditional process, and the dual-constraint information is applied to the reverse process. A classifier-free guidance strategy is used during sampling, fusing conditional and unconditional score estimates. The i-th sample data in the training set... The forward diffusion process is represented as follows: In the formula, This indicates the introduction of dual constraint information. , The forward diffusion process described in} Indicates data distribution, The mean is The variance is Gaussian distribution , For the i-th sample in step t , It is the identity matrix. For the i-th sample in step t-1, This represents the noise variance at step t; In the reverse denoising process, the true reverse transition distribution is approximated through constrained score estimation. The parameters of the noise prediction network are represented by the following logic, defining the i-th sample at step t. Corresponding constraint score : In the formula, Indicates the first Sample The corresponding variance, This indicates the introduction of dual constraint information. , The reverse denoising process described in} Represents probability density; During the sampling phase, the constrained and unconstrained model score estimates are fused: In the formula, The parameters used to control the classifier's guidance strength, This indicates the introduction of dual constraint information. , The first one sample Parameters of the corresponding noise prediction network The estimated value, Indicates standard Gaussian noise; The objective function of the noise prediction network can be expressed using the following logic: In the formula, Indicates the first sample The corresponding noise mean square error, For the parameters of the noise prediction network, This indicates taking the minimum value. This represents the square of the L2 norm.
5. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, In step S2, a group attention mechanism is used to construct groups from the input images of the model, completing the grouping operation; wherein, during the training phase, for samples of images in dataset D... Define the query function and construct the relevant sample group. : The sim function returns the first... Sample With sample The similarity between the corresponding two images, Indicates the image similarity threshold. Represents an image. The data distribution is represented, and image features are extracted using an encoder based on label constraints and domain adaptation. Cosine similarity is then calculated based on the image features. Perform the group attention operation; wherein, the hidden state h is extracted from the model input image X, and before the attention operation, the hidden state h is... Remodeling In the formula, L is the patch sequence length of a single image, C is the number of channels, and N is the number of images in the group. R is the product of the number of images in the group and the length of the patch sequence for a single image; R represents the reshaping operation. After multi-head self-attention operation, the hidden state h is reshaped back to its original shape; For all patches of the same model input image X, add the same learnable sample embedding vector to establish a dual feature correspondence between images, both within and between images. The Fault Severity Attention Module (FSAM) uses the ViT backbone and incorporates time step t and dual constraint information during the embedding phase. , As a marker injection, it forms a fault severity-aware attention; The input time-spectrum graph is segmented into patch markers, and time step markers and conditional information encoding fault types are appended. Condition information on the severity of the fault The mark.
6. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 5, characterized in that, The i-th sample The corresponding image segmentation is image block P=(H) W) / Each image block contains a patch, where H, W, and U represent the image height, width, and patch size, respectively. After linear embedding, a positional encoding PosEmb(p) is added to preserve spatial information, resulting in a labeled sequence: = Linear( ) + in, This is the embedding vector for the i-th image and the j-th patch. This represents the image patch of the i-th image and the j-th patch. Represents probability density; Linear represents linear embedding operation. The labeled sequence is processed through at least two stacked Transformer modules, with the input being... Let represent the original input at position i. The following logic is used to compute the i-th Transformer module: in, and They are respectively The mean and variance, b are learnable parameters. This represents the normalized feature vector at position i. Indicates the offset parameter. This represents the result of multi-head attention at position i. This represents the attention head corresponding to the hidden state h. This indicates a splicing operation. Second normalized output, Representation layer normalization, The output of the i-th sublayer of the feedforward network, This indicates taking the maximum value. These are the parameters for controlling the guidance strength of the classifier corresponding to layer 1. These are the parameters for controlling the guidance strength of the classifier corresponding to the second layer. Level 1 bias, Second layer bias; The noise prediction errors of all samples within a group are summed to obtain the training loss function of GDiT. : Where c represents conditional information, t represents the denoising time step, and N represents the group size. This loss function allows the model to refer to the information of other samples within the group when predicting noise for each sample. Denotes the square of the L2 norm. This represents the i-th constraint score corresponding to the model input image X at step t. , For the parameters of the noise prediction network, Represents the i-th constraint score , This indicates that the input image X of the model follows a Gaussian distribution. The noise parameters at step t , Represents the identity matrix. Indicates a Gaussian distribution. This indicates noise error.
7. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, In S2, cross-sample attention analysis is performed based on image-level cross-attention weights and cross-sample attention scores. Let the i-th... sample The corresponding images include a set of patch indices. For querying patches The key patch k has an attention weight of . , Represents the weight parameter, defining the i-th... sample The first sample The cross-sample attention weights for the corresponding image are: : In the formula, Indicates the first Sample up to the first sample Cross-sample operations, Indicates cross-sample, Represents the probability density, the i-th sample up to the first sample The probability density corresponding to cross-sample operations for: ; in, and These are the maximum and mean values of cross-sample attention, respectively. Represents the mean function, This indicates taking the maximum value.
8. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, The multi-dimensional comprehensive quality assessment framework of S3 includes: PSNR, SSIM, NMSE, and GAN training and testing; Image quality metrics such as PSNR, SSIM, and NMSE are used for categorical evaluation.
9. The method for small-sample fault diagnosis of RV reducers based on group diffusion Transformer according to claim 1, characterized in that, In step S4, the augmented dataset is processed by extracting deep features through ResNet residual network blocks; The deep features are input into the fault refinement classifier FRC, which employs a custom joint loss function and simultaneously optimizes the cross-entropy loss for fault type and fault severity. : in, ; ; ; and These are the actual labels for fault type and fault severity, respectively. and These represent the predicted probabilities corresponding to fault type and fault severity, respectively. and These are the loss weights corresponding to the fault type and the fault severity, respectively. and These are the losses corresponding to the type and severity of the fault, respectively. Conditional information indicating the type of encoded fault. Conditional information indicating the severity of the fault.
10. A small-sample fault diagnosis system for RV reducers based on group diffusion Transformer, characterized in that, The system includes: The data processing module is used to collect the original vibration signal using the RV reducer vibration sensor, perform segmented processing and short-time Fourier transform on the original vibration signal to obtain a standardized time-frequency image, which is used as the model input image. The group diffusion data augmentation module is used to augment the model input image using a group diffusion Transformer that integrates dual constraint information to obtain augmented image samples. The dual constraint information is used to simultaneously encode the fault type and fault severity. Hierarchical fault features are extracted from the augmented image samples using ViT. Group attention operation is performed on the augmented image samples to complete tensor reshaping and obtain generated samples. The group diffusion data augmentation module is connected to the data processing module. The quality assessment module is used to screen the generated samples through a multi-dimensional comprehensive quality assessment framework, retain high-quality samples that meet the preset threshold, and obtain an enhanced dataset. The quality assessment module is connected to the group diffusion data enhancement module. The fault diagnosis module is used to train a ResNet-18-based fault refinement classifier using the augmented dataset, and to perform simultaneous classification of fault type and fault severity through a joint loss function to obtain the fault diagnosis result of the RV reducer. The fault diagnosis module is connected to the quality assessment module.
Citation Information
Patent Citations
Continuous casting billet quality prediction method and system based on diffusion model data enhancement
CN118469374A
