A fault diagnosis method and system based on a codec attention mechanism reinforced pulse neural network
By using an enhanced spiking neural network based on an encoding/decoding attention mechanism, time-series signals are converted into time-frequency images. Combined with spiking convolution and an efficient additive attention mechanism, a lightweight model is constructed, which solves the problem of high computational requirements of deep learning models and enables high-precision real-time online fault diagnosis of electromechanical equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI UNIV
- Filing Date
- 2025-12-08
- Publication Date
- 2026-04-21
AI Technical Summary
Existing deep learning models have high computational requirements, high hardware costs, and limited scalability in electromechanical equipment fault diagnosis. Traditional methods rely on expert knowledge and have difficulty in mining signal temporal dependencies, resulting in limited diagnostic accuracy.
We employ an enhanced spiking neural network based on an encoder-decoder attention mechanism to convert time-series signals into time-frequency images through S-transform. By combining a spiking convolutional encoder and an efficient additive attention encoder, we extract local spatial features and model global contextual dependencies, constructing a lightweight model that can be deployed on edge devices for real-time diagnostics.
It enables high-precision real-time online fault diagnosis on resource-constrained edge devices, reduces computing power consumption and parameter quantity, and improves fault feature capture capability and diagnostic efficiency.
Smart Images

Figure CN121527539B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine state prediction technology, specifically relating to a fault diagnosis method and system based on an encoding / decoding attention mechanism to enhance a spiking neural network. Background Technology
[0002] Electromechanical equipment, as the cornerstone of manufacturing, is a fundamental guarantee for the robust development of society and the economy. As an indispensable core component in modern industrial production, it plays a vital role in industrial sectors such as petrochemicals, power, and metallurgy, as well as civilian sectors like transportation, thanks to its high precision, long lifespan, and stability. Its operational status directly determines equipment stability and industrial production efficiency. Therefore, fault diagnosis of electromechanical equipment is crucial for stable production operation, ensuring product quality, improving manufacturing efficiency, extending equipment lifespan, reducing downtime risks, and ensuring workplace safety.
[0003] Traditional fault diagnosis methods rely on signal processing, using time-domain or frequency-domain features for training, which has yielded good results. However, extracting only time-domain or frequency-domain features depends on expert knowledge, requires manual extraction, and suffers from problems such as partial feature loss and difficulty in uncovering temporal dependencies in the signal, leading to decreased model performance and limited accuracy.
[0004] The rapid advancement of artificial intelligence technology has led to the expanding application of deep learning in fault diagnosis. Deep learning models not only possess powerful feature extraction capabilities but also offer advantages such as wide applicability, strong generalization ability, high potential performance, and ease of portability. Therefore, deep learning is now a key focus in feature extraction, fault mode recognition, and industrial deployment. However, existing deep learning models, especially those with encoder-decoder attention mechanisms, require a large number of parameters and rely on powerful computing capabilities, resulting in high hardware requirements and costs. With increasing energy consumption and computational demands, the scalability of these models becomes limited.
[0005] To address the aforementioned issues, a signal feature extraction method based on an encoding / decoding attention mechanism to enhance spiking neural networks is proposed. Summary of the Invention
[0006] The purpose of this invention is to provide a fault diagnosis method and system based on an encoding / decoding attention mechanism to enhance a spiking neural network, so as to solve the problems mentioned in the background art.
[0007] The present invention achieves the above objectives through the following technical solutions:
[0008] This invention proposes a fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network, the method comprising:
[0009] The original time-domain vibration signals of the target equipment under different fault and health states are acquired and processed to generate time segments of fixed length.
[0010] Based on the S-transform, time-frequency analysis is performed on the time series segments to transform each one-dimensional time series segment into a two-dimensional time-frequency image, forming a time-frequency image dataset containing all time-frequency images.
[0011] The preprocessed time-frequency graph dataset is input into a pre-built classification model, which outputs a deep feature representation that characterizes the fault category or health status of the target device.
[0012] The pre-built classification model includes alternating cascaded pulsed convolutional encoders and pulsed efficient additive attention mechanism encoders.
[0013] The pulse convolutional encoder combines spiking neurons with depthwise separable convolutions to pulse-encode time-frequency image data and extract local spatial features. The pulse efficient additive attention mechanism encoder uses an efficient additive attention mechanism with low linear complexity to model the global contextual dependencies of the local spatial features, and learns and aggregates the deep feature representation from the time-frequency image in stages.
[0014] Furthermore, the acquisition and processing of the raw time-domain vibration signals of the target device under different fault and health states to generate a fixed-length time segment includes:
[0015] The original time-domain vibration signal is segmented by setting the sliding window length Lg and the step size St to generate multiple time-series segments; wherein, the i-th time-series segment... It is generated by the following formula:
[0016] ;
[0017] Where N is the total number of samples extracted.
[0018] Furthermore, the time-frequency analysis processing of the time segment based on the S-transform includes:
[0019] For the time segment Treating the signal x(t) as a continuous time-series signal, the S-transform of the signal x(t) is performed based on the Gaussian window function, and its time-frequency transformation formula is as follows:
[0020] ;
[0021] in, For time shift parameters, For frequency; The Gaussian window function is expressed as follows:
[0022] ;
[0023] By introducing a frequency-dependent Gaussian window width This allows the window width to adapt to changes in frequency.
[0024] Let τ = mT and f = l / (LT), then discretize the continuous S-transform to obtain the discrete S-transform formula:
[0025] ;
[0026] ;
[0027] Where L is the number of sampling points, T is the sampling period, m is the sampling point number, and l is the index of the frequency domain sampling point; Let X(θ) be a frequency point with a value range of 0-(L-1), and let X(θ) be the discrete Fourier transform of the signal x(m).
[0028] Through the discrete S-transform process, each time segment is transformed into a two-dimensional time-frequency matrix D: , where the x-coordinate t m Representing time, the vertical axis f l Indicates frequency.
[0029] Furthermore, the structure of the pulse convolution encoder includes, in sequence:
[0030] The system consists of a first spiking neuron layer, a 1×1 pointwise convolutional layer for channel expansion, a second spiking neuron layer, a 3×3 depthwise separable convolutional layer for spatial feature extraction, and a 1×1 pointwise convolutional layer for channel recovery.
[0031] The output of the first spiking neuron layer is fused with the output of the 1×1 pointwise convolutional layer used for channel recovery via skip connections; the calculation process of the spiking convolution encoder is as follows:
[0032] ;
[0033] Z i This represents the input to the spiking convolutional encoder, where SNN stands for spiking neuron, and PWConv... BN The DWConv layer consists of 1×1 pointwise convolutional layers and batch normalization layers, while the DWConv layer consists of 3×3 depthwise separable convolutional layers. This is the output of the pulse convolution encoder.
[0034] Furthermore, the structure of the pulse-efficient additive attention mechanism encoder sequentially includes:
[0035] Pulse-separable convolutional layers, efficient additive attention modules, and pulse-channel convolutional blocks;
[0036] The pulse-separable convolutional layer is used to perform local pulse coding on the input features;
[0037] The efficient additive attention module is used to receive encoded features and model global context dependencies through an efficient additive attention mechanism with low linear complexity;
[0038] The pulsed channel convolutional block is used to nonlinearly enhance the output of the efficient additive attention module. The pulsed channel convolutional block includes two spiking neuron layers connected in series along the channel dimension, a one-dimensional convolutional layer, and a batch normalization layer. The computation process of the pulsed efficient additive attention mechanism encoder is as follows:
[0039] ;
[0040] ;
[0041] ;
[0042] in, This represents the input to the spiking efficient additive attention mechanism encoder, where SNN is a spiking neuron, and PWConv... BN DWConv consists of 1×1 pointwise convolutional layers and batch normalization layers, while QK represents an efficient additive attention mechanism. BN R consists of one-dimensional convolutional layers and batch normalization layers. i Output of a pulse-efficient additive attention mechanism encoder.
[0043] Furthermore, the spiking neurons used in the spiking convolutional encoder and the spiking efficient additive attention mechanism encoder are both Leaky Integrate-and-Fire spike neurons, and their dynamic model is described as follows:
[0044] ;
[0045] ;
[0046] ;
[0047] Where τ is the membrane time constant, and X[t] is the input current at time step t; when the membrane potential H[t] exceeds the discharge threshold V th At this time, the spiking neuron will trigger a pulse S[t]; Θ(v) is the Heaviside step function, which is 1 when v≥0, and 0 otherwise; V[t] represents the membrane potential after the triggering event, which is equal to H[t] if there is no triggering potential, and equal to the reset potential V otherwise. reset .
[0048] Furthermore, the efficient additive attention mechanism used in the pulse efficient additive attention mechanism encoder specifically includes the following calculation process:
[0049] Using the weight matrix W q and W k The input embedding matrix Y i These are transformed into a query matrix (Q) and a key matrix (K), respectively, where , , where n represents the length of the token and d is the embedding dimension;
[0050] Compare the query matrix Q with the trainable vectors Multiply the results and normalize them using the Softmax function to obtain the query attention weights. for: ;
[0051] Based on the attention weights The query matrix Q is weighted and pooled to obtain a single global query vector. , ;
[0052] global query vector AND key matrix The global context matrix is obtained by encoding the elements through element-wise multiplication. ;
[0053] Use a linear transformation layer on the global context matrix The transformation is performed to learn the hidden representation of the token, and the final output of the efficient additive attention mechanism is... for: ;in, Let T be the normalized query matrix, and let T represent the linear mapping layer.
[0054] Furthermore, the method also includes:
[0055] The trained classification model, which includes the pulse convolutional encoder and the pulse efficient additive attention mechanism encoder, is deployed to an edge computing device.
[0056] On the edge computing device, the vibration signal collected in real time from the target device is processed sequentially through the following steps: acquiring time-series segments, generating time-frequency images based on S-transform, inputting the time-frequency images into the classification model, and outputting deep feature representations.
[0057] Based on the deep feature representation of the output, the fault category or health status of the target device is determined, enabling real-time online fault diagnosis.
[0058] This invention also proposes a fault diagnosis system based on an encoding / decoding attention mechanism to enhance a spiking neural network. The system implements the fault diagnosis steps described above and includes:
[0059] The signal acquisition and preprocessing module is used to acquire the raw time-domain vibration signals of the target equipment under different fault and health conditions, and generate fixed-length time segments through sliding window segmentation.
[0060] The time-frequency analysis module is used to perform time-frequency analysis processing on the time series segments based on the S-transform, transforming each one-dimensional time series segment into a two-dimensional time-frequency image to form a time-frequency image dataset;
[0061] A lightweight hybrid network model module is used to receive and process the time-frequency images to extract and output deep feature representations for fault classification;
[0062] The lightweight hybrid network model module incorporates an alternating cascaded pulse convolutional encoder and a pulsed efficient additive attention mechanism encoder.
[0063] The pulse convolutional encoder combines pulse neurons with depthwise separable convolution to pulse-encode time-frequency map data and extract local spatial features.
[0064] The pulse-efficient additive attention mechanism encoder employs a low-linear-complexity, efficient additive attention mechanism to model the global contextual dependencies of the local spatial features, thereby learning and aggregating the deep feature representation from the time-frequency image in stages.
[0065] The classification and output module is used to output the diagnostic results of the fault category or health status of the target device based on the deep feature representation.
[0066] The beneficial effects of this invention are as follows:
[0067] This invention constructs a lightweight hybrid diagnostic model by combining spiking neural networks with an efficient additive attention mechanism. The method utilizes the S-transform to convert vibration signals into time-frequency images, effectively fusing the time-frequency domain information of the signal and enhancing the ability to capture fault features. In model design, an efficient additive attention mechanism based on spiking neurons is introduced to model global context dependencies with linear computational complexity. Simultaneously, depthwise separable convolution technology is combined to reduce the number of model parameters and computational energy consumption. Ultimately, this lightweight model can be deployed on resource-constrained edge devices, achieving real-time online monitoring and rapid diagnosis of electromechanical equipment faults while ensuring high diagnostic accuracy. Attached Figure Description
[0068] Figure 1This is a flowchart of a fault diagnosis method based on the encoding / decoding attention mechanism to enhance the spiking neural network in this invention;
[0069] Figure 2 This is a flowchart of a fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network in this invention.
[0070] Figure 3 This is a diagram of the pulse convolution encoder used in this invention;
[0071] Figure 4 This is a schematic diagram of the spiking neural network structure used in this invention;
[0072] Figure 5 This is a diagram of the pulse-efficient additive attention mechanism encoder used in this invention;
[0073] Figure 6 This is a diagram of the efficient additive attention mechanism used in this invention;
[0074] Figure 7 This is a diagram showing the confusion matrix results in this invention. Detailed Implementation
[0075] The following description provides specific application scenarios and requirements for this specification, intended to enable those skilled in the art to make and use the contents of this specification. Various partial modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but rather to the widest scope consistent with the claims.
[0076] The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not restrictive. For example, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. When used in this specification, the terms “comprising,” “including,” and / or “containing” mean that the associated integers, steps, operations, elements, and / or components are present, but do not exclude the presence of one or more other features, integers, steps, operations, elements, components, and / or groups, or that other features, integers, steps, operations, elements, components, and / or groups may be added to the system / method.
[0077] Considering the following description, these and other features of this specification, as well as the operation and function of the related components of the structure, and the economy of assembly and manufacture of the parts, can be significantly improved. All of these form part of this specification with reference to the accompanying drawings. However, it should be clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.
[0078] The flowcharts used in this specification illustrate operations implemented according to some embodiments of this specification. It should be clearly understood that the operations in the flowcharts may not be implemented in a sequential order. Instead, the operations may be implemented in reverse order or simultaneously. Furthermore, one or more additional operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.
[0079] First Embodiment
[0080] This embodiment proposes a fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network. The method includes the following steps:
[0081] S1. Acquire and process the original time-domain vibration signals of the target equipment under different fault and health conditions to generate a time sequence segment of fixed length.
[0082] Specifically, taking a linear guide as an example, an accelerometer can be used to collect time-domain vibration signals of the electromechanical equipment under different fault and health conditions. For instance, by mounting the accelerometer on the mover of the linear guide and fixing it with double-ended bolts, vibration signals of the linear guide under different fault and health conditions can be collected. The linear guide has 13 preset fault types, including missing balls, worn balls, and worn guide rails, plus 1 normal type, for a total of 14 types. The vibration signals collected for different faults contain different response information, which can reflect the current state of the guide.
[0083] Furthermore, the raw time-domain vibration signals of the target equipment under different fault and health states are acquired and processed to generate fixed-length time segments, including:
[0084] The acquired vibration signal is segmented into segments of equal length using the sliding window technique to extract local features of the vibration time sequence.
[0085] The original time-domain vibration signal is segmented by setting the sliding window length Lg and the step size St, generating multiple time segments; where the i-th time segment... It is generated by the following formula:
[0086] ;
[0087] Where N is the total number of samples extracted.
[0088] For example, the sampling frequency is 6 kHz, each sequence segment contains Lg=1024 sampling points, and the sliding step size St=256, in order to extract local features of vibration timing and build a sufficient number of training samples.
[0089] S2. Based on the S-transform, time-frequency analysis is performed on the time series segments, transforming each one-dimensional time series segment into a two-dimensional time-frequency image, forming a time-frequency image dataset containing all time-frequency images.
[0090] Furthermore, time-frequency analysis processing of the time segment is performed based on the S-transform, including:
[0091] For time series segments Treating the signal x(t) as a continuous time-series signal, the S-transform of the signal x(t) is performed based on the Gaussian window function, and its time-frequency transformation formula is as follows:
[0092] ;
[0093] in, For time shift parameters, For frequency; The Gaussian window function is expressed as follows:
[0094] ;
[0095] By introducing a frequency-dependent Gaussian window width This allows the window width to adapt to frequency; the window is wider at low frequencies, resulting in lower time resolution but higher frequency resolution; the window is narrower at high frequencies, resulting in higher time resolution but lower frequency resolution. This effectively overcomes the limitations of the fixed time-frequency scale of the window in the short-time Fourier transform, enabling a more accurate time-frequency characterization of non-stationary vibration signals.
[0096] Let τ = mT and f = l / (LT), then discretize the continuous S-transform to obtain the discrete S-transform formula:
[0097] ;
[0098] ;
[0099] Where L is the number of sampling points, T is the sampling period, m is the sampling point number, and l is the index of the frequency domain sampling point; Let X(θ) be a frequency point with a value range of 0-(L-1), and let X(θ) be the discrete Fourier transform of the signal x(m).
[0100] By using the discrete S-transform, each time segment is transformed into a two-dimensional time-frequency matrix D: , where the x-coordinate t m Representing time, the vertical axis f l Indicates frequency.
[0101] S3. Input the preprocessed time-frequency graph dataset into the pre-built classification model, and output a deep feature representation that characterizes the fault category or health status of the target device.
[0102] Before inputting the time-frequency image dataset into the model, necessary preprocessing is required to improve the model's training efficiency and generalization ability. First, the time-frequency image dataset is divided into a training set and a test set according to a predetermined ratio (e.g., 7:3). Preprocessing is then performed on the time-frequency images in the training set, including image size normalization (e.g., uniform scaling to a fixed height H and width W), random cropping (to increase data diversity), random rotation (within a small angle, such as ±10 degrees), and pixel value standardization.
[0103] Combination Figure 2 The pre-built classification model is a lightweight hybrid network model, the core of which is an alternating cascaded Spiking Convolutional Encoder and Spiking Efficient Additive Attention Encoder, which aims to extract and fuse the time-frequency features of the signal at multiple levels and scales.
[0104] like Figure 3 As shown, it illustrates the pulse convolutional encoder used in this invention. The pulse convolutional encoder combines spiking neurons with depthwise separable convolutions to pulse-encode the input and extract local spatial features. The pulse efficient additive attention mechanism encoder adopts an efficient additive attention mechanism with low linear complexity to model the global contextual dependencies of local spatial features, and learns and aggregates deep feature representations from time-frequency images in stages.
[0105] The structure of the pulse convolution encoder includes, in sequence:
[0106] The first spiking neuron layer receives the preprocessed time-frequency image (or the feature map output from the previous layer) and uses Leaky Integrate-and-Fire (LIF) spiking neurons to encode continuous pixel values (or feature values) into discrete pulse sequences (0 or 1). This encoding is sparse and event-driven.
[0107] 1×1 pointwise convolution for channel expansion: Performs 1×1 convolution operation on the pulse-coded feature map. Its main function is to increase the number of channels in the feature map (for example, increase the number of input channels C to an expansion factor of t, i.e., t*C) to increase the expressive power of the model.
[0108] The second spiking neuron layer (Spiking Neuron Layer 2) performs secondary spiking encoding on the feature map after the expansion of the channel.
[0109] A 3×3 Depthwise Separable Convolution for Spatial Feature Extraction: This layer consists of depthwise convolution and pointwise convolution. First, the 3×3 depthwise convolution independently extracts spatial features on each input channel; then, a 1×1 pointwise convolution combines the features from each channel. This structure significantly reduces the number of parameters and computational cost while maintaining feature extraction capabilities.
[0110] 1×1 Pointwise Convolution for Channel Reduction: Uses 1×1 convolutions to adjust the number of channels in the feature map to be the same as the number of input channels C (or to the required number of channels according to the network design).
[0111] The output of the first spiking neuron layer is fused with the output of the 1×1 pointwise convolutional layer used for channel recovery via a skip connection, that is, the corresponding elements of the feature maps of the two outputs are added together. This structure helps gradient flow and information preservation, enhancing the robustness of the model. The computation process of this spiking convolutional encoder can be formally represented as:
[0112] ;
[0113] Among them, Z i This represents the input to the spiking convolutional encoder, where SNN stands for spiking neuron, and PWConv... BN The DWConv layer consists of 1×1 pointwise convolutional layers and batch normalization layers, while the DWConv layer consists of 3×3 depthwise separable convolutional layers. This is the output of the pulse convolution encoder.
[0114] like Figure 5 As shown, it illustrates the pulse-efficient additive attention mechanism encoder used in this invention. The structure of the pulse-efficient additive attention mechanism encoder includes, in sequence:
[0115] Spiking Separable Convolution Layer: Consists of a deep convolutional layer and a pointwise convolutional layer, used to further extract local features from the input features and perform pulse coding.
[0116] The Efficient Additive Attention Module aims to capture the global contextual dependencies of features with linear computational complexity, replacing the quadratic scaling dot product attention in the traditional Transformer.
[0117] The efficient additive attention mechanism used, such as Figure 6 As shown, this mechanism effectively replaces quadratic matrix multiplication with linear element-wise multiplication. The design demonstrates that key-value interactions can be replaced with linear layers without sacrificing any accuracy. Additive attention eliminates the need for expensive matrix multiplication operations, significantly reducing the computational complexity of the model.
[0118] The specific calculation process is as follows:
[0119] 1. Feature mapping: using the weight matrix W q and W k The input embedding matrix Y i These are transformed into a query matrix (Q) and a key matrix (K), respectively, where , , where n represents the length of the token and d is the embedding dimension.
[0120] 2. Global query generation: Combine the query matrix Q with the trainable vectors Multiply the results and normalize them using the Softmax function to obtain the query attention weights. for: Based on attention weights The query matrix Q is weighted and pooled to obtain a single global query vector. , .
[0121] 3. Context Encoding and Output
[0122] global query vector AND key matrix The global context matrix is obtained by encoding the elements through element-wise multiplication. Use a linear transformation layer on the global context matrix. The transformation is performed to learn the hidden representation of the token, and the final output of the efficient additive attention mechanism is... for: ;in, Let T be the normalized query matrix, and let T represent the linear mapping layer.
[0123] Spiking Channel Convolution Block: This block is used to non-linearly enhance the features output by the attention module and integrate information along the channel dimension. It consists of: a first spiking neuron layer, a one-dimensional convolutional layer (operating along the channel dimension), a batch normalization layer, and a second spiking neuron layer. The computational process of the spiking efficient additive attention mechanism encoder can be represented as:
[0124] ;
[0125] ;
[0126] .
[0127] in, This represents the input to the spiking efficient additive attention mechanism encoder, where SNN is a spiking neuron, and PWConv... BN DWConv consists of 1×1 pointwise convolutional layers and batch normalization layers, while QK represents an efficient additive attention mechanism. BN It consists of one-dimensional convolutional layers and batch normalization layers. R i Output of a pulse-efficient additive attention mechanism encoder.
[0128] Furthermore, in combination Figure 4 It illustrates the spiking neurons used in this invention. The spiking neurons employed in the spiking convolution encoder and the spiking efficient additive attention mechanism encoder are all Leaky Integrate-and-Fire spike neurons, and their dynamic model is described as follows:
[0129] ;
[0130] ;
[0131] ;
[0132] Where τ is the membrane time constant, and X[t] is the input current at time step t; when the membrane potential H[t] exceeds the discharge threshold V th At this time, the spiking neuron will trigger a pulse S[t]; Θ(v) is the Heaviside step function, which is 1 when v≥0, and 0 otherwise; V[t] represents the membrane potential after the triggering event, which is equal to H[t] if there is no triggering potential, and equal to the reset potential V otherwise. reset .
[0133] The entire classification model consists of four stages, each containing a spiked convolutional encoder and a spiked efficient additive attention encoder. The input to each subsequent stage is the output of the previous stage passed through a downsampling layer (e.g., a convolutional layer with a stride of 2). In this way, the model can extract hierarchical features at four different spatial scales (gradually decreasing resolution and progressively increasing semantic feature level). Finally, the feature map output from the last stage is flattened by global average pooling and fed into a multilayer perceptron (MLP) classification head, which typically contains one or more fully connected layers. The final output is the probability distribution corresponding to different fault categories (and health states). During training, the cross-entropy loss function is used, and the backpropagation through-time (BPTT) algorithm or its approximation (such as STBP) is employed to optimize the model parameters.
[0134] Furthermore, the methods also include:
[0135] The trained classification model, which includes a pulse convolutional encoder and a pulse efficient additive attention mechanism encoder, is deployed to an edge computing device. On the edge computing device, the vibration signals collected in real time from the target device are processed sequentially, including acquiring time-series segments, generating time-frequency images based on S-transform, inputting the time-frequency images into the classification model, and outputting deep feature representations. Based on the output deep feature representations, the fault category or health status of the target device is determined, thereby achieving real-time online fault diagnosis.
[0136] On edge devices, build an online diagnostic system that performs the following steps in a loop:
[0137] 1. The vibration signal of the target device is collected in real time through the connected accelerometer.
[0138] 2. The acquired real-time signal stream is segmented using a sliding window with the same duration as the training time. For each signal segment within the window, an S-transform is performed in real-time to generate a corresponding time-frequency image, which is then subjected to the same standardization preprocessing.
[0139] 3. Input the preprocessed time-frequency images into the deployed lightweight hybrid network model. The model passes through each stage of the pulsed convolutional encoder and pulsed efficient additive attention encoder in a forward propagation manner to extract deep feature representations, and the MLP classification head outputs confidence scores for each category.
[0140] 4. Based on the output confidence score (e.g., the category corresponding to the highest confidence score), determine the current fault category or health status of the target device. Diagnostic results can be output via local device display, transmission to a host computer, or triggering of an alarm device.
[0141] As an example, the confusion matrix obtained from testing edge computing devices is as follows: Figure 7 As shown in the figure, the rows represent the true categories and the columns represent the predicted categories. The model achieves a classification accuracy of 98.45%, demonstrating excellent performance.
[0142] Second Embodiment
[0143] A fault diagnosis system based on an encoding / decoding attention mechanism to enhance a spiking neural network is disclosed. This system implements the fault diagnosis steps described in the first embodiment. It can be integrated into industrial edge computing platforms, embedded devices, or dedicated monitoring devices with data acquisition and processing capabilities to achieve real-time, online, and intelligent diagnosis of the status of electromechanical equipment. The specific structure and functional modules of the system are described in detail below:
[0144] The signal acquisition and preprocessing module is used to acquire raw time-domain vibration signals of the target equipment under different fault and health conditions, and generate fixed-length time segments through sliding window segmentation. This module specifically includes a high-precision piezoelectric or MEMS accelerometer, signal conditioning circuits (such as amplification and filtering), and an analog-to-digital converter (ADC). The sensor is fixed to specific measuring points of the monitored equipment (such as motor bearing housings or gearbox housings) by means of magnetic bases, bolts, or adhesives.
[0145] The time-frequency analysis module is used to perform time-frequency analysis on time-series segments based on the S-transform, transforming each one-dimensional time-series segment into a two-dimensional time-frequency image to form a time-frequency graph dataset.
[0146] A lightweight hybrid network model module is used to receive and process time-frequency images to extract and output deep feature representations for fault classification.
[0147] The lightweight hybrid network model module incorporates an alternating cascaded spiking convolutional encoder and a spiking efficient additive attention mechanism encoder. The spiking convolutional encoder combines spiking neurons with depthwise separable convolutions to spiking-encode the input and extract local spatial features. The spiking efficient additive attention mechanism encoder employs a low-linear-complexity, efficient additive attention mechanism to model the global contextual dependencies of local spatial features, thereby learning and aggregating deep feature representations from time-frequency images in stages.
[0148] The classification and output module is used to output the diagnostic results of the fault category or health status of the target device based on the deep feature representation.
[0149] The classification and output module typically includes a classifier, which is part of the model and follows the global average pooling layer. It consists of one or more fully connected layers whose parameters have been learned during training. This classifier maps the input deep feature vector to confidence scores for each fault category (and "healthy" state).
[0150] The specific output diagnostic results (such as "Normal", "Ball Wear - Mid-term", "Bearing Outer Ring Failure", etc.) and optional confidence levels are output via a monitor, indicator lights, or local log file connected to the edge device.
[0151] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0152] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0153] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.
Claims
1. A fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network, characterized in that, The method includes: The original time-domain vibration signals of the target equipment under different fault and health states are acquired and processed to generate time segments of fixed length. Based on the S-transform, time-frequency analysis is performed on the time series segments to transform each one-dimensional time series segment into a two-dimensional time-frequency image, forming a time-frequency image dataset containing all time-frequency images. The preprocessed time-frequency graph dataset is input into a pre-built classification model, which outputs a deep feature representation that characterizes the fault category or health status of the target device. The pre-built classification model includes alternating cascaded pulsed convolutional encoders and pulsed efficient additive attention mechanism encoders. The pulse convolutional encoder combines spiking neurons with depthwise separable convolutions to pulse-encode time-frequency image data and extract local spatial features. The pulse efficient additive attention mechanism encoder uses an efficient additive attention mechanism with low linear complexity to model the global contextual dependencies of the local spatial features, and learns and aggregates the deep feature representation from the time-frequency image in stages. The structure of the pulse convolution encoder includes, in sequence: The system consists of a first spiking neuron layer, a 1×1 pointwise convolutional layer for channel expansion, a second spiking neuron layer, a 3×3 depthwise separable convolutional layer for spatial feature extraction, and a 1×1 pointwise convolutional layer for channel recovery. The output of the first spiking neuron layer is fused with the output of the 1×1 pointwise convolutional layer used for channel recovery via skip connections; the calculation process of the spiking convolution encoder is as follows: in Z i This represents the input to the spiking convolutional encoder, where SNN stands for spiking neuron. PWConv BN It consists of 1×1 pointwise convolutional layers and batch normalization layers. DWConv It is a 3×3 depth separable convolutional layer. This is the output of the pulse convolution encoder; The structure of the pulse-efficient additive attention mechanism encoder includes, in sequence: Pulse-separable convolutional layers, efficient additive attention modules, and pulse-channel convolutional blocks; The pulse-separable convolutional layer is used to perform local pulse coding on the input features; The efficient additive attention module is used to receive encoded features and model global context dependencies through an efficient additive attention mechanism with low linear complexity; The pulsed channel convolutional block is used to nonlinearly enhance the output of the efficient additive attention module. The pulsed channel convolutional block includes two spiking neuron layers connected in series along the channel dimension, a one-dimensional convolutional layer, and a batch normalization layer. The computation process of the pulsed efficient additive attention mechanism encoder is as follows: in, This represents the input to the encoder of the spiking efficient additive attention mechanism, where SNN stands for spiking neuron. PWConv BN It consists of 1×1 pointwise convolutional layers and batch normalization layers. DWConv It is a 3×3 depth separable convolutional layer. QK This indicates an efficient additive attention mechanism. 1DConv BN It consists of one-dimensional convolutional layers and batch normalization layers. R i Output of a pulse-efficient additive attention mechanism encoder.
2. The fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network according to claim 1, characterized in that, The process of acquiring and processing the raw time-domain vibration signals of the target device under different fault and health states to generate a fixed-length time segment includes: Set the length of the sliding window Lg and step length St The original time-domain vibration signal is segmented to generate multiple time-series segments; wherein, the i-th time-series segment... It is generated by the following formula: in, N This represents the total number of samples extracted.
3. The fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network according to claim 2, characterized in that, The time-frequency analysis processing of the time segment based on the S-transform includes: For the time segment Treated as a continuous timing signal x(t) Based on the Gaussian window function for signal x ( t The S-transform is performed, and its time-frequency transformation formula is as follows: in, For time shift parameters, For frequency; The Gaussian window function is expressed as follows: By introducing a frequency-dependent Gaussian window width This allows the window width to adapt to changes in frequency. set up τ = mT , f = l / ( LT Discretizing the continuous S-transform yields the discrete S-transform formula: in, L The number of sampling points. T The sampling period is m The sampling point number, l This is the index of the frequency domain sampling point; The frequency point has a value range of 0-( L -1), X ( θ ) is a signal x ( m Discrete Fourier transform of ). By using the discrete S-transform, each time segment is transformed into a two-dimensional time-frequency matrix D: , where the x-axis t m Represents time, y-axis f l Indicates frequency.
4. The fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network according to claim 1, characterized in that, The spiking neurons used in both the spiking convolutional encoder and the spiking efficient additive attention mechanism encoder are Leaky Integrate-and-Fire spike neurons, and their dynamic model is described as follows: in, τ The membrane time constant is X [ t [Time step] t Input current; when the membrane potential H [ t Exceeding the discharge threshold V th At that time, the spiking neuron will trigger a spiking pulse. S [ t ]; Θ ( v ) is the Heaviside step function. v The value is 1 if the value is ≥0, otherwise it is 0; V [ t [] represents the membrane potential after a trigger event. If there is no trigger potential, it is equal to [value]. H [ t Otherwise, it equals the reset potential. V reset .
5. The fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network according to claim 4, characterized in that, The efficient additive attention mechanism used in the pulse-efficient additive attention mechanism encoder specifically includes the following calculation process: Using the weight matrix W q and W k The input embedding matrix Y i Convert them into query matrices respectively. Q ) and key matrix ( K ),in , , n Indicates the length of the token. d For the dimension of embedding; query matrix Q With trainable vectors Multiply the results and normalize them using the Softmax function to obtain the query attention weights. for: ; Based on the attention weights The query matrix Q is weighted and pooled to obtain a single global query vector. , ; global query vector AND key matrix The global context matrix is obtained by encoding the elements through element-wise multiplication. ; Use a linear transformation layer on the global context matrix The transformation is performed to learn the hidden representation of the token, and the final output of the efficient additive attention mechanism is... for: ;in, Let T be the normalized query matrix, and let T represent the linear mapping layer.
6. The fault diagnosis method based on an encoding / decoding attention mechanism to enhance a spiking neural network according to claim 1, characterized in that, The method further includes: The trained classification model, which includes the pulse convolutional encoder and the pulse efficient additive attention mechanism encoder, is deployed to an edge computing device. On the edge computing device, the vibration signal collected in real time from the target device is processed sequentially through the following steps: acquiring time-series segments, generating time-frequency images based on S-transform, inputting the time-frequency images into the classification model, and outputting deep feature representations. Based on the deep feature representation of the output, the fault category or health status of the target device is determined, enabling real-time online fault diagnosis.
7. A fault diagnosis system based on an encoding / decoding attention mechanism to enhance a spiking neural network, comprising implementing the fault diagnosis steps as described in any one of claims 1-6, characterized in that, The system includes: The signal acquisition and preprocessing module is used to acquire the raw time-domain vibration signals of the target equipment under different fault and health conditions, and generate fixed-length time segments through sliding window segmentation. The time-frequency analysis module is used to perform time-frequency analysis processing on the time series segments based on the S-transform, transforming each one-dimensional time series segment into a two-dimensional time-frequency image to form a time-frequency image dataset; A lightweight hybrid network model module is used to receive and process the time-frequency images to extract and output deep feature representations for fault classification; The lightweight hybrid network model module incorporates an alternating cascaded pulse convolutional encoder and a pulsed efficient additive attention mechanism encoder. The pulse convolutional encoder combines pulse neurons with depthwise separable convolution to pulse-encode time-frequency map data and extract local spatial features. The pulse-efficient additive attention mechanism encoder employs a low-linear-complexity, efficient additive attention mechanism to model the global contextual dependencies of the local spatial features, thereby learning and aggregating the deep feature representation from the time-frequency image in stages. The classification and output module is used to output the diagnostic results of the fault category or health status of the target device based on the deep feature representation.
Citation Information
Patent Citations
Multi-lead pulse signal intelligent identification method and system based on deep learning
CN117281528A
Residual life prediction method based on improved pulse separable convolution enhanced Transform encoder
CN117493793A