Lightweight fault diagnosis method and system under small sample based on improved diffusion model, and storage medium
By improving the diffusion model to generate high-quality samples and combining with deep learning models, the problem of rotary machinery fault diagnosis under small samples is solved, and the fault diagnosis effect with high accuracy and robustness is achieved.
Patent Information
- Application Number
- CN202411905194.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-05-30
AI Technical Summary
With limited sample size, how to achieve high-precision rotary machinery fault diagnosis has become a difficult problem that needs to be overcome at present.
A lightweight fault diagnosis method based on a small sample based on an improved diffusion model is adopted. By collecting vibration signals of the rotating machinery, a sliding window algorithm is used to build a small sample data set, and a high-quality fault sample is generated using an improved diffusion model. Finally, a deep learning model is used to identify and predict fault categories.
Effectively generate high-quality samples under small sample conditions, improving the accuracy of fault diagnosis and having certain robustness.
Smart Images

Figure CN120067925A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent fault diagnosis of rotating machinery and equipment. Specifically, it particularly relates to a lightweight fault diagnosis method, system, and storage medium based on an improved diffusion model under small samples. Background Art
[0002] As the core power source of industrial production, the stability and reliability of the performance of rotating machinery and equipment are crucial for the efficient operation of the entire industrial system. Among these machines, rolling bearings and gearboxes are indispensable core components, which are mainly responsible for supporting the rotational movement of the machinery. A large number of studies have shown that faults in rolling bearings and gearboxes are the main reasons for the shutdown of rotating machinery. Therefore, accurate fault diagnosis of rolling bearings and gearboxes is of great significance for ensuring the continuous operation of mechanical equipment and promoting the stable and safe production of modern industry.
[0003] With the advancement of Industry 4.0 and intelligent manufacturing, the research and application of fault diagnosis technology have become increasingly important. Deep learning technology uses a large amount of labeled data to train deep neural network models, which can extract deep abstract features in fault signals, thus achieving relatively high diagnostic accuracy. However, in actual production, since machine equipment usually operates stably and will stop immediately once a fault occurs to ensure safety, it makes the collection of fault data difficult. Therefore, how to achieve high-precision fault diagnosis under limited sample sizes has become a difficult problem that needs to be solved urgently. Summary of the Invention
[0004] In view of the above-mentioned technical problem of insufficient available samples in engineering practice, a lightweight fault diagnosis method based on an improved diffusion model under small samples is provided. The present invention can effectively generate high-quality samples under the condition of small samples, improve the diagnostic accuracy, and has a certain degree of robustness.
[0005] The technical means adopted by the present invention are as follows:
[0006] A lightweight fault diagnosis method based on an improved diffusion model under small samples, comprising:
[0007] Collect vibration signals of the health state and various fault states of the core components of rotating machinery, such as bearings or gears;
[0008] Apply a sliding window algorithm to divide the continuous original signal into multiple signal segments with a unified window size, and construct a small sample dataset;
[0009] Input the divided small sample dataset into the constructed improved diffusion model to generate high-quality fault samples;
[0010] Use the enhanced dataset of samples to train a deep learning model to identify and predict fault categories.
[0011] Furthermore, collect the vibration signals of the core components of the rotating machinery, such as bearings or gears, in healthy states and various fault states, specifically including:
[0012] Based on the rotating machinery fault simulation test bench, collect different types of fault signals;
[0013] Replace the core components of the rotating machinery, such as bearing or gear components, to construct a dataset;
[0014] After the machinery runs, collect the fault signals in the steady-state operation and store them in the format of csv files.
[0015] Furthermore, apply the sliding window algorithm to divide the continuous original signals into multiple signal segments with a unified window size to construct a small sample dataset, specifically including:
[0016] Use the normalization method to scale the amplitude of the signal to between [0, 1]. The formula is as follows:
[0017]
[0018] where x is the original signal, x min and x max are the minimum and maximum values of the signal respectively;
[0019] Through the sliding window algorithm, uniformly divide the collected signals into signal segments with the same sample length to construct a small sample dataset. According to the data points of the signal, calculate the number of samples after sampling as follows:
[0020]
[0021] where M is the number of data points in the original signal, ΔK is the sliding amount, and N is the window length.
[0022] Furthermore, input the divided small sample dataset into the constructed improved diffusion model to generate high-quality fault samples, specifically including:
[0023] Introduce the multi-head dynamic transposed attention mechanism into the diffusion model to calculate the cross-channel covariance and generate an attention map that implicitly encodes the global context;
[0024] Normalize the input feature map and apply 3×1 depth convolution to encode the channel-level spatial context, thereby forming the query Q, the key K, and the value V;
[0025] Adopt 1×1 convolution to merge the cross-channel context at the pixel level as follows:
[0026] Y = normalize(X)
[0027]
[0028] where represents a 1×1 pointwise convolution operation, represents a 3×1 depthwise convolution operation;
[0029] After changing the shapes of Q and K, perform a click operation to generate a transposed feature map with size, as follows:
[0030]
[0031] Re - weight through the Softmax function to highlight key fault features while suppressing irrelevant features, as follows:
[0032]
[0033] where and represent reshaped tensors, and α is a learnable scaling parameter;
[0034] Perform feature interaction and fusion through 1×1 convolution, as follows:
[0035]
[0036] Through the forward diffusion process, gradually add noise that conforms to a Gaussian distribution to the original sample x 0 ~q(x 0 ), as follows:
[0037]
[0038] where T is the total number of steps in the diffusion process, and q(x t ) represents the data distribution at time step t of the diffusion process, represents generating Gaussian - distributed noise with mean μ and variance σ for x, I represents a matrix with the same shape as the input data, and β t ∈(0,1) is a hyperparameter used to represent the noise strategy, (β 1 <···<β t <···<β T );
[0039] Through the reverse diffusion process, recover the clear data from a series of Gaussian - distributed noise samples by iterating through multiple time steps for the noise added during the prediction and inference forward processes, and finally generate samples that are consistent with the original data distribution, as follows:
[0040]
[0041] Among them, p(x T ) represents the prior distribution of the final state of the diffusion process, μ θ (x t , t) represents the mean, and Σ θ (x t , t) represents the covariance. θ is the learnable parameter of the neural network.
[0042] Furthermore, using the dataset after sample augmentation to train the deep learning model for identifying and predicting fault categories specifically includes:
[0043] Taking the high-quality samples generated by the improved diffusion model as the training dataset;
[0044] Constructing a convolutional neural network to train the dataset after sample augmentation;
[0045] Mapping the feature vector to the probability space through the Softmax function, and taking the highest probability category as the fault type finally predicted by the model.
[0046] The present invention also provides a lightweight fault diagnosis system based on the improved diffusion model for small samples implemented by the lightweight fault diagnosis method based on the improved diffusion model for small samples, including: a vibration signal acquisition unit, a small sample dataset construction unit, a high-quality fault sample generation unit, and a fault category prediction unit, where:
[0047] The vibration signal acquisition unit is used to acquire the vibration signals of the health state and various fault states of the core components of the rotating machinery, such as bearings or gears;
[0048] The small sample dataset construction unit is used to apply the sliding window algorithm to divide the continuous original signal into multiple signal segments with a unified window size to construct a small sample dataset;
[0049] The high-quality fault sample generation unit is used to input the divided small sample dataset into the constructed improved diffusion model to generate high-quality fault samples;
[0050] The fault category prediction unit is used to use the dataset after sample augmentation to train the deep learning model to identify and predict fault categories.
[0051] The present invention also provides a storage medium, which includes a stored program. When the program runs, it executes the lightweight fault diagnosis method based on the improved diffusion model for small samples.
[0052] Compared with the prior art, the present invention has the following advantages:
[0053] The present invention takes into account the problem of small samples in engineering practice and proposes a lightweight fault diagnosis method based on an improved diffusion model for small samples. First, vibration signals of the health state and various fault states of the core components of rotating machinery, such as bearings or gears, are collected through sensors. Then, the sliding window algorithm is applied to divide these continuous original signals into multiple signal segments with a unified window size to construct a data set. The divided small-sample data set is input into the constructed improved diffusion model to generate high-quality fault samples. Finally, the data set after sample enhancement is used to train a deep learning model to identify and predict fault categories. Compared with the prior art, the model established by the present invention can effectively generate high-quality samples under the condition of small samples, improve the diagnosis accuracy and has certain robustness.
[0054] For the above reasons, the present invention can be widely promoted in the fields of intelligent fault diagnosis of rotating machinery equipment, etc. Brief Description of the Drawings
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0056] Figure 1 It is the flowchart of the method of the present invention.
[0057] Figure 2 It is the schematic diagram of the sliding window algorithm provided by the embodiment of the present invention.
[0058] Figure 3 It is the schematic diagram of the multi-head dynamic transposed attention mechanism provided by the embodiment of the present invention.
[0059] Figure 4 It is the diffusion model process provided by the embodiment of the present invention.
[0060] Figure 5 It is the comparison between the generated mild tooth fracture fault signal and the measured signal provided by the embodiment of the present invention.
[0061] Figure 6 It is the comparison between the generated severe spalling fault signal and the measured signal provided by the embodiment of the present invention.
[0062] Figure 7 It is the fault diagnosis result using the enhanced samples provided by the embodiment of the present invention.
[0063] Figure 8 It is the visualization of the t-SNE clustering map provided by the embodiment of the present invention. Detailed Embodiments
[0064] To enable those skilled in the art to better understand the solution of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0065] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0066] As Figure 1 shown, the present invention provides a lightweight fault diagnosis method based on an improved diffusion model under small samples, including:
[0067] S1. Collect vibration signals of the health state and various fault states of the core components of rotating machinery, such as bearings or gears;
[0068] S2. Apply the sliding window algorithm to divide the continuous original signal into multiple signal segments with a unified window size to construct a small sample dataset;
[0069] S3. Input the divided small sample dataset into the constructed improved diffusion model to generate high-quality fault samples;
[0070] S4. Use the dataset after sample enhancement to train a deep learning model to identify and predict fault categories.
[0071] When specifically implemented, as a preferred implementation manner of the present invention, step S1 specifically includes:
[0072] S11. Based on a rotating machinery fault simulation test bench, collect different types of fault signals;
[0073] S12. Replace the core components of the rotating machinery, such as bearing or gear elements, to construct a dataset;
[0074] S13. After the machine runs, obtain the fault signal in the steady-state operation and store it in the csv file format.
[0075] In specific implementation, as a preferred implementation manner of the present invention, step S2 specifically includes:
[0076] S21. Use the normalization method to scale the amplitude of the signal to between [0, 1]. The formula is as follows:
[0077]
[0078] where x is the original signal, x min and x max are the minimum value and the maximum value of the signal respectively;
[0079] S22. As Figure 2 shown, through the sliding window algorithm, uniformly divide the collected signal into signal segments with the same sample length, construct a small sample data set, and calculate the number of samples after sampling according to the data points of the signal, as follows:
[0080]
[0081] where M is the number of data points in the original signal, ΔK is the slip amount, and N is the window length.
[0082] In specific implementation, as a preferred implementation manner of the present invention, step S3 specifically includes:
[0083] S31. Introduce a multi-head dynamic transposed attention mechanism into the diffusion model, calculate the cross-channel covariance, and generate an attention map that implicitly encodes the global context; as Figure 3 shown.
[0084] S32. Perform normalization processing on the input feature map, and apply a 3×1 depth convolution to encode the channel-level spatial context, thereby forming a query Q, a key K, and a value V;
[0085] S33. Use a 1×1 convolution to merge the cross-channel context at the pixel level, as follows:
[0086] Y = normalize(X)
[0087]
[0088] where represents the 1×1 pointwise convolution operation, represents the 3×1 depthwise convolution operation;
[0089] S34. After changing the shapes of Q and K, perform a dot operation to generate a transposed feature map with the size, as follows:
[0090]
[0091] S35. Reweight through the Softmax function to highlight key fault features while suppressing irrelevant features, as follows:
[0092]
[0093] where, and represent reshaped tensors, and α is a learnable scaling parameter;
[0094] S36. Perform feature interaction and fusion through 1×1 convolution, as follows:
[0095]
[0096] S37. Through the forward diffusion process, gradually add noise that conforms to a Gaussian distribution to the original sample x 0 ~q(x 0 ), as follows:
[0097]
[0098] where, T is the total number of steps in the diffusion process, and q(x t ) represents the data distribution at time step t of the diffusion process, represents generating Gaussian distribution noise with mean μ and variance σ for x, I represents a matrix with the same shape as the input data, and β t ∈(0,1) is a hyperparameter used to represent the noise strategy, (β 1 <···<β t <···<β T );
[0099] S38. As Figure 4 shown, through the reverse diffusion process, recover clear data from a series of Gaussian distribution noise samples by iterating through multiple time steps for the noise added during the prediction and inference forward processes, and finally generate samples that are consistent with the original data distribution, as follows:
[0100]
[0101] where, p(x T ) represents the prior distribution of the final state of the diffusion process, μ θ (x t ,t) represents the mean, Σ θ (x t ,t) represents the covariance, and θ is the learnable parameter of the neural network.
[0102] In this embodiment, in order to verify the effectiveness of the generated signal, the following metrics are used to evaluate the quality of the generated signal: Root Mean Square Error (RMSE), Peak Signal-to-Noise Ratio (PSNR), and Frequency Spectrum Cosine Similarity (FSCS), as follows:
[0103]
[0104]
[0105] Among them, y and respectively represent the generated signal and the actual signal. n is the number of samples, and fft(·) represents the Fourier transform. MSE represents the mean square error. d(·) represents the Euclidean distance between two corresponding points on the curves of the generated signal and the true signal.
[0106] Based on the above metrics, this embodiment also constructs a comprehensive evaluation metric to judge the quality of the generated signal, including: First, perform positive normalization on the metrics. Then, perform standardization and calculate the Euclidean distances of each alternative solution from the ideal solution and the anti-ideal solution. The mathematical formulas are as follows:
[0107] S i ′ = max(S) - S i
[0108]
[0109] Among them, S represents the minimization metric, and X ij = {x ij |(i = 1, 2 ···, n; j = 1, 2, 3, 4)} is the standardized evaluation metric,
[0110] Specifically in implementation, as a preferred implementation manner of the present invention, step S4 specifically includes:
[0111] S41. Use the high-quality samples generated by the improved diffusion model as the training data set;
[0112] S42. Construct a convolutional neural network and train the data set after sample enhancement;
[0113] S43. Through the Softmax function, map the feature vector to the probability space, and the highest probability category is used as the fault type finally predicted by the model.
[0114] Figure 5 For comparison between the mild tooth breakage fault signal generated by using the method of the present invention and the measured signal. Figure 6Comparison between the severe spalling fault signal generated by the method of the present invention and the measured signal. It can be seen from the time-domain signal that the generated signal and the real signal show a high degree of similarity. It can be seen from the spectrograms of all generated signals that the amplitudes of the characteristic frequencies of the generated signals are slightly lower than those of the real signals, but all retain the basic characteristics of the original signals, and the meshing frequency f of the gear can be clearly seen m and its multiple frequencies nf m , which shows the effectiveness and reliability of the generated signal.
[0115] Table 1 shows the comparison of the results of the method of the present invention and other methods, where "↑" indicates that the index is a maximization index, "↓" indicates that the index is a minimization index, and bold indicates the optimal result. It can be seen from the table that the signal quality generated by WGAN and DCGAN is much lower than that of the diffusion model. This is because the GAN model requires a large amount of data to learn the distribution of real data. When the number of samples in the dataset is very small, the model cannot fully capture all the characteristics of the data, resulting in a significant difference between the generated signal and the real signal. In addition, it is found that the running time of the GAN model is relatively short, and the generation time of each type of sample is less than 10 minutes, while the running time of the original diffusion model is 16 minutes and 39 seconds, which shows that the computational cost of the diffusion model is relatively high. After adding the MDTA module, the running time of the model is reduced by 3 minutes and 23 seconds compared with the original DDPM. In addition, the model proposed in this paper has achieved the best performance in all indicators except the FSCS index. The CI index is 0.898, which is 0.005 higher than that of DDPM, which shows the superiority of the model proposed by the method of the present invention.
[0116] Table 1. Evaluation results of generated gear data
[0117] Model RMSE↓ PSNR↑ FSCS↑ FD↓ CI↑ Training Time WGAN 0.3034 10.4367 0.9899 0.5467 0.288 7 minutes and 8 seconds DCGAN 0.1633 15.9404 0.9843 0.2738 0.751 5 minutes and 10 seconds VAE - GAN 0.1286 18.1286 0.9943 0.1994 0.875 9 minutes and 56 seconds DDPM 0.1305 18.3215 0.9849 0.1983 0.893 16 minutes and 39 seconds Proposed 0.1206 18.6209 0.9929 0.1954 0.898 13 minutes and 16 seconds
[0118] Figure 7 For the diagnostic results after sample enhancement. Experiments were carried out with WDCNN and Resnet18 as the benchmark models under 50 and 10 samples per class respectively. It can be seen that the model proposed in the present invention has achieved the best diagnostic accuracy under the conditions of 50 and 10 samples per class. Taking the Resnet model as the benchmark, they are 97.97% and 94.85% respectively, which are 1.2% and 2.33% higher than the original DDPM. Taking the WDCNN model as the benchmark, they are 94.27% and 91.39% respectively, which are 1.88% and 0.95% higher than the original DDPM.
[0119] Figure 8 For the visualization of the t-SNE clustering map. Figure 8 (a) shows the original sample distribution. It can be seen that before feature extraction, the sample points are scattered quite randomly and lack obvious regularity. Figure 8(b) The feature distribution after the model sample synthesis proposed by the present invention is shown. It can be seen that it has a certain similarity with the feature distribution of the original data, but overall it is still very messy. After feature extraction, each type of sample of the method of the present invention is highly concentrated, and the points of different types are clearly separated from each other. There is a small amount of sample confusion in the 7th and 2nd types of samples in DDPM-Resnet18. The samples generated by VAEGAN and CDGAN contain more noise, and there is confusion in a large number of samples after feature extraction, and accurate clustering cannot be performed.
[0120] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A lightweight fault diagnosis method with small samples based on an improved diffusion model, characterized in that: include: Collect vibration signals of the health status and various fault conditions of the core components of rotating machinery such as bearings or gears; Apply the sliding window algorithm to divide the continuous original signal into multiple signal segments with uniform window size to construct a small sample data set; Input the divided small sample data set into the constructed improved diffusion model to generate high-quality fault samples; Use the sample-augmented dataset to train a deep learning model to identify and predict fault categories.
2. According to claim 1, a lightweight fault diagnosis method for small samples based on an improved diffusion model is characterized in that: The collecting of vibration signals of the health status and various fault status of the core components of the rotating machinery such as bearings or gears specifically includes: Based on the rotating machinery fault simulation test bench, different types of fault signals are collected; Replace core components of rotating machinery such as bearings or gear elements and build data sets; After the machine is running, the fault signal of steady-state operation is taken and stored in csv file format.
3. The lightweight fault diagnosis method with small sample size based on improved diffusion model according to claim 1 is characterized in that: The sliding window algorithm is applied to divide the continuous original signal into multiple signal segments with a uniform window size to construct a small sample data set, which specifically includes: Use the normalization method to scale the signal amplitude to between [0,1]. The formula is as follows: Among them, x is the original signal, x min and x max are the minimum and maximum values of the signal respectively; Through the sliding window algorithm, the collected signal is uniformly divided into signal segments with consistent sample lengths, and a small sample data set is constructed. According to the data points of the signal, the number of samples after sampling is calculated as follows: Where M is the number of data points in the original signal, ΔK is the slip amount, and N is the window length.
4. The lightweight fault diagnosis method with small sample size based on improved diffusion model according to claim 1 is characterized in that: The divided small sample data set is input into the constructed improved diffusion model to generate high-quality fault samples, specifically including: Introducing a multi-head dynamic transposed attention mechanism into the diffusion model, calculating cross-channel covariance and generating an attention map that implicitly encodes the global context; The input feature map is normalized and a 3×1 depthwise convolution is applied to encode the channel-level spatial context to form the query Q, keyword K, and value V; A 1×1 convolution is used to merge cross-channel context at the pixel level as follows: Y=normalize(X) in, represents a 1×1 point-by-point convolution operation, Represents a 3×1 depth-wise convolution operation; After changing the shapes of Q and K and clicking, a The transposed feature map of size is as follows: Re-weighting is performed through the Softmax function to highlight key fault features while suppressing irrelevant features, as follows: in, and represents the reshaped tensor, α is a learnable scaling parameter; Through 1×1 convolution, feature interaction fusion is performed as follows: Through the forward diffusion process, the noise that conforms to the Gaussian distribution is gradually added to the original sample x0~q(x0), as follows: Where T is the total number of steps in the diffusion process, q(x t ) represents the data distribution at time t of the diffusion process, It means that Gaussian noise with mean μ and variance σ is generated for x, I represents a matrix with the same shape as the input data, β t ∈(0,1) is a hyperparameter used to represent the noise strategy, (β1<···<β t <···<β T ); Through the reverse diffusion process, the noise added in the prediction and inference forward process is restored from a series of Gaussian distributed noise samples through multiple time steps of iteration, and finally a sample consistent with the original data distribution is generated, as follows: Among them, p(x T ) represents the prior distribution of the final state of the diffusion process, μ θ (x t ,t) represents the mean, Σ θ (x t ,t) represents the covariance, and θ is the learnable parameter of the neural network.
5. The lightweight fault diagnosis method with small sample size based on improved diffusion model according to claim 1 is characterized in that: The sample-enhanced dataset is used to train a deep learning model to identify and predict fault categories, specifically including: The high-quality samples generated by the improved diffusion model are used as training datasets; Construct a convolutional neural network and train it on the sample-enhanced dataset; The feature vector is mapped to the probability space through the Softmax function, and the highest probability category is used as the fault type finally predicted by the model.
6. A lightweight fault diagnosis system based on a small sample size based on an improved diffusion model implemented by the lightweight fault diagnosis method based on a small sample size based on an improved diffusion model as described in any one of claims 1 to 5, characterized in that: include: Vibration signal acquisition unit, small sample data set construction unit, high-quality fault sample generation unit and fault category prediction unit, where: The vibration signal acquisition unit is used to collect vibration signals of the health status and various fault status of the core components of the rotating machinery, such as bearings or gears; The small sample data set construction unit is used to apply a sliding window algorithm to divide the continuous original signal into a plurality of signal segments with a uniform window size to construct a small sample data set; The high-quality fault sample generating unit is used to input the divided small sample data set into the constructed improved diffusion model to generate high-quality fault samples; The fault category prediction unit is used to train a deep learning model using the sample-enhanced data set to identify and predict fault categories.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the lightweight fault diagnosis method for small samples based on the improved diffusion model as described in any one of claims 1 to 5 is executed.