A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition

By employing a bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition method, combined with dynamic adaptive wavelet networks and BGSFF, the accuracy and reliability issues of tool wear condition monitoring are addressed, achieving higher wear classification accuracy and model generalization ability, making it suitable for wear detection of various mechanical equipment.

CN120277567BActive Publication Date: 2026-04-28NANJING TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING TECH UNIV
Filing Date
2025-04-17
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing methods for monitoring tool wear conditions lack accuracy and reliability, and the generalization ability and adaptability of identification models need to be improved, making it difficult to meet the wear detection needs of various mechanical equipment.

Method used

A tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition is adopted. By using a dynamic adaptive wavelet network and a bidirectional gated spatiotemporal feature fusion machine (BGSFF), the correlation features of data in the spatiotemporal dimension are dynamically captured, and detailed features of different frequency components are accurately extracted to construct a tool wear classification model.

Benefits of technology

It improves the accuracy and generalization ability of tool wear classification, enhances the robustness of the model, and enables it to better adapt to complex industrial field signals, thereby improving the accuracy and reliability of wear condition identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277567B_ABST
    Figure CN120277567B_ABST
Patent Text Reader

Abstract

The application provides a tool wear classification method based on bidirectional gate spatio-temporal fusion and adaptive wavelet decomposition, which comprises the following steps: collecting original data, dividing a training set and a test set, and performing pretreatment; constructing a dynamic adaptive wavelet network, decomposing the original signal according to odd and even indexes to obtain approximation coefficients and detail coefficients; performing interpolation upsampling processing, retaining the original size, and then normalizing the approximation coefficient instances, which are used as the frequency domain features of the vibration signal; constructing a bidirectional gate spatio-temporal feature fusioner, dynamically updating the horizontal and vertical hidden states through a multi-head gate mechanism, and capturing the long-term wear trend and local transient features of the input; splicing the outputs of the two modules to obtain comprehensive features, and then obtaining the classification result of the tool wear; and verifying the model performance through the training set and the test set to obtain the final tool wear classification model. The application can more effectively identify the wear state and provide strong support for tool maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tool wear condition monitoring, and in particular to a tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition. Background Technology

[0002] Wear is an unavoidable and crucial issue in modern industrial production and machinery operation. Accurately monitoring and predicting equipment wear is of paramount importance for ensuring normal equipment operation, improving production efficiency, reducing maintenance costs, and preventing potential safety accidents. With the continuous development of sensor technology and the improvement of data acquisition capabilities, analyzing various signals generated during equipment operation to monitor and predict wear has become a research hotspot.

[0003] With the development of artificial intelligence technology, machine learning and deep learning models have been widely used in tool wear condition identification. Machine learning models learn and train on large amounts of tool wear data to establish a mapping relationship between tool wear conditions and monitoring signal features, thereby achieving tool wear condition identification. Support Vector Machines (SVMs) are a commonly used machine learning model, exhibiting good performance in small-sample, nonlinear classification problems. Neural networks are also a widely used machine learning model for tool wear condition identification, possessing powerful nonlinear mapping capabilities and self-learning abilities. Deep learning models, as a branch of machine learning, have achieved significant results in the field of tool wear condition identification in recent years. Deep learning models can automatically learn complex feature representations from large amounts of data, eliminating the need for manual feature extraction and achieving higher recognition accuracy and efficiency. Convolutional Neural Networks (CNNs) are a commonly used deep learning model, performing excellently in image recognition and also widely used in image-based tool wear condition identification.

[0004] Numerous scholars have conducted extensive research on tool wear monitoring methods and identification models, achieving fruitful results. However, current research still has some shortcomings, such as the need to improve the accuracy and reliability of monitoring methods, and to further enhance the generalization ability and adaptability of identification models. Therefore, future research needs to continuously explore new monitoring methods and identification models to improve the accuracy and reliability of tool wear condition identification and meet the actual needs of industrial production. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention proposes a tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition. This method is designed to be applicable to various mechanical equipment, particularly for tool wear detection set classification. It aims to dynamically capture the spatiotemporal correlation features of data, perform multi-scale decomposition of the input, accurately extract detailed features of different frequency components, and balance computational efficiency with the robustness of the wear classification model.

[0006] To achieve the above-mentioned technical objectives, the present invention provides the following technical solution:

[0007] The tool wear classification method based on bidirectional doorway spatiotemporal fusion and adaptive wavelet decomposition specifically includes the following steps:

[0008] S1. Collect vibration signal data during the tool operation process, divide the obtained raw dataset into training set and test set, and preprocess the data.

[0009] S2. Construct a dynamic adaptive wavelet network, take the preprocessed signal data as input, decompose it according to the parity index, and obtain the approximation coefficients and detail coefficients of the input.

[0010] S3. The obtained approximation coefficients and detail coefficients are interpolated and upsampled to preserve the original size; then, instance normalization is applied to the approximation coefficients to use them as frequency domain features of the vibration signal.

[0011] S4. Construct a bidirectional gated spatiotemporal feature fusion network (BGSFF) to process the preprocessed signal data in parallel with a dynamic adaptive wavelet network. The input is concatenated with the horizontal and vertical hidden states. The two states are dynamically updated through a multi-head gating mechanism to capture the long-term wear trend and local transient features in the input vibration signal data.

[0012] S5. Concatenate the output of the dynamic adaptive wavelet network with the output of BGSFF to obtain the comprehensive features; obtain the classification results of tool wear based on the comprehensive features;

[0013] S6. Train the model using the training set data and validate it using the test set. Monitor the model's performance during the training process to obtain the final tool wear classification model.

[0014] Furthermore, step S1 specifically includes:

[0015] S11. Obtain the raw vibration signal data X∈R during the tool operation process from publicly available data. N×C Where N is the total length of the signal and C is the feature dimension;

[0016] S12. Normalize the original vibration signal data X by scaling it to the range [0,1] to obtain the normalized data X.norm ∈R N×C ;

[0017] S13. Divide the normalized data into multiple samples according to the specified sample length L; the formula is expressed as:

[0018] X samples ={X norm [i:i+L]|i=0,L,2L,...,NL};

[0019] Among them, X samples It is the set of cut samples, where each sample X samples [k]∈R L×C ,

[0020] S14. Assign a corresponding wear label to each sample, expressed by the formula:

[0021] Y samples ={y k |k=1,2,...k};

[0022] Among them, y k It is the wear label of the kth sample. The wear label is also the classification label, which represents the degree of tool wear.

[0023] S15. Divide the dataset into a training set x. train and test set x test Furthermore, noise is added to the training set to dynamically generate augmented data, expand the training dataset, and improve the model's generalization ability and robustness.

[0024] Furthermore, step S2 specifically includes:

[0025] S21, Input signal x∈R B×C×L The sequence is split into two subsequences based on parity index, as expressed by the formula:

[0026]

[0027] Where, x even x odd Let B be the even and odd samples of the input signal, respectively; B is the batch size, C is the feature dimension, and L is the sample length; x[:,:,::2] means that in the sample length dimension, starting from index 0, every 2 elements are taken to obtain the subsequence at the even index position; x[:,:,1::2] means that in the sample length dimension, starting from index 1, every 2 elements are taken to obtain the subsequence at the odd index position.

[0028] S22. The split signal is processed using learnable P and U operators. The P and U operators consist of learnable one-dimensional convolution, reflection filling, GELU activation and layer normalization connected in sequence. First, the U operator is used to update the even samples based on the odd samples and update the approximation coefficients. Then, the P operator is used to predict the detail coefficients d from the updated and corrected approximation coefficients c.

[0029] Furthermore, step S3 specifically includes:

[0030] S31. The obtained approximation coefficients c and detail coefficients d are subjected to interpolation upsampling to maintain the same size as the original input signal. The formula is expressed as:

[0031]

[0032] Among them, c up d up These are the approximation coefficients and detail coefficients after interpolation and upsampling, respectively; x.size(2) is the length of the original input signal, Interpolate is the interpolation operation, and mode=linear indicates that linear interpolation is used;

[0033] S32. Regarding the approximation coefficients c after interpolation up Instance normalization is applied to improve the stability and expressive power of features; the formula is expressed as:

[0034] c norm =InstanceNorm1d(c up );

[0035] Here, `InstanceNorm1d` is a one-dimensional instance normalization operation that normalizes each channel separately. Finally, it returns the approximate coefficient `c` after instance normalization. norm Frequency domain characteristics of vibration signals.

[0036] Furthermore, step S4 specifically includes:

[0037] S41. At each time step t, the input to the BGSFF module consists of: the preprocessed vibration signal x at the current time step. t Horizontal Hidden State Vertical Hidden State These three parts are then concatenated to form a comprehensive input vector.

[0038] S42. For each attention head i, use an independent weight matrix W i and bias B i The gating signal is calculated using the following formula:

[0039] gate i=W i ·gate_input t +B i ;

[0040] Among them, W i B is the weight matrix of the i-th attention head, used to learn different frequency band features from the input vector concatenated by linear transformation; i It is the bias vector of the i-th attention head, used to learn the baseline threshold of the gating signal, gate. i This is the gating signal for the i-th attention head, which is divided into four parts: a sigmoid gating signal (horizontal update gate, vertical update gate, horizontal output gate, and vertical output gate) and two parts: a tanh gating signal (horizontal input gate and vertical input gate). The sigmoid gating signal controls the degree to which information from the hidden state is retained and its influence on the output; the tanh gating signal controls the degree to which information is added.

[0041] S43. At each attention head, update the horizontal and vertical hidden states according to the Sigmoid gate signal and the Tanh gate signal respectively, and then calculate the difference between the hidden states before and after the update to obtain the output increment of each attention head for the hidden state.

[0042] S44. Enable residual connections, sum the output increments of each attention head for the hidden state, and add them to the original hidden state. This sum is used as the updated horizontal and vertical hidden states of the BGSFF module at each time step; the formula is expressed as:

[0043]

[0044] in, These are the vertical hidden state and horizontal hidden state at time step t, respectively, and output_slice_row. i ,output_slice_col i These are the output increments of the i-th attention head for the horizontal hidden state and for the vertical hidden state, respectively, where num_heads is the total number of attention heads. These are the updated horizontal and vertical hidden states for the next time step.

[0045] The updated horizontal and vertical hidden states are then combined to form the final output of the BGSFF model at each time step.

[0046] More specifically, step S43 includes:

[0047] S431. At each attention head, intermediate states generated through nonlinear transformation are used as candidate features to provide new states to be fused; the formula is expressed as:

[0048]

[0049] in, As candidate features, h t To be in a hidden state, W c For candidate feature weight matrix, b c is the candidate feature bias term; tanh() represents the tanh gate signal, which compresses the features to the interval [-1,1].

[0050] S432. The new state fusion ratio is calculated using the update gate in the Sigmoid gated signal, expressed by the following formula:

[0051] z t+1 =σ(W z ·[h t ;x t ]+b z );

[0052] Among them, W z To update the gate weight matrix, b z To update the gate bias, z t+1 The fusion ratio for the new state is σ(.), which is the Sigmoid gate signal.

[0053] S433. Calculate the hidden state update amount, expressed by the formula:

[0054]

[0055] Among them, (1-z t ) represents the proportion of the old state retained, and ⊙ represents element-wise multiplication;

[0056] S434. Then, the updated hidden state is obtained through the output gate, expressed by the formula:

[0057]

[0058] Among them, W o Here, b0 is the output gate weight matrix, and b0 is the output gate bias; t+1 To output the gate value; This is the updated hidden state.

[0059] Furthermore, step S5 specifically includes:

[0060] S51. The frequency features extracted by the dynamic adaptive wavelet network and the spatiotemporal features extracted by BGSFF are concatenated together in the channel dimension to obtain comprehensive features and capture richer signal characteristics.

[0061] S52. Then input the comprehensive features into a single-layer LSTM to capture temporal dependencies;

[0062] S53. Take the last hidden state of the LSTM as the final feature representation, and input the final feature representation into the fully connected layer to achieve tool wear classification.

[0063] Furthermore, step S6 specifically includes:

[0064] S61. First, train the tool wear classification model using the training set, optimize the model parameters, and obtain the optimal parameter configuration model; the formula is expressed as:

[0065] θ * =argminL train (f θ (X train ),Y train );

[0066] Where θ are the parameters of the model, f θ It is the mapping function of the model, L train () is the training loss function, θ * These are the optimal configuration parameters;

[0067] S62. After obtaining the optimal parameter configuration model, the model is validated using a test set. The accuracy, recall, and F1-Score are calculated using the confusion matrix to evaluate the performance of the obtained tool wear classification model.

[0068] Based on the above technical solution, the present invention has at least the following beneficial effects:

[0069] 1. This invention designs a dynamic adaptive wavelet network, which designs the P operator and the U operator as a learnable one-dimensional convolutional structure and integrates reflection filling, GELU activation and layer normalization components; it can adaptively extract key features for the complex characteristics of tool wear signals, accurately capture the signal patterns at different wear stages, achieve higher accuracy in tool wear classification tasks, significantly improve generalization ability, and successfully solve the problem of insufficient signal feature adaptation caused by the fixed parameters of traditional fixed operators, making it more suitable for application scenarios with variable signals in industrial fields;

[0070] 2. This invention designs a BGSFF module, which can capture the long-term evolution pattern of vibration signals through horizontal gating (such as the gradual change of wear from the initial stage to the later stage), and fuse the coordinated changes of multi-channel vibration signals through vertical gating (such as the vibration correlation of different tool positions). The gating mechanism dynamically suppresses the time step dominated by noise (such as random interference in machining) and focuses on effective vibration events; the residual connection can further ensure the gradient stability of the model in long-term vibration signal series.

[0071] 3. This invention focuses on extracting local high-frequency details (such as transient impacts and noise in vibration signals) and low-frequency trends (such as gradual changes in wear) through a dynamic adaptive wavelet network. It achieves multi-scale analysis through wavelet decomposition and captures global spatiotemporal correlations (such as long-term dependencies in time series and spatial correlations between features) through BGSFF. The combination of these two approaches covers full-scale features from micro to macro levels, enhancing the model's joint perception of local abrupt changes and global evolutionary patterns in signals. The features derived from wavelet decomposition possess physical interpretability (such as high-frequency components corresponding to anomalous events), while the output of BGSFF is a data-driven abstract representation. The concatenation of these two approaches preserves the essential characteristics of the signal while incorporating high-level semantic information. The wavelet module suppresses noise interference through filtering, while BGSFF filters redundant information through a gating mechanism; this dual denoising enhances the model's classification robustness in complex environments. Attached Figure Description

[0072] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0073] Figure 1 The overall flowchart of a tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition provided by the present invention;

[0074] Figure 2 This is an architecture diagram of the dynamic adaptive wavelet network provided by the present invention;

[0075] Figure 3 The architecture diagram of the bidirectional gated spatiotemporal feature fusion processor BGSFF provided by the present invention;

[0076] Figure 4 This is a schematic diagram illustrating the accuracy of the method of the present invention in classifying tool wear conditions.

[0077] Figure 5 This is a schematic diagram illustrating the loss in classifying tool wear conditions using the method of the present invention;

[0078] Figure 6 This is a schematic diagram of the confusion matrix of the tool wear state classification results of the method of the present invention.

[0079] Figure 7 This is a comparison chart of the accuracy rates of the present invention and existing technologies. Detailed Implementation

[0080] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding of how the present application uses technical means to solve technical problems and achieve technical effects, and to facilitate its implementation.

[0081] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] Please refer to Figures 1-7 This illustration shows a specific implementation of the present invention. In this embodiment, the present invention designs a network that includes a dynamic adaptive wavelet network, a bidirectional gated spatiotemporal feature fusion (BGSFF) and an LSTM, which can enable the application of a wear recognition model trained based on known tool data to wear recognition of unknown data. This solves the problem of low accuracy in tool wear recognition and can output more accurate tool wear recognition results, thereby improving the versatility and accuracy of the tool wear state recognition model.

[0083] Please refer to Figure 1 This embodiment proposes a tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition. The method includes the following steps:

[0084] S1. Collect vibration signal data during the tool operation process, divide the obtained raw dataset into training set and test set, and preprocess the data.

[0085] In a preferred embodiment, step S1 specifically includes:

[0086] S11. Obtain the raw vibration signal data X∈R during the tool operation process from publicly available data. N×C Where N is the total length of the signal and C is the feature dimension;

[0087] S12. Normalize the original vibration signal data X by scaling it to the range [0,1] to obtain the normalized data X. norm ∈R N×C ;

[0088] S13. Divide the normalized data into multiple samples according to the specified sample length L; the formula is expressed as:

[0089] X samples ={X norm [i:i+L]|i=0,L,2L,...,NL};

[0090] Among them, X samples It is the set of cut samples, where each sample X samples [k]∈R L×C k = 1, 2, ..., K

[0091] S14. Assign a corresponding wear label to each sample, expressed by the formula:

[0092] Y samples ={y k |k=1,2,...k};

[0093] Among them, y k It is the wear label of the kth sample. The wear label is also the classification label, which represents the degree of tool wear.

[0094] S15. Divide the dataset into a training set x. train and test set x test Furthermore, noise is added to the training set to dynamically generate augmented data, expand the training dataset, and improve the model's generalization ability and robustness.

[0095] In this embodiment, uniform noise is added, with its value randomly distributed within a specified range. A small noise factor of 0.01 is chosen to represent the noise intensity relative to the original signal. By creating a noise matrix with the same shape as the input data and adding it to the original data, real-world interference is simulated. When mechanical equipment is operating, sensors may be subjected to some uniform, non-periodic interference. For example, due to factors such as temperature changes and the operating status of electrical equipment, the equipment may generate certain electromagnetic interference or noise. This noise generally exhibits uniform distribution characteristics. Therefore, adding uniform noise improves the model's ability to cope with noise and enhances its tolerance to data fluctuations and equipment errors in real-world environments.

[0096] S2. Construct a dynamic adaptive wavelet network, using the preprocessed signal data as input, and decompose it according to parity index to obtain the approximation coefficients and detail coefficients of the input; for example... Figure 2As shown, after the data is input, the Splitting module is called first to segment the data, then the data is processed by the LiftingScheme module, then the normalization operation is performed, and finally the adaptive wavelet block processing is completed by calling AdpWaveletBlock, and the final processing result is output.

[0097] In a preferred embodiment, step S2 specifically includes:

[0098] S21, Input signal x∈R B×C×L The sequence is split into two subsequences based on parity index, as expressed by the formula:

[0099]

[0100] Where, x even x odd Let B be the even and odd samples of the input signal, C be the feature dimension, and L be the sample length. x[:,:,::2] represents the subsequence at even index positions, starting from index 0 and taking every two elements along the sample length dimension; x[:,:,1::2] represents the subsequence at odd index positions, starting from index 1 and taking every two elements along the sample length dimension. This design employs a channel-priority splitting strategy to avoid feature ambiguity caused by channel mixing in traditional methods. The channel-priority strategy prioritizes maintaining the independence of the channel dimension (C) during signal splitting (odd / even sampling), performing subsequence division only along the sample length dimension (L). Its core purpose is to avoid feature ambiguity caused by cross-channel mixing operations in traditional methods, ensuring that the feature information of each channel is fully preserved after splitting.

[0101] S22. The split signal is processed using learnable P and U operators. The P and U operators consist of sequentially connected learnable one-dimensional convolution, reflection padding, GELU activation, and layer normalization. First, the U operator updates the even samples based on odd samples, updating the approximation coefficients. Then, the P operator predicts the detail coefficients d from the updated and corrected approximation coefficients c. The specific calculation process is as follows:

[0102] First, calculate the update amount U(x) calculated by the U operator. odd )

[0103] U(x odd )=LayerNorm(GELU(Conv1d(ReflectionPad1d(x odd ))));

[0104] Where LayerNorm(.) is layer normalization, GELU(.) is GELU activation, Conv1d(.) is learning one-dimensional convolution, and ReflectionPad1d(.) is reflection padding;

[0105] Then update the approximation coefficient, expressed by the formula:

[0106] c = x even +U(x odd );

[0107] The structure of the P operator is symmetric to that of the U operator, and the prediction P(c) calculated by the P operator is:

[0108] P(c)=LayerNorm(GELU(Conv1d(ReflectionPad1d(c))));

[0109] The prediction detail coefficient is expressed by the following formula:

[0110] d = X odd -P(c);

[0111] In this embodiment, a learnable one-dimensional convolution is designed to extract local patterns of signals in tool wear signal analysis. These local patterns correspond to the feature changes at different wear stages, such as the periodicity and impact of vibration signals. During training, the kernel weights of the learnable one-dimensional convolution are continuously adjusted through a backpropagation algorithm, thereby automatically learning the most suitable pattern for feature extraction based on the characteristics of the input signal, thus achieving adaptive feature extraction. Furthermore, nonlinear factors are introduced into the model through reflection filling, GELU activation, and layer normalization, enabling the model to learn more complex nonlinear relationships in the signal, thereby enhancing the model's expressive power.

[0112] In traditional wavelet transform lifting schemes, the prediction and update operators are usually based on fixed filter designs, relying on prior knowledge and fixed parameter settings, making it difficult to adapt to signals of different types and complexities. The dynamic adaptive wavelet transform scheme designed in this invention breaks away from the fixed pattern of traditional methods.

[0113] S3. The obtained approximation coefficients and detail coefficients are interpolated and upsampled to preserve the original size; then, instance normalization is applied to the approximation coefficients to use them as frequency domain features of the vibration signal.

[0114] In a preferred embodiment, step S3 specifically includes:

[0115] S31. The obtained approximation coefficients c and detail coefficients d are subjected to interpolation upsampling to maintain the same size as the original input signal. The formula is expressed as:

[0116]

[0117] Among them, c up d up These are the approximation coefficients and detail coefficients after interpolation and upsampling, respectively; x.size(2) is the length of the original input signal, Interpolate is the interpolation operation, and mode=linear indicates that linear interpolation is used;

[0118] In this application, linear interpolation is chosen to restore the low-frequency approximation coefficients and high-frequency detail coefficients after wavelet decomposition to the original signal length, facilitating subsequent feature fusion. Traditional wavelet processing typically discards high-frequency components or retains only low frequencies. Interpolation preserves the integrity of multi-scale features, ensuring compatibility with subsequent neural network layers (avoiding size mismatch). Furthermore, early tool wear is characterized by small-amplitude continuous vibration energy growth, while severe wear exhibits quasi-periodic impact components. Linear interpolation can perfectly reconstruct the gradual change trend of the wear signal.

[0119] S32. Regarding the approximation coefficients c after interpolation up Instance normalization is applied to improve the stability and expressive power of features; the formula is expressed as:

[0120] c norm =InstanceNorm1d(c up );

[0121] Here, `InstanceNorm1d` is a one-dimensional instance normalization operation that normalizes each channel separately. Finally, it returns the approximate coefficient `c` after instance normalization. norm Frequency domain characteristics of vibration signals;

[0122] In the milling cutter wear experiment, the energy growth of the approximation coefficient monotonically increases during the severe wear stage, while the detail coefficient exhibits irregular fluctuations. A comparison of the robustness of the approximation and detail coefficients reveals that sensor noise affects the approximation coefficient by <5% but the detail coefficient by >50%. Rotation speed fluctuations have a negligible impact on the approximation coefficient but a significant impact on the detail coefficient. Therefore, this application selects the instance-normalized approximation coefficient as the frequency domain feature of the vibration signal, i.e., the output of the dynamic adaptive wavelet network.

[0123] S4. Construct a bidirectional gated spatiotemporal feature fusion network (BGSFF) to process the preprocessed signal data in parallel with a dynamic adaptive wavelet network. The input is concatenated with the horizontal and vertical hidden states. The two states are dynamically updated through a multi-head gating mechanism to capture the long-term wear trend and local transient features in the input vibration signal data.

[0124] The BGSFF module designed in this invention introduces multi-head dynamic gating and residual connections. Tool vibration signals include high-frequency chipping impacts (short-term bursts) and low-frequency wear trends (long-term gradual changes), which traditional single-gating methods struggle to handle simultaneously. Therefore, this invention employs multi-head division of labor, which can capture high-frequency impacts (chipping events), model low-frequency energy accumulation (gradual wear), and analyze the phase difference between multiple sensor channels. Each attention head is connected via an independent W... i / B i The parameters are used to learn diverse and differentiated features in different frequency bands. In addition, early wear features are weak (signal change <5%), and deep networks are prone to gradient vanishing. The introduction of residual connections can ensure that gradients pass directly to the bottom layer. Residual connections allow the model to utilize both the local transient features extracted from the shallow layer (such as chipping pulses) and the global wear state learned from the deep layer.

[0125] As a preferred embodiment, such as Figure 3 As shown, step S4 specifically includes:

[0126] S41. At each time step t, the input to the BGSFF module consists of: the preprocessed vibration signal x at the current time step. t Horizontal Hidden State Vertical Hidden State These three parts are then concatenated to form a comprehensive input vector.

[0127] S42. For each attention head i, use an independent weight matrix W i and bias B i The gating signal is calculated using the following formula:

[0128] gate i =W i ·gate_input t +B i ;

[0129] Among them, W i B is the weight matrix of the i-th attention head, used to learn different frequency band features from the input vector concatenated by linear transformation; i It is the bias vector of the i-th attention head, used to learn the baseline threshold of the gating signal, gate. i This is the gating signal for the i-th attention head, which is divided into four parts: a sigmoid gating signal (horizontal update gate, vertical update gate, horizontal output gate, and vertical output gate) and two parts: a tanh gating signal (horizontal input gate and vertical input gate). The sigmoid gating signal controls the degree to which information from the hidden state is retained and its influence on the output; the tanh gating signal controls the degree to which information is added.

[0130] S43. At each attention head, update the horizontal and vertical hidden states according to the Sigmoid gate signal and the Tanh gate signal respectively, and then calculate the difference between the hidden states before and after the update (that is, the hidden state before the update is subtracted from the hidden state after the update) to obtain the output increment of each attention head for the hidden state.

[0131] More specifically, step S43 includes:

[0132] S431. At each attention head, intermediate states generated through nonlinear transformation are used as candidate features to provide new states to be fused; the formula is expressed as:

[0133]

[0134] in, As candidate features, h t To be in a hidden state, W c For candidate feature weight matrix, b c is the candidate feature bias term; tanh() represents the tanh gate signal, which compresses the features to the [-1,1] interval; First, it should be noted that since the horizontal and vertical hidden states are processed in the same way, they only represent the hidden states in the time dimension and the feature dimension, respectively, and are therefore collectively referred to as hidden states in the formulas of steps S431-S434;

[0135] S432. The new state fusion ratio is calculated using the update gate in the Sigmoid gated signal, expressed by the following formula:

[0136] z t+1 =σ(W z ·[h t ;x t ]+b z );

[0137] Among them, W z To update the gate weight matrix, b z To update the gate bias, z t+1 The fusion ratio for the new state is σ(.), which is the Sigmoid gate signal.

[0138] S433. Calculate the hidden state update amount, expressed by the formula:

[0139]

[0140] Among them, (1-z t ) represents the proportion of the old state retained, and ⊙ represents element-wise multiplication, achieving dimension-independent weight allocation.

[0141] S434. Then, the updated hidden state is obtained through the output gate, expressed by the formula:

[0142]

[0143] Among them, W o Here, b0 is the output gate weight matrix, and b0 is the output gate bias; t+1 To output the gate value; The updated hidden state is first passed through a tanh gate signal, and then multiplied element-wise with the output gate value to prevent gradient explosion and enhance numerical stability.

[0144] S44. Enable residual connections, sum the output increments of each attention head for the hidden state, and add them to the original hidden state. This sum is used as the updated horizontal and vertical hidden states of the BGSFF module at each time step; the formula is expressed as:

[0145]

[0146] in, These are the vertical hidden state and horizontal hidden state at time step t, respectively, and output_slice_row. i ,output_slice_col i These are the output increments of the i-th attention head for the horizontal hidden state and for the vertical hidden state, respectively, where num_heads is the total number of attention heads. These are the updated horizontal and vertical hidden states for the next time step.

[0147] The updated horizontal and vertical hidden states are then combined (that is, the output states are added element by element to form the final output of the BGSFF model at each time step).

[0148] S5. Concatenate the output of the dynamic adaptive wavelet network with the output of BGSFF to obtain the comprehensive features; obtain the classification results of tool wear based on the comprehensive features;

[0149] In a preferred embodiment, step S5 specifically includes:

[0150] S51. The frequency features extracted by the dynamic adaptive wavelet network and the spatiotemporal features extracted by BGSFF are concatenated together in the channel dimension to obtain comprehensive features and capture richer signal characteristics.

[0151] S52. Then input the comprehensive features into a single-layer LSTM to capture temporal dependencies;

[0152] S53. Take the last hidden state of the LSTM as the final feature representation, and input the final feature representation into the fully connected layer to achieve tool wear classification.

[0153] S6. Train the model using the training set data and validate it using the test set. Monitor the model's performance during the training process to obtain the final tool wear classification model.

[0154] In a preferred embodiment, step S6 specifically includes:

[0155] S61. First, train the tool wear classification model using the training set, optimize the model parameters, and obtain the optimal parameter configuration model; the formula is expressed as:

[0156] θ * =argminL train (f θ (X train ),Y train );

[0157] Where θ are the parameters of the model, f θ It is the mapping function of the model, L train () is the training loss function, θ * These are the optimal configuration parameters; in this embodiment, the cross-entropy loss function is selected, and the formula is expressed as:

[0158]

[0159] Where, N train Y represents the total number of training samples, CA is the total number of categories (including initial wear, normal wear, and severe wear), and Y represents the total number of training samples. i,c The true label of sample i (one-hot encoded), f θ (X i ) ca It is the model's predicted probability for category ca;

[0160] S62. After obtaining the optimal parameter configuration model, the model is validated using a test set. The accuracy, recall, and F1-Score are calculated using the confusion matrix to evaluate the performance of the obtained tool wear classification model.

[0161] In addition, in this embodiment, to verify the tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition proposed in this invention, the following experimental examples were also conducted:

[0162] This method was implemented on the open dataset of the 2010 High-Speed ​​CNC Machine Tool Health Prediction Competition by the New York Society for Predictive Health Management. Vibration signals and corresponding wear values ​​generated by the milling cutter C1 during machining were collected. The cutter underwent 315 passes, and the wear value of the cutting edge was measured after each pass. The vibration signals collected during the machining of C1 were used as the dataset.

[0163] The original vibration signal was sampled at a frequency of 50kHz. Directly inputting the original signal into the network for training would result in an excessive number of model parameters, making it difficult for ordinary equipment to meet the requirements. Therefore, 80% of the dataset was used as the training set, and 20% as the test set. Based on the actual wear curve of the tool, the wear state was divided into three stages: initial wear, intermediate wear, and late wear. The specific division was based on the wear condition of the flank face, with labels 0, 1, and 2 representing initial wear, intermediate wear, and late wear, respectively. One-hot encoding was used to convert the labels into a format suitable for deep learning models. The division results are shown in Table 1.

[0164] Table 1. Classification Labels for Tool Wear Degree

[0165]

[0166] During the actual data acquisition process, the tool processing signal data for some time periods was incomplete. Therefore, signal segments with abnormal data volume were removed, and the original segmented data was downsampled to obtain data samples with a shape of (250, 40). This dataset was used as input to a deep learning model to verify the performance of each model. The initial learning rate of the model was set to 0.001, and after every 10,000 steps, the learning rate became 0.9 times the original rate. The batch size was 64, and the number of training epochs was set to 100.

[0167] As an explanation, Figure 4 and Figure 5 This paper demonstrates the accuracy and loss changes of the model during training. The training iterations are set to 100, the batch size to 64, and the learning rate to an initial Adam algorithm of 0.001. Samples after normalization and data segmentation are used as inputs to a bidirectional gated spatiotemporal feature fusion network and a dynamic adaptive wavelet network, respectively. The wavelet output is concatenated with the output of the bidirectional gated spatiotemporal feature fusion network along the channel dimension. A single-layer LSTM is used to process the temporal features, and the final state is input to a fully connected layer for classification. Figure 4 It can be seen that the training accuracy of the model of this invention can be higher than 97%; Figure 5 It can be seen that the training loss of the model in this invention can be lower than 0.1; from Figure 6It can be seen that the model of the present invention has a high accuracy rate in recognizing wear and tear on mechanical equipment. Figure 7 Comparing this invention with existing technologies, it is evident that this invention significantly improves the accuracy and generalization ability of tool wear classification, demonstrating its technical advantages and innovation. Therefore, the wear identification method proposed in this invention is reliable.

[0168] In summary, the classification method proposed in this invention combines a dynamic adaptive wavelet network and a bidirectional gated spatiotemporal feature fusion machine (BGSFF) to cover full-scale features from micro to macro levels, enhancing the model's joint perception of local signal mutations and global evolution patterns. The wavelet module suppresses noise interference through filtering, while the BGSFF filters redundant information through a gating mechanism. This dual denoising enhances the model's classification robustness in complex environments. This invention can more effectively identify wear conditions, providing strong support for tool maintenance.

[0169] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0170] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0171] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition, characterized in that, Includes the following steps; S1. Collect vibration signal data during the tool operation process, divide the obtained raw dataset into training set and test set, and preprocess the data. S2. Construct a dynamic adaptive wavelet network, using the preprocessed signal data as input, and decompose it according to the parity index to obtain the approximation coefficients and detail coefficients of the input; Step S2 specifically includes: S21, Input signal The sequence is split into two subsequences based on parity index, as expressed by the formula: ; in, , These represent the even and odd samples of the input signal, respectively; B is the batch size, C is the feature dimension, and L is the sample length. This means that, in the dimension of sample length, starting from index 0, every two elements are taken to obtain the subsequence at even index positions; This means that, in the dimension of sample length, starting from index 1, every two elements are taken, and finally the subsequence at odd index positions is obtained; S22. Use learnable P and U operators to process the split signal; the P and U operators are composed of reflection filling, learnable one-dimensional convolution, GELU activation and layer normalization connected in sequence; first use the U operator to update the even samples based on the odd samples, update the approximation coefficients, and then use the P operator to predict the detail coefficients d from the updated and corrected approximation coefficients c. S3. The obtained approximation coefficients and detail coefficients are interpolated and upsampled to preserve the original size; then, instance normalization is applied to the approximation coefficients to use them as frequency domain features of the vibration signal. S4. Construct a bidirectional gated spatiotemporal feature fusion network (BGSFF) to process the preprocessed signal data in parallel with a dynamic adaptive wavelet network. The input is concatenated with the horizontal and vertical hidden states. The two states are dynamically updated through a multi-head gating mechanism to capture the long-term wear trend and local transient features in the input vibration signal data. S5. Concatenate the output of the dynamic adaptive wavelet network with the output of BGSFF to obtain the comprehensive features; obtain the classification results of tool wear based on the comprehensive features; S6. Train the model using the training set data and validate it using the test set. Monitor the model's performance during the training process to obtain the final tool wear classification model.

2. The tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that, Step S1 specifically includes: S11. Obtain raw vibration signal data of the tool during operation from publicly available data. Where N is the total length of the signal and C is the feature dimension; S12, regarding the original vibration signal data Normalization is performed, scaling the data to the range [0, 1] to obtain the normalized data. ; S13. Divide the normalized data into multiple samples according to the specified sample length L; the formula is expressed as: ; in, It is the set of cut samples, where each sample , ; S14. Assign a corresponding wear label to each sample, expressed by the formula: ; in, It is the wear label of the kth sample. The wear label is also the classification label, which represents the degree of tool wear. S15. Divide the dataset into a training set. and test set Furthermore, noise is added to the training set to dynamically generate augmented data, expand the training dataset, and improve the model's generalization ability and robustness.

3. The tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that, Step S3 specifically includes: S31. The obtained approximation coefficients c and detail coefficients d are subjected to interpolation upsampling to maintain the same size as the original input signal. The formula is expressed as: ; in, , These are the approximation coefficients and detail coefficients after interpolation and upsampling, respectively. It is the length of the original input signal. It is an interpolation operation. This indicates the use of linear interpolation; S32. Approximate coefficients after interpolation Instance normalization is applied to improve the stability and expressive power of features; the formula is expressed as: ; in, It is a one-dimensional instance normalization operation that normalizes each channel separately; finally, it returns the approximate coefficients after instance normalization. Frequency domain characteristics of vibration signals.

4. The tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that, Step S4 specifically includes: S41. At each time step t, the input to the BGSFF module consists of: the preprocessed vibration signal of the current time step. Horizontal Hidden State Vertical Hidden State These three parts are then concatenated to form a comprehensive input vector. ; S42. For each attention head i, use an independent weight matrix. and bias The gating signal is calculated using the following formula: ; in, It is the weight matrix of the i-th attention head, used to learn different frequency band features from the input vector concatenated by linear transformation; It is the bias vector of the i-th attention head, used to learn the baseline threshold of the gating signal. This is the gating signal for the i-th attention head, which is divided into four parts: a sigmoid gating signal (horizontal update gate, vertical update gate, horizontal output gate, and vertical output gate) and two parts: a tanh gating signal (horizontal input gate and vertical input gate). The sigmoid gating signal controls the degree to which information from the hidden state is retained and its influence on the output; the tanh gating signal controls the degree to which information is added. S43. At each attention head, update the horizontal and vertical hidden states according to the Sigmoid gate signal and the Tanh gate signal respectively, and then calculate the difference between the hidden states before and after the update to obtain the output increment of each attention head for the hidden state. S44. Enable residual connections, sum the output increments of each attention head for the hidden state, and add them to the original hidden state. This sum is used as the updated horizontal and vertical hidden states of the BGSFF module at each time step; the formula is expressed as: ; ; in, , These are the vertical hidden state and the horizontal hidden state at time step t, respectively. , These are the output increments of the i-th attention head for the horizontal hidden state and for the vertical hidden state, respectively. It is the total number of attention heads. , These are the updated horizontal and vertical hidden states for the next time step. The updated horizontal and vertical hidden states are then combined to form the final output of the BGSFF model at each time step.

5. The tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition according to claim 4, characterized in that, Step S43 specifically includes: S431. At each attention head, intermediate states generated through nonlinear transformation are used as candidate features to provide new states to be fused; the formula is expressed as: ; in, As candidate features, In hidden state, For candidate feature weight matrix, is the candidate feature bias term; tanh() represents the tanh gate signal, which compresses the features to the interval [−1,1]. S432. The new state fusion ratio is calculated using the update gate in the Sigmoid gated signal, expressed by the following formula: ; in, To update the gate weight matrix, To update the door offset, The fusion ratio for the new state; It is a Sigmoid-gated signal; S433. Calculate the hidden state update amount, expressed by the formula: ; in, This indicates the proportion of the old state that is retained. For element-wise multiplication; S434. Then, the updated hidden state is obtained through the output gate, expressed by the formula: ; in, This is the output gate weight matrix. For output gate bias; To output the gate value; This is the updated hidden state.

6. The tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that, Step S5 specifically includes: S51. The frequency features extracted by the dynamic adaptive wavelet network and the spatiotemporal features extracted by BGSFF are concatenated together in the channel dimension to obtain comprehensive features and capture richer signal characteristics. S52. Then input the comprehensive features into a single-layer LSTM to capture temporal dependencies; S53. Take the last hidden state of the LSTM as the final feature representation, and input the final feature representation into the fully connected layer to achieve tool wear classification.

7. The tool wear classification method based on bidirectional gated spatiotemporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that, Step S6 specifically includes: S61. First, train the tool wear classification model using the training set, optimize the model parameters, and obtain the optimal parameter configuration model; the formula is expressed as: ; in, These are the parameters of the model. It is the mapping function of the model. () is the training loss function. These are the optimal configuration parameters; S62. After obtaining the optimal parameter configuration model, the model is validated using a test set. The accuracy, recall, and F1-Score are calculated using the confusion matrix to evaluate the performance of the obtained tool wear classification model.