A fault diagnosis method and device based on sliding window processing and attention mechanism
By combining sliding window processing with attention mechanisms, the problems of multi-source data fusion and mining are solved, improving the accuracy of feature extraction and diagnostic results in fault diagnosis.
Patent Information
- Application Number
- CN202310863439.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-13
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-07-13
AI Technical Summary
Existing deep learning-based fault diagnosis methods struggle to achieve multi-source data fusion and mining, resulting in incomplete feature extraction and affecting the accuracy of fault diagnosis results.
A fault diagnosis method based on sliding window processing and attention mechanism is adopted. By constructing a fault diagnosis model, multi-sensor data is input into the model and subjected to sliding window processing and multi-dimensional time series data fusion. Multiple attention mechanism modules are used to weight and fuse the output feature map, and the model is trained until the loss function is minimized.
It achieves effective fusion of multi-dimensional data and mining of multi-dimensional dependencies, improving the accuracy of feature extraction in fault diagnosis and the precision of the final diagnosis results.
Smart Images

Figure CN116994041B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault diagnosis technology for industrial systems / machines, and specifically to a fault diagnosis method and apparatus based on sliding window processing and attention mechanism. Background Technology
[0002] Fault diagnosis is a crucial technology for ensuring the stable operation of industrial activities. In recent years, with the widespread deployment of sensor devices in industrial settings, multi-source operational data from industrial systems / machines can be collected quickly and conveniently. This has promoted the research and development of data-driven fault diagnosis methods in both academia and industry. In particular, compared to traditional data-driven methods based on statistical analysis and shallow machine learning, deep learning-based methods have significantly improved the performance of fault diagnosis.
[0003] Chinese Patent Publication No. CN112861443A discloses a deep learning-based fault diagnosis method incorporating prior knowledge. By integrating prior knowledge, this method enables deep learning technology to extract features from data in a targeted manner, making it suitable for diagnosing a small number of faults. Furthermore, it increases the interpretability of deep learning, making it suitable for fault diagnosis with higher reliability requirements. However, the aforementioned deep learning method still has the following two technical problems:
[0004] 1. Multi-source data fusion problem: Multi-source data collected by multiple sensors provides the data foundation for training deep learning methods. How to effectively fuse information from multiple sources to provide a sufficient and effective source of big data for training deep learning methods is an important technical problem in the field of fault diagnosis.
[0005] 2. Multi-source data mining problem: Compared with single-sensor data, multi-source data fused from multiple sensors contains more multi-dimensional dependency information. Existing deep learning methods struggle to effectively mine this multi-dimensional dependency information. Therefore, further improving existing deep learning methods to achieve multi-source data mining is another important technical problem facing the field of fault diagnosis. Summary of the Invention
[0006] The technical problem to be solved by this invention is that the existing fault diagnosis methods based on deep learning are difficult to achieve multi-source data fusion and multi-source data mining, resulting in insufficient and inaccurate extracted features, leading to inaccurate final fault diagnosis results.
[0007] This invention solves the above-mentioned technical problems through the following technical means: a fault diagnosis method based on sliding window processing and attention mechanism, the method comprising:
[0008] Step a: Construct a fault diagnosis model. Input multi-sensor data into the fault diagnosis model. Based on sliding window processing, fuse multi-dimensional time-series data from the attribute dimension and the time-series dimension to obtain an output feature map. Input the output feature map into various different attention mechanism modules. The weight vectors of different attention mechanism modules are used to weight the output feature map to obtain the final feature map.
[0009] Step b: Adjust the parameters of the fault diagnosis model and train the fault diagnosis model until the loss function is minimized or the preset number of training rounds is reached, then stop training to obtain the trained fault diagnosis model.
[0010] Step c: Input the real-time collected multi-sensor data into the trained fault diagnosis model to perform fault diagnosis.
[0011] Further, step a includes:
[0012] The fault diagnosis model includes a first convolutional module, a channel attention mechanism module, a first attribute attention mechanism module, a first temporal attention mechanism module, and a second convolutional module. The first convolutional module receives data from multiple sensors, and its output forms an output feature map. The output feature map is then input into the channel attention mechanism module, the first attribute attention mechanism module, the first temporal attention mechanism module, and the second convolutional module, respectively. The channel attention mechanism module, the first attribute attention mechanism module, and the first temporal attention mechanism module perform weighted fusion on the output of the second convolutional module to form the final feature map.
[0013] Furthermore, the fault diagnosis model also includes a second attribute attention mechanism module and a second temporal attention mechanism module. The second attribute attention mechanism module, the second temporal attention mechanism module, and the first convolutional module receive multi-sensor data respectively. The second attribute attention mechanism module and the second temporal attention mechanism module respectively perform weighted fusion on the output of the first convolutional module to form an output feature map.
[0014] Furthermore, before the first convolutional module receives multi-sensor data, it also includes:
[0015] Multi-sensor data is M-dimensional time-series data. By performing sliding window processing on the multi-sensor data, the M-dimensional time-series data is transformed into an image-like dataset, which is then used as input to the fault diagnosis model.
[0016] Furthermore, the weight vectors of different attention mechanism modules in the fault diagnosis model are obtained as follows:
[0017] The output feature maps input to different attention mechanism modules are flattened to obtain a one-dimensional vector X. A non-linear transformation is performed using the formula y = s(AX + b), where y is the vector after non-linear transformation, A is a learnable parameter, b is a bias term, and s() is any activation function.
[0018] The weight vector is obtained by formula W = sigmoid(y), where sigmoid() is the normalization function.
[0019] Furthermore, the channel attention mechanism module, the first attribute attention mechanism module, and the first temporal attention mechanism module respectively perform weighted fusion on the output of the second convolutional module, including:
[0020] The weight vectors of the channel attention mechanism module, the first attribute attention mechanism module, and the first time attention mechanism module are W1, W2, and W3, respectively, and are obtained through the formula... The outputs of the second convolutional module are weighted and fused, where F ou This represents the output of the second convolutional module. Pixel-wise multiplication representing the attribute direction. Pixel-by-pixel multiplication representing the temporal direction Pixel-by-pixel multiplication representing the channel direction.
[0021] Furthermore, in step b, the expected value of the squared difference between the fault probability predicted by the fault diagnosis model and the actual fault probability is used as the loss function, where the actual fault probability is 1 when a fault occurs and 0 when no fault occurs.
[0022] Furthermore, in step b, the Adam learning algorithm is used to train the fault diagnosis model.
[0023] This invention also provides a fault diagnosis system based on sliding window processing and attention mechanisms, the system comprising:
[0024] The model building section is used to build a fault diagnosis model. It inputs multi-sensor data into the fault diagnosis model and fuses the multi-dimensional time-series data from the attribute dimension and the time-series dimension based on sliding window processing to obtain an output feature map. The output feature map is then input into various different attention mechanism modules. The weight vectors of different attention mechanism modules are used to weight the output feature map to obtain the final feature map.
[0025] The model training unit is used to adjust the parameters of the fault diagnosis model and train the fault diagnosis model until the loss function is minimized or the preset number of training rounds is reached, at which point training stops and a well-trained fault diagnosis model is obtained.
[0026] The fault diagnosis department is used to input real-time multi-sensor data into a trained fault diagnosis model for fault diagnosis.
[0027] Furthermore, the model building unit is also used for:
[0028] The fault diagnosis model includes a first convolutional module, a channel attention mechanism module, a first attribute attention mechanism module, a first temporal attention mechanism module, and a second convolutional module. The first convolutional module receives data from multiple sensors, and its output forms an output feature map. The output feature map is then input into the channel attention mechanism module, the first attribute attention mechanism module, the first temporal attention mechanism module, and the second convolutional module, respectively. The channel attention mechanism module, the first attribute attention mechanism module, and the first temporal attention mechanism module perform weighted fusion on the output of the second convolutional module to form the final feature map.
[0029] Furthermore, the fault diagnosis model also includes a second attribute attention mechanism module and a second temporal attention mechanism module. The second attribute attention mechanism module, the second temporal attention mechanism module, and the first convolutional module receive multi-sensor data respectively. The second attribute attention mechanism module and the second temporal attention mechanism module respectively perform weighted fusion on the output of the first convolutional module to form an output feature map.
[0030] Furthermore, before the first convolutional module receives multi-sensor data, it also includes:
[0031] Multi-sensor data is M-dimensional time-series data. By performing sliding window processing on the multi-sensor data, the M-dimensional time-series data is transformed into an image-like dataset, which is then used as input to the fault diagnosis model.
[0032] Furthermore, the weight vectors of different attention mechanism modules in the fault diagnosis model are obtained as follows:
[0033] The output feature maps input to different attention mechanism modules are flattened to obtain a one-dimensional vector X. A non-linear transformation is performed using the formula y = s(AX + b), where y is the vector after non-linear transformation, A is a learnable parameter, b is a bias term, and s() is any activation function.
[0034] The weight vector is obtained by formula W = sigmoid(y), where sigmoid() is the normalization function.
[0035] Furthermore, the channel attention mechanism module, the first attribute attention mechanism module, and the first temporal attention mechanism module respectively perform weighted fusion on the output of the second convolutional module, including:
[0036] The weight vectors of the channel attention mechanism module, the first attribute attention mechanism module, and the first time attention mechanism module are W1, W2, and W3, respectively, and are obtained through the formula... The outputs of the second convolutional module are weighted and fused, where F ou This represents the output of the second convolutional module. Pixel-wise multiplication representing the attribute direction. Pixel-by-pixel multiplication representing the temporal direction Pixel-by-pixel multiplication representing the channel direction.
[0037] Furthermore, in the model training unit, the expected value of the squared difference between the fault probability predicted by the fault diagnosis model and the actual fault probability is used as the loss function, where the actual fault probability is 1 when a fault occurs and 0 when no fault occurs.
[0038] Furthermore, the Adam learning algorithm is used to train the fault diagnosis model in the model training unit.
[0039] The advantages of this invention are:
[0040] (1) Since multi-sensor data is multi-dimensional, the present invention transforms the original data into an output feature map by fusing attribute dimension and time dimension through sliding window processing, thereby realizing the fusion of multi-dimensional data, that is, the fusion of multi-source data, making the extracted features more complete. The output feature map is used as the input of the subsequent attention mechanism module. Through various different attention mechanism modules, the multi-dimensional dependency relationship of multi-sensor is mined. The mined multi-dimensional information is used to weight the output feature map to obtain the final feature map, so that the feature extraction result takes into account multi-dimensional dependency relationship and is more accurate, thus the final fault diagnosis result is more accurate.
[0041] (2) In order to mine attribute-dependent information, temporal-dependent information and channel-dependent information in multi-sensor data, this invention designs attribute attention mechanism, temporal attention mechanism and channel attention mechanism respectively. Through the model proposed in this invention, multi-source data can be well integrated and rich information in multi-source data can be mined, which can further improve the performance and efficiency of existing deep learning-based fault diagnosis methods. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the sliding window processing process in a fault diagnosis method based on sliding window processing and attention mechanism disclosed in an embodiment of the present invention;
[0043] Figure 2 This is a fault diagnosis model architecture diagram in a fault diagnosis method based on sliding window processing and attention mechanism disclosed in an embodiment of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0045] Embodiment 1
[0046] As Figure 1 and Figure 2 shown, a fault diagnosis method based on sliding window processing and attention mechanism, the method includes:
[0047] S1: Construct a fault diagnosis model, input multi-sensor data into the fault diagnosis model, and fuse multi-dimensional time series data from the attribute dimension and the time series dimension based on sliding window processing to obtain an output feature map; input the output feature map into multiple different attention mechanism modules respectively, and the weight vectors of different attention mechanism modules weight the output feature map to obtain the final feature map; the specific process is as follows:
[0048] S101. Sliding window processing
[0049] The multi-sensor data is M-dimensional time series data. Given M-dimensional time series data S = [s1,..., s M , where is a one-dimensional time series data with a period of T, arrange S in the following form to obtain the original data D in matrix form
[0050]
[0051] As Figure 1 shown, define an M*d window, where 0 < d < T, and specify the step size of the window sliding as 0 < λ < T. Move the window sequentially from top to bottom on the original data D according to the step size λ, and record the data covered by each window as X n , and take the label of the data corresponding to the bottom row of the data covered by the window as the label y n of X n . In this form, the original data (D, Y) can finally be transformed into a picture-like data set The picture-like data set is used as the input quantity of the fault diagnosis model.
[0052] The method of sliding window processing belongs to the prior art and adopts the sliding window processing step in the fault diagnosis method of multi-attribute time series data based on the CNN-LSTM deep learning method disclosed in Chinese Patent Publication No. CN109814523A, which will not be elaborated here.
[0053] S102, Model Building
[0054] like Figure 2 As shown, in order to mine attribute dependency, temporal dependency and channel dependency information in multi-source data, this invention proposes three attention mechanisms, namely attribute attention mechanism, temporal attention mechanism and channel attention mechanism.
[0055] (1) Attribute attention mechanism
[0056] Given a feature map F = [F1, ..., F2] C ], where F c ∈R d×M c = 1, ..., C, the attribute attention mechanism learns a weight vector W1 = [w1, ..., w M ], where w m , m = 1, ..., M, represents the importance of attribute m in fault diagnosis.
[0057] (2) Time attention mechanism
[0058] Given a feature map F = [F1, ..., F2] C ], where F c ∈R d×M c = 1, ..., C, the temporal attention mechanism learns a weight vector W2 = [w1, ..., w d ], where w δ δ = 1, ..., d, representing the importance of time δ in fault diagnosis.
[0059] (3) Channel attention mechanism
[0060] Given a feature map F = [F1, ..., F2] C ], where F c ∈R d×M c = 1, ..., C, the channel attention mechanism learns a weight vector W3 = [w1, ..., w C ], where w c c = 1, ..., C, representing the importance of channel c in fault diagnosis.
[0061] The learning models for these three types of attention are arbitrary. In this embodiment, a fully connected layer is used for learning. The learning process is carried out together with the entire fault diagnosis model. Specifically, in step S2, the model is trained by adjusting the learnable parameters, bias terms, and the learning rate of the convolutional neural network. After training, the parameters and weight vectors of the three attention mechanisms are fixed. The calculation formulas for the weight vectors of the three attention mechanisms are the same; only the training process leads to different specific parameters, resulting in different weight vectors. The calculation process of the weight vectors is as follows:
[0062] First, the output feature maps input to different attention mechanism modules are flattened to obtain a one-dimensional vector X. Then, a nonlinear transformation is performed using the following formula:
[0063] y = s(AX + b)
[0064] Where y is the vector after nonlinear transformation, A is the learnable parameter, b is the bias term, and s() is any activation function, such as the ReLU activation function. The final weight vector W can be obtained by normalizing the sigmoid function.
[0065] W = sigmoid(y)
[0066] Continue reading Figure 2 The fault diagnosis model includes a first convolutional module 3, a channel attention mechanism module 4, a first attribute attention mechanism module 5, a first temporal attention mechanism module 6, and a second convolutional module 7. The first convolutional module 3 receives multi-sensor data, and its output forms an output feature map. This output feature map is then input into the channel attention mechanism module 4, the first attribute attention mechanism module 5, the first temporal attention mechanism module 6, and the second convolutional module 7, respectively. The output feature map is denoted as... Output feature map F in Inputting the second convolution module 7 yields The weight vectors of channel attention mechanism module 4, first attribute attention mechanism module 5, and first time attention mechanism module 6 are W1, W2, and W3, respectively, and are obtained through the formula... The outputs of the second convolutional module 7 are weighted and fused, where F ou This represents the output of the second convolutional module 7. Pixel-wise multiplication representing the attribute direction. Pixel-by-pixel multiplication representing the temporal direction This represents pixel-wise multiplication along the channel direction. It should be noted that the channel attention mechanism module 4, the first attribute attention mechanism module 5, and the first temporal attention mechanism module 6 can be integrated into any layer of any traditional convolutional neural network. In this embodiment, the channel attention mechanism module 4, the first attribute attention mechanism module 5, and the first temporal attention mechanism module 6 can be integrated into any layer of the first convolutional module 3 or the second convolutional module 7, such as... Figure 2 This only provides one implementation method, which is integrated into the second convolution module 7. Since the input layer has only one channel, the channel attention mechanism cannot be applied. Therefore, when integrating the above three attention mechanisms in the first convolution module 3, only the first attribute attention mechanism module 5 and the first time attention mechanism module 6 can be integrated. As a result, the output of the first convolution module 3 does not include the weighted fusion of channel attention mechanism information.
[0067] A fault diagnosis model is constructed by stacking the above operations. In this model, the application of three attention mechanisms can extract attribute dependencies, temporal dependencies, and channel dependencies from multi-source data.
[0068] It should also be noted that the attention mechanism module and convolution module of this invention can both adopt existing technologies. The main improvement of this invention lies in the data fusion between the modules, not in the specific improvement of each module, because the specific structure of each module will not be described in detail here. Any existing conventional attention mechanism module and convolution module can be used, as long as the dimensions conform to the present invention. Figure 2 The dimensions that are labeled are sufficient, for example, Figure 2 In this context, a representation like 1*M1*1 represents the dimension of the corresponding module. Figure 2 In this context, Attribute attention represents the attribute attention mechanism, Time attention represents the time attention mechanism, Convolution represents the convolution, and Channel attention represents the channel attention mechanism.
[0069] S2: Adjust the parameters of the fault diagnosis model, such as the learnable parameters A of the three attention mechanisms mentioned above, the bias term b, the relevant parameters of the first convolutional module, and the relevant parameters of the second convolutional module, etc., and train the fault diagnosis model until the loss function is minimized or the preset number of training rounds is reached, and then stop training to obtain the trained fault diagnosis model.
[0070] It should be noted that the main improvement of this invention lies in feature extraction, and the main architecture of the constructed fault diagnosis model also lies in feature extraction. In practical applications, the fault diagnosis model also includes a classifier. After obtaining the final feature map, the feature map is input into the classifier for classification, thereby obtaining the predicted fault probability.
[0071] This embodiment uses the dataset obtained from sliding window processing. The training set and test set are divided into a specific ratio. The expected value of the squared difference between the fault diagnosis model's predicted fault probability and the actual fault probability (i.e., the mean squared error between the predicted and actual fault probabilities) is used as the loss function, where the actual fault probability is 1 when a fault occurs and 0 when no fault occurs. The Adam learning algorithm is used to train the fault diagnosis model. After a certain number of iterations, the constructed model can fit the data in the training dataset well. Finally, the trained model is tested on the test dataset using specific performance metrics.
[0072] S3: Input the real-time collected multi-sensor data into the trained fault diagnosis model to perform fault diagnosis.
[0073] Based on the above technical solutions, this invention proposes a deep learning model for mining dependency information in multi-sensor data using an attention mechanism. To mine attribute dependency information, temporal dependency information, and channel dependency information in multi-sensor data, attribute attention mechanism, temporal attention mechanism, and channel attention mechanism are designed respectively. The model proposed in this invention can effectively fuse multi-source data and mine rich information from it, further improving the performance and efficiency of existing deep learning-based fault diagnosis methods.
[0074] Example 2
[0075] The difference between Embodiment 2 and Embodiment 1 lies only in the slightly different architecture of the fault diagnosis model. Embodiment 1 has already explained that the channel attention mechanism module 4, the first attribute attention mechanism module 5, and the first temporal attention mechanism module 6 can be integrated into any layer of the convolutional neural network. Therefore, in practical applications, there are also cases where these three attention mechanisms are integrated into the first convolutional module 3 and the second convolutional module 7 respectively, realizing a multi-level attention mechanism. First, an attention mechanism is used to fuse multi-source information and mine dependencies, and then another attention mechanism is used to mine dependencies again, further improving the accuracy of feature extraction. Specifically, as shown... Figure 2As shown, the fault diagnosis model includes a second attribute attention mechanism module 1, a second temporal attention mechanism module 2, a first convolutional module 3, a channel attention mechanism module 4, a first attribute attention mechanism module 5, a first temporal attention mechanism module 6, and a second convolutional module 7. The second attribute attention mechanism module 1, the second temporal attention mechanism module 2, and the first convolutional module 3 respectively receive multi-sensor data. The second attribute attention mechanism module 1 and the second temporal attention mechanism module 2 respectively perform weighted fusion on the output of the first convolutional module 3 to form an output feature map. The output feature map is then input into the channel attention mechanism module 4, the first attribute attention mechanism module 5, the first temporal attention mechanism module 6, and the second convolutional module 7, respectively. The output feature map is denoted as... Output feature map F in Inputting the second convolution module 7 yields The weight vectors of channel attention mechanism module 4, first attribute attention mechanism module 5, and first time attention mechanism module 6 are W1, W2, and W3, respectively, and are obtained through the formula... The outputs of the second convolutional module 7 are weighted and fused, where F ou This represents the output of the second convolutional module 7. Pixel-wise multiplication representing the attribute direction. Pixel-by-pixel multiplication representing the temporal direction The pixel-wise multiplication represents the channel direction. The method by which the second attribute attention mechanism module 1 and the second temporal attention mechanism module 2 perform weighted fusion on the output of the first convolution module 3 is the same as the method by which the channel attention mechanism module 4, the first attribute attention mechanism module 5, and the first temporal attention module 6 perform weighted fusion on the output of the second convolution module 7, and will not be described in detail here.
[0076] Example 3
[0077] Based on Embodiment 1, Embodiment 3 of the present invention also provides a fault diagnosis system based on sliding window processing and attention mechanism, the system comprising:
[0078] The model building section is used to build a fault diagnosis model. It inputs multi-sensor data into the fault diagnosis model and fuses the multi-dimensional time-series data from the attribute dimension and the time-series dimension based on sliding window processing to obtain an output feature map. The output feature map is then input into various different attention mechanism modules. The weight vectors of different attention mechanism modules are used to weight the output feature map to obtain the final feature map.
[0079] The model training unit is used to adjust the parameters of the fault diagnosis model and train the fault diagnosis model until the loss function is minimized or the preset number of training rounds is reached, at which point training stops and a well-trained fault diagnosis model is obtained.
[0080] The fault diagnosis department is used to input real-time multi-sensor data into a trained fault diagnosis model for fault diagnosis.
[0081] Specifically, the model building unit is also used for:
[0082] The fault diagnosis model includes a first convolutional module 3, a channel attention mechanism module 4, a first attribute attention mechanism module 5, a first temporal attention mechanism module 6, and a second convolutional module 7. The first convolutional module 3 receives multi-sensor data, and its output forms an output feature map. The output feature map is input into the channel attention mechanism module 4, the first attribute attention mechanism module 5, the first temporal attention mechanism module 6, and the second convolutional module 7, respectively. The channel attention mechanism module 4, the first attribute attention mechanism module 5, and the first temporal attention mechanism module 6 perform weighted fusion on the output of the second convolutional module 7 to form the final feature map.
[0083] More specifically, the fault diagnosis model further includes a second attribute attention mechanism module 1 and a second temporal attention mechanism module 2. The second attribute attention mechanism module 1, the second temporal attention mechanism module 2, and the first convolution module 3 respectively receive multi-sensor data. The second attribute attention mechanism module 1 and the second temporal attention mechanism module 2 respectively perform weighted fusion on the output of the first convolution module 3 to form an output feature map.
[0084] More specifically, before the first convolution module 3 receives multi-sensor data, it also includes:
[0085] Multi-sensor data is M-dimensional time-series data. By performing sliding window processing on the multi-sensor data, the M-dimensional time-series data is transformed into an image-like dataset, which is then used as input to the fault diagnosis model.
[0086] More specifically, the weight vectors of different attention mechanism modules in the fault diagnosis model are obtained as follows:
[0087] The output feature maps input to different attention mechanism modules are flattened to obtain a one-dimensional vector X. A non-linear transformation is performed using the formula y = s(AX + b), where y is the vector after non-linear transformation, A is a learnable parameter, b is a bias term, and s() is any activation function.
[0088] The weight vector is obtained by formula W = sigmoid(y), where sigmoid() is the normalization function.
[0089] More specifically, the channel attention mechanism module 4, the first attribute attention mechanism module 5, and the first temporal attention mechanism module 6 respectively perform weighted fusion on the output of the second convolution module 7, including:
[0090] The weight vectors of channel attention mechanism module 4, first attribute attention mechanism module 5, and first time attention mechanism module 6 are W1, W2, and W3, respectively, and are obtained through the formula... The outputs of the second convolutional module 7 are weighted and fused, where F ou This represents the output of the second convolutional module 7. Pixel-wise multiplication representing the attribute direction. Pixel-by-pixel multiplication representing the temporal direction Pixel-by-pixel multiplication representing the channel direction.
[0091] Specifically, in the model training unit, the expected value of the squared difference between the fault probability predicted by the fault diagnosis model and the actual fault probability is used as the loss function, where the actual fault probability is 1 when a fault occurs and 0 when no fault occurs.
[0092] Specifically, the Adam learning algorithm is used to train the fault diagnosis model in the model training unit.
[0093] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for fault diagnosis based on sliding window processing and attention mechanism, characterized in that, The method comprises: Step a: constructing a fault diagnosis model, inputting multi-sensor data into the fault diagnosis model, fusing multi-dimensional time series data from attribute dimension and time dimension based on sliding window processing to obtain an output feature map; inputting the output feature map into a plurality of different attention mechanism modules respectively, and weighting the output feature map by a weight vector of each different attention mechanism module to obtain a final feature map; the fault diagnosis model comprises a first convolution module, a channel attention mechanism module, a first attribute attention mechanism module, a first time attention mechanism module, and a second convolution module, the first convolution module receives multi-sensor data, and an output of the first convolution module forms the output feature map, the output feature map is input into the channel attention mechanism module, the first attribute attention mechanism module, the first time attention mechanism module, and the second convolution module respectively, the channel attention mechanism module, the first attribute attention mechanism module, and the first time attention mechanism module perform weighted fusion on an output of the second convolution module respectively to form the final feature map; the fault diagnosis model further comprises a second attribute attention mechanism module and a second time attention mechanism module, the second attribute attention mechanism module, the second time attention mechanism module, and the first convolution module receive multi-sensor data respectively, and the second attribute attention mechanism module and the second time attention mechanism module perform weighted fusion on an output of the first convolution module respectively to form the output feature map; Step b: adjusting parameters of the fault diagnosis model, training the fault diagnosis model until a loss function is minimized or a preset training round is reached, and stopping training to obtain a trained fault diagnosis model; Step c: inputting real-time collected multi-sensor data into the trained fault diagnosis model to perform fault diagnosis.
2. The method of claim 1, wherein, Before the first convolution module receives the multi-sensor data, the method further comprises: The multi-sensor data is M The multi-sensor data is processed by a sliding window to convert the multi-sensor data into a picture-like data set, and the picture-like data set is used as an input quantity of a fault diagnosis model. M The multi-sensor data is processed by a sliding window to convert the multi-sensor data into a picture-like data set, and the picture-like data set is used as an input quantity of a fault diagnosis model.
3. The method of claim 1, wherein, The weight vector of each different attention mechanism module in the fault diagnosis model is obtained in the following manner: The output feature maps input to different attention mechanism modules are flattened to obtain a one-dimensional vector , and a nonlinear transformation is performed by formula , wherein, is the vector after nonlinear transformation, is a learnable parameter, is a bias term, is any kind of activation function; The weight vector is obtained by the formula wherein is a normalization function.
4. The method of claim 1, wherein, The channel attention mechanism module, the first attribute attention mechanism module, and the first time attention mechanism module perform weighted fusion on the output of the second convolution module respectively, comprising: The weight vectors of the channel attention mechanism module, the first attribute attention mechanism module, and the first time attention mechanism module are respectively , , The output of the second convolution module is weighted and fused by the formula , wherein represents the output of the second convolution module, represents pixel-by-pixel multiplication in the attribute direction, represents pixel-by-pixel multiplication in the time sequence direction, represents pixel-by-pixel multiplication in the channel direction.
5. The method of claim 1, wherein, In step b, an expected value of a square of a difference between a predicted fault probability and an actual fault probability is used as the loss function, wherein the actual fault probability is 1 when a fault occurs and 0 when no fault occurs.
6. The method of claim 1, wherein, In step b, the fault diagnosis model is trained by using an Adam learning algorithm.
7. A fault diagnosis system based on sliding window processing and attention mechanism, characterized in that, The system comprises: The model construction unit is configured to construct a fault diagnosis model, input multi-sensor data into the fault diagnosis model, fuse multi-dimensional time-series data from attribute dimensions and time dimensions based on a sliding window processing to obtain an output feature map, input the output feature map into different attention mechanism modules respectively, and weight the output feature map by weight vectors of different attention mechanism modules to obtain a final feature map. The model training unit is configured to adjust parameters of the fault diagnosis model, train the fault diagnosis model until a loss function is minimized or a preset training round is reached, and stop training to obtain a trained fault diagnosis model. The fault diagnosis unit is configured to input real-time collected multi-sensor data into the trained fault diagnosis model, and perform fault diagnosis.
Citation Information
Patent Citations
CNN-LSTM-based depth learning method and multi-attribute time sequence data fault diagnosis method
CN109814523A
Deep learning fault diagnosis method integrated with prior knowledge
CN112861443A
Method for film recommendation by using user attribute
CN110008377A
Zero sample learning method and system based on semantic attribute attention redistribution mechanism
CN110163258A