CN118094368A - Bearing fault diagnosis method and device based on diffusion model and attention mechanism - Google Patents

Bearing fault diagnosis method and device based on diffusion model and attention mechanism Download PDF

Info

Publication number
CN118094368A
CN118094368A CN202410523128.XA CN202410523128A CN118094368A CN 118094368 A CN118094368 A CN 118094368A CN 202410523128 A CN202410523128 A CN 202410523128A CN 118094368 A CN118094368 A CN 118094368A
Authority
CN
China
Prior art keywords
signal
model
bearing
attention mechanism
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410523128.XA
Other languages
Chinese (zh)
Other versions
CN118094368B (en
Inventor
谭平
邹涵
周鲜成
周开军
覃业梅
曾理
李世玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiangjiang Laboratory
Original Assignee
Xiangjiang Laboratory
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiangjiang Laboratory filed Critical Xiangjiang Laboratory
Priority to CN202410523128.XA priority Critical patent/CN118094368B/en
Publication of CN118094368A publication Critical patent/CN118094368A/en
Application granted granted Critical
Publication of CN118094368B publication Critical patent/CN118094368B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Testing And Monitoring For Control Systems (AREA)

Abstract

The embodiment of the invention provides a bearing fault diagnosis method and device based on a diffusion model and an attention mechanism, and relates to the technical field of bearing fault detection technology. The method comprises the following steps: acquiring initial bearing fault information; performing signal generation processing on the basis of the initial bearing signal by a preset diffusion model to obtain a training signal and a test signal; determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics; training and optimizing the attention mechanism model through the training signals to obtain a bearing fault signal target classification model; and carrying out fault identification processing on the bearing fault signal target classification model through the test signal so as to obtain a fault identification result. The invention solves the problem of low bearing fault recognition precision, and further achieves the effect of improving the bearing fault recognition precision.

Description

Bearing fault diagnosis method and device based on diffusion model and attention mechanism
Technical Field
The embodiment of the invention relates to the technical field of bearing fault detection, in particular to a bearing fault diagnosis method and device based on a diffusion model and an attention mechanism.
Background
Bearings play a critical role in steel machinery and are responsible for supporting the weight and moving loads of rotating components. If the bearing fails, the performance and the service life of the mechanical equipment can be influenced, and the safety of constructors can be seriously and even threatened. Through the diagnosis of bearing faults, hidden dangers can be found in advance, and larger harm possibly generated later is avoided.
A Diffusion Model (Diffusion Model) belongs to a new generation of generative models, and can be used for generating data similar to input data; the attention mechanism is an important technology in the neural network, and both technologies are currently applied in the signal processing field in a large number.
However, when the existing attention mechanism is applied to the field of bearing detection, the overfitting phenomenon is easy to generate due to the fact that data samples are few, the diffusion model can generate signals, but the generated signals are poor in quality, and the causal features of the bearing signals are not extracted due to the fact that only the time-frequency features of the bearing fault signals are extracted, so that feature extraction is incomplete, and the bearing fault diagnosis accuracy is affected.
In view of the above problems, there is currently a lack of a better solution.
Disclosure of Invention
The embodiment of the invention provides a bearing fault diagnosis method and device based on a diffusion model and an attention mechanism, which at least solve the problem of low bearing fault diagnosis accuracy in the related technology.
According to an embodiment of the present invention, there is provided a bearing failure diagnosis method based on a diffusion model and an attention mechanism, including:
Acquiring initial bearing fault information, wherein the initial bearing fault information at least comprises initial bearing signals and signal characteristics, and the signal characteristics at least comprise signal time-frequency characteristics and signal causal characteristics;
Performing signal generation processing on the basis of the initial bearing signal by a preset diffusion model to obtain a training signal and a test signal;
determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics;
Training and optimizing the attention mechanism model through the training signals to obtain a bearing fault signal target classification model;
And carrying out fault identification processing on the bearing fault signal target classification model through the test signal so as to obtain a fault identification result.
In an exemplary embodiment, the performing, by the preset diffusion model, a signal generating process based on the initial bearing signal to obtain a training signal and a test signal includes:
Performing noise inversion denoising processing on a first bearing signal through the preset diffusion model to obtain a first signal, wherein the first bearing signal is obtained by grouping processing on the initial bearing fault information;
Performing energy sum value calculation on the first signals in the same group, and performing signal filtering processing according to the energy sum value calculation result to obtain a second signal;
And carrying out mixed division processing on the second signal and the first bearing signal to obtain the training signal and the test signal.
In an exemplary embodiment, before said determining a target attention mechanism model based on said signal time-frequency characteristics and said signal causal characteristics, said method further comprises:
carrying out global average pooling treatment on the initial attention mechanism model based on preset characteristic tensor parameters;
Based on a global average pooling processing result, connecting model channels of the initial attention mechanism model through a preset full-connection layer and a preset first function, and determining channel weights of the model channels through a preset second function;
And weighting the model channel based on the channel weight to obtain a target channel, wherein the target channel is used for carrying out characteristic recalibration on the initial bearing fault information.
In an exemplary embodiment, the training optimization processing on the attention mechanism model by the training signal to obtain a bearing fault signal target classification model includes:
calculating an error value of the attention mechanism model through a preset third function;
And carrying out parameter adjustment processing on network parameters in the attention mechanism model according to the error value calculation result so as to obtain the bearing fault signal target classification model.
In one exemplary embodiment, the target attention mechanism model includes:
The input layer is used for acquiring the training signal and converting the training signal to obtain a characteristic tensor parameter;
the time-frequency and causal feature extraction layer is used for extracting the time-frequency features of the signals and the causal features of the signals;
The feature fusion layer is used for splicing bearing fault signals after the time-frequency extraction operation and the causal feature extraction operation are completed;
And the full connection layer is used for outputting the fault identification result.
According to another embodiment of the present invention, there is provided a bearing failure diagnosis apparatus based on a diffusion model and an attention mechanism, including:
The information acquisition module is used for acquiring initial bearing fault information, wherein the initial bearing fault information at least comprises initial bearing signals and signal characteristics, and the signal characteristics at least comprise signal time-frequency characteristics and signal causal characteristics;
The signal generation module is used for enabling a preset diffusion model to perform signal generation processing based on the initial bearing signal so as to obtain a training signal and a test signal;
the model determining module is used for determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics;
The training optimization module is used for carrying out training optimization processing on the attention mechanism model through the training signal so as to obtain a bearing fault signal target classification model;
And the fault identification module is used for carrying out fault identification processing on the bearing fault signal target classification model through the test signal so as to obtain a fault identification result.
In one exemplary embodiment, the signal generation module includes:
the denoising unit is used for carrying out noise inversion denoising processing on the first bearing signal through the preset diffusion model to obtain a first signal, wherein the first bearing signal is obtained by carrying out grouping processing on the initial bearing fault information;
The filtering unit is used for carrying out energy sum value calculation on the first signals in the same group and carrying out signal filtering processing according to the energy sum value calculation result so as to obtain a second signal;
And the signal dividing unit is used for carrying out mixed dividing processing on the second signal and the first bearing signal so as to obtain the training signal and the test signal.
In an exemplary embodiment, the apparatus further comprises:
the average pooling module is used for carrying out global average pooling processing on the initial attention mechanism model based on a preset characteristic tensor parameter before the target attention mechanism model is determined based on the signal time-frequency characteristics and the signal causal characteristics;
the channel processing module is used for connecting model channels of the initial attention mechanism model through a preset full-connection layer and a preset first function based on a global average pooling processing result, and determining channel weights of the model channels through a preset second function;
And the weighting processing module is used for carrying out weighting processing on the model channel based on the channel weight so as to obtain a target channel, and the target channel is used for carrying out characteristic recalibration processing on the initial bearing fault information.
According to a further embodiment of the invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the invention, the attention mechanism model is determined according to the time-frequency characteristic and the causal characteristic of the signal, so that the finally generated model has better fault recognition capability, the problem of low bearing fault recognition precision can be solved, and the effect of improving the bearing fault recognition precision and efficiency is achieved.
Drawings
FIG. 1 is a block diagram of a hardware architecture of a mobile terminal of a bearing failure diagnosis method based on a diffusion model and an attention mechanism according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of bearing fault diagnosis based on a diffusion model and a attention mechanism according to an embodiment of the present invention;
FIG. 3 is a block diagram of a bearing failure diagnosis apparatus based on a diffusion model and an attention mechanism according to an embodiment of the present invention;
FIG. 4 is a flow chart of an embodiment of the present invention;
FIG. 5 is a detailed flow diagram of a partial flow of an embodiment of the present invention;
FIG. 6 is a schematic diagram of simulation results of a forward process of generating a bearing failure signal in accordance with an embodiment of the present invention;
FIG. 7 is a second schematic diagram of simulation results of a backward process for generating a bearing failure signal in accordance with an embodiment of the present invention;
FIG. 8 is a third schematic diagram of simulation results according to an embodiment of the present invention;
FIG. 9 is a diagram showing simulation results according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the operation on the mobile terminal as an example, fig. 1 is a hardware structural block diagram of the mobile terminal of a bearing fault diagnosis method based on a diffusion model and an attention mechanism according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a bearing fault diagnosis method based on a diffusion model and an attention mechanism in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for diagnosing a bearing fault based on a diffusion model and an attention mechanism is provided, and fig. 2 is a flowchart of a method for diagnosing a bearing fault based on a diffusion model and an attention mechanism according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
Step S201, initial bearing fault information is obtained, wherein the initial bearing fault information at least comprises initial bearing signals and signal characteristics, and the signal characteristics at least comprise signal time-frequency characteristics and signal causal characteristics;
In this embodiment, the time-frequency characteristic and the causal characteristic of the signal are obtained to facilitate the subsequent model to learn and train the time-frequency characteristic and the causal characteristic of the signal, so as to improve the efficiency of fault diagnosis.
The initial bearing fault information further comprises, but is not limited to, information such as a bearing model, a bearing production serial number, normal bearing data (obtained by sampling for 6 seconds in each file at 97656 Hz), outer ring bearing data (obtained by sampling for 3 seconds in each file at 48828 Hz), inner ring bearing data (obtained by sampling for 3 seconds in each file at 48828 Hz), and the like, wherein data points are obtained through single-channel radial acceleration calculation, and a normal bearing data set is downsampled to 48828 Hz so as to be matched with other fault bearing data, so that multiple bearing faults can be respectively identified.
The signal time-frequency characteristics include (but are not limited to) characteristics of average power spectral density for indicating the energy distribution of the signal over various frequencies, instantaneous frequency for indicating the rate of change of the frequency of the signal over time, pulse decision functions for describing the response of the system to the input signal, instantaneous phase for indicating the phase of the signal at each point in time, instantaneous amplitude for indicating the amplitude of the signal at each point in time, instantaneous frequency difference for indicating the frequency difference at adjacent times, etc., signal causal characteristics include, but are not limited to, causality (i.e., the value of a signal is always a function of its preceding time period) for indicating that any time in time of a signal depends on this preceding time point, anti-causality (i.e., the value of a signal is always a function of its following time period) for indicating that any time in time of a signal depends on this following time point, non-causality (i.e., the value of a signal is not a function of time) for indicating that the value of a signal neither depends on the preceding time point nor on the following time point, causality for indicating that the relationship of a signal to time is not strict, i.e., some portions of a signal may depend on the following time point but generally remain causality non-strict, etc.
Step S202, a preset diffusion model performs signal generation processing based on the initial bearing signal to obtain a training signal and a test signal;
In this embodiment, the initial bearing signals are grouped according to different categories, the data of each group is generated by using a diffusion model, then the most unreasonable 30% of the signals in the generated signals and the original signals are discarded by calculating the difference between the generated signals and the original signals, and the rest 70% of the generated bearing fault signals in each group are mixed with the original signals to obtain training bearing fault signals (i.e. the training signals) and test bearing fault signals (corresponding to the test signals) of different groups.
Step S203, determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics;
In this embodiment, the model channels and related parameters of the initial Squeeze-and-Excitation attention mechanism model are adjusted based on the signal time-frequency characteristics and the signal cause-effect characteristics, so as to obtain the attention mechanism model to be trained.
Step S204, training and optimizing the attention mechanism model through the training signals to obtain a bearing fault signal target classification model;
and step S205, performing fault identification processing on the bearing fault signal target classification model through the test signal to obtain a fault identification result.
In this embodiment, the tested bearing fault signal is input into the model obtained by previous training, and the prediction result is obtained by the SE attention mechanism neural network model integrating the time-frequency characteristic and the causal characteristic.
Through the steps, the attention mechanism model is determined according to the time-frequency characteristics and the causal characteristics of the signals, so that the finally generated model has better fault recognition capability, the problem of low bearing fault recognition precision is solved, and the bearing fault recognition precision and efficiency are improved.
In an optional embodiment, the performing, by the preset diffusion model, a signal generating process based on the initial bearing signal to obtain a training signal and a test signal includes:
Step S2021, performing noise inversion denoising processing on the first bearing signal through the preset diffusion model to obtain a first signal, where the first bearing signal is obtained by performing packet processing on the initial bearing fault information;
In this embodiment, the grouping may be based on different bearing faults, where the initial bearing signals are divided into different groups, or may be grouped according to other rules, where the grouping of the signals is beneficial for the model to learn for different fault conditions, so as to improve the recognition accuracy of the model for different faults.
Noise-inversion denoising processing involves destroying signals of different groups by continuously adding gaussian noise, and then recovering the signals by learning the inverse denoising process. After training, randomly sampled noise may be transferred into a trained diffusion model, and a first signal may be generated by a learned denoising process.
Step S2022, performing energy sum value calculation on the first signals in the same group, and performing signal filtering processing according to the energy sum value calculation result to obtain a second signal;
In this embodiment, the energy sums (i.e., the energy sums) of different frequency bands of the original signals and the generated signals of the same group (i.e., the initial bearing signals after grouping) are calculated through wavelet packet decomposition, the average energy sum of each frequency band of the original signals of the same group is calculated, then the error between each generated signal and the average energy sum in the same group is calculated, the generated signal with the largest error of 30% is discarded, and the remaining 70% of relatively reasonable generated signals (i.e., the second signals) are reserved.
Step S2023 performs a hybrid division process on the second signal and the first bearing signal to obtain the training signal and the test signal.
In this embodiment, the remaining 70% of the generated bearing fault signals in each group are mixed with the grouped original bearing fault signals (i.e., the first bearing signals) to obtain the training bearing fault signals (corresponding to the training signals) and the test bearing fault signals (corresponding to the test signals) of different groups.
In an alternative embodiment, prior to said determining a target attention mechanism model based on said signal time-frequency characteristics and said signal causal characteristics, said method further comprises:
step S20301, performing global average pooling processing on the initial attention mechanism model based on preset feature tensor parameters;
in this embodiment, using the Squeeze-and-Excitation attention model (i.e., the initial attention mechanism model described above), spatial features are first reduced to 1×1 by global averaging pooling based on the width and height of the feature tensors, as shown in equation 1:
Wherein, H, W and C represent input tensors/>, respectivelyLength, width and number of channels,/>Is the input tensor/>X-th channel data,/>,/>Refers to the x-th element of Z.
Step S20302, based on the global average pooling result, connecting model channels of the initial attention mechanism model through a preset full connection layer and a preset first function, and determining channel weights of the model channels through a preset second function;
in this embodiment, two full connection layers (i.e. the aforementioned preset full connection layer) and Relu functions (i.e. the aforementioned first function) are used to establish connection between each channel, and then the weights of each channel are obtained through a Sigmoid function (i.e. the aforementioned second function), as shown in the following formula 2-4:
Wherein, Is the calculated weight of each channel (i.e. the aforementioned channel weight)/>Representing the weights of the two fully connected layers, respectively.
Step S20303, performing weighting processing on the model channel based on the channel weight, so as to obtain a target channel, where the target channel is used for performing feature recalibration processing on the initial bearing fault information.
In this embodiment, s is weighted by channel multiplication onto each channel of the original feature map, so as to achieve the recalibration of the channel attention to the original feature (i.e. the foregoing feature recalibration process), as shown in equation 5 specifically:
Wherein, The output tensor, which is the SE attention model, i.e. the Squeeze-and-Excitation attention model, through which the tensor shape of the input and output is unchanged, but the important features are highlighted by weighting the individual channels.
In an optional embodiment, the training and optimizing the attention mechanism model by using the training signal to obtain a bearing fault signal target classification model includes:
Step S2041, calculating an error value of the attention mechanism model through a preset third function;
And step S2042, carrying out parameter adjustment processing on network parameters in the attention mechanism model according to the error value calculation result so as to obtain the bearing fault signal target classification model.
In this embodiment, in the process of obtaining the optimal weight classification model, calculating an error value by using a cross entropy loss function (corresponding to the third function), and adjusting network parameters in the network model; the cross entropy loss function calculation formula is as follows:
Wherein, Is a cross entropy loss function,/>Actual tag representing this sample,/>Representing the actual tag of this sample after the one-time encoding, e.g. the class of the actual tag is the second class, then its corresponding actual tag after the one-time encoding is/>;/>Representing the predictive probability distribution of the model.
In an alternative embodiment, the target attention mechanism model includes:
The input layer is used for acquiring the training signal and converting the training signal to obtain a characteristic tensor parameter;
the time-frequency and causal feature extraction layer is used for extracting the time-frequency features of the signals and the causal features of the signals;
The feature fusion layer is used for splicing bearing fault signals after the time-frequency extraction operation and the causal feature extraction operation are completed;
And the full connection layer is used for outputting the fault identification result.
In this embodiment, an input layer, a time-frequency and causal feature extraction layer, a feature fusion layer, an attention mechanism layer, and a full connection layer are set in the neural network model.
The input layer mainly obtains the mixed original and generated training bearing fault signals and converts the signals into tensor data types required by the neural network input through a1 x 1 convolution.
The time-frequency and causal feature extraction layer completes the time-frequency extraction operation and the causal feature extraction operation by setting two main branches so as to obtain more effective information of the bearing fault signal, specifically:
branch one: for extracting time-frequency characteristic branches, extracting different time-frequency characteristics on different secondary branches by setting time dimension convolution kernels 1×T with different sizes, wherein the lengths of T on the secondary branches are different;
Branch two: in order to extract causal features branches, the causal features are used for extracting bearing fault diagnosis signals, namely, the generated faults can influence future bearing fault signals, and the causal features are extracted to be beneficial to obtaining more comprehensive features, so that the classification accuracy is improved. The causal feature extraction branches are obtained based on time convolution network improvement and specifically comprise n residual blocks, wherein the expansion base number is set to b, m layers of convolution layers are arranged in each residual block, and the size of a convolution kernel is set to be 1 xA; the receptive field (RECEPTIVE FIELD size, RFS) of the time convolution network can be changed by changing the above parameters, as shown in equation 7:
The feature fusion layer is used for splicing bearing fault signals after the time-frequency extraction operation and the causal feature extraction operation are completed;
the full connection layer is used for functioning as a classifier in the whole neural network and outputting a prediction result of the model.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
In this embodiment, a bearing fault diagnosis device based on a diffusion model and an attention mechanism is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 3 is a block diagram of a bearing failure diagnosis apparatus based on a diffusion model and an attention mechanism according to an embodiment of the present invention, as shown in fig. 3, the apparatus including:
the information acquisition module 31 is configured to acquire initial bearing fault information, where the initial bearing fault information at least includes an initial bearing signal and a signal feature, and the signal feature at least includes a signal time-frequency feature and a signal causal feature;
The signal generating module 32 is configured to enable a preset diffusion model to perform signal generation processing based on the initial bearing signal, so as to obtain a training signal and a test signal;
a model determination module 33 for determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics;
The training optimization module 34 is configured to perform training optimization on the attention mechanism model through the training signal, so as to obtain a bearing fault signal target classification model;
and the fault recognition module 35 is configured to perform fault recognition processing on the bearing fault signal target classification model through the test signal, so as to obtain a fault recognition result.
In an alternative embodiment, the signal generation module 32 includes:
the denoising unit is used for carrying out noise inversion denoising processing on the first bearing signal through the preset diffusion model to obtain a first signal, wherein the first bearing signal is obtained by carrying out grouping processing on the initial bearing fault information;
The filtering unit is used for carrying out energy sum value calculation on the first signals in the same group and carrying out signal filtering processing according to the energy sum value calculation result so as to obtain a second signal;
And the signal dividing unit is used for carrying out mixed dividing processing on the second signal and the first bearing signal so as to obtain the training signal and the test signal.
In an alternative embodiment, the apparatus further comprises:
the average pooling module is used for carrying out global average pooling processing on the initial attention mechanism model based on a preset characteristic tensor parameter before the target attention mechanism model is determined based on the signal time-frequency characteristics and the signal causal characteristics;
the channel processing module is used for connecting model channels of the initial attention mechanism model through a preset full-connection layer and a preset first function based on a global average pooling processing result, and determining channel weights of the model channels through a preset second function;
And the weighting processing module is used for carrying out weighting processing on the model channel based on the channel weight so as to obtain a target channel, and the target channel is used for carrying out characteristic recalibration processing on the initial bearing fault information.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; or the above modules may be located in different processors in any combination.
The present embodiment is described below by way of specific examples.
As shown in fig. 4, a bearing fault diagnosis method based on a diffusion model and an attention mechanism specifically includes the following steps:
And step S100, inputting an original bearing fault signal into a diffusion model for generating data similar to the original signal, discarding unreasonable signals in the generated signal, and dividing training and testing signals.
The experiments employed bearing failure data provided by the american society of mechanical failure prevention technology, the dataset comprising three types of data from a bearing test stand:
(1) Normal bearing data, sampled at 97656 Hz seconds in each file;
(2) Outer race bearing data sampled at 48828 Hz seconds in each file;
(3) Inner race fault bearing data was sampled at 48828 Hz seconds in each file.
The data points are from a single channel radial accelerometer. The normal bearing dataset is downsampled to 48828 Hz to match other faulty bearing data. The goal of the classifier is to correctly classify the input data into three faults.
The method comprises the steps of grouping original bearing fault signals according to different categories, generating data of each group by using a diffusion model, then discarding the least reasonable 30% of signals by calculating the difference between the generated signals and the original signals, and mixing the rest 70% of generated bearing fault signals in each group with the original signals to obtain training bearing fault signals and test bearing fault signals of different groups.
And step 200, determining an SE attention mechanism neural network model integrating the time-frequency characteristic and the causal characteristic based on the time-frequency characteristic and the causal characteristic of the bearing fault signal.
And designing a SE attention mechanism neural network model integrating the time-frequency characteristic and the causal characteristic according to the characteristics of the bearing fault signal.
And step S300, training and optimizing the constructed neural network model to obtain the bearing fault signal classification model with the optimal weight.
And training and optimizing the SE attention mechanism neural network model fused with the time-frequency characteristic and the causal characteristic based on each group of bearing fault signals for training so as to obtain the optimal weight of the bearing fault signal classification model.
And step 400, inputting the tested bearing fault signals into a bearing fault signal classification model with optimal weight to obtain a fault identification result.
And inputting each group of test bearing fault signals into the obtained bearing fault signal classification model, and determining the types of the test bearing faults.
Further, please refer to fig. 5, fig. 5 is a detailed flow chart of an embodiment of step S100 shown in fig. 4, in which step S100 includes:
Step S110, grouping original bearing fault signals: dividing the original bearing model into different groups based on different bearing faults;
As the data set used in the present invention includes three types of data: normal bearing data, outer ring bearing data and inner ring fault bearing data, so three types of original data are grouped and labeled correspondingly.
Step S120, generating a bearing fault signal: the signals of the different groups are corrupted by continuously adding gaussian noise, and then the signals are recovered by learning the inverse denoising process. After training, we can transfer randomly sampled noise into a trained diffusion model, and generate a signal through a learned denoising process.
Generating a bearing fault signal: according to fig. 6 and 7, in the forward process (as shown in fig. 6), noise is gradually added to the original bearing fault signal until the original signal becomes a gaussian noise signal, and the distribution of the noise at each step is learned through a neural network. Then in the backward process (as shown in fig. 7), the noise distribution learned by the forward process is reversed, gradually removing the noise, and generating a similar bearing failure signal.
Step S130, discarding unreasonable signals: and calculating energy sums of different frequency bands of the original signals and the generated signals of the same group through wavelet packet decomposition, calculating average energy sums of all frequency bands of the original signals of the same group, calculating errors of each generated signal and the average energy sums in the same group, discarding the generated signal with the largest error by 30%, and reserving the rest 70% of relatively reasonable generated signals.
Discard unreasonable signals therein: according to fig. 8 and 9, the energy sum of the original signal and the generated signal in each frequency band can be calculated by using wavelet packet decomposition, then the error of the average energy sum of each generated signal and the original signal in the same group is calculated, the generated signal with the largest error of 30% is discarded, and the rest 70% of relatively reasonable generated signals are remained.
Step S140, dividing the training and testing signals: mixing the remaining 70% of the generated bearing fault signals in each group with the original signals and grouping to obtain training bearing fault signals and test bearing fault signals of different groups. Further, in the step of determining the SE attention mechanism neural network model fusing the time-frequency features and the causal features based on the time-frequency features and the causal features of the bearing fault signals, an extrusion-and-Excitation (attention) model is used, and the spatial features are first reduced to 1×1 by global average pooling based on the width and the height of the feature tensor, specifically as shown in the foregoing formula 1.
The connection between the channels is then established using two full connection layers and Relu functions, and then the weights of the channels are obtained via Sigmoid functions, the specific formulas are shown in formulas 2-4.
And finally weighting s to each channel of the original characteristic diagram channel by channel multiplication to finish recalibration of the channel attention to the original characteristic, wherein a specific formula is shown in the formula 5.
Further, in the step of determining the SE attention mechanism neural network model incorporating the time-frequency characteristic and the causal characteristic based on the time-frequency characteristic and the causal characteristic of the bearing fault signal,
An input layer, a time-frequency and causal feature extraction layer, a feature fusion layer, an attention mechanism layer and a full connection layer are arranged in the neural network model.
The input layer mainly obtains the mixed original and generated training bearing fault signals and converts the signals into tensor data types required by the neural network input through a1 x 1 convolution.
The time-frequency and causal feature extraction layer is used for completing the extraction of the time-frequency and causal features by arranging two main branches, and specifically comprises the following steps:
the first branch is a time-frequency characteristic extraction branch, different time-frequency characteristics are extracted on different secondary branches by setting time dimension convolution kernels 1 xT with different sizes, wherein the lengths of T on the secondary branches are different;
the second branch is a causal feature extraction branch, and is used for extracting causal features of bearing fault diagnosis signals, namely, the generated faults can influence future bearing fault signals, and the causal features are extracted to be beneficial to obtaining more comprehensive features, so that classification accuracy is improved.
The causal feature extraction branches are obtained based on time convolution network improvement and specifically comprise n residual blocks, wherein the expansion base number is set to b, m layers of convolution layers are arranged in each residual block, and the size of a convolution kernel is set to be 1 XA; the receptive field (RECEPTIVE FIELD size, RFS) of the time convolution network may be varied by varying the above parameters, as specifically shown in equation 7 above.
The feature fusion layer is used for splicing bearing fault signals after the time-frequency extraction operation and the causal feature operation are completed;
The full-connection layer is used for playing a role of a classifier in the whole neural network and outputting a prediction result of the model;
Further, training and optimizing the constructed neural network model to obtain the bearing fault signal classification model with the optimal weight. Calculating an error value by using a cross entropy loss function in the process of obtaining an optimal weight classification model, and adjusting network parameters in a network model; the cross entropy loss function calculation formula is shown in the foregoing formula 6.
Further, in the step of inputting the tested bearing fault signal into the bearing fault signal classification model with the optimal weight to obtain the fault recognition result, inputting the tested bearing fault signal into the model obtained by training before, and obtaining the prediction result through the SE attention mechanism neural network model integrating the time-frequency characteristic and the causal characteristic.
The invention provides a fault bearing diagnosis method based on a diffusion model and an attention mechanism, which comprises the steps of increasing data volume through the diffusion model, carrying out wavelet packet decomposition on data generated by the diffusion model to calculate energy sum of each frequency band, comparing the energy sum of each frequency band with the energy sum of each frequency band calculated by wavelet packet decomposition of an original signal, discarding 30% of generated signals with the largest error, reserving 70% of the generated signals, mixing with the original signals, and grouping to obtain training bearing fault signals and test bearing fault signals of different groups; based on the time-frequency characteristics and the causal characteristics of the bearing fault signals, determining an SE attention mechanism neural network model integrating the time-frequency characteristics and the causal characteristics; training and optimizing the neural network model based on the training bearing fault signals of different groups to obtain an optimal weight classification model; and inputting the test bearing fault signals of different groups into the trained neural network model to obtain the fault type of the test bearing fault signals.
Embodiments of the present invention also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for diagnosing a bearing failure based on a diffusion model and an attention mechanism, comprising:
Acquiring initial bearing fault information, wherein the initial bearing fault information at least comprises initial bearing signals and signal characteristics, and the signal characteristics at least comprise signal time-frequency characteristics and signal causal characteristics;
Performing signal generation processing on the basis of the initial bearing signal by a preset diffusion model to obtain a training signal and a test signal;
determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics;
Training and optimizing the attention mechanism model through the training signals to obtain a bearing fault signal target classification model;
And carrying out fault identification processing on the bearing fault signal target classification model through the test signal so as to obtain a fault identification result.
2. The method of claim 1, wherein the performing signal generation processing by the preset diffusion model based on the initial bearing signal to obtain a training signal and a test signal includes:
Performing noise inversion denoising processing on a first bearing signal through the preset diffusion model to obtain a first signal, wherein the first bearing signal is obtained by grouping processing on the initial bearing fault information;
Performing energy sum value calculation on the first signals in the same group, and performing signal filtering processing according to the energy sum value calculation result to obtain a second signal;
And carrying out mixed division processing on the second signal and the first bearing signal to obtain the training signal and the test signal.
3. The method of claim 1, wherein prior to said determining a target attention mechanism model based on said signal time-frequency characteristics and said signal causal characteristics, said method further comprises:
carrying out global average pooling treatment on the initial attention mechanism model based on preset characteristic tensor parameters;
Based on a global average pooling processing result, connecting model channels of the initial attention mechanism model through a preset full-connection layer and a preset first function, and determining channel weights of the model channels through a preset second function;
And weighting the model channel based on the channel weight to obtain a target channel, wherein the target channel is used for carrying out characteristic recalibration on the initial bearing fault information.
4. The method of claim 1, wherein said training the attention mechanism model by the training signal to obtain a bearing fault signal target classification model comprises:
calculating an error value of the attention mechanism model through a preset third function;
And carrying out parameter adjustment processing on network parameters in the attention mechanism model according to the error value calculation result so as to obtain the bearing fault signal target classification model.
5. The method of claim 1, wherein the target attention mechanism model comprises:
The input layer is used for acquiring the training signal and converting the training signal to obtain a characteristic tensor parameter;
the time-frequency and causal feature extraction layer is used for extracting the time-frequency features of the signals and the causal features of the signals;
The feature fusion layer is used for splicing bearing fault signals after the time-frequency extraction operation and the causal feature extraction operation are completed;
And the full connection layer is used for outputting the fault identification result.
6. A bearing failure diagnosis apparatus based on a diffusion model and an attention mechanism, comprising:
The information acquisition module is used for acquiring initial bearing fault information, wherein the initial bearing fault information at least comprises initial bearing signals and signal characteristics, and the signal characteristics at least comprise signal time-frequency characteristics and signal causal characteristics;
The signal generation module is used for enabling a preset diffusion model to perform signal generation processing based on the initial bearing signal so as to obtain a training signal and a test signal;
the model determining module is used for determining a target attention mechanism model based on the signal time-frequency characteristics and the signal causal characteristics;
The training optimization module is used for carrying out training optimization processing on the attention mechanism model through the training signal so as to obtain a bearing fault signal target classification model;
And the fault identification module is used for carrying out fault identification processing on the bearing fault signal target classification model through the test signal so as to obtain a fault identification result.
7. The apparatus of claim 6, wherein the signal generation module comprises:
the denoising unit is used for carrying out noise inversion denoising processing on the first bearing signal through the preset diffusion model to obtain a first signal, wherein the first bearing signal is obtained by carrying out grouping processing on the initial bearing fault information;
The filtering unit is used for carrying out energy sum value calculation on the first signals in the same group and carrying out signal filtering processing according to the energy sum value calculation result so as to obtain a second signal;
And the signal dividing unit is used for carrying out mixed dividing processing on the second signal and the first bearing signal so as to obtain the training signal and the test signal.
8. The apparatus of claim 6, wherein the apparatus further comprises:
the average pooling module is used for carrying out global average pooling processing on the initial attention mechanism model based on a preset characteristic tensor parameter before the target attention mechanism model is determined based on the signal time-frequency characteristics and the signal causal characteristics;
the channel processing module is used for connecting model channels of the initial attention mechanism model through a preset full-connection layer and a preset first function based on a global average pooling processing result, and determining channel weights of the model channels through a preset second function;
And the weighting processing module is used for carrying out weighting processing on the model channel based on the channel weight so as to obtain a target channel, and the target channel is used for carrying out characteristic recalibration processing on the initial bearing fault information.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program, wherein the computer program is arranged to execute the method of any of the claims 1 to 5 when run.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 5.
CN202410523128.XA 2024-04-28 2024-04-28 Bearing fault diagnosis method and device based on diffusion model and attention mechanism Active CN118094368B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410523128.XA CN118094368B (en) 2024-04-28 2024-04-28 Bearing fault diagnosis method and device based on diffusion model and attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410523128.XA CN118094368B (en) 2024-04-28 2024-04-28 Bearing fault diagnosis method and device based on diffusion model and attention mechanism

Publications (2)

Publication Number Publication Date
CN118094368A true CN118094368A (en) 2024-05-28
CN118094368B CN118094368B (en) 2024-07-02

Family

ID=91146253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410523128.XA Active CN118094368B (en) 2024-04-28 2024-04-28 Bearing fault diagnosis method and device based on diffusion model and attention mechanism

Country Status (1)

Country Link
CN (1) CN118094368B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210286995A1 (en) * 2018-10-15 2021-09-16 ZhuZhou CRRC Times Electric Co., Ltd. Motor bearing failure diagnosis device
WO2022228049A1 (en) * 2021-04-27 2022-11-03 浙大城市学院 Method for diagnosing malfunction in aero-engine on basis of 5g edge computing and deep learning
CN115409733A (en) * 2022-09-02 2022-11-29 山东财经大学 Low-dose CT image noise reduction method based on image enhancement and diffusion model
WO2023137807A1 (en) * 2022-01-21 2023-07-27 苏州大学 Rolling bearing class imbalance fault diagnosis method and system
CN117390371A (en) * 2023-10-18 2024-01-12 武汉大学 Bearing fault diagnosis method, device and equipment based on convolutional neural network
CN117556317A (en) * 2023-11-09 2024-02-13 安徽工业大学 Rotary bearing fault diagnosis method based on time-frequency image
CN117606798A (en) * 2023-12-27 2024-02-27 广西中烟工业有限责任公司 Tobacco machinery bearing fault diagnosis method and diagnosis system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210286995A1 (en) * 2018-10-15 2021-09-16 ZhuZhou CRRC Times Electric Co., Ltd. Motor bearing failure diagnosis device
WO2022228049A1 (en) * 2021-04-27 2022-11-03 浙大城市学院 Method for diagnosing malfunction in aero-engine on basis of 5g edge computing and deep learning
WO2023137807A1 (en) * 2022-01-21 2023-07-27 苏州大学 Rolling bearing class imbalance fault diagnosis method and system
CN115409733A (en) * 2022-09-02 2022-11-29 山东财经大学 Low-dose CT image noise reduction method based on image enhancement and diffusion model
CN117390371A (en) * 2023-10-18 2024-01-12 武汉大学 Bearing fault diagnosis method, device and equipment based on convolutional neural network
CN117556317A (en) * 2023-11-09 2024-02-13 安徽工业大学 Rotary bearing fault diagnosis method based on time-frequency image
CN117606798A (en) * 2023-12-27 2024-02-27 广西中烟工业有限责任公司 Tobacco machinery bearing fault diagnosis method and diagnosis system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI, LINGLING AND LI, WEICONG AND DING, QIYUAN AND TANG, CHENGPEI AND WANG, KEZE: "Gesture Generation Via Diffusion Model with Attention Mechanism", ICASSP 2024 - 2024 IEEE INTERNATIONAL CONFERENCE ON ACOUSTICS, SPEECH AND SIGNAL PROCESSING (ICASSP), 18 March 2024 (2024-03-18), pages 8316 - 8320 *

Also Published As

Publication number Publication date
CN118094368B (en) 2024-07-02

Similar Documents

Publication Publication Date Title
CN110427846B (en) Face recognition method for small unbalanced samples by using convolutional neural network
CN111458142A (en) Sliding bearing fault diagnosis method based on generation of countermeasure network and convolutional neural network
CN111091278B (en) Edge detection model construction method and device for mechanical equipment anomaly detection
CN105426356A (en) Target information identification method and apparatus
CN108416032A (en) A kind of file classification method, device and storage medium
CN112131907A (en) Method and device for training classification model
CN106897945A (en) The clustering method and equipment of wind power generating set
CN117034123B (en) Fault monitoring system and method for fitness equipment
US11568167B2 (en) Systems and methods for detecting drift between data used to train a machine learning model and data used to execute the machine learning model
CN114638633A (en) Abnormal flow detection method and device, electronic equipment and storage medium
CN117150359A (en) Small sample fault diagnosis method, system, device and medium based on model independent element learning
CN114048787B (en) Method and system for intelligently diagnosing bearing fault in real time based on Attention CNN model
Sadoughi et al. A deep learning approach for failure prognostics of rolling element bearings
CN115114965A (en) Wind turbine generator gearbox fault diagnosis model, method, equipment and storage medium
Mobtahej et al. An LSTM‐Autoencoder Architecture for Anomaly Detection Applied on Compressors Audio Data
CN111080168A (en) Power communication network equipment reliability evaluation method based on capsule network
CN118094368B (en) Bearing fault diagnosis method and device based on diffusion model and attention mechanism
CN111612021B (en) Error sample identification method, device and terminal
Hudaib et al. Software Reusability classification and predication using self-organizing map (SOM)
CN115791174A (en) Rolling bearing abnormity diagnosis method and system, electronic equipment and storage medium
CN115209441A (en) Method, device, equipment and storage medium for predicting base station out-of-service alarm
CN115116594B (en) Method and device for detecting effectiveness of medical device
CN115146596B (en) Recall text generation method and device, electronic equipment and storage medium
WO2024124658A1 (en) Diagnostic algorithm quantitative recommendation method based on case learning and diagnosability analysis
CN116756484A (en) Multi-signal fusion fault detection method, device and medium for cigarette equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant