A mechanical fault diagnosis method and system based on spiking neural networks
By improving the gated attention coding module and the pulse residual network embedded in the time step shrinkage layer, the problem of low mechanical fault diagnosis efficiency caused by the fixed one-dimensional signal and time step is solved in the prior art, and high-precision and efficient fault diagnosis are achieved.
Patent Information
- Application Number
- CN202510041342.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-01-10
AI Technical Summary
The existing gated attention encoding module is not suitable for one-dimensional signals. The time step is set to a fixed value and the serial transmission method of pulsed neurons is inefficient, resulting in poor mechanical fault diagnosis accuracy.
The gating attention coding module is improved by replacing the one-dimensional sparse convolution layer with one-dimensional batch normalization layer. The time step shrinkage layer is embedded in the pulse residual network. The leakage integral ignition neuron is used to replace the leakage integral ignition neurons, and the time step shrinkage layer is embedded between the levels of the number of convolution channels changes.
It improves the accuracy and efficiency of mechanical fault diagnosis, improves the computing efficiency through sparseness and parallel processing, adapts to the dynamic changes of different input data, reduces redundant calculations, and improves the accuracy and speed of fault diagnosis.
Smart Images

Figure CN119443153B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mechanical fault diagnosis, and particularly to a mechanical fault diagnosis method and system based on a pulsed neural network. Background Technique
[0002] As an important part of industrial automation, once a mechanical system fails, it will affect the economic benefits of enterprise production and pose potential safety hazards. Therefore, the fault diagnosis of mechanical systems is of great significance. Existing fault diagnosis methods are generally divided into methods based on mathematical modeling and methods based on data-driven. The methods based on mathematical modeling have many limitations, such as the need for a large amount of prior knowledge, difficulty in modeling complex systems, and relatively high resource consumption in the maintenance process. With the development of artificial intelligence and big data technologies, data-driven methods have received extensive attention in recent years, which mainly include signal processing methods and machine learning methods. Among them, signal processing and traditional machine learning methods usually require certain prior knowledge and theoretical knowledge of statistical learning. Correspondingly, deep learning in machine learning can learn autonomously and provides a powerful support tool for analyzing large-capacity data for fault diagnosis. With the efforts of researchers, many deep learning network models have emerged in recent years, such as convolutional neural networks, long short-term memory networks, generative adversarial networks, graph neural networks, and Transformers. The above several network models have been widely applied in fields such as image recognition and intelligent fault diagnosis and have achieved excellent results. However, as a black-box model, although deep learning has excellent performance, it lacks a certain degree of interpretability.
[0003] Based on the appeal for interpretability, the spiking neural network (SNN), known as the "third-generation neural network", has been proposed to mimic the information transmission mode of biological neurons. The spiking neural network not only has strong biological interpretability, but its discrete binary characteristics also enable it to save certain energy consumption when deployed on hardware. Therefore, the spiking neural network (SNN) has quickly become a research hotspot in the field of deep learning. When the spiking neural network (SNN) initially entered the field of fault diagnosis, researchers first built a simple-structured single-layer spiking neural network (SNN) to diagnose the faults of rolling bearings. The experimental results confirmed the feasibility of using the spiking neural network (SNN) for mechanical equipment fault diagnosis and its unique advantages in interpretability. The current research on the spiking neural network (SNN) covers multiple aspects, including coding methods, training algorithms, neuron models, and network architectures, etc. The currently commonly used spiking neural network (SNN) pulse coding method is gated attention coding, which is used for two-dimensional image processing. It uses ordinary two-dimensional convolutional layers to extract input features, and after passing through the batch normalization processing layer and spiking neurons, it performs element-wise multiplication with the output of the gated attention unit. The pulse coding result of gated attention coding is obtained in the above way. The gated attention unit completes the fusion of temporal attention and spatial attention. The addition of the attention mechanism can better guide the pulse coding process. Therefore, the existing gated attention coding method can perform pulse coding well. Different from traditional artificial neural networks, the spiking neural network (SNN) has a concept of time and incorporates the time step parameter. Researchers have found that the setting of the time step greatly affects the training effect of the spiking neural network (SNN). Specifically, too large a time step will lead to insufficient memory and too slow training speed, while too small a time step will result in the loss of the time characteristics of the spiking neural network (SNN) and poor training effect. The existing spiking neural networks (SNNs) usually choose a fixed moderate value, such as 4 or 8, to avoid the above problems. For spiking neurons, the most commonly used one currently is the leaky integrate-and-fire (LIF) neuron because this neuron model better balances biological characteristics and computational complexity. The leaky integrate-and-fire (LIF) neuron completes the serial iterative process through its dynamic charging and discharging and triggering reset operations to transmit the information of the spiking neural network (SNN), achieving a good training effect.
[0004] However, the existing gated attention encoding module is used to process the two-dimensional structure and spatial correlation of images, and is only applicable to two-dimensional images, but not suitable for processing one-dimensional time series signals. Therefore, it cannot be directly used for the pulse coding of mechanical vibration signals. At the same time, the gated attention encoding module uses ordinary convolution, which involves all input features or pixels in each convolution operation, without fully considering which regions are more important for feature extraction, resulting in a reduction in the accuracy and efficiency of the model. In addition, the existing spiking neural network sets the time step to a fixed moderate value. Although it can alleviate the adverse effects of the time step on network training to a certain extent, it cannot adapt to the dynamic changes of different input data, and may cause unnecessary calculations. Especially when the input information is simple or redundant, a too long time step will waste computing resources, and a too short time step may lead to information loss, thus affecting the learning rate and convergence effect of the model. Moreover, the fault diagnosis of mechanical equipment usually requires real-time processing of a large amount of data to achieve rapid assessment and prediction of the health status of the equipment. The leaky integrate-and-fire (LIF) neuron model is a serial transport mode, and the state update of each neuron usually depends on the state of the previous time step. This gradually updated characteristic limits the efficiency of parallel computing, and may lead to a high time cost especially in the application of large-scale neural networks. Summary of the Invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the defects that the existing gated attention encoding module is not applicable to one-dimensional signals and has low sparsity, the time step set to a fixed value has limitations, the serial transmission mode of spiking neurons is inefficient, resulting in poor accuracy of mechanical fault diagnosis.
[0006] To solve the above technical problems, the present invention provides a mechanical fault diagnosis method based on a spiking neural network, including the following steps:
[0007] Construct a fault diagnosis network, the fault diagnosis network includes: an improved gated attention encoding module and a spiking residual network; wherein, by replacing the ordinary convolutional layer of the gated attention encoding module with a one-dimensional sparse convolutional layer and replacing the two-dimensional batch normalization layer with a one-dimensional batch normalization layer, an improved gated attention encoding module is obtained; the spiking neurons in the fault diagnosis network are set as PSN neurons, and a time step contraction layer is embedded in the spiking residual network;
[0008] Input the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for pulse coding to obtain the pulse sequence of the current sampling period;
[0009] Input the pulse sequence of the current sampling period into the spiking residual network to output the predicted fault category label of the current sampling period.
[0010] Preferably, inputting the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for pulse encoding to obtain the pulse sequence of the current sampling period includes:
[0011] Passing the mechanical vibration signal of the current sampling period through a one-dimensional sparse convolutional layer, a one-dimensional batch normalization layer, and a PSN neuron in sequence to generate the pulse output of the current sampling period;
[0012] Inputting the mechanical vibration signal of the current sampling period into the gated attention unit to generate the attention weight map of the current sampling period;
[0013] Performing Hadamard product on the pulse output of the current sampling period and the attention weight map to obtain the pulse sequence of the current sampling period.
[0014] Preferably, the gated attention unit includes: a parallel time attention channel and a spatial attention channel; the time attention channel includes: a max pooling layer, an average pooling layer, and a shared multi-layer perceptron; the spatial attention channel includes: a sequence transformation function.
[0015] Preferably, inputting the mechanical vibration signal of the current sampling period into the gated attention unit to generate the attention weight map of the current sampling period includes:
[0016] Inputting the mechanical vibration signal of the current sampling period into the time attention channel to output the time attention feature of the current sampling period, including:
[0017] Passing the mechanical vibration signal of the current sampling period through a max pooling layer and a shared multi-layer perceptron in sequence to obtain the first mechanical vibration feature of the current sampling period;
[0018] Passing the mechanical vibration signal of the current sampling historical period through an average pooling layer and a shared multi-layer perceptron in sequence to obtain the second mechanical vibration feature of the current sampling period;
[0019] Adding the first mechanical vibration feature and the second mechanical vibration feature of the current sampling period to obtain the time attention feature of the current sampling period;
[0020] Inputting the mechanical vibration signal of the current sampling period into the spatial attention channel to output the spatial attention map of the current sampling period;
[0021] Multiplying the time attention feature and the spatial attention map of the current sampling period element-wise and then processing through the Sigmoid function to obtain the attention weight map of the current sampling period.
[0022] Preferably, the time step contraction layer includes: a fully connected layer, a max pooling layer, and a Softmax classifier connected in sequence.
[0023] Preferably, a time step contraction layer is embedded between two convolutional layers with different numbers of channels in the pulse residual network.
[0024] Preferably, any one of SEW-ResNet18, MS-ResNet18, and SEW-ResNet50 is used as the basic network. A time step contraction layer is embedded between two basic layers with different numbers of convolutional channels in the basic network, and the pulse neurons in the basic network are set as PSN neurons to construct a pulse residual network.
[0025] Preferably, a pulse residual network is constructed based on SEW-ResNet18. The pulse residual network includes: a downsampling layer, a first basic layer, a time step contraction layer, a second basic layer, a time step contraction layer, a third basic layer, a time step contraction layer, a fourth basic layer, and a fully connected layer, which are connected in sequence; the numbers of channels of the four basic layers are all different;
[0026] Among them, the downsampling layer includes: a convolutional layer, a batch normalization layer, a PSN neuron, and a max pooling layer, which are connected in sequence. Each basic layer is composed of two basic blocks with the same number of channels. Each basic block includes: a 3×3 convolution, a batch normalization layer, a PSN neuron, a 3×3 convolution, a batch normalization layer, and a PSN neuron, which are connected in sequence.
[0027] Preferably, the dynamics formula of the PSN neuron is:
[0028] ,
[0029] Among them, is the input sequence of the PSN neuron, is the learnable weight matrix, is the hidden state sequence, B is the learnable threshold, is the unit step function, is the binary output pulse sequence of the PSN neuron.
[0030] The present invention also provides a mechanical fault diagnosis system based on a spiking neural network, including:
[0031] A model construction module for constructing a fault diagnosis network. The fault diagnosis network includes: an improved gated attention encoding module and a pulse residual network; among them, the ordinary convolutional layer of the gated attention encoding module is replaced by a one-dimensional sparse convolutional layer, and the two-dimensional batch normalization layer is replaced by a one-dimensional batch normalization layer to obtain the improved gated attention encoding module; the pulse neurons in the fault diagnosis network are set as PSN neurons, and a time step contraction layer is embedded in the pulse residual network;
[0032] A pulse sequence acquisition module, which is used to input the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for pulse encoding to obtain the pulse sequence of the current sampling period;
[0033] A prediction module, which is used to input the pulse sequence of the current sampling period into the pulse residual network and output the predicted fault category label of the current sampling period.
[0034] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0035] For a mechanical fault diagnosis method and system based on a pulse neural network according to the present invention, the ordinary convolutional layer of the gated attention encoding module is replaced with a one-dimensional sparse convolutional layer, and the two-dimensional batch normalization layer is replaced with a one-dimensional batch normalization layer; since the mechanical vibration signal is usually a one-dimensional time series, the timing characteristics of its signal are very important. The one-dimensional sparse convolutional layer can better standardize the time series data and only focus on the important parts of the mechanical vibration signal, thereby improving the sparsity and computational efficiency of the network, avoiding the limitations of the traditional image processing network structure when processing mechanical vibration signals, and being able to better decode and process the timing characteristics of these pulse signals, thus improving the diagnosis accuracy of mechanical faults.
[0036] A time step shrinkage layer is embedded in the pulse residual network; the time step shrinkage layer includes a fully connected layer, a max pooling layer, and a Softmax classifier connected in sequence. The time step shrinkage layer will receive the time step of the previous layer and the size of the time step to be converted. It smoothly completes the conversion of the time step through two channels without losing information in other dimensions, can effectively extract features related to the time step, and can also perform feature aggregation and classification. The max pooling layer helps to extract important spatio-temporal features, while the Softmax classifier can achieve efficient classification output. The time step shrinkage layer dynamically adjusts the time step, enabling the network to automatically adjust the calculation time scale according to the characteristics of the input data, being able to more accurately capture the important features in the signal, avoiding redundant calculations, and improving the accuracy and efficiency of mechanical fault diagnosis.
[0037] In addition, traditional neuron models usually rely on iterative summation, which leads to a complex calculation process and a large time overhead. In the present invention, the pulse neuron is set as a PSN neuron. The PSN neuron can make full use of the parallelism of matrix operations, can process data of multiple time steps simultaneously, and does not need to rely on the order of the time series to be updated step by step, significantly improving the processing speed of the fault diagnosis network. Description of the Drawings
[0038] In order to make the content of the present invention easier to be clearly understood, the following further details the present invention according to the specific embodiments of the present invention in combination with the drawings, where:
[0039] Figure 1 It is a schematic diagram for the training of the fault diagnosis network.
[0040] Figure 2 It is a schematic diagram for the testing of the fault diagnosis network.
[0041] Figure 3 It is a t-SNE dimensionality reduction visualization graph of the classification results of the test data samples of the small bearings of the gearbox.
[0042] Figure 4 It is a confusion matrix graph of the classification results of the test data samples of the small bearings of the gearbox. Specific implementation manners
[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments cited are not intended to limit the present invention.
[0044] Embodiment 1 of the present invention provides a mechanical fault diagnosis method based on a spiking neural network, including the following steps:
[0045] Step S1: Construct a fault diagnosis network, where the fault diagnosis network includes: an improved gated attention encoding module and a spiking residual network; among them, by replacing the ordinary convolutional layer of the gated attention encoding module with a one-dimensional sparse convolutional layer and replacing the two-dimensional batch normalization layer with a one-dimensional batch normalization layer, an improved gated attention encoding module is obtained; setting the spiking neurons in the fault diagnosis network as PSN neurons and embedding a time step contraction layer in the spiking residual network;
[0046] In this embodiment, preferably, the time step contraction layer includes: a fully connected layer, a max pooling layer, and a Softmax classifier connected in sequence.
[0047] Embedding a time step contraction layer in the spiking residual network can not only effectively extract time step-related features but also perform feature aggregation and classification. The max pooling layer helps to extract important spatio-temporal features, while the Softmax classifier can achieve efficient classification output. The time step contraction layer dynamically adjusts the time step, enabling the network to automatically adjust the calculation time scale according to the characteristics of the input data, being able to more accurately capture the important features in the signal, avoiding redundant calculations, and improving the accuracy and efficiency of mechanical fault diagnosis.
[0048] The time step contraction layer has the characteristics of being plug-and-play and can be freely embedded between the levels of the spiking residual network.
[0049] In this embodiment, preferably, a time step contraction layer is embedded between two layers where the number of convolutional channels changes in the pulse residual network, so as to gradually contract the value of the time step during the training process. The time step contraction layer realizes the compression and refinement of information between two layers where the number of convolutional channels changes by introducing a max pooling layer and a fully connected layer. This structure helps reduce the computational amount of subsequent layers because the pooling layer can reduce the size of the feature map, while the fully connected layer reduces the number of weights to be trained through parameter sharing. By adding this layer at the position where the number of convolutional channels changes, the computational amount and storage requirements of each convolution operation can be effectively reduced. Especially when the number of convolutional channels increases, the computational cost may increase sharply. At the end of the time step contraction layer, the introduction of the Softmax classifier helps to perform the final classification processing on the extracted features. By embedding the Softmax classifier between two layers where the number of convolutional channels changes, it can be ensured that the network can make corresponding decisions at each time step after feature transformation. This not only helps the end-to-end optimization of the model but also further improves the classification accuracy of the network in time series tasks.
[0050] In this embodiment, specifically, the dynamics formula of the PSN neuron is:
[0051] ,
[0052] where is the input sequence of the PSN neuron, is the learnable weight matrix, is the hidden state sequence, B is the learnable threshold, is the unit step function, is the binary output pulse sequence of the PSN neuron.
[0053] The present invention sets the pulse neuron as a PSN neuron. The PSN neuron can make full use of the parallelism of matrix operations, can process data of multiple time steps simultaneously, and does not need to rely on the order of the time series to be updated step by step, significantly improving the processing speed of the fault diagnosis network.
[0054] Step S2: Input the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for pulse encoding to obtain the pulse sequence of the current sampling period;
[0055] Specifically, the step of inputting the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for pulse encoding to obtain the pulse sequence of the current sampling period includes:
[0056] Step S21: Pass the mechanical vibration signal of the current sampling period through a one-dimensional sparse convolutional layer, a one-dimensional batch normalization layer, and a PSN neuron in sequence to generate the pulse output of the current sampling period;
[0057] Step S22: Input the mechanical vibration signal of the current sampling period into the gated attention unit to generate the attention weight map of the current sampling period;
[0058] In this embodiment, specifically, the gated attention unit includes: a parallel temporal attention channel and a spatial attention channel; the temporal attention channel includes: a max pooling layer, an average pooling layer, and a shared multi-layer perceptron; the spatial attention channel includes: a sequence transformation function.
[0059] The step of inputting the mechanical vibration signal of the current sampling period into the gated attention unit to generate the attention weight map of the current sampling period includes:
[0060] Step S221: Input the mechanical vibration signal of the current sampling period into the temporal attention channel to output the temporal attention feature of the current sampling period, including:
[0061] Step S222: Pass the mechanical vibration signal of the current sampling period through the max pooling layer and the shared multi-layer perceptron in sequence to obtain the first mechanical vibration feature of the current sampling period;
[0062] Step S223: Pass the mechanical vibration signal of the current sampling historical period through the average pooling layer and the shared multi-layer perceptron in sequence to obtain the second mechanical vibration feature of the current sampling period;
[0063] Step S224: Add the first mechanical vibration feature and the second mechanical vibration feature of the current sampling period to obtain the temporal attention feature of the current sampling period;
[0064] Step S225: Input the mechanical vibration signal of the current sampling period into the spatial attention channel to output the spatial attention map of the current sampling period;
[0065] Step S226: Multiply the temporal attention feature and the spatial attention map of the current sampling period element by element, and then process it through the Sigmoid function to obtain the attention weight map of the current sampling period.
[0066] Step S23: Perform a Hadamard product on the pulse output of the current sampling period and the attention weight map to obtain the pulse sequence of the current sampling period.
[0067] Step S3: Input the pulse sequence of the current sampling period into the pulse residual network to output the predicted fault class label of the current sampling period.
[0068] In this embodiment, specifically, any one of SEW-ResNet18, MS-ResNet18, and SEW-ResNet50 is used as the basic network. A time step contraction layer is embedded between two basic layers with different numbers of convolutional channels in the basic network, and the spiking neurons in the basic network are set as PSN neurons to construct a spiking residual network.
[0069] Preferably, a spiking residual network is constructed based on SEW-ResNet18. The spiking residual network includes: a downsampling layer, a first basic layer, a time step contraction layer, a second basic layer, a time step contraction layer, a third basic layer, a time step contraction layer, a fourth basic layer, and a fully connected layer connected in sequence. The numbers of channels of the four basic layers are all different.
[0070] Among them, the downsampling layer includes: a convolutional layer, a batch normalization layer, a PSN neuron, and a max pooling layer connected in sequence. Each basic layer is composed of two basic blocks with the same number of channels. Each basic block includes: a 3×3 convolution, a batch normalization layer, a PSN neuron, a 3×3 convolution, a batch normalization layer, and a PSN neuron connected in sequence.
[0071] Therefore, the number of channels changes between each basic layer. The time step contraction layer is embedded between two adjacent basic layers, and finally, classification is performed through the max pooling layer and the fully connected layer to form a network depth of 18 layers.
[0072] Specifically, the first time step contraction layer is embedded between the first basic layer and the second basic layer of the spiking residual network to change the initial time step from 32 to 16; the second time step contraction layer is embedded between the second basic layer and the third basic layer of the spiking residual network to change the time step from 16 to 8; the third time step contraction layer is embedded between the third basic layer and the fourth basic layer of the spiking residual network to change the time step from 8 to 4.
[0073] In this embodiment, preferably, the training process of the fault diagnosis network is as follows:
[0074] Obtain a mechanical fault data set and perform preprocessing, and divide the mechanical fault data set into a training set and a test set; among them, the mechanical fault data set includes mechanical vibration signals and their true labels in multiple historical sampling periods.
[0075] In this embodiment, specifically, the preprocessing of the mechanical fault data set includes: intercepting mechanical vibration signals in multiple sampling periods as data samples, and after unifying the sample lengths, normalizing the sample amplitudes to the range of [0, 1].
[0076] The training set is used for training the fault diagnosis network. The test data set does not participate in model training and is only used to test the accuracy of the model results. The mechanical working conditions and fault categories included in the training data set and the test data set are the same.
[0077] As Figure 1 shown, Figure 1 it is a schematic diagram of the training of the fault diagnosis network. The training set is input into the fault diagnosis network to obtain the predicted fault category labels for each historical sampling period. An optimization algorithm is used to train the fault diagnosis network to obtain a trained fault diagnosis network.
[0078] As Figure 2 shown, Figure 2 it is a schematic diagram of the test of the fault diagnosis network. The performance of the fault diagnosis network is evaluated through the test set to obtain the target fault diagnosis network.
[0079] Among them, the optimization algorithm is any one of the root mean square propagation algorithm, the stochastic gradient descent method, and the adaptive moment estimation algorithm.
[0080] In the first embodiment, by improving the existing coding method, the one-dimensional applicability of the gated attention coding module and the sparsity of the pulse coding process are improved; at the same time, a time step contraction layer for smoothing the time step conversion process is designed, so that the convergence speed of the model can be improved while retaining information; furthermore, the processing speed and efficiency of network transmission are improved by using parallel processing PSN pulse neurons. Finally, a fault diagnosis network capable of extracting deep features of mechanical vibration signals is formed. The fault diagnosis network proposed in the first embodiment has high sparsity in feature extraction, low energy consumption in hardware, high accuracy in mechanical fault intelligent diagnosis, and fast processing speed.
[0081] Based on the first embodiment, the second embodiment of the present invention takes the vibration data set of a small bearing fault in a high-speed rail gearbox as an example for fault intelligent diagnosis, including:
[0082] Taking the vibration data set of a small bearing fault in a high-speed rail gearbox as an example, this data set contains five kinds of health state data: normal state (N), rolling element crack fault (B), outer ring crack fault (O), outer ring corrosion fault (OC), and outer ring rolling element crack composite fault (OB). The fault category labels are represented by 0, 1, 2, 3, and 4 respectively. The data sampling frequency is 10.24 kHz. The data collected at two different rotational speeds, positive and negative, are included in the experiment. The description of the vibration data of the small bearing fault in the gearbox used in the second embodiment is shown in Table 1, and Table 1 is the description of the vibration data set of the small bearing fault in the gearbox.
[0083] Table 1
[0084]
[0085] To highlight the anti-interference ability of the fault diagnosis network proposed in the present invention and test whether the fault diagnosis network can correctly classify fault categories under different working conditions, in the second embodiment, data at two different rotational speeds, positive and negative, are packed proportionally into one category label. In the preprocessing, 1000 data points are taken as one sample, and the number of samples in each sub-state is 320. Therefore, the number of samples in each category label is 640. The training set and the test set are divided in a ratio of 4:1, that is, 512 samples in each category are used for training and 128 samples are used for testing.
[0086] The above gearbox vibration signals are intercepted into data samples with a length of 1000 points, and then the amplitudes of the samples are normalized, and the sample amplitudes are normalized to the range of [0, 1], and the data set is divided into a training data set and a test data set.
[0087] Taking the preprocessed time-domain signal data samples as the input of the fault diagnosis network, through the improved gated attention encoding module, pulse encoding is performed, and a pulse sequence with a length of 1000 is output; among them, the input channel number of the improved gated attention encoding module is 1, the output channel number is 3, the convolution kernel size is 3, and the time step is 32.
[0088] In the second embodiment, the time step value of the PSN neuron is set to 32, and a pulse residual network is constructed based on SEW-ResNet18.
[0089] In the second embodiment, the training set is used to train the fault diagnosis network, and the mean square error between the predicted fault category label output by the fault diagnosis network and its true label is minimized to optimize the training. The optimization algorithm uses the adaptive moment estimation algorithm (Adam), the learning rate is 0.001, the momentum is 0.9, and the loss function tends to balance after 16 iterations, and the training of the fault diagnosis network is completed. The test set is input into the trained fault diagnosis network for intelligent fault diagnosis, and the test accuracy result is calculated from the predicted fault category label and the true label obtained by inputting the test samples into the fault diagnosis network.
[0090] As Figure 3 shown, Figure 3 is the t-SNE dimensionality reduction visualization diagram of the classification results of the gearbox small bearing test data samples. As can be Figure 3 seen, a mechanical fault diagnosis method based on a pulse neural network proposed by the present invention can effectively aggregate samples of the same category, and there is a relatively obvious boundary between the features of different category samples, which proves that the present invention can learn the deep features in the gearbox small bearing data set and improve the intra-class aggregation and inter-class separability of fault categories.
[0091] As Figure 4 shown, Figure 4It is a confusion matrix diagram of the classification results of the test data samples of the small bearings of the gearbox. As can be seen from Figure 4 Figure 4 , the diagnostic accuracy rate of a mechanical fault diagnosis method based on a spiking neural network proposed by the present invention reaches 99.84%. Only one classification error occurred among 640 test samples in five health states, demonstrating the superior diagnostic performance and generalization ability of the method of the present invention.
[0092] In summary, the present invention establishes a fault diagnosis network. Through an improved gated attention encoding module for sparse spiking coding, and by embedding a time step contraction layer between the layers of the spiking residual network, replacing the commonly used serial LIF neurons with parallel PSN neurons, the model can efficiently extract the deep features of the small bearing fault data set of the gearbox, realizing high-precision, high-efficiency and anti-operating condition interference intelligent fault diagnosis.
[0093] Embodiment 3 of the present invention provides a mechanical fault diagnosis system based on a spiking neural network, including:
[0094] A model construction module for constructing a fault diagnosis network, where the fault diagnosis network includes: an improved gated attention encoding module and a spiking residual network; wherein, by replacing the ordinary convolutional layer of the gated attention encoding module with a one-dimensional sparse convolutional layer and replacing the two-dimensional batch normalization layer with a one-dimensional batch normalization layer, an improved gated attention encoding module is obtained; setting the spiking neurons in the fault diagnosis network as PSN neurons, and embedding a time step contraction layer in the spiking residual network;
[0095] A spiking sequence acquisition module for inputting the mechanical vibration signal of the current sampling period into the gated attention encoding module for spiking coding to obtain the spiking sequence of the current sampling period;
[0096] A prediction module for inputting the spiking sequence of the current sampling period into the spiking residual network and outputting the predicted fault category label of the current sampling period.
[0097] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more flows and / or one or more blocks in the flow. Figure 1 in one or more flows and / or one or more blocks Figure 1 of the means for implementing the functions specified in the block or blocks.
[0099] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one or more flows and / or one or more blocks Figure 1 in one or more flows and / or one or more blocks Figure 1 of the block or blocks.
[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows and / or one or more blocks Figure 1 in one or more flows and / or one or more blocks Figure 1 of the block or blocks.
[0101] Obviously, the above embodiments are merely examples for clear illustration and are not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation manners here. And the obvious changes or modifications derived therefrom are still within the protection scope of the present invention.
Claims
1. A mechanical fault diagnosis method based on a spiking neural network, characterized in that, It includes the following steps: Construct a fault diagnosis network, where the fault diagnosis network includes: an improved gated attention encoding module and a spiking residual network; among them, the ordinary convolutional layer of the gated attention encoding module is replaced by a one-dimensional sparse convolutional layer, and the two-dimensional batch normalization layer is replaced by a one-dimensional batch normalization layer to obtain the improved gated attention encoding module; the spiking neurons in the fault diagnosis network are set as PSN neurons, and a time step contraction layer is embedded between the two convolutional layers with changed number of channels in the spiking residual network. The time step contraction layer includes: a fully connected layer, a max pooling layer, and a Softmax classifier connected in sequence; a first time step contraction layer is embedded between the first basic layer and the second basic layer of the spiking residual network to change the initial time step from 32 to 16; a second time step contraction layer is embedded between the second basic layer and the third basic layer of the spiking residual network to change the time step from 16 to 8; a third time step contraction layer is embedded between the third basic layer and the fourth basic layer of the spiking residual network to change the time step from 8 to 4; Input the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for spiking encoding to obtain the spiking sequence of the current sampling period; Input the spiking sequence of the current sampling period into the spiking residual network to output the predicted fault class label of the current sampling period.
2. The mechanical fault diagnosis method based on a spiking neural network according to claim 1, wherein The step of inputting the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for spiking encoding to obtain the spiking sequence of the current sampling period includes: Pass the mechanical vibration signal of the current sampling period through a one-dimensional sparse convolutional layer, a one-dimensional batch normalization layer, and a PSN neuron in sequence to generate the spiking output of the current sampling period; Input the mechanical vibration signal of the current sampling period into the gated attention unit to generate the attention weight map of the current sampling period; Perform Hadamard product on the spiking output of the current sampling period and the attention weight map to obtain the spiking sequence of the current sampling period.
3. The mechanical fault diagnosis method based on a spiking neural network according to claim 2, characterized in that The gated attention unit includes: a parallel time attention channel and a spatial attention channel; the time attention channel includes: a max pooling layer, an average pooling layer, and a shared multi-layer perceptron; the spatial attention channel includes: a sequence transformation function.
4. A mechanical fault diagnosis method based on a spiking neural network according to claim 3, characterized in that The step of inputting the mechanical vibration signal of the current sampling period into the gated attention unit to generate the attention weight map of the current sampling period includes: Input the mechanical vibration signal of the current sampling period into the time attention channel to output the time attention feature of the current sampling period, including: Pass the mechanical vibration signal of the current sampling period through a max pooling layer and a shared multi-layer perceptron in sequence to obtain the first mechanical vibration feature of the current sampling period; Pass the mechanical vibration signal of the current sampling historical period through an average pooling layer and a shared multi-layer perceptron in sequence to obtain the second mechanical vibration feature of the current sampling period; Add the first mechanical vibration feature and the second mechanical vibration feature of the current sampling period to obtain the time attention feature of the current sampling period; Input the mechanical vibration signal of the current sampling period into the spatial attention channel to output the spatial attention map of the current sampling period; After multiplying the temporal attention feature of the current sampling period by the spatial attention map element-wise and processing it through the Sigmoid function, the attention weight map of the current sampling period is obtained.
5. A mechanical fault diagnosis method based on a spiking neural network according to claim 1, characterized in that, Taking any one of SEW-ResNet18, MS-ResNet18, and SEW-ResNet50 as the basic network, a temporal step contraction layer is embedded between two basic layers with changed convolutional channels in the basic network, and the spiking neurons in the basic network are set as PSN neurons to construct a spiking residual network.
6. A mechanical fault diagnosis method based on a spiking neural network according to claim 5, characterized in that, Based on SEW-ResNet18, a spiking residual network is constructed. The spiking residual network includes: a downsampling layer, a first basic layer, a temporal step contraction layer, a second basic layer, a temporal step contraction layer, a third basic layer, a temporal step contraction layer, a fourth basic layer, and a fully connected layer connected in sequence. The number of channels of the four basic layers is different. Among them, the downsampling layer includes: a convolutional layer, a batch normalization layer, a PSN neuron, and a max pooling layer connected in sequence. Each basic layer consists of two basic blocks with the same number of channels. Each basic block includes: a 3×3 convolution, a batch normalization layer, a PSN neuron, a 3×3 convolution, a batch normalization layer, and a PSN neuron connected in sequence.
7. A mechanical fault diagnosis method based on a spiking neural network according to claim 1, characterized in that The dynamics formula of the PSN neuron is: H = WX, S = Θ(H - B), where X is the input sequence of the PSN neuron, W is the learnable weight matrix, H is the hidden state sequence, B is the learnable threshold, Θ(.) is the unit step function, and S is the binary output spike sequence of the PSN neuron.
8. A mechanical fault diagnosis system based on a spiking neural network, characterized in that, Including: A model construction module for constructing a fault diagnosis network. The fault diagnosis network includes: an improved gated attention encoding module and a spiking residual network. Among them, the ordinary convolutional layer of the gated attention encoding module is replaced by a one-dimensional sparse convolutional layer, and the two-dimensional batch normalization layer is replaced by a one-dimensional batch normalization layer to obtain the improved gated attention encoding module. The spiking neurons in the fault diagnosis network are set as PSN neurons, and a temporal step contraction layer is embedded between two convolutional layers with changed channels in the spiking residual network. The temporal step contraction layer includes: a fully connected layer, a max pooling layer, and a Softmax classifier connected in sequence. A first temporal step contraction layer is embedded between the first basic layer and the second basic layer of the spiking residual network to change the initial temporal step from 32 to 16. A second temporal step contraction layer is embedded between the second basic layer and the third basic layer of the spiking residual network to change the temporal step from 16 to 8. A third temporal step contraction layer is embedded between the third basic layer and the fourth basic layer of the spiking residual network to change the temporal step from 8 to 4. A spike sequence acquisition module for inputting the mechanical vibration signal of the current sampling period into the improved gated attention encoding module for spike encoding to obtain the spike sequence of the current sampling period. A prediction module for inputting the spike sequence of the current sampling period into the spiking residual network and outputting the predicted fault class label of the current sampling period.