A method, device, medium and equipment for detecting mechanical faults under variable speed conditions
Through the MS-GATv2 multi-scale graph convolution network and adaptive loss weight strategy, the multi-scale feature capture and dynamic adjustment of mechanical fault detection under variable speed conditions is solved, and the accuracy and robustness of the detection are improved.
Patent Information
- Application Number
- CN202510541441.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-28
AI Technical Summary
The prior art is difficult to flexibly capture multi-scale features under variable speed conditions, resulting in insufficient accuracy in mechanical fault detection, and traditional loss functions cannot dynamically adjust the diagnosis difficulty of fault types, affecting the robustness and accuracy of the model.
The multi-scale graph convolution network MS-GATv2 and adaptive loss weight strategy are adopted to build a sparse threshold graph and multi-head attention mechanism layer, and the feature fusion and loss weight are dynamically adjusted to improve the model's adaptability to complex working conditions and fault detection capabilities.
It realizes comprehensive extraction of multi-scale features and outstanding key features under variable speed operating conditions, improves the accuracy and robustness of fault detection, and reduces the probability of false detection and missed detection.
Smart Images

Figure CN120067874B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault detection, and in particular to a method, device, medium and equipment for detecting mechanical faults under speed-changing conditions. Background Art
[0002] As the operating environment of industrial equipment becomes increasingly complex, data characteristics exhibit significant localization and heterogeneity. This is especially true under variable speed conditions, where varying speeds further exacerbate the diversity and complexity of fault types. This variable speed fault diagnosis plays a crucial role in promptly identifying potential issues in equipment operation and improving the reliability and stability of industrial systems. This has prompted many researchers to focus on mechanical fault diagnosis under variable speed conditions, providing a potential direction for future research.
[0003] In recent studies, GNN (Graph Neural Networks) has demonstrated unique advantages in the field of mechanical fault diagnosis, especially in processing monitoring data of variable-speed equipment. This network architecture, with its efficient graph construction capabilities for non-Euclidean data, enables learning and fault detection of structured data, and can capture complex relationships and topological structure characteristics between nodes, providing new ideas and methods for fault diagnosis.
[0004] However, feature extraction in GNN is often limited to a single scale. A single scale processes diverse fault modes and variable speed conditions within a fixed range, which may lead to neglect of local details or global patterns of mechanical equipment, resulting in the need to improve the model's detection accuracy of mechanical defects. Summary of the Invention
[0005] Based on this, in order to solve the technical problems in the prior art, the present invention provides a method, device, medium and equipment for detecting mechanical faults under speed-changing conditions.
[0006] The present invention provides a method for detecting mechanical faults under a speed-changing working condition, comprising:
[0007] Constructing a neural network, the neural network including a single-head attention mechanism layer, a dual-head attention mechanism layer, and a triple-head attention mechanism layer in parallel, a single-head dynamic feature fusion layer, a dual-head dynamic feature fusion layer, and a triple-head dynamic feature fusion layer connected to the output ends of the single-head, dual-head, and triple-head attention mechanism layers in one-to-one correspondence, and a fully connected layer connected to the output ends of the single-head, dual-head, and triple-head dynamic feature fusion layers at the same time;
[0008] Obtain different types of speed change fault diagram data of mechanical equipment under speed change conditions, and construct a data set based on the different types of speed change fault diagram data; use the data set to train a neural network to obtain a fault diagnosis model;
[0009] The speed change fault map data to be detected is input into the fault diagnosis model, and the single attention head, double attention head and triple attention head in the single-head attention mechanism layer, double-head attention mechanism layer and triple-head attention mechanism layer are used to extract features of different scales on the speed change fault map data, and obtain single-head fault feature map, double-head fault feature map and triple-head fault feature map; the single-head dynamic feature fusion layer and the double-head dynamic feature fusion layer are used to perform adaptive feature weighted fusion operations on the single-head fault feature map, double-head fault feature map and triple-head fault feature map, and obtain single-head fault weighted feature map, double-head fault weighted feature map and triple-head fault weighted feature map; the single-head fault weighted feature map, double-head fault weighted feature map and triple-head fault weighted feature map are spliced together by the fully connected layer for probability prediction, and the fault type label corresponding to the speed change fault map data to be detected is output.
[0010] Furthermore, the feature extraction of different scales on the transmission fault map data specifically includes:
[0011]
[0012] Among them, h j is the feature of node j; W k is the linear transformation matrix of the kth attention head; is the attention weight of node j output by the kth attention head; j∈N (i) Indicates that node j belongs to the set of neighbor nodes of node i; K is the number of attention heads, K = {1, 2, 3}; It is the feature of node i generated after the attention mechanism is processed.
[0013] Furthermore, the adaptive feature weighted fusion operation specifically includes:
[0014]
[0015] Among them, H K is the fault weighted feature map.
[0016] Furthermore, the data set is constructed based on different types of transmission fault map data, specifically including:
[0017] Calculate the Euclidean distance between each node in the fault graph data and set the threshold d according to the distribution of the Euclidean distance between each node th , retain the Euclidean distance between nodes in the fault graph data that is less than or equal to the threshold d th The edges between the nodes of the graph are obtained:
[0018]
[0019] d th=Percentile(D,q)
[0020]
[0021] Among them, x i,m and x j,m are the eigenvalues of node i and node j in the mth dimension respectively; n is the dimension of the eigenvector; d i,j is the Euclidean distance between node i and node j; Percentile(·) represents the quantile threshold function, and D represents the set of Euclidean distances between all pairs of nodes, which is d i,j The complete set of; q represents percentile; A ij is the adjacency matrix in the underlying graph structure;
[0022] Set the deletion ratio p, randomly delete some edges in the basic graph structure according to the deletion ratio p, and obtain a sparse graph structure:
[0023]
[0024] Among them, A' ij is the adjacency matrix of the sparse graph structure;
[0025] Add the corresponding fault type label to each sparse graph structure to obtain the data set.
[0026] Furthermore, the use of the data set to train the neural network specifically includes:
[0027] Use the cross entropy loss function to calculate the initial loss between the predicted fault type label output by the neural network and the true fault type label;
[0028] Based on the ALW strategy, the loss ratio of different types of faults is dynamically calculated, and a guiding factor is introduced to adaptively adjust the weight distribution of each fault type to obtain the total loss:
[0029]
[0030] Where C is the guiding factor; N is the total number of fault types; e t is the epoch at time t in the training phase; e max is the maximum epoch; l is the fault type label, l = {1, 2, 3..., N}; is the initial loss of the lth fault type at time t in the training phase; is the initial loss of the lth fault type at time t-1 in the training phase; is the training speed of the lth fault type at time t in the training phase; The loss weight of the lth type of fault at time t in the training phase; Loss tis the total loss at time t in the training phase:
[0031] The optimization objective of the optimizer is to minimize the total loss, and the optimizer is used to iteratively update the parameters in the neural network.
[0032] Furthermore, the probability prediction is performed after splicing the single-head fault weighted feature map, the double-head fault weighted feature map, and the triple-head fault weighted feature map, specifically including:
[0033] The single-head fault weighted feature map, the double-head fault weighted feature map, and the triple-head fault weighted feature map are spliced to form a spliced feature vector;
[0034] After weighting the concatenated feature vector, nonlinear processing is performed through the ReLU activation function to obtain a nonlinear weighted concatenated feature vector;
[0035] The nonlinear weighted concatenated feature vector is mapped to the probability distribution of fault categories through the Softmax function, and the fault category with the highest probability is taken as the output.
[0036] Furthermore, the acquisition of different types of speed change fault diagram data of the mechanical equipment under speed change conditions specifically includes:
[0037] Collect fault vibration sensor data of mechanical equipment under variable speed conditions;
[0038] The fault vibration sensor data is transformed from the time domain to the frequency domain. In the frequency domain, each sampling point is used as a node, the frequency domain eigenvalue corresponding to each sampling point is used as the point feature, and edges are constructed between adjacent sampling points to obtain the fault diagram data of the mechanical equipment under the speed change condition.
[0039] The present invention provides a mechanical fault detection device under a speed change condition, comprising:
[0040] A model construction module is used to construct a neural network, wherein the neural network includes a single-head attention mechanism layer, a dual-head attention mechanism layer, and a triple-head attention mechanism layer in parallel, a single-head dynamic feature fusion layer, a dual-head dynamic feature fusion layer, and a triple-head dynamic feature fusion layer connected to the output ends of the single-head, dual-head, and triple-head attention mechanism layers in a one-to-one correspondence, and a fully connected layer connected to the output ends of the single-head, dual-head, and triple-head dynamic feature fusion layers simultaneously;
[0041] The model training module is used to obtain different types of speed change fault diagram data of mechanical equipment under speed change conditions, build a data set based on the different types of speed change fault diagram data, and use the data set to train the neural network to obtain a fault diagnosis model;
[0042] The fault detection module is used to input the speed change fault map data to be detected into the fault diagnosis model, and perform feature extraction of different scales on the speed change fault map data through the single attention head, double attention head and triple attention head in the single-head attention mechanism layer, the double-head attention mechanism layer and the triple-head attention mechanism layer, respectively, to obtain the single-head fault feature map, the double-head fault feature map and the triple-head fault feature map; perform adaptive feature weighted fusion operation on the single-head fault feature map, the double-head fault feature map and the triple-head fault feature map through the single-head dynamic feature fusion layer and the double-head dynamic feature fusion layer, respectively, to obtain the single-head fault weighted feature map, the double-head fault weighted feature map and the triple-head fault weighted feature map; splice the single-head fault weighted feature map, the double-head fault weighted feature map and the triple-head fault weighted feature map through the fully connected layer, and perform probability prediction to output the fault type label corresponding to the speed change fault map data to be detected.
[0043] The present invention provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting mechanical faults under the above-mentioned speed-changing working condition is implemented.
[0044] The present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for detecting mechanical faults under the above-mentioned speed-changing working condition is implemented.
[0045] At least one of the above technical solutions adopted by the present invention can achieve the following beneficial effects:
[0046] In the mechanical fault detection method under variable speed conditions provided by the present invention, through the parallel single-head, dual-head, and triple-head attention mechanism layer architecture and adaptive dynamic weight allocation, the model can effectively address the non-stationary problem of signals under variable speed conditions: the multi-scale network architecture can extract information at different time or frequency scales, enhance adaptability to complex working conditions, achieve multi-granularity coverage of fault features, and improve the comprehensiveness and robustness of feature extraction; while the adaptive weight allocation can dynamically adjust the importance of features at different scales, making key features more prominent, optimizing feature selection, and thus improving the accuracy of fault detection. The combination of the two allows the model to dynamically adjust the importance of information at each scale according to the current working conditions, helping the model to more accurately identify fault features under variable speed conditions and reduce the probability of false detection and missed detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0048] Figure 1A schematic flow chart of a method for detecting mechanical faults under speed-changing conditions provided by the present invention;
[0049] Figure 2 Schematic diagram of the GATv2 weighted feature aggregation process provided by the present invention;
[0050] Figure 3 This is a schematic diagram of the MS-GATv2 model structure provided by the present invention;
[0051] Figure 4 Schematic diagram of the data acquisition device provided by the present invention, Figure 4 (a) is a bearing failure simulation test bench. Figure 4 (b) is a gearbox fault simulation test bench;
[0052] Figure 5 This is a visualization diagram of multi-state vibration signals under variable speed conditions provided by the present invention. Figure 5 (a1) is the normal waveform of the bearing. Figure 5 (b1) is the normal waveform of the gearbox. Figure 5 (a2) is the bearing rolling element defect waveform, Figure 5 (b2) is the gear tooth root crack waveform. Figure 5 (a3) is the waveform of the bearing composite defect. Figure 5 (b3) is the gear tooth wear waveform. Figure 5 (a4) is the defect waveform of the bearing inner ring. Figure 5 (b4) is the gear missing tooth waveform, Figure 5 (a5) is the defect waveform of the bearing outer ring. Figure 5 (b5) is the gear tooth breaking waveform;
[0053] Figure 6 A schematic diagram of the process of constructing dynamic graph data provided by the present invention;
[0054] Figure 7 A schematic diagram of the ALW strategy provided by the present invention;
[0055] Figure 8 The present invention provides different graph structure construction methods and their corresponding confusion matrix results. Figure 8 (a) is the STG method, Figure 8 (b) in the example is the FCG method. Figure 8 (c) in the figure is the KCG method;
[0056] Figure 9 This is a schematic diagram of the impact of different p-values on the model accuracy provided by the present invention. Figure 9 (a) in the example is the result of case 1. Figure 9 (b) in the figure is the result of Case 2;
[0057] Figure 10 The two-dimensional visualization results of the encoding features of different models provided by the present invention are: Figure 10 (a) is the two-dimensional visualization result of the encoding features of the SAMS-GAT model. Figure 10 (b) in the figure is a two-dimensional visualization of the encoding features of the Chebynet model. Figure 10 (c) in the figure is a two-dimensional visualization of the encoding features of the GCN model. Figure 10 (d) in the figure is a two-dimensional visualization of the encoding features of the SGCN model. Figure 10 (e) in the figure is a two-dimensional visualization result of the encoding features of the GAT model. Figure 10 (f) in the figure is the two-dimensional visualization result of the GIN model encoding features. Figure 10 (g) in the figure is a two-dimensional visualization of the encoding features of the GraphSage model. Figure 10 (h) is the two-dimensional visualization result of the encoding features of the HO-GNN model;
[0058] Figure 11 This is a schematic diagram of the ALW strategy update process provided by the present invention. Figure 11 (a) is the ALW strategy update process of case 1. Figure 11 (b) is the ALW strategy update process of case 2;
[0059] Figure 12 This is a schematic diagram comparing the test accuracy of the ALW, SWA and RWU methods provided by the present invention. Figure 12 (a) is the ALW strategy update process of case 1. Figure 12 (b) is the ALW strategy update process of case 2; DETAILED DESCRIPTION
[0060] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present invention and corresponding drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.
[0061] As the operating environment of industrial equipment becomes increasingly complex, data characteristics exhibit significant localization and heterogeneity. This is especially true under variable speed conditions, where varying speeds further exacerbate the diversity and complexity of fault types. This variable speed fault diagnosis plays a crucial role in promptly identifying potential issues in equipment operation and improving the reliability and stability of industrial systems. This has prompted many researchers to focus on mechanical fault diagnosis under variable speed conditions, providing a potential direction for future research.
[0062] Because traditional methods typically model based on fixed operating data, they struggle to flexibly address the dynamic characteristics and diverse fault types associated with variable speed operating conditions. In recent research, GNNs have garnered increasing attention in the field of variable speed fault diagnosis. This architecture, leveraging its efficient graph construction capabilities for non-Euclidean data, enables learning and fault detection from structured data. It can capture complex relationships and topological features between nodes, providing new insights and approaches for fault diagnosis. Yuan et al. integrated fault data with information about the physical structure and dynamic characteristics of bearings into a unified graph model. By combining node features, edge relationships, and physical constraints, they achieved comprehensive modeling and diagnosis of time-varying bearing faults. Yan et al. proposed a method combining a label propagation strategy with a dynamic graph attention network. This method effectively leverages label dependencies between samples, fully exploits limited label information, and dynamically extracts feature information from different adjacent nodes under speed fluctuations. Liang et al. proposed an end-to-end semi-supervised subdomain adaptive graph convolutional network method to extract transferable features, reduce the distribution differences between the source and target domains, and overcome the impact of speed fluctuations. Li et al. proposed a semi-supervised fault diagnosis method based on a multi-head dynamic graph attention network. By introducing dynamic time warping similarity and pseudo-labeling mechanism, they effectively solved problems such as time offset and insufficient utilization of neighborhood information.
[0063] In fault diagnosis tasks, the complexity and optimization difficulty of different fault types often vary significantly. Traditional loss functions typically use fixed weight distribution strategies, making it difficult to dynamically adapt to these differences. In recent years, fault diagnosis methods based on dynamic loss function updates have become a research hotspot. Zhang et al. proposed dynamic metric learning and an improved triplet loss function to more accurately model the complex relationships between vibration signals, generating an adjacency matrix that reflects the similarity and correlation between nodes, thereby improving the robustness and expressiveness of graph structure construction. Yan et al. designed a dynamic weight optimization strategy that adaptively adjusts the data reconstruction loss weights under different operating conditions to flexibly balance the contributions of various data types, aiming to guide the model to more effectively learn generalized features with broad applicability. Wang et al. proposed a dynamic spectral loss to effectively overcome the bottleneck of synthesizing difficult frequency components in the data. Based on spectral distance, this method introduces a dynamic weight matrix to reduce the weight of easy-to-synthesize frequencies in the spectrum while adaptively increasing the focus on difficult-to-synthesize frequencies. The loss function designed by Zhou et al. does not require additional adjustable parameters. Thanks to its inherent dynamic mechanism, it effectively improves prediction accuracy and the progressiveness of the training process while maintaining model simplicity, demonstrating strong adaptability and robustness.
[0064] Research on fault diagnosis under variable speed conditions faces three major challenges, which significantly restrict the performance and robustness of these methods under complex operating conditions. First, traditional fixed-graph data approaches struggle to adapt to dynamic operating conditions and cannot fully capture the dynamic relationships and complex topological characteristics between nodes. In particular, under diverse operating conditions and speed fluctuations, fixed graph structures are prone to information loss, which weakens their ability to represent system characteristics. Dynamic graph data, on the other hand, can effectively compensate for this information loss by dynamically adjusting and reconstructing the relationship structure. Second, feature extraction is often limited to a single scale and lacks the ability to comprehensively utilize multi-scale information. This limitation is particularly pronounced when dealing with diverse fault modes or complex dynamic conditions, potentially leading to neglect of local details or global patterns, further limiting the model's generalization and adaptability. Furthermore, single-scale strategies struggle to cope with the diverse fault characteristics under different operating conditions and fail to provide comprehensive information support for the model. Finally, traditional loss functions assign equal attention to all fault types, ignoring the significant differences in diagnostic difficulty among different fault types and making it difficult to dynamically adjust the focus on challenging fault types or key features. Under complex operating conditions and variable data distribution, this strategy not only weakens the ability to learn key features but also limits the model's ability to handle unbalanced data, further impacting diagnostic accuracy and robustness. Therefore, to better address the diverse challenges of variable speed operating conditions, it is necessary to introduce a dynamic graph structure to dynamically capture inter-node correlations, employ a multi-scale feature fusion strategy to comprehensively extract key information, and incorporate a dynamic loss optimization mechanism to flexibly adjust the model's focus. This will comprehensively improve the diagnostic capability and robustness for complex operating conditions and diverse faults.
[0065] Based on this, this paper proposes a new fault detection method that aims to cope with the complexity of data under variable speed conditions and improve detection accuracy and model robustness. The main innovations of this method can be summarized as follows: (1) A sparse threshold graph is constructed to flexibly capture the local geometric structure of variable speed data and enhance the adaptability of the graph model to dynamic environments; (2) A multi-scale attention graph convolution layer is designed to effectively extract multi-level graph structure information, realize multi-scale feature fusion, and improve the ability to capture diverse fault characteristics; (3) An adaptive loss weight strategy is developed to dynamically adjust the loss weight to judge the diagnostic difficulty of different fault types, thereby enhancing the model's attention and optimization capabilities for complex faults. Experimental results show that this method performs excellently on variable speed conditions and complex data sets, can effectively adapt to the data distribution characteristics under different speed changes, and exhibits higher detection accuracy and robustness.
[0066] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0067] Figure 1The following is a flow chart of a mechanical fault detection method under a speed change condition in this embodiment, which specifically includes the following steps:
[0068] S1: Construct a neural network, which includes parallel single-head attention mechanism layers, dual-head attention mechanism layers, and triple-head attention mechanism layers, single-head dynamic feature fusion layers, dual-head dynamic feature fusion layers, and triple-head dynamic feature fusion layers that are connected one-to-one to the output ends of the single-head, dual-head, and triple-head attention mechanism layers, and fully connected layers that are simultaneously connected to the output ends of the single-head, dual-head, and triple-head dynamic feature fusion layers.
[0069] Traditional GNNs have difficulty in capturing both local and global features simultaneously when processing complex graph data, and have limited expressive capabilities for multi-scale structures. In addition, their feature fusion methods lack flexibility, making them difficult to adapt to dynamic working conditions and non-uniform data distribution, and their robustness to abnormal data is insufficient. In order to address these problems, the present invention adopts MS-GATv2 (Multi-Scale GraphAttenTion convolution v2) to efficiently capture graph features of different scales, and adopts the DWU (Dynamic Weight Update) method to improve the expressive power and robustness of the model under complex working conditions, thereby better meeting the needs of complex graph data processing.
[0070] Before introducing MS-GATv2, you need to understand the GATv2 network model. GATv2 is an improved model of the traditional GAT (Graph AttenTion network). By introducing dynamic attention mechanisms and nonlinear feature interactions, it significantly improves the expressive power of modeling relationships between nodes. The traditional GAT uses static linear transformations to calculate attention weights, which limits the ability to model complex nonlinear feature interactions. GATv2 dynamically calculates the attention weights between nodes through MLP (MultiLayerPerceptron), thereby being able to capture more complex relationships between nodes. Specifically, GATv2 can not only flexibly adjust weight distribution according to the dynamic interaction relationship of node features, but also more efficiently combine neighboring node features to construct high-quality node representations through weighted aggregation. The key calculation process of GATv2 includes the following steps:
[0071] (1) The attention score e between node i and node j ij Calculated by the following formula:
[0072] e ij =MLP([h i ||h j ]);
[0073] Among them, hi and h j are the features of node i and node j; || represents feature concatenation; MLP represents a multi-layer perceptron, which is used to dynamically model the feature relationship between nodes.
[0074] (2) Use the Softmax function to normalize the attention scores of the neighboring nodes of node i to obtain the attention weight α ij :
[0075]
[0076] Among them, N (i) Represents the set of neighbor nodes of node i.
[0077] (3) Feature aggregation is achieved through weighted summation, and node feature update is completed by combining the linear transformation matrix W and the activation function σ. The GATv2 weighted feature aggregation process is as follows: Figure 2 As shown, where i=1, j={1, 2, 3, 4, 5, 6}:
[0078]
[0079] Where σ represents the activation function and W is the learnable linear transformation matrix.
[0080] The MS-GATv2 network structure constructed by the present invention is as follows Figure 3 As shown in the figure, this network is an innovative multi-scale graph convolution method. By combining multi-head attention mechanisms with different numbers of heads (Head=1, Head=2, Head=3), it effectively captures feature information at different levels in the graph structure. Each head independently models the feature relationship between nodes within the same neighborhood through different attention mechanisms, and averages the results of each head at output. Head=1 provides a single attention allocation to capture basic feature relationships. Head=2 adds an independent head to enrich the features. Head=3 further improves the diversity and robustness of feature learning through the multi-head mechanism. Figure 3 As shown in Figure 2, the model consists of MS-GATv2, a DFF layer (Dynamic Feature Fusion layer), and an FC layer (Fully Connected layer). A multi-head attention mechanism dynamically adjusts the feature interactions between a node and its neighbors. Each head independently calculates attention weights and feature updates to ensure that feature information at different scales is fully expressed. GATv2 feature calculations for different numbers of heads are as follows:
[0081]
[0082] Among them, h jis the feature of node j; W k is the linear transformation matrix of the kth attention head; is the attention weight of node j output by the kth attention head; j∈N (i) Indicates that node j belongs to the set of neighbor nodes of node i; K is the number of attention heads, K = {1, 2, 3}; is the node i feature generated after processing by the attention mechanism. Through the parallel single-head, dual-head, and triple-head attention mechanism layer architecture, the model can integrate information from different attention branches to form a more comprehensive, multi-scale fault feature representation. This fused feature representation is more conducive to making accurate fault detection decisions. Specifically, the single-head attention mechanism captures local details and can focus on the specific location and subtle features of the fault; the dual-head attention mechanism balances local and slightly larger-scale features, which helps understand the propagation and impact of faults in local areas; the three-head attention mechanism captures information from a more global perspective, achieving multi-granular coverage of fault features; each attention mechanism branch has an independent adaptive weight allocation mechanism, which means that the model can dynamically adjust the importance of information at each scale based on the current operating conditions, helping the model to more accurately identify fault features under variable speed conditions.
[0083] After obtaining different numbers of multi-head attention features, the DWU strategy is used to fuse features of different scales. This strategy can adaptively adjust the contribution ratio of different features, allowing the model to flexibly allocate attention according to task requirements. By dynamically learning weights, the model can highlight the most important feature scales while suppressing irrelevant or redundant information, thereby improving the effectiveness of feature expression. In addition, dynamic weight fusion can integrate multi-scale information based on the multi-head attention mechanism, not only preserving the diversity of features, but also optimizing the balance of feature fusion, greatly enhancing the robustness and generalization ability of the model in complex data structures. The calculation process is as follows:
[0084]
[0085] Among them, H K The output of the MS-GATv2 module is batch normalized (BN) and activated nonlinearly with the ReLU function, and then fused with the output of the DWU module to obtain the output of the DFF layer.
[0086] Finally, the weighted feature maps for single-, dual-, and triple-head faults are concatenated to form a final feature vector as input. The input features then undergo a linear transformation, using a trainable weight matrix and bias term for weighted summation to extract deeper features. This is followed by a nonlinear activation function (ReLU) to introduce nonlinearity and enhance the model's expressiveness. Finally, the output layer uses Softmax to calculate the probability distribution of each category, enabling classification and prediction of mechanical faults.
[0087] S2: Obtain different types of speed change fault diagram data of mechanical equipment under speed change conditions, and construct a data set based on the different types of speed change fault diagram data; use the data set to train a neural network to obtain a fault diagnosis model.
[0088] S21: Build dataset.
[0089] S211: Obtaining an original fault data set.
[0090] Case 1: Dataset 1 comes from the mechanical bearing failure test bench of the University of Ottawa, such as Figure 4 (a) shows the motor, encoder, healthy bearing, accelerometer, experimental bearing, and AC drive. The dataset includes five bearing conditions: normal, inner race defect, outer race defect, ball defect, and a combination of inner race, outer race, and ball defects. During the experiment, vibration signals were collected during two deceleration cycles. Acceleration was sampled and analyzed under speed fluctuations of 14.1 Hz to 23.8 Hz at a sampling frequency of 200 kHz.
[0091] Case 2: Dataset 2 comes from the Beijing Jiaotong University rail transit train bogie transmission system fault simulation test bench, such as Figure 4 (b) shows the gearbox, motor, and accelerometer. The dataset includes nine gearbox conditions: normal, tooth root cracks, tooth surface wear, missing teeth, broken teeth, bearing inner race fault, bearing outer race fault, bearing rolling element fault, and bearing cage fault. During the experiment, vibration data was collected and analyzed at speeds of 20 Hz, 40 Hz, and 60 Hz, with a sampling frequency of 64 kHz.
[0092] For the two datasets mentioned above, the samples used in this invention are shown in Table 1. In Case 1, the time-varying speed of the test bench increases from 14.1 Hz to 23.8 Hz. There are 50 training samples and 50 test samples in each state, and the length of each sample is 4096. In Case 2, the variable speed samples in each state of the test bench are 20 Hz, 40 Hz, and 60 Hz, respectively. There are 30 training samples and 30 test samples at different speeds in each state. The three speeds are spliced into variable speed data. Therefore, the total number of training samples and test samples in each state is 90, and the length of each sample is also 4096. Figure 5 The differences in the time domain waveform characteristics of the two speed-changing data sets under five equipment operating conditions are shown, including normal conditions and various fault conditions. Figure 5 (a1) is the normal waveform of the bearing. Figure 5 (b1) is the normal waveform of the gearbox. Figure 5 (a2) is the bearing rolling element defect waveform, Figure 5 (b2) is the gear tooth root crack waveform. Figure 5 (a3) is the waveform of the bearing composite defect. Figure 5 (b3) is the gear tooth wear waveform. Figure 5 (a4) is the defect waveform of the bearing inner ring. Figure 5 (b4) is the gear missing tooth waveform, Figure 5 (a5) is the defect waveform of the bearing outer ring. Figure 5 Figure (b5) shows the waveform of a broken gear tooth. As can be seen from the figure, the complexity of the waveform characteristics increases significantly as the equipment state changes: under normal conditions, the waveform is stable with minimal amplitude variation; under fault conditions, however, the amplitude fluctuations increase, and the signal irregularity and suddenness increase significantly. In particular, complex fault conditions such as combined defects and broken teeth exhibit highly nonlinear and multi-band coupling characteristics. This significant complexity increases the difficulty of fault diagnosis based on time-domain signals and also reflects the diversity and challenges of transmission equipment fault data.
[0093] Table 1 Experimental sample usage
[0094]
[0095] Graph data in real scenarios often have redundant connection problems due to noise interference, which not only increases the computational burden, but also may mask the key relationships between nodes and reduce the learning effect of the model. In addition, real speed-changing data has a certain volatility, and traditional fixed-connection graph structures are difficult to effectively simulate this characteristic, which limits the model's adaptability to complex dynamic environments. In response to the above problems, the present invention proposes a method for constructing a sparse threshold graph, which aims to reduce redundant connections and improve the adaptability of the graph model to complex data. The process is as follows: Figure 6shown.
[0096] S212: The collected original fault data of the mechanical equipment under the variable speed working condition is transformed from the time domain to the frequency domain through FFT (Fast Fourier Transform); in the frequency domain, the "sampling point" is used as the node, the "adjacent sampling point" is used as the edge, and the "node characteristic value" is used as the node feature.
[0097] A vibration sensor collects sensor data from the bearing during operation over a preset time period. This data is then partitioned to obtain several nodes in the time domain signal. FFT is then used to transform these nodes from the time domain to the frequency domain, and edges are constructed by searching for adjacent nodes within the frequency domain. This process builds a graph model based on the frequency domain data, where each node represents a frequency component, its eigenvalue represents the amplitude of that frequency component, and edges between nodes represent the relationship between adjacent frequency components.
[0098] S213: retaining edges between nodes in the fault graph data whose Euclidean distance between nodes is less than or equal to a threshold, and obtaining a basic graph structure.
[0099] First, by calculating the Euclidean distance between nodes, the threshold d is set according to the data distribution. th , determines whether nodes are connected and retains only edges with a distance less than or equal to a threshold, thereby constructing a basic graph structure. This method can effectively filter out weakly related or irrelevant connections, retain high-quality node relationships, reduce noise interference, and improve the graph's representation capabilities. Its calculation formula is as follows:
[0100]
[0101] Among them, x i,m and x j,m are the eigenvalues of node i and node j in the mth dimension respectively; n is the dimension of the eigenvector; d i,j is the Euclidean distance between node i and node j; Percentile(·) represents the quantile threshold function, and D represents the set of Euclidean distances between all pairs of nodes, which is d i,j The complete set of; q represents percentile; A ij is the adjacency matrix in the underlying graph structure.
[0102] S214: Setting a deletion ratio p, randomly deleting some edges in the basic graph structure according to the deletion ratio p, to obtain a sparse graph structure.
[0103] Based on the constructed basic graph, a random edge deletion strategy is further introduced. By setting the deletion ratio p, edges that meet the distance threshold are deleted or retained in a random manner, and finally a sparse graph structure is generated. Figure 6 As shown in , different deletion ratios p can randomly delete adjacent edges to reduce the density of the graph, optimize computational efficiency, and introduce moderate perturbations to enhance the model's robustness to dynamic conditions and complex topological structures. The calculation process is as follows:
[0104]
[0105] Among them, A' ij is the adjacency matrix of the sparse graph structure after random deletion; p is the ratio of adjacent edges deleted in the graph, and p can be set to 0.1, 0.5 or 0.9.
[0106] S215: Add a corresponding fault type label to each sparse graph structure to obtain a data set.
[0107] S22: Train a neural network using a dataset.
[0108] S221: Setting model related parameters.
[0109] The model-related parameters are set as shown in Table 2.
[0110] Table 2 Model related parameters
[0111]
[0112] S222: Set the loss function.
[0113] Most existing fault diagnosis methods fail to fully consider the differences between different fault modes in their loss design. This deficiency makes it difficult for the model to maintain a balanced diagnostic capability for all faults when faced with complex operating conditions or diverse fault types. This is particularly true for some difficult-to-diagnose fault modes, severely impacting overall diagnostic performance. Furthermore, some methods often employ fixed loss allocation strategies, paying insufficient attention to the characteristics of certain important fault types in complex operating conditions, thus weakening the model's adaptability and generalization capabilities. To address this issue, this method proposes an ALW (Adaptive Loss Weighting) strategy.
[0114] The process of ALW strategy is as follows Figure 7 As shown in Figure 1, first, a guidance factor C is designed to dynamically adjust the training phase. In the early stages of training, the value of the dynamic guidance factor C in the formula is large. At this time, the guidance factor will amplify the impact of the loss ratio of different fault modes, ensuring that the loss weights of all fault modes are relatively close, thereby guiding the model to pay more balanced attention to all global fault modes. Then, as training progresses, e t Gradually approaching the maximum value e max, causing C to gradually decrease and approach 1. At this time, the amplification effect of the guidance factor on the training rate is weakened, and the loss ratio dominates. Finally, for the failure mode that is difficult to diagnose (the loss decreases slowly), the training speed is will be larger, thus increasing the value in the weight, guiding the model to focus more on diagnosing these difficulties. The process is as follows Figure 7 As shown in Figure 2, compared with the non-ALW strategy, this method can more accurately guide the update of model parameters:
[0115]
[0116] Where C is the guiding factor; N is the total number of fault types; e t is the epoch at time t in the training phase; e max is the maximum epoch; l is the fault type label, l = {1, 2, 3..., N}; is the initial loss of the lth fault type at time t in the training phase; is the initial loss of the lth fault type at time t-1 in the training phase; is the training speed of the lth fault type at time t in the training phase; The loss weight of the lth type of fault at time t in the training phase; Loss t is the total loss at time t in the training phase.
[0117] S223: Taking the minimum total loss as the optimization goal of the optimizer, the optimizer is used to iteratively update the parameters in the neural network. The weight update formula based on the loss function is:
[0118]
[0119] Where H represents the final fused feature; y′ is the predicted label, y is the true label; Loss(·) is the cross entropy loss function; η is the learning rate; t and t+1 are the number of iterations.
[0120] S23: Model effect verification.
[0121] To demonstrate the superiority of the proposed method, eight existing methods were used for comparison, including Chebynet, graph convolutional networks (GCN), simplifying graph convolutional networks (SGCN), graph sample and aggregate (GraphSage), graph isomorphism network (GIN), higher-order graph neural network (HO-GNN), and graph attention network (GAT). The fault diagnosis evaluation metrics involved included accuracy, precision, recall, and area under the curve (AUC).
[0122] The experimental results for Case 1 and Case 2 are shown in Tables 3 and 4, respectively. In Case 1, SAMS-GAT (Sparse Threshold Graph and Adaptive Loss Weighting Multi-Scale Attention Model) demonstrated excellent performance, achieving an accuracy of 99.20%, significantly outperforming other methods. GCN achieved an accuracy of 95.60%, a gap of approximately 3.6%. SAMS-GAT also led the pack in key metrics such as precision (98.03%), recall (98.00%), and AUC (99.99%). These data demonstrate not only SAMS-GAT's high accuracy in classification tasks but also its stability and robustness in complex network environments. Among the compared methods, traditional models (such as ChebNet and HO-GNN) performed relatively poorly. While other advanced models (such as GCN and GAT) performed well in some metrics, they were generally inferior to SAMS-GAT.
[0123] In Case 2, SAMS-GAT once again demonstrated its exceptional performance, achieving an accuracy of 98.15%, significantly exceeding the other compared methods. GAT achieved an accuracy of 90.13%, with a gap of nearly 8%. This result fully demonstrates SAMS-GAT's superiority in accuracy. Furthermore, SAMS-GAT also performed strongly in other key metrics, such as precision of 98.24%, recall of 97.22%, and an AUC of 99.96%. These results not only validate SAMS-GAT's robustness in classification tasks but also demonstrate its strong adaptability in diverse scenarios.
[0124] Table 3 Experimental results of Case 1
[0125]
[0126]
[0127] Table 4 Experimental results of Case 2
[0128] Methods Accuracy(%) Precision(%) Recall (%) AUC (%) SAMS-GAT 98.15 98.24 97.22 99.96 chebynet 54.84 53.67 56.27 83.88 GCN 89.26 92.10 86.28 99.85 SGCN 65.56 75.84 67.56 97.14 GraphSage 76.40 91.51 60.67 93.35 GIN 71.48 79.84 7.13 95.80 HO-GNN 85.10 87.66 85.87 97.10 GAT 90.13 93.14 89.92 97.66
[0129] This paper evaluates the performance of the STG (Sparse Threshold Graph) module in classification tasks by comparing it with two other graph construction methods. The first method is FCG (Fully Connected Graph), which uses all node data for global information fusion, but has high information redundancy; the second method is K-Nearest Connected Graph (KCG), which selects 4 neighbor nodes based on KNN to construct a sparse graph and can capture local features; the STG method proposed in this paper reduces noise interference while retaining key connections by randomly removing redundant edges. The three graph construction methods are as follows: Figure 8 As shown in the confusion matrix, the STG method achieves high classification accuracy in all categories. The correct classification numbers for categories 0 to 4 are 50, 48, 50, 50, and 50, respectively. There are very few misclassifications, which demonstrates the robustness and accuracy of the method in complex data environments.
[0130] In contrast, the FCG method performed poorly in the classification of categories 2 and 3. Eleven samples of category 1 were misclassified as category 0, nine samples of category 2 were misclassified as category 1, and 19 and 26 samples of category 3 were misclassified as categories 2 and 4, respectively. This suggests that the redundant information in the fully connected graph may lead to the model's high sensitivity to noise. The KCG method has a strong ability to extract local features, but only 46 and 41 samples were correctly classified for categories 1 and 4, respectively, indicating significant misclassification, especially for categories 2 and 3. Overall, the STG method effectively enhances the balance between global information and local associations by optimizing graph structure construction, while significantly reducing the impact of noise on graph construction quality, thereby improving classification accuracy and system robustness.
[0131] In addition, the present invention also explores the effect of p-value (the ratio of adjacent edges deleted) on the model. The results are as follows: Figure 9 As shown, Figure 9 (a) in the example is the result of case 1. Figure 9(b) in Figure 2 shows the results for Case 2. Overall, as the p-value increases, the model accuracy in both cases shows a slight downward trend. Case 2 has slightly higher accuracy and less fluctuation at high p-values, demonstrating greater adaptability. Both cases show that at low p-values, the model accuracy is above 97%, and even when there is some missing information or incomplete structure in the actual network, the model can still maintain high accuracy. As the p-value increases to 0.9, the accuracy decreases slightly, but still remains above 95%, indicating that the model has a certain degree of stability and adaptability in the face of network structure interruptions, and can effectively cope with the incomplete graph structure problems that may arise in real work.
[0132] To verify the feature extraction capability of the MS-GATv2 module in the proposed method, SAMS-GAT and seven comparison methods were applied to Case 2 and a comparative experimental analysis was conducted. The encoding features of each method were visualized in two dimensions, as shown in Figure 2. Figure 10 As shown, Figure 10 (a) is the two-dimensional visualization result of the encoding features of the SAMS-GAT model. Figure 10 (b) in the figure is a two-dimensional visualization of the encoding features of the Chebynet model. Figure 10 (c) in the figure is a two-dimensional visualization of the encoding features of the GCN model. Figure 10 (d) in the figure is a two-dimensional visualization of the encoding features of the SGCN model. Figure 10 (e) in the figure is a two-dimensional visualization result of the encoding features of the GAT model. Figure 10 (f) in the figure is the two-dimensional visualization result of the GIN model encoding features. Figure 10 (g) in the figure is a two-dimensional visualization of the encoding features of the GraphSage model. Figure 10 (h) is a two-dimensional visualization of the encoded features of the HO-GNN model. The results show that the proposed method significantly outperforms other methods in distinguishing between normal and faulty samples, demonstrating a strong feature separation capability.
[0133] From the figures, we can observe that: (a) the features extracted by SAMS-GAT have a good clustering effect, with normal samples and various fault samples forming clearly separated clusters, demonstrating high feature discrimination ability; (b) ChebNet and (c) GCN also show a certain degree of sample separation, but the cluster boundaries are relatively fuzzy, and some categories overlap; (d) SGCN's feature extraction ability is relatively weak, the sample distribution is relatively scattered, and the category distinction is not clear; (e) GAT and (g) GraphSage have improved clustering structures, but still have the problem of fuzzy category boundaries compared to SAMS-GAT; (f) GIN and (h) HO-GNN have no obvious pattern in sample distribution, and their ability to distinguish between normal samples and fault samples is the weakest. Therefore, the proposed SAMS-GAT method outperforms other compared methods in both feature extraction and classification performance, and can effectively achieve accurate identification of different types of faults, further verifying the superiority of the MS-GATv2 module.
[0134] Figure 11 It shows the changes in weight updates during the training process of the ALW strategy. Figure 11 (a) is the ALW strategy update process of case 1. Figure 11 (b) in Figure 2 shows the ALW strategy update process for case 2. In the early stages of training, the weight changes for each fault type are relatively small, driven primarily by the guiding factor C, and the model focuses on the overall loss distribution. At this stage, the weight differences between the various fault types are not significant, and the primary goal is to balance the global loss. However, as training progresses, changes in the loss ratio gradually dominate the weight update, at which point the weights for different fault types begin to diverge, and the model begins to focus on fault types that are more difficult to diagnose. Therefore, the ALW strategy gradually amplifies the weights of categories with larger losses in the later stages of training to more effectively diagnose difficult problems. Furthermore, to better observe the differences, the weights of different categories are amplified by the same proportion every 20 batches.
[0135] As can be seen from the figure, the weight change is recorded every 20 training batches, and the weight gradually differentiates as the training progresses, reflecting the dynamic adjustment ability of the model during the optimization process. Figure 9 Taking (a) in the example, the weights of different labels have formed significant differences at epoch 100. The weights of difficult-to-diagnose categories gradually increase, while the weights of easy-to-diagnose categories decrease, indicating that the model tends to focus on difficult samples. Similarly, Figure 9Figure (b) shows a similar trend. The divergence of the weight curves further demonstrates that the ALW strategy can dynamically adjust the model's focus on different categories. By capturing category difficulty information in real time, it adaptively prioritizes learning for difficult-to-diagnose categories. This dynamic adjustment method not only improves the model's optimization performance for complex categories, but also maintains global optimization stability and balance, demonstrating significant potential in handling category imbalance and complex sample scenarios.
[0136] In addition, two methods, Static Weight Adjustment (SWA) and Random Weight Update (RWU), were selected for comparison with the proposed method (ALW). Figure 12 (a) is the ALW strategy update process of case 1. Figure 12 (b) is the ALW strategy update process of case 2, from Figure 12 As can be seen, the ALW method demonstrates significant advantages over the SWA and RWU methods in test accuracy. Specifically, ALW's test accuracy reached approximately 0.85 by the 20th epoch, significantly outperforming SWA's 0.75 and RWU's 0.65. The final test accuracy reached 0.98, significantly higher than SWA's 0.88 and RWU's 0.82. Furthermore, after the 80th epoch, ALW's accuracy curve stabilized with minimal fluctuation, remaining at a high level of 0.97-0.98. In contrast, SWA and RWU not only had lower accuracy but also exhibited greater fluctuations. This demonstrates that the ALW method exhibits significant superiority in terms of convergence speed, final performance, and stability.
[0137] S3: Input the speed change fault map data to be detected into the fault diagnosis model, and perform feature extraction of different scales on the speed change fault map data through the single attention head, double attention head and triple attention head in the single-head attention mechanism layer, double-head attention mechanism layer and triple-head attention mechanism layer, respectively, to obtain single-head fault feature map, double-head fault feature map and triple-head fault feature map; perform adaptive feature weighted fusion operation on the single-head fault feature map, double-head fault feature map and triple-head fault feature map through the single-head dynamic feature fusion layer and double-head dynamic feature fusion layer, respectively, to obtain single-head fault weighted feature map, double-head fault weighted feature map and triple-head fault weighted feature map; splice the single-head fault weighted feature map, double-head fault weighted feature map and triple-head fault weighted feature map through the fully connected layer, perform probability prediction, and output the fault type label corresponding to the speed change fault map data to be detected.
[0138] Through the above method, the relevant process is as follows:
[0139] (1) First, vibration data under speed fluctuations is obtained on a mechanical equipment fault simulation test bench. The collected data is preprocessed and divided into training and test sets to ensure that the model can be learned and verified at different stages. Subsequently, the divided samples are analyzed in the frequency domain using the FFT method to extract spectral features from the time domain signal, further enhancing the ability to express fault characteristics. Finally, a graph structure is generated for the sample data based on the constructed distance threshold graph, and the incompleteness and noise effects of the graph are simulated by randomly deleting some edges.
[0140] (2) The constructed graph structure is input into the designed MS-GATv2 model, and its multi-scale attention mechanism is used to efficiently extract graph features at different levels, fully capturing local and global structural information. Subsequently, the extracted features are further feature mapped through a fully connected layer, and the predicted probability is finally output.
[0141] (3) The predicted probabilities and true labels are input into the cross-entropy loss function to calculate the training loss. On this basis, the ALW strategy is developed and applied. By dynamically calculating the loss ratio of each fault mode and introducing a guiding factor, the weight distribution of each fault type is adaptively adjusted to calculate the total loss. Finally, the total loss is input into the optimizer for parameter update, continuously optimizing model performance and improving the accuracy and robustness of fault diagnosis.
[0142] (4) The test set is fed into the trained model, and the model's predicted output is used to obtain diagnostic results, evaluating its detection capability and accuracy for different fault modes. Furthermore, a comprehensive comparative analysis is conducted with other commonly used GNN-based fault diagnosis methods, evaluating their superiority across multiple metrics to verify the robustness and applicability of the proposed method in handling variable speed conditions and diverse fault types.
[0143] In response to the problems of redundant connections and computational overhead brought by fully connected graphs faced by graph neural network models when processing complex graph data, as well as the challenge of the model having difficulty in balancing different categories due to the differences in fault categories, the present invention proposes a multi-scale attention model based on dynamic perception and adaptive optimization. By introducing STG, the model can dynamically perceive and capture the local geometric structure of the data, enhancing the expressiveness and robustness of the characteristics of graph data. In addition, the present invention designs MS-GATv2, combined with the DWU strategy, to efficiently capture graph structure information at different levels and effectively adapt to the characteristics of complex fault categories. Finally, by developing the ALW strategy, the model can optimize the attention to difficult-to-classify categories in real time, further improving the overall detection performance.
[0144] Experimental results show that the proposed SAMS-GAT method performs well in multiple key performance indicators (Accuracy, Precision, Recall, AUC). In the experiments of Case 1 and Case 2, SAMS-GAT demonstrated excellent classification performance, with accuracy rates reaching 99.20% and 98.15% respectively, and also maintained a leading position in indicators such as precision, recall and AUC. This proves that the method of the present invention can not only effectively solve the problem of fault diagnosis under variable speed conditions, but also dynamically adapt to the characteristics of graph data and enhance the detection capability of complex fault categories. Overall, the dynamic perception and multi-scale attention model proposed in the present invention provides an effective solution for complex graph data analysis, and lays the foundation for research and practice in related fields. Future work will combine multimodal data fusion technology to expand practical application scenarios. Further optimizing the dynamic perception mechanism and improving efficiency will help promote the widespread application of the model in industrial intelligent diagnosis.
[0145] The above is a method for detecting mechanical faults under a speed-changing working condition provided by one or more embodiments of the present invention. Based on the same idea, the present invention also provides a corresponding mechanical fault detection device under a speed-changing working condition, including:
[0146] The model construction module is used to construct a neural network. The neural network includes parallel single-head attention mechanism layers, dual-head attention mechanism layers, and triple-head attention mechanism layers, single-head dynamic feature fusion layers, dual-head dynamic feature fusion layers, and triple-head dynamic feature fusion layers that are connected one-to-one to the output ends of the single-head, dual-head, and triple-head attention mechanism layers, and fully connected layers that are simultaneously connected to the output ends of the single-head, dual-head, and triple-head dynamic feature fusion layers.
[0147] The model training module is used to obtain different types of speed change fault diagram data of mechanical equipment under speed change conditions, build a data set based on different types of speed change fault diagram data; use the data set to train the neural network to obtain a fault diagnosis model.
[0148] The fault detection module is used to input the speed change fault map data to be detected into the fault diagnosis model, and perform feature extraction of different scales on the speed change fault map data through the single attention head, double attention head and triple attention head in the single-head attention mechanism layer, the double-head attention mechanism layer and the triple-head attention mechanism layer, respectively, to obtain the single-head fault feature map, the double-head fault feature map and the triple-head fault feature map; perform adaptive feature weighted fusion operation on the single-head fault feature map, the double-head fault feature map and the triple-head fault feature map through the single-head dynamic feature fusion layer and the double-head dynamic feature fusion layer, respectively, to obtain the single-head fault weighted feature map, the double-head fault weighted feature map and the triple-head fault weighted feature map; splice the single-head fault weighted feature map, the double-head fault weighted feature map and the triple-head fault weighted feature map through the fully connected layer, and perform probability prediction to output the fault type label corresponding to the speed change fault map data to be detected.
[0149] The specific limitations of the mechanical fault detection device under variable speed conditions can be found in the limitations of the mechanical fault detection method under variable speed conditions described above and will not be repeated here. Each module in the aforementioned mechanical fault detection device under variable speed conditions can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the aforementioned modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so that the processor can call and execute operations corresponding to each of the aforementioned modules.
[0150] The present invention also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A mechanical fault detection method under variable speed conditions is provided.
[0151] The present invention also provides a computer device structure. At the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 A mechanical fault detection method under variable speed conditions is provided.
[0152] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0153] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.
Claims
1. A method for detecting mechanical faults under variable speed conditions, characterized in that: include: Constructing a neural network, the neural network including a single-head attention mechanism layer, a dual-head attention mechanism layer, and a triple-head attention mechanism layer in parallel, a single-head dynamic feature fusion layer, a dual-head dynamic feature fusion layer, and a triple-head dynamic feature fusion layer connected to the output ends of the single-head, dual-head, and triple-head attention mechanism layers in one-to-one correspondence, and a fully connected layer connected to the output ends of the single-head, dual-head, and triple-head dynamic feature fusion layers at the same time; Acquire different types of speed change fault diagram data of mechanical equipment under speed change conditions, and construct a data set based on the different types of speed change fault diagram data; Use the data set to train the neural network and obtain a fault diagnosis model; The use of the data set to train the neural network specifically includes: Use the cross entropy loss function to calculate the initial loss between the predicted fault type label output by the neural network and the true fault type label; Based on the ALW strategy, the loss ratio of different types of faults is dynamically calculated, and a guiding factor is introduced to adaptively adjust the weight distribution of each fault type to obtain the total loss: Where C is the guiding factor; N is the total number of fault types; e t is the epoch at time t in the training phase; e max is the maximum epoch; l is the fault type label, l = {1, 2, 3..., N}; is the initial loss of the lth fault type at time t in the training phase; is the initial loss of the lth fault type at time t-1 in the training phase; is the training speed of the lth fault type at time t in the training phase; The loss weight of the lth type of fault at time t in the training phase; Loss t is the total loss at time t in the training phase: The optimizer takes the minimum total loss as the optimization goal and uses the optimizer to iteratively update the parameters in the neural network; The speed change fault map data to be detected is input into the fault diagnosis model, and the single attention head, double attention head and triple attention head in the single-head attention mechanism layer, double-head attention mechanism layer and triple-head attention mechanism layer are used to extract features of different scales on the speed change fault map data, and obtain single-head fault feature map, double-head fault feature map and triple-head fault feature map; the single-head dynamic feature fusion layer, double-head dynamic feature fusion layer and triple-head dynamic feature fusion layer are used to perform adaptive feature weighted fusion operations on the single-head fault feature map, double-head fault feature map and triple-head fault feature map, respectively, to obtain single-head fault weighted feature map, double-head fault weighted feature map and triple-head fault weighted feature map; the single-head fault weighted feature map, double-head fault weighted feature map and triple-head fault weighted feature map are spliced together by the fully connected layer for probability prediction, and the fault type label corresponding to the speed change fault map data to be detected is output.
2. The mechanical fault detection method under the speed change condition according to claim 1, characterized in that: The feature extraction of different scales from the speed change fault diagram data specifically includes: Among them, h j is the feature of node j; W k is the linear transformation matrix of the kth attention head; is the attention weight of node j output by the kth attention head; j∈N (i) Indicates that node j belongs to the set of neighbor nodes of node i; K is the number of attention heads, K = {1, 2, 3}; It is the feature of node i generated after the attention mechanism is processed.
3. The mechanical fault detection method under the speed change condition according to claim 2, characterized in that: The adaptive feature weighted fusion operation specifically includes: Among them, H K is the fault weighted feature map.
4. The method for detecting mechanical failure under a speed change condition according to claim 1, wherein: The data set is constructed based on different types of transmission fault diagram data, specifically including: Calculate the Euclidean distance between each node in the fault graph data and set the threshold d according to the distribution of the Euclidean distance between each node th , retain the Euclidean distance between nodes in the fault graph data that is less than or equal to the threshold d th The edges between the nodes of the graph are obtained: d th =Percentile(D,q) Among them, x i,m and x j,m are the eigenvalues of node i and node j in the mth dimension respectively; n is the dimension of the eigenvector; d i,j is the Euclidean distance between node i and node j; Percentile(·) represents the quantile threshold function, and D represents the set of Euclidean distances between all pairs of nodes, which is d i,j The complete set of; q represents percentile; A ij is the adjacency matrix in the underlying graph structure; Set the deletion ratio p, randomly delete some edges in the basic graph structure according to the deletion ratio p, and obtain a sparse graph structure: Among them, A' ij is the adjacency matrix of the sparse graph structure; Add the corresponding fault type label to each sparse graph structure to obtain the data set.
5. The method for detecting mechanical failure under a speed change condition according to claim 1, wherein: The probability prediction is performed by splicing the single-head fault weighted feature map, the double-head fault weighted feature map, and the triple-head fault weighted feature map, specifically including: The single-head fault weighted feature map, the double-head fault weighted feature map, and the triple-head fault weighted feature map are spliced to form a spliced feature vector; After weighting the concatenated feature vector, nonlinear processing is performed through the ReLU activation function to obtain a nonlinear weighted concatenated feature vector; The nonlinear weighted concatenated feature vector is mapped to the probability distribution of fault categories through the Softmax function, and the fault category with the highest probability is taken as the output.
6. The method for detecting mechanical failure under a speed change condition according to claim 1, wherein: The obtaining of different types of speed change fault diagram data of the mechanical equipment under speed change conditions specifically includes: Collect fault vibration sensor data of mechanical equipment under variable speed conditions; The fault vibration sensor data is transformed from the time domain to the frequency domain. In the frequency domain, each sampling point is used as a node, the frequency domain eigenvalue corresponding to each sampling point is used as the point feature, and edges are constructed between adjacent sampling points to obtain the fault diagram data of the mechanical equipment under the speed change condition.
7. A mechanical fault detection device under speed change conditions, characterized in that: include: A model construction module is used to construct a neural network, wherein the constructed neural network includes a parallel single-head attention mechanism layer, a dual-head attention mechanism layer, and a triple-head attention mechanism layer, a single-head dynamic feature fusion layer, a dual-head dynamic feature fusion layer, and a triple-head dynamic feature fusion layer connected to the output ends of the single-head, dual-head, and triple-head attention mechanism layers in a one-to-one correspondence, and a fully connected layer connected to the output ends of the single-head, dual-head, and triple-head dynamic feature fusion layers at the same time; A model training module is used to obtain different types of speed change fault diagram data of mechanical equipment under speed change conditions and construct a data set based on the different types of speed change fault diagram data; Use the data set to train the neural network and obtain a fault diagnosis model; The use of the data set to train the neural network specifically includes: Use the cross entropy loss function to calculate the initial loss between the predicted fault type label output by the neural network and the true fault type label; Based on the ALW strategy, the loss ratio of different types of faults is dynamically calculated, and a guiding factor is introduced to adaptively adjust the weight distribution of each fault type to obtain the total loss: Where C is the guiding factor; N is the total number of fault types; e t is the epoch at time t in the training phase; e max is the maximum epoch; l is the fault type label, l = {1, 2, 3..., N}; is the initial loss of the lth fault type at time t in the training phase; is the initial loss of the lth fault type at time t-1 in the training phase; is the training speed of the lth fault type at time t in the training phase; The loss weight of the lth type of fault at time t in the training phase; Loss t is the total loss at time t in the training phase: The optimizer takes the minimum total loss as the optimization goal and uses the optimizer to iteratively update the parameters in the neural network; The fault detection module is used to input the speed change fault map data to be detected into the fault diagnosis model, and perform feature extraction of different scales on the speed change fault map data through the single attention head, double attention head and triple attention head in the single-head attention mechanism layer, the double-head attention mechanism layer and the triple-head attention mechanism layer, respectively, to obtain the single-head fault feature map, the double-head fault feature map and the triple-head fault feature map; perform adaptive feature weighted fusion operation on the single-head fault feature map, the double-head fault feature map and the triple-head dynamic feature fusion layer, respectively, to obtain the single-head fault weighted feature map, the double-head fault weighted feature map and the triple-head fault weighted feature map; splice the single-head fault weighted feature map, the double-head fault weighted feature map and the triple-head fault weighted feature map through the fully connected layer, and perform probability prediction to output the fault type label corresponding to the speed change fault map data to be detected.
8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Traffic flow prediction method and system of adaptive graph learning space-time neural network
CN119227861A