Workpiece fault diagnosis method based on convolutional neural network
By designing a convolutional neural network model with multi-scale separable wavelet convolution and dynamically fused attention modules, the accuracy and robustness issues of traditional workpiece fault diagnosis in complex environments are solved, achieving efficient fault identification and diagnosis.
Patent Information
- Application Number
- CN202511397241.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-09-28
AI Technical Summary
Traditional workpiece fault diagnosis methods lack accuracy and robustness in complex and ever-changing industrial scenarios, and are difficult to adapt to harsh environments and noise interference.
A workpiece fault diagnosis method based on convolutional neural networks is adopted. It utilizes a multi-scale separable wavelet convolution module and a dynamic fusion attention module. The multi-scale separable wavelet convolution module extracts local features of vibration data at different scales, and the dynamic fusion attention module is combined to perform feature fusion and residual connection to construct the MSWFA-Net model.
It improves the accuracy and robustness of fault diagnosis, enhances the stability and generalization ability of the model, and shows strong adaptability, especially under complex working conditions and high noise conditions.
Smart Images

Figure CN120892804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mechanical fault diagnosis technology, and specifically to a workpiece fault diagnosis method based on convolutional neural networks. Background Technology
[0002] Fault diagnosis of bearings in large machinery is crucial for ensuring industrial safety. In actual industrial environments, bearings are prone to wear, cracks, and other faults due to harsh working conditions, frequent load changes, and long-term operation. However, the complexity of equipment faults and noise interference in the collected data pose significant challenges to fault diagnosis and identification.
[0003] Existing fault diagnosis methods typically utilize signal processing and pattern recognition techniques to improve diagnostic accuracy. Examples include classic signal processing methods such as Fast Fourier Transform, Short-Time Fourier Transform, and Wavelet Transform, as well as neural network-based diagnostic methods.
[0004] However, the aforementioned signal processing techniques require human intervention and rely on expert experience to select feature extraction methods. Furthermore, traditional signal processing and machine learning methods are highly sensitive to input perturbations and heavily depend on the quality of dynamically generated parameters, making them difficult to adapt to complex and ever-changing industrial scenarios, resulting in insufficient accuracy and robustness in fault diagnosis. Summary of the Invention
[0005] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a workpiece fault diagnosis method based on convolutional neural networks, which solves the problems of insufficient stability and accuracy in traditional workpiece fault diagnosis.
[0006] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides a workpiece fault diagnosis method based on a convolutional neural network, comprising: The vibration data of the workpiece and a target neural network model are acquired. The target neural network model includes a feature extraction module, which comprises a multi-scale separable wavelet convolution module, a dynamic fusion attention module, and a feature fusion layer. The separable wavelet convolution module includes a wavelet transform layer, a multi-scale dilated convolution group, a BN-S submodule, and a first residual branch. The dynamic fusion attention module includes a channel attention submodule, a multi-scale spatial attention submodule, a dynamic fusion submodule, and a second residual branch. The multi-scale spatial attention submodule replaces the convolutional layer of the original spatial attention module with a multi-scale convolutional layer composed of three parallel convolutions. The channel attention submodule and the multi-scale spatial attention submodule are connected in parallel. The vibration data is processed by the target neural network model to obtain the fault diagnosis result of the workpiece; wherein, the multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, the dynamic fusion attention module is used to fuse the channel features and spatial features of the local features according to weight parameters, and the feature fusion layer is used to perform residual connection between the local features and the output of the dynamic fusion attention module.
[0007] Preferably, the multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, including: The vibration data is divided into low-frequency sub-bands and high-frequency sub-bands through the wavelet transform layer. The low-frequency subband and high-frequency subband are dilated and convolved by the multi-scale dilated convolution group to obtain low-frequency feature maps and high-frequency feature maps. The BN-S submodule is used to perform affine transformation and inverse wavelet transform on the low-frequency feature map and the high-frequency feature map to obtain the reconstructed features; The basic features of the vibration data are extracted by the first residual branch and connected with the reconstructed features to obtain local features.
[0008] Preferably, the step of processing the vibration data through the target neural network model to obtain the fault diagnosis result of the workpiece includes: The channel features of the local features are extracted by the channel attention submodule, and the spatial features of the local features are extracted by the multi-scale spatial attention submodule. The dynamic fusion submodule fuses the channel features and the spatial features according to the weight parameters to obtain key features; wherein, the weight parameters represent the contribution of the channel features and the spatial features under the current input. The basic features of the local features are extracted using the second residual branch; The basic features and the key features are residually connected to obtain the output features.
[0009] Preferably, the first residual branch includes: The system comprises a deep convolutional layer, an activation function, and a BN-S submodule; wherein the BN-S submodule includes a batch normalization layer and an affine transformation layer.
[0010] Preferably, the second residual branch includes: Average pooling layer, convolutional layer, and activation function.
[0011] Preferably, the step of processing the vibration data through the target neural network model further includes: The vibration data is subjected to average pooling, convolution, batch normalization, and activation processing.
[0012] Preferably, the method further includes: The initial neural network model is preset and the loss value is calculated based on the cross-entropy function; The AdamW optimizer is used to update the parameters of the neural network model based on the loss value; The neural network model that achieves the highest diagnostic accuracy on the validation set is selected as the target neural network model.
[0013] Secondly, the present invention also provides a workpiece fault diagnosis system based on a convolutional neural network, comprising: The acquisition module acquires vibration data of the workpiece and a target neural network model. The target neural network model includes a feature extraction module, which comprises a multi-scale separable wavelet convolution module, a dynamic fusion attention module, and a feature fusion layer. The separable wavelet convolution module includes a wavelet transform layer, a multi-scale dilated convolution group, a BN-S submodule, and a first residual branch. The dynamic fusion attention module includes a channel attention submodule, a multi-scale spatial attention submodule, a dynamic fusion submodule, and a second residual branch. The multi-scale spatial attention submodule replaces the convolutional layer of the original spatial attention module with a multi-scale convolutional layer composed of three parallel convolutions. The channel attention submodule and the multi-scale spatial attention submodule are connected in parallel. The data processing module processes the vibration data through the target neural network model to obtain the fault diagnosis result of the workpiece; wherein, the multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, the dynamic fusion attention module is used to fuse the channel features and spatial features of the local features according to weight parameters, and the feature fusion layer is used to perform residual connection between the local features and the output of the dynamic fusion attention module.
[0014] Thirdly, the present invention also provides a computer storage medium storing a computer program for a workpiece fault diagnosis method based on a convolutional neural network, wherein the computer program causes a computer to execute any of the above-described workpiece fault diagnosis methods based on a convolutional neural network.
[0015] Fourthly, the present invention also provides an electronic device, comprising: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs including methods for performing the convolutional neural network-based workpiece fault diagnosis method described above.
[0016] (III) Beneficial Effects This invention provides a workpiece fault diagnosis method based on convolutional neural networks. Compared with existing technologies, it has the following advantages: 1. This application designs a multi-scale separable wavelet convolution module with three parallel convolutions forming a multi-scale convolutional layer. This module extracts low-frequency and high-frequency features at different scales, significantly reducing the number of parameters and computational cost while maintaining high diagnostic accuracy. At the same time, by setting different dilation rates for the multi-scale separable wavelet convolution module, the receptive field is expanded, enhancing the stability and generalization ability of the neural network.
[0017] 2. This application enhances a convolutional attention module by introducing multi-scale convolution with different kernel sizes, attention features with parallel connections, and residual connections introduced from the sides. This design reduces the sensitivity of the attention mechanism to external factors, thereby improving the stability and generalization ability of the model.
[0018] 3. This application designs a novel neural network model that can complete fault diagnosis by processing workpiece vibration data. The fault diagnosis framework is constructed by multi-scale separable wavelet convolution and fusion attention mechanism, which shows strong generalization ability and robustness to noise in complex working conditions. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a workpiece fault diagnosis method based on a convolutional neural network, provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of the MSWFA-Net network provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the feature extraction submodule provided in an embodiment of this application; Figure 4 A schematic diagram of the structure of a multi-scale separable wavelet convolution module provided in this application embodiment; Figure 5 This is a schematic diagram of the structure of a dynamic fusion attention module provided in an embodiment of this application; Figure 6 A schematic diagram of the structure of a multi-scale spatial attention submodule provided in an embodiment of this application; Figure 7A flowchart illustrating a workpiece fault diagnosis method based on a convolutional neural network, provided for another embodiment of this application; Figure 8 This application also provides a schematic flowchart of a workpiece fault diagnosis method based on a convolutional neural network in another embodiment. Detailed Implementation
[0021] 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 are described clearly and completely. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] This application provides a workpiece fault diagnosis method based on convolutional neural networks, which solves the problems of insufficient stability and accuracy of traditional workpiece fault diagnosis, and realizes the stability and generalization ability of neural network models for fault diagnosis.
[0023] The technical solution in this application is to solve the above-mentioned technical problems, and the general idea is as follows: Fault diagnosis of bearings in large machinery is crucial for ensuring industrial safety. However, in real industrial environments, accurate fault identification remains challenging due to the complexity of equipment failures and the unavoidable noise in collected data. To address the low accuracy of traditional bearing fault diagnosis models in complex data and noisy environments, this paper proposes a novel fault diagnosis framework—MSWFA-Net (Multiscale Separable WaveletFusion Attention). This framework is based on multiscale separable wavelet convolution and a fusion attention mechanism. First, a multiscale separable wavelet convolution module is designed to extract local features from vibration signals using wavelet transform characteristics, with a particular focus on capturing low-frequency information. Pointwise convolution reduces computational costs and accelerates model convergence. Second, a dynamic fusion attention module is introduced to efficiently capture and utilize key features while minimizing the adverse effects of noise and irrelevant components. This module combines multiscale convolution to mine deep spatial information in the signal and dynamically fuses it with channel features, preserving significant information through residual connections. Finally, extensive experiments on three bearing datasets demonstrate that MSWFA-Net outperforms traditional deep learning models in both diagnostic accuracy and robustness, especially under complex fault and high-noise conditions. Ablation experiments further validate the effectiveness of the proposed module.
[0024] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0025] like Figure 1 As shown, Figure 1 This document illustrates the flow of a workpiece fault diagnosis method based on a convolutional neural network according to one embodiment of this application.
[0026] First, key vibration data is collected from the experimental platform and transmitted to the display device. Then, the data is divided into samples for training, verification, and testing using a sliding window method.
[0027] Then, the training samples were used to construct the MSWFA-Net (Multiscale Separable Wavelet Fusion Attention) network architecture using modules such as DFAM (Dynamic Fusion Attention Module) and MSWTC (Multiscale Separable Wavelet Convolution). During model training, the cross-entropy function was selected to calculate the loss value, and the AdamW optimizer was used to update the model's learned parameters. During the iteration process, the model with the highest accuracy on the validation set was selected as the completed model.
[0028] Finally, the test samples are input into the trained model for fault diagnosis, and the experimental results are visualized using a two-dimensional t-SNE plot, a two-dimensional confusion matrix, and a bar chart.
[0029] Since the embodiments of this application involve a large number of improvements to neural networks, for ease of understanding, the neural network-related concepts involved in the embodiments of this application will be introduced below.
[0030] (1) Depthwise separable convolution Depthwise Separable Convolution (DSC) is an efficient component in convolutional neural networks that decomposes standard convolution into two independent layers: one for feature extraction and the other for feature combination. This decomposition significantly reduces computational complexity and model size. First, channel-wise convolution operates independently on each channel of the input feature map, changing its height (H) and width (W) while maintaining the same number of channels. Each channel is processed by a dedicated convolutional kernel, meaning one kernel handles one channel, ensuring the output feature map maintains the same number of channels as the input. Then, pointwise convolution processes the output of the depthwise convolution using a 1×1 kernel to adjust the number of channels while keeping the feature map's height and width constant. This step enables cross-channel information fusion.
[0031] Depthwise separable convolution can significantly reduce computational complexity and the number of parameters. Assume the input data has dimensions of length, width, and height. The length, width, and height of the output data are The kernel size of standard convolution is Where M is the number of input channels, N is the number of output channels, and with a stride of 1, the computational cost of a standard convolution is: (1) The computational cost of depthwise separable convolution is: (2) That is, the sum of the computational costs of channel-wise convolution and 1×1 pointwise convolution.
[0032] The ratio of computational complexity between standard convolution and depthwise separable convolution can be calculated as follows: (3) When using 3×3 depthwise separable convolutions (as used in MobileNet), the computational cost is reduced by about 8 to 9 times compared to standard convolutions.
[0033] (2) Convolutional block attention module The Convolutional Block Attention Module (CBAM) is an attention mechanism designed to improve the performance of convolutional neural networks by fusing channel attention and spatial attention. CBAM consists of two sub-modules: the Channel Attention Module (CAM) and the Spatial Attention Module (SAM). CAM enhances channel features relevant to the current task while suppressing irrelevant channels. The input feature map is first subjected to global average pooling and max pooling operations to extract features for each channel. These features are then passed through a shared multilayer perceptron (MLP) to generate average pooling features and max pooling features, respectively. The resulting features are fused element-wise and then processed using a sigmoid activation function to generate channel feature vectors. In summary, the formula for calculating channel attention can be expressed as: (4) Where σ represents the Sigmoid activation function, MLP represents a model containing a multilayer perceptron, Avgpool and Maxpool represent global average pooling and max pooling operations, respectively, and F represents the input feature map. This represents the channel feature map.
[0034] On the other hand, the Spatial Attention Module (SAM) aims to highlight important spatial locations while mitigating the influence of irrelevant regions. The input feature maps are first subjected to average pooling and max pooling operations along the channel dimension. The resulting feature maps are then fused element-wise to extract spatial information. Subsequently, this fused feature map is passed through a convolutional layer to generate a spatial attention map, and finally activated by the sigmoid function to obtain the spatial feature vector. In short, the formula for calculating spatial attention can be expressed as: (5) in, This represents the Sigmoid activation function. Indicates the filter size is Convolution operation, and These represent average pooling and max pooling operations, respectively. Indicates the input feature map, Represents spatial feature map.
[0035] The CAM and SAM modules are connected sequentially to form the CBAM module. The input feature map is first multiplied element-wise with the channel attention vector generated by the Channel Attention submodule (CAM) to enhance channel features helpful to the current task while suppressing irrelevant channels. Subsequently, the feature map, enhanced in the channel dimension by CAM, is multiplied element-wise with the spatial attention vector generated by the Spatial Attention module (SAM) to further improve the model's ability to extract useful information from the input features. The specific calculation formula is as follows: (6) (7) Here, ⊗ represents element-wise multiplication. This represents the product of the input feature map and the channel feature map. express The product of the spatial feature map and the spatial feature map.
[0036] Next, the fault diagnosis method provided in the embodiments of this application will be described using the model training stage as an example.
[0037] like Figure 1 As shown, a workpiece fault diagnosis method based on convolutional neural networks is provided in this application embodiment. This workpiece fault diagnosis method based on convolutional neural networks can be executed by a terminal device with data processing capabilities. The terminal device includes a smartphone, tablet computer, personal computer, or embedded system, and is suitable for edge computing and localized diagnosis scenarios in industrial equipment condition monitoring. Figure 1 As shown in the embodiment of this application, a workpiece fault diagnosis method based on a convolutional neural network includes: Step S110: Obtain vibration data of the workpiece and a target neural network model. The target neural network model includes a feature extraction module, which includes a multi-scale separable wavelet convolution module, a dynamic fusion attention module, and a feature fusion layer. The separable wavelet convolution module includes a wavelet transform layer, a multi-scale dilated convolution group, a BN-S submodule, and a first residual branch. The dynamic fusion attention module includes a channel attention submodule, a multi-scale spatial attention submodule, a dynamic fusion submodule, and a second residual branch. The multi-scale spatial attention submodule replaces the convolutional layer of the original spatial attention module with a multi-scale convolutional layer composed of three parallel convolutions. The channel attention submodule and the multi-scale spatial attention submodule are connected in parallel.
[0038] In this embodiment of the application, the terminal device can acquire the vibration data of the workpiece and the target neural network model, wherein the target neural network model is a pre-trained MSWFA-Net model that has DFAM and MSWTC modules.
[0039] Next, the structure of the target neural network model will be described in detail.
[0040] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the MSWFA-Net model in an embodiment of this application.
[0041] The input data first passes through an average pooling layer (Avgpool), followed by convolution (Conv), batch normalization (BN), and ReLU activation operations. This process reduces the temporal dimension of the input data, decreases the number of parameters and computational load, aggregates information from adjacent regions, and extracts the main features of the input data.
[0042] Subsequently, the main features of the input data are input into the feature extraction module. As an example and not a limitation, the feature extraction module in this embodiment consists of four structurally identical feature extraction sub-modules. For the specific structure of the feature extraction sub-modules, please refer to [link to relevant documentation]. Figure 3 The feature extraction submodule is the core component of the MSWFA-Net model, mainly consisting of multi-scale separable wavelet convolution (MSWTC) and dynamic fusion attention module (DFAM).
[0043] See Figure 4 , Figure 4 This represents the structure of a multi-scale separable wavelet convolution (MSWTC) module. For example... Figure 7 As shown, the specific steps in this embodiment are as follows: Step S210: The vibration data is divided into low-frequency sub-band and high-frequency sub-band by wavelet transform layer.
[0044] Step S220: The low-frequency subband and the high-frequency subband are dilated and convolved by a multi-scale dilated convolution group to obtain low-frequency feature maps and high-frequency feature maps.
[0045] Step S230: The low-frequency feature map and the high-frequency feature map are reconstructed by performing affine transformation and inverse wavelet transformation through the BN-S submodule.
[0046] Step S240: Extract the basic features of the vibration data through the first residual branch and form a residual connection with the reconstructed features to obtain local features.
[0047] The MSWTC module consists of a main path and a first residual branch. The main path comprises a wavelet transform layer, four parallel convolutional layers, a BN-S submodule, and an inverse wavelet transform layer connected sequentially. The first residual branch comprises a deep convolutional layer, an activation function, and a BN-S submodule connected sequentially. The BN-S submodule includes a batch normalization layer and an affine transform layer. After residual connections, the data passes through a convolutional layer, normalization, and activation operations, outputting the extracted local features.
[0048] In this embodiment, firstly, the existing 2D wavelet convolutional layer is improved to a one-dimensional form, and the signal is separated into low-frequency trend components and high-frequency transient features through multi-level wavelet decomposition. Secondly, a multi-scale dilated convolutional group is designed, using a larger dilation rate for the low-frequency subband to model long-distance dependencies, and a smaller dilation rate for the high-frequency subband to detect local abrupt changes. This grouping computation achieves a balance between cross-scale feature interaction and computational efficiency. Finally, feature fusion is completed through normalization, pointwise convolution, and cross-layer residual connections. The specific implementation steps of this module are as follows: First, the low-frequency components are initialized. During each decomposition level, the wavelet transform divides the input signal into a low-frequency sub-band that preserves global trend information and a high-frequency sub-band that captures local features. This multi-level wavelet transform uses artificially constructed Haar wavelet transform (WT) basis functions as fixed wavelet kernels. Its mathematical expression can be described as follows: (8) (9) in, X Indicates input data; and They represent the first time. - The low-frequency and high-frequency features extracted by the -th layer; WTC represents the convolution operation in the wavelet domain; This indicates the wavelet filter used, which consists of a high-frequency filter and a low-frequency filter.
[0049] Subsequently, the obtained frequency features are processed using multi-scale small-kernel dilated convolution. After convolution processing, the low-frequency subbands are passed as input to the next-level wavelet decomposition module for further processing. Dilated convolution is a special form of convolution that expands the receptive field by inserting holes (i.e., zero values) into the convolution kernel without adding additional parameters. In this embodiment, by setting the dilation rate [1, 2, 3, 4] to construct parallel multi-scale convolutions, it is possible not only to capture a wider range of contextual information but also to extract local features more effectively at different scales. Its calculation formula can be expressed as: (10) (11) in, This represents the initial low-frequency convolutional features. and They represent the first time. The low-frequency and high-frequency feature maps obtained after the -th layer convolution operation. This indicates the multi-scale dilated convolution used. Indicates the first -th layer convolution kernel, This represents the input data of the i-th layer obtained by recombining low-frequency and high-frequency features.
[0050] To accelerate model training and adjust the feature maps after convolutional operations, a BN-S submodule is designed after each dilated convolution. This module consists of a batch normalization (BN) layer immediately following the previous convolutional operation and an affine transformation layer. The calculation formula for the affine transformation layer can be expressed as: (12) in, This indicates element-wise multiplication. This represents element-wise addition, where W represents the weight parameter and b represents the bias term. During training, W and b are continuously updated using the backpropagation algorithm.
[0051] Starting from the last layer, the integrated information undergoes inverse wavelet transform step by step, and features at different scales are re-fused to restore it to the original signal domain. The calculation formula for this process is: (13) in, Indicates from the first -Th layer reverse propagation aggregate output This indicates the inverse wavelet transform operation.
[0052] On the other hand, the input data is processed sequentially through a simple deep convolutional layer, a ReLU activation function, and a BN-S submodule to extract basic features. These basic features are then combined with data obtained through wavelet convolution transformation. X The features are then fused to achieve residual connections, thereby obtaining local feature vectors. Finally, pointwise convolutions are used to transform the channel dimensions for further feature processing.
[0053] This application's embodiments integrate wavelet transform, inverse wavelet transform, multi-scale dilated convolution, normalization operation, residual connection, and pointwise convolution into an organic whole; it solves the problem that traditional depthwise separable convolution is difficult to effectively capture the multi-resolution characteristics of signals due to its single feature extraction scale when processing complex non-stationary signals; and it achieves deep feature extraction.
[0054] See Figure 5 , Figure 5 This is a schematic diagram illustrating the process of the DFAM module extracting attention features for local features. For example... Figure 8 As shown, the specific steps in this embodiment are as follows: Step S310: Extract the channel features of local features through the channel attention submodule, and extract the spatial features of local features through the multi-scale spatial attention submodule.
[0055] Step S320: The channel features and spatial attention are fused according to the weight parameters through the dynamic fusion submodule to obtain key features; where the weight parameters represent the contribution of the channel features and spatial features to the current input.
[0056] Step S330: Extract the basic features of the local features through the second residual branch.
[0057] Step S340: Perform residual connection between the basic features and the key features to obtain the output features.
[0058] See Figure 5 , Figure 5 This represents the structure of the Dynamically Fusion Attention Module (DFAM). DFAM consists of a main path and a second residual branch. The main path comprises parallel-connected Channel Attention Submodule (CAM) and Multi-Scale Spatial Attention Submodule (MSAM), which are then fused by the Dynamic Fusion Submodule (DFM). The second residual branch consists of sequentially connected average pooling layers, convolutional layers, and activation functions. See also... Figure 6 The Multi-Scale Spatial Attention Submodule (MSAM) consists of parallel max pooling and average pooling layers, followed by a concatenation layer, then a multi-scale convolutional layer composed of three parallel convolutions, and finally a sigmoid activation function to obtain multi-scale spatial features.
[0059] In this embodiment, the input data is first fed in parallel into the Channel Attention Submodule (CAM) and the Multi-Scale Spatial Attention Submodule (MSAM) to extract channel features and spatial features, respectively. Then, a learnable adaptive weight is introduced using the Dynamic Fusion Module (DFM) to dynamically adjust the contributions of these two types of attention information. The weight parameters are scaled to between 0 and 1 using an activation function to ensure a balanced and reasonable fusion process of the two attention information types. This process can be formally represented by the following mathematical formula: (14) (15) (16) Where F represents the input feature map, and These represent the computational results of the Channel Attention Submodule (CAM) and the Multi-Scale Spatial Attention Submodule (MSAM), respectively. This represents the Sigmoid activation function. and These represent the weight parameters for channel attention and spatial attention, respectively, and these weights are continuously updated during training.Z This represents the output of the dynamic fusion attention module.
[0060] Finally, to ensure that the attention mechanism does not overlook certain key features, the input data processed by simple convolution is added to the features processed by DFM (Dynamic Fusion Submodule) to form residual connections. This fusion of features from different levels effectively enhances the model's expressive power.
[0061] The dynamic fusion attention module in this embodiment fully considers the interaction between channel attention and spatial attention, connecting the channel attention submodule and the spatial attention submodule in parallel. A Dynamic Fusion Module (DFM) submodule dynamically fuses the attention results generated by these two submodules. Simultaneously, a Multi-Scale Spatial Attention Submodule (MSAM) is constructed, replacing the convolutional layers in the original spatial attention submodule with multi-scale convolutional layers composed of three parallel convolutions, further enhancing the extraction and fusion capabilities of deep features. Residual connections are also introduced to further reduce the impact of noise on the parallel attention mechanism, preserving more original important features. The DFAM module integrates operations such as channel attention, multi-scale spatial attention, dynamic attention fusion, and residual connections, exhibiting stronger feature representation capabilities and noise resistance.
[0062] The neural network-based workpiece fault diagnosis method of this application, in the process of the feature extraction submodule processing the main features of the input data, firstly, extracts multi-scale information from the signal through the MSWTC module to obtain local features at high and low frequencies. Secondly, it applies layer normalization to stabilize the data distribution and accelerate and stabilize the model training process. Thirdly, it uses the DFAM (Dynamic Fusion Attention) module to capture key features in the data and introduces a feature fusion (FF) layer for integration; this FF layer uses residual connections with trainable weights, which are dynamically updated during training to adaptively adjust the importance of the extracted features. Fourthly, it performs nonlinear transformations through two convolutional layers in sequence; a batch normalization (BN) layer and a ReLU activation function layer are inserted between the first and second convolutional layers; after the second convolutional layer, a ReLU layer and a dropout layer (dropout rate of 0.2) are added to alleviate the overfitting problem; in addition, a traditional residual connection is introduced to prevent gradient instability and retain more feature information from the original data. The fifth step involves using a fully connected layer to map the high-dimensional features to the dimension of the fault category, thereby obtaining the output result.
[0063] The method for obtaining the target neural network model in this embodiment is as follows: Step S410: Set the initial neural network model and calculate the loss value based on the cross-entropy function.
[0064] Step S420: Update the parameters of the neural network model using the AdamW optimizer based on the loss value.
[0065] Step S430: Select the neural network model with the highest diagnostic accuracy on the validation set as the target neural network model.
[0066] In this embodiment of the application, when training the model, the parameters in the initial neural network model are first set independently, then the cross-entropy function is selected to calculate the loss value, and the AdamW optimizer is used to update the model learning parameters. During the iteration process, the model with the highest accuracy on the validation set is selected as the trained model, i.e., the target neural network model.
[0067] See Table 1, which summarizes the key parameters and signal shapes of each module in the MSWFA-Net architecture, where the signal length is 1024 sampling points.
[0068] Table 1: Key parameters and signal status of each module in the target neural network Note: 'a' indicates the number of fault types.
[0069] This application provides a novel fault diagnosis method based on a fusion attention mechanism and multi-scale separable wavelet transform. By designing two key modules—a multi-scale separable wavelet convolution module with different dilation rates and a multi-scale fusion attention module with different kernel sizes—this method not only improves diagnostic accuracy but also enhances network stability and generalization ability by expanding the receptive field.
[0070] Step S120: The vibration data is processed by the target neural network model to obtain the fault diagnosis result of the workpiece; wherein, the multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, and the dynamic fusion attention module is used to dynamically fuse the channel attention and spatial attention of the local features.
[0071] In this embodiment of the application, the terminal device can extract features from the vibration data according to the target neural network model to obtain fault diagnosis results, and visualize the experimental results through a two-dimensional t-SNE plot, a two-dimensional confusion matrix, and a bar chart.
[0072] This concludes the entire process of a workpiece fault diagnosis method based on a convolutional neural network according to an embodiment of this application.
[0073] This application also provides a workpiece fault diagnosis system based on a convolutional neural network, including: The acquisition module acquires vibration data of the workpiece and a target neural network model. The target neural network model includes a feature extraction module, which comprises a multi-scale separable wavelet convolution module, a dynamic fusion attention module, and a feature fusion layer. The separable wavelet convolution module includes a wavelet transform layer, a multi-scale dilated convolution group, a BN-S submodule, and a first residual branch. The dynamic fusion attention module includes a channel attention submodule, a multi-scale spatial attention submodule, a dynamic fusion submodule, and a second residual branch. The multi-scale spatial attention submodule replaces the convolutional layer of the original spatial attention module with a multi-scale convolutional layer composed of three parallel convolutions. The channel attention submodule and the multi-scale spatial attention submodule are connected in parallel. The data processing module processes vibration data through a target neural network model to obtain fault diagnosis results for the workpiece. Among them, the multi-scale separable wavelet convolution module is used to acquire local features of vibration data at different scales, the dynamic fusion attention module is used to fuse the channel features and spatial features of local features according to weight parameters, and the feature fusion layer is used to perform residual connection between local features and the output of the dynamic fusion attention module.
[0074] It is understood that the workpiece fault diagnosis system based on convolutional neural networks provided in this application corresponds to the workpiece fault diagnosis method based on convolutional neural networks described above. The explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding content in the workpiece fault diagnosis method based on convolutional neural networks, and will not be repeated here.
[0075] This application also provides a computer-readable storage medium storing a computer program for a workpiece fault diagnosis method based on a convolutional neural network, wherein the computer program causes a computer to execute the workpiece fault diagnosis method based on a convolutional neural network as described above.
[0076] This application also provides an electronic device, including: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs including methods for performing a workpiece fault diagnosis method based on a convolutional neural network as described above.
[0077] In summary, compared with existing technologies, it has the following beneficial effects: 1. This application's embodiments design a multi-scale separable wavelet convolution module with three parallel convolutional layers forming a multi-scale convolutional layer. This module extracts low-frequency and high-frequency features at different scales, significantly reducing the number of parameters and computational cost while maintaining high diagnostic accuracy. Furthermore, by setting different dilation rates for the multi-scale separable wavelet convolution module, the receptive field is expanded, enhancing the stability and generalization ability of the neural network.
[0078] 2. The embodiments of this application enhance a convolutional attention module by introducing multi-scale convolution with different kernel sizes, attention features with parallel connections, and residual connections introduced from the sides. This design reduces the sensitivity of the attention mechanism to external factors, thereby improving the stability and generalization ability of the model.
[0079] 3. This application presents a novel neural network model that can perform fault diagnosis by processing workpiece vibration data. It constructs a fault diagnosis framework through multi-scale separable wavelet convolution and fusion attention mechanism, and exhibits strong generalization ability and robustness to noise in complex working conditions.
[0080] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0081] 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 workpiece fault diagnosis method based on convolutional neural networks, characterized in that, include: The system acquires vibration data of the workpiece and a target neural network model. The target neural network model includes a feature extraction module, which comprises a multi-scale separable wavelet convolution module, a dynamic fusion attention module, and a feature fusion layer. The separable wavelet convolution module includes a wavelet transform layer, a multi-scale dilated convolution group, a BN-S submodule, and a first residual branch. The dynamic fusion attention module includes a channel attention submodule, a multi-scale spatial attention submodule, a dynamic fusion submodule, and a second residual branch. The multi-scale spatial attention submodule replaces the convolutional layer of the original spatial attention module with a multi-scale convolutional layer composed of three parallel convolutions. The channel attention submodule and the multi-scale spatial attention submodule are connected in parallel. The vibration data is processed by the target neural network model to obtain the fault diagnosis result of the workpiece; wherein, the multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, the dynamic fusion attention module is used to fuse the channel features and spatial features of the local features according to weight parameters, and the feature fusion layer is used to perform residual connection between the local features and the output of the dynamic fusion attention module.
2. The workpiece fault diagnosis method based on convolutional neural networks according to claim 1, characterized in that, The multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, including: The vibration data is divided into low-frequency sub-bands and high-frequency sub-bands through the wavelet transform layer. The low-frequency subband and high-frequency subband are dilated and convolved by the multi-scale dilated convolution group to obtain low-frequency feature maps and high-frequency feature maps. The BN-S submodule is used to perform affine transformation and inverse wavelet transform on the low-frequency feature map and the high-frequency feature map to obtain the reconstructed features; The basic features of the vibration data are extracted by the first residual branch and connected with the reconstructed features to obtain local features.
3. The workpiece fault diagnosis method based on convolutional neural networks according to claim 1, characterized in that, The process of processing the vibration data using the target neural network model to obtain the workpiece fault diagnosis result includes: The channel features of the local features are extracted by the channel attention submodule, and the spatial features of the local features are extracted by the multi-scale spatial attention submodule. The dynamic fusion submodule fuses the channel features and the spatial features according to the weight parameters to obtain key features; wherein, the weight parameters represent the contribution of the channel features and the spatial features under the current input. The basic features of the local features are extracted using the second residual branch; The basic features and the key features are residually connected to obtain the output features.
4. The workpiece fault diagnosis method based on convolutional neural networks according to claim 2, characterized in that, The first residual branch includes: The system comprises a deep convolutional layer, an activation function, and a BN-S submodule; wherein the BN-S submodule includes a batch normalization layer and an affine transformation layer.
5. The workpiece fault diagnosis method based on convolutional neural networks according to claim 1, characterized in that, The second residual branch includes: Average pooling layer, convolutional layer, and activation function.
6. The workpiece fault diagnosis method based on convolutional neural networks according to claim 1, characterized in that, The process of processing the vibration data using the target neural network model further includes: The vibration data is subjected to average pooling, convolution, batch normalization, and activation processing.
7. The workpiece fault diagnosis method based on convolutional neural networks according to claim 1, characterized in that, The method further includes: The initial neural network model is preset and the loss value is calculated based on the cross-entropy function; The AdamW optimizer is used to update the parameters of the neural network model based on the loss value; The neural network model that achieves the highest diagnostic accuracy on the validation set is selected as the target neural network model.
8. A workpiece fault diagnosis system based on convolutional neural networks, characterized in that, include: The acquisition module acquires vibration data of the workpiece and a target neural network model. The target neural network model includes a feature extraction module, which comprises a multi-scale separable wavelet convolution module, a dynamic fusion attention module, and a feature fusion layer. The separable wavelet convolution module includes a wavelet transform layer, a multi-scale dilated convolution group, a BN-S submodule, and a first residual branch. The dynamic fusion attention module includes a channel attention submodule, a multi-scale spatial attention submodule, a dynamic fusion submodule, and a second residual branch. The multi-scale spatial attention submodule replaces the convolutional layer of the original spatial attention module with a multi-scale convolutional layer composed of three parallel convolutions. The channel attention submodule and the multi-scale spatial attention submodule are connected in parallel. The data processing module processes the vibration data through the target neural network model to obtain the fault diagnosis result of the workpiece; wherein, the multi-scale separable wavelet convolution module is used to obtain local features of the vibration data at different scales, the dynamic fusion attention module is used to fuse the channel features and spatial features of the local features according to weight parameters, and the feature fusion layer is used to perform residual connection between the local features and the output of the dynamic fusion attention module.
9. A computer storage medium, characterized in that, It stores a computer program for a workpiece fault diagnosis method based on a convolutional neural network, wherein the computer program causes a computer to execute a workpiece fault diagnosis method based on a convolutional neural network as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs including methods for performing the convolutional neural network-based workpiece fault diagnosis method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Fault diagnosis method and device based on dynamic separable convolutional neural network
CN115374810A
Cited By
Accurate positioning system for damaged position of impermeable membrane of landfill
CN121878844A