Cutter wear classification method based on bidirectional gating space-time fusion and adaptive wavelet decomposition
Through bidirectional gated space-time fusion and adaptive wavelet decomposition, the space-time characteristics of tool wear signals are captured dynamically, and the problem of insufficient accuracy and reliability of tool wear monitoring in the prior art is solved, and higher recognition accuracy and adaptability are achieved, which is suitable for wear detection of various mechanical equipment.
Patent Information
- Application Number
- CN202510482183.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-04-17
AI Technical Summary
The existing tool wear status monitoring methods have shortcomings in terms of accuracy and reliability. The generalization ability and adaptability of the identification model need to be improved, making it difficult to adapt to the wear detection needs of various mechanical equipment.
Using a method based on bidirectional gating spatiotemporal fusion and adaptive wavelet decomposition, the associated features of data in the spatiotemporal dimension are dynamically captured through dynamic adaptive wavelet networks and bidirectional gating spatiotemporal feature fusion devices, multi-scale decomposition and feature extraction are performed, and tool wear classification model is constructed.
It improves the accuracy and generalization ability of tool wear classification, can better adapt to complex industrial field environments, enhances the robustness of the model and the adaptability of signal characteristics, and achieves higher recognition accuracy and reliability.
Smart Images

Figure CN120277567A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of tool wear state monitoring, and particularly to a tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition. Background Art
[0002] In the process of modern industrial production and mechanical equipment operation, wear is an inevitable and crucial problem. Accurately monitoring and predicting the wear state of equipment is of great significance for ensuring the normal operation of equipment, improving production efficiency, reducing maintenance costs, and avoiding 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 achieve wear state monitoring and prediction has become a research hotspot.
[0003] With the development of artificial intelligence technology, machine learning, deep learning and other models have been widely used in tool wear state recognition. Machine learning models learn and train a large amount of tool wear data to establish a mapping relationship between tool wear states and monitoring signal features, thereby realizing the recognition of tool wear states. Support Vector Machine (SVM) is a commonly used machine learning model, which has good performance in small sample and non-linear classification problems. Neural network is also a machine learning model widely used in tool wear state recognition, which has strong non-linear mapping ability and self-learning ability. As a branch of machine learning, deep learning models have achieved remarkable results in the field of tool wear state recognition in recent years. Deep learning models can automatically learn complex feature representations from a large amount of data without manual feature extraction, and have higher recognition accuracy and efficiency. Convolutional Neural Network (CNN) is a commonly used deep learning model, which performs well in the field of image recognition and is also widely used in image-based tool wear state recognition.
[0004] Many scholars have conducted a large number of studies on tool wear monitoring methods and recognition models, and achieved rich results. However, there are still some deficiencies in the current research, such as the accuracy and reliability of monitoring methods need to be improved, and the generalization ability and adaptability of recognition models need to be further enhanced. Therefore, future research needs to continuously explore new monitoring methods and recognition models to improve the accuracy and reliability of tool wear state recognition and meet the actual needs of industrial production. Summary of the Invention
[0005] Aiming at the deficiencies of the existing technology, the present invention proposes a tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition, aiming to be applicable to a variety of mechanical equipment, especially the wear detection and classification of tools; aiming to dynamically capture the correlation features of data in the spatio-temporal dimension, perform multi-scale decomposition on the input, accurately extract the detailed features of different frequency components, and balance the computational efficiency and the robustness of the wear classification model.
[0006] To achieve the above technical objectives, the present invention provides the following technical solutions:
[0007] The tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition specifically includes the following steps:
[0008] S1. Collect the vibration signal data during the operation of the tool, divide the obtained original data set into a training set and a test set, and preprocess the data at the same time;
[0009] S2. Construct a dynamic adaptive wavelet network, take the preprocessed signal data as the input, decompose it according to odd and even indices, and obtain the approximate coefficients and detailed coefficients of the input;
[0010] S3. Perform interpolation upsampling on the obtained approximate coefficients and detailed coefficients to retain the original size; then apply instance normalization to the approximate coefficients and use them as the frequency domain features of the vibration signal;
[0011] S4. Construct a bidirectional gated spatio-temporal feature fusion device BGSFF to process the preprocessed signal data in parallel with the dynamic adaptive wavelet network, splice the input with the horizontal and vertical hidden states, and dynamically update the two states through a multi-head gated mechanism to capture the long-term wear trend and local transient features in the input vibration signal data;
[0012] S5. Splice the output of the dynamic adaptive wavelet network and the output of the BGSFF to obtain comprehensive features; obtain the classification result of tool wear according to the comprehensive features;
[0013] S6. Use the training set data to train the model, use the test set for verification, monitor the performance of the model during the training process, and obtain the final tool wear classification model.
[0014] Further, step S1 specifically includes:
[0015] S11. Obtain the original vibration signal data X ∈ R during the operation of the tool from public data N×C , where N is the total length of the signal and C is the feature dimension;
[0016] S12. Perform normalization processing on the original vibration signal data X and scale it to the range of [0,1] to obtain the normalized data Xnorm ∈R N×C ;
[0017] S13. Cut the normalized data according to the specified sample length L to generate multiple samples; the formula is expressed as:
[0018] X samples ={X norm [i:i + L]|i = 0, L, 2L,..., N - L};
[0019] where X samples is the set of cut samples, and each sample X samples [k]∈R L×C ,
[0020] S14. Assign corresponding wear labels to each sample, the formula is expressed as:
[0021] Y samples ={y k |k = 1, 2,...k};
[0022] where y k is the wear label of the kth sample, and the wear label is the classification label, representing the tool wear degree;
[0023] S15. Divide the dataset into a training set x train and a test set x test , and add noise to the training set to dynamically generate augmented data, expand the training dataset, and improve the generalization ability and robustness of the model.
[0024] Furthermore, step S2 specifically includes:
[0025] S21. Input the signal x∈R B×C×L , split it into two subsequences according to even and odd indices, the formula is expressed as:
[0026]
[0027] where x even , x odd are 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, taking one element every 2 elements, and finally getting the subsequence at even index positions; x[:, :, 1::2] means that in the sample length dimension, starting from index 1, taking one element every 2 elements, and finally getting the subsequence at odd index positions;
[0028] S22. Process the split signal using learnable P operator and U operator; the P operator and U operator consist of a learnable one-dimensional convolution, reflection padding, GELU activation, and layer normalization connected in sequence; first use the U operator to update the even samples based on the odd samples and update the approximation coefficients, and then predict the detail coefficients d from the updated and corrected approximation coefficients c through the P operator.
[0029] Further, step S3 specifically includes:
[0030] S31. Perform interpolation upsampling on the obtained approximation coefficients c and detail coefficients d to maintain the same size as the original input signal. The formula is expressed as:
[0031]
[0032] where c up , d up are the approximation coefficients and detail coefficients after interpolation upsampling respectively; x.size(2) is the length of the original input signal, Interpolate is the interpolation operation, and mode = linear indicates the use of linear interpolation.
[0033] S32. Apply instance normalization to the interpolated approximation coefficients c up to improve the stability and expression ability of the features. The formula is expressed as:
[0034] c norm = InstanceNorm1d(c up );
[0035] where InstanceNorm1d is a one-dimensional instance normalization operation, which normalizes each channel separately. Finally, return the instance-normalized approximation coefficients c norm as the frequency domain features of the vibration signal.
[0036] Further, step S4 specifically includes:
[0037] S41. At each time step t, the input of the BGSFF module is divided into: the preprocessed vibration signal x t at the current time step, the horizontal hidden state the vertical hidden state Concatenate these three parts together to form a comprehensive input vector
[0038] S42. For each attention head i, calculate the gating signal through independent weight matrix W i and bias B i . The formula is expressed as:
[0039] gate i= W i · gate_input t + B i ;
[0040] Wherein, W i is the weight matrix of the i-th attention head, used to learn different frequency band features from the input vector after linear transformation splicing; B i is the bias vector of the i-th attention head, used to learn the reference threshold of the gating signal, gate i is the gating signal of the i-th attention head, which is split into four parts of Sigmoid gating signals, namely the update gate in the horizontal direction, the update gate in the vertical direction, the output gate in the horizontal direction and the output gate in the vertical direction, and two parts of Tanh gating signals, namely the input gate in the horizontal direction and the input gate in the vertical direction; The Sigmoid gating signal is used to control the information retention degree of the hidden state and the influence degree on the output; The Tanh gating signal is used to control the degree of information addition;
[0041] S43. On each attention head, update the horizontal and vertical hidden states according to the Sigmoid gating signal and the Tanh gating 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 to the hidden state;
[0042] S44. Enable the residual connection, sum the output increments of each attention head to the hidden state and add them to the original hidden state as the updated horizontal hidden state and vertical hidden state of the BGSFF module at each time step; The formula is expressed as:
[0043]
[0044] Wherein, are the vertical hidden state and horizontal hidden state at time step t respectively, output_slice_row i 、output_slice_col i are the output increments of the i-th attention head to the horizontal hidden state and to the vertical hidden state respectively, num_heads is the total number of attention heads, are the updated, that is, the horizontal hidden state and vertical hidden state at the next time step;
[0045] Then combine the updated horizontal hidden state and vertical hidden state as the final output of the BGSFF model at each time step.
[0046] More specifically, step S43 specifically includes:
[0047] S431. For each attention head, the intermediate state generated by non-linear transformation first serves as a candidate feature to provide a new state to be fused. The formula is expressed as:
[0048]
[0049] Among them, is the candidate feature, h t is the hidden state, W c is the candidate feature weight matrix, b c is the candidate feature bias term; tanh() represents the tanh gating signal, which compresses the feature to the interval [-1, 1];
[0050] S432. Calculate the new state fusion ratio through the update gate in the Sigmoid gating signal. The formula is expressed as:
[0051] z t+1 =σ(W z ·[h t ; x t +b z );
[0052] Among them, W z is the update gate weight matrix, b z is the update gate bias, z t+1 is the new state fusion ratio; σ(.) is the Sigmoid gating signal;
[0053] S433. Obtain the hidden state update amount. The formula is expressed as:
[0054]
[0055] Among them, (1 - z t ) represents the proportion of the old state retained, and ⊙ is element-wise multiplication;
[0056] S434. Then obtain the updated hidden state through the output gate. The formula is expressed as:
[0057]
[0058] Among them, W o is the output gate weight matrix, b0 is the output gate bias; o t+1 is the output gate value; is the updated hidden state.
[0059] Furthermore, step S5 specifically includes:
[0060] S51, splicing the frequency features extracted by the dynamic adaptive wavelet network and the spatiotemporal features extracted by BGSFF 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 LSTM as the final feature representation, and input the final feature representation into the fully connected layer to realize tool wear classification.
[0063] Furthermore, step S6 specifically includes:
[0064] S61. First, use the training set to train the tool wear classification model, 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] Among them, θ is the parameter of the model, f θ is the mapping function of the model, L train () is the training loss function, θ * is the optimal configuration parameter;
[0067] S62. After obtaining the optimal parameter configuration model, the model is verified using the test set. The accuracy, recall rate, and F1-Score indicators are calculated through 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. The present invention designs a dynamic adaptive wavelet network, designs the P operator and the U operator as a learnable one-dimensional convolution structure, and integrates reflection filling, GELU activation and layer normalization components; it can adaptively extract key features based on the complex characteristics of tool wear signals, accurately capture the patterns of signals at different wear stages, and achieve higher accuracy in tool wear classification tasks. The generalization ability is significantly improved, and the problem of insufficient signal feature adaptation caused by parameter solidification of traditional fixed operators is successfully solved, which is more suitable for application scenarios with changeable industrial field signals;
[0070] 2. The present invention designs a BGSFF module. Through its horizontal gating, it can capture the long-term evolution pattern of vibration signals (such as the gradual change of wear from the initial stage to the later stage), and through vertical gating, it can fuse the co-variation of multi-channel vibration signals (such as the vibration correlation at different positions of the tool). The gating mechanism dynamically suppresses the time steps dominated by noise (such as random interference during machining) and focuses on effective vibration events. Residual connections can further ensure the gradient stability of the model in long-time series vibration signals.
[0071] 3. The present invention focuses on extracting local high-frequency details (such as transient shocks and noise in vibration signals) and low-frequency trends (such as the gradual change of wear) through a dynamic adaptive wavelet network, and realizes multi-scale analysis through wavelet decomposition. The BGSFF focuses on capturing global spatio-temporal correlations (such as long-term dependencies in time series and spatial correlations between features). The combination of the two covers all-scale features from micro to macro, enhancing the model's joint perception of local mutations and global evolution laws of signals. The features after wavelet decomposition have physical interpretability (such as high-frequency components corresponding to abnormal events), while the output of the BGSFF is a data-driven abstract representation. The splicing of the two not only retains the essential characteristics of the signal but also incorporates high-level semantic information. The wavelet module suppresses noise interference through filtering, and the BGSFF filters redundant information through the gating mechanism, and the dual denoising improves the classification robustness of the model in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The drawings described herein are used to provide a further understanding of the present application, form a part of the present application, and the schematic embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0073] Figure 1 is the overall flowchart of a tool wear classification method based on bidirectional gating spatio-temporal fusion and adaptive wavelet decomposition provided by the present invention;
[0074] Figure 2 is the architecture diagram of the dynamic adaptive wavelet network provided by the present invention;
[0075] Figure 3 is the architecture diagram of the bidirectional gating spatio-temporal feature fusion device BGSFF provided by the present invention;
[0076] Figure 4 is the schematic diagram of the accuracy rate of the tool wear state classification by the method of the present invention;
[0077] Figure 5 is the schematic diagram of the loss of the tool wear state classification by the method of the present invention;
[0078] Figure 6 is the schematic diagram of the confusion matrix of the tool wear state classification result by the method of the present invention.
[0079] Figure 7 This is a comparison chart of the accuracy rate between the present invention and the prior art. Specific embodiments
[0080] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Thereby, the implementation process of how this application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0081] Those of ordinary skill in the art can understand that all or part of the steps in the above-described embodiment methods can be completed by instructing relevant hardware through a program. Therefore, this application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can adopt 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 , which shows a specific implementation manner of this embodiment. In this embodiment, the present invention designs a network including a dynamic adaptive wavelet network, a bidirectional gated spatio-temporal feature fusion device (BGSFF), and LSTM, which can apply a wear recognition model trained based on known tool data to the wear recognition of unknown data, solve the problem of low accuracy of tool wear recognition, and can output more accurate tool wear recognition results, achieving the purpose of improving the versatility and accuracy rate 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 spatio-temporal fusion and adaptive wavelet decomposition, and this method includes the following steps:
[0084] S1. Collect vibration signal data during the operation of the tool, divide the obtained original data set into a training set and a test set, and preprocess the data at the same time;
[0085] As a preferred implementation manner, step S1 specifically includes:
[0086] S11. Obtain the original vibration signal data X ∈ R N×C during the operation of the tool from public data, where N is the total length of the signal and C is the feature dimension;
[0087] S12. Perform normalization processing on the original vibration signal data X, scale it to the range of [0, 1], and obtain the normalized data X norm ∈ R N×C ;
[0088] S13. Cut the normalized data according to the specified sample length L to generate multiple samples. The formula is expressed as:
[0089] X samples ={X norm [i:i + L]|i = 0,L,2L,...,N - L};
[0090] Among them, X samples is the set of cut samples, and each sample X samples [k]∈R L×C , k = 1,2,...,K,
[0091] S14. Assign corresponding wear labels to each sample. The formula is expressed as:
[0092] Y samples ={y k |k = 1,2,...k};
[0093] Among them, y k is the wear label of the kth sample. The wear label is the classification label, representing the tool wear degree;
[0094] S15. Divide the dataset into a training set x train and a test set x test , and add noise to the training set, dynamically generate augmented data, expand the training dataset, and improve the model generalization ability and robustness.
[0095] In this embodiment, the added is uniform noise, and its value is randomly distributed within a specified range. A small noise factor 0.01 is selected, indicating the intensity of the noise 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, the interference in reality is simulated. When the mechanical equipment is working, the sensor may be subject to some uniform and non-periodic interference. For example, due to factors such as temperature changes and the working state of electrical equipment, the equipment may generate certain electromagnetic interference or noise, and these noises generally show the characteristics of uniform distribution. Therefore, uniform noise is added to improve the model's ability to handle noise and its tolerance to data fluctuations and equipment errors in the real environment.
[0096] S2. Construct a dynamic adaptive wavelet network, use the preprocessed signal data as the input, decompose it according to odd and even indices, and obtain the approximate coefficients and detail coefficients of the input; as Figure 2As shown, after the data is input, the Splitting module is first called for data splitting, then processed by the lifting scheme (calling the LiftingScheme module), then the normalization operation is performed, and finally the adaptive wavelet block processing is completed by calling the AdpWaveletBlock, and the processing result is finally output;
[0097] As a preferred embodiment, step S2 specifically includes:
[0098] S21. The input signal x ∈ R B×C×L , is split into two subsequences according to even and odd indices, and the formula is expressed as:
[0099]
[0100] where x even and x odd are the even samples 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, one element is taken every 2 elements, and finally the subsequence at the even index position is obtained; x[:, :, 1::2] means that in the sample length dimension, starting from index 1, one element is taken every 2 elements, and finally the subsequence at the odd index position is obtained; here, the channel-first splitting strategy is designed to avoid the feature blur problem caused by channel mixing in traditional methods; the channel-first strategy means that when splitting the signal (even and odd sampling), the independence of the channel dimension (C) is given priority, and the subsequence division is only performed in the sample length dimension (L). Its core purpose is to avoid the feature blur problem caused by cross-channel mixing operations in traditional methods and ensure that the feature information of each channel can be completely retained after splitting.
[0101] S22. Use the learnable P operator and U operator to process the split signal; the P operator and U operator are composed of a learnable one-dimensional convolution, reflection padding, GELU activation, and layer normalization connected in sequence; first use the U operator to update the even samples based on the odd samples and update the approximation coefficients, and then predict the detail coefficients d from the updated and corrected approximation coefficients c through the P operator; the specific calculation process is as follows:
[0102] First, find the update amount U(x odd )
[0103] U(x odd ) = LayerNorm(GELU(Conv1d(ReflectionPad1d(x odd ))));
[0104] Among them, LayerNorm(.) is layer normalization, GELU(.) is the GELU activation, Conv1d(.) is the learned one-dimensional convolution, and ReflectionPad1d(.) is the reflection padding;
[0105] Then update the approximation coefficient, which is 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. The predicted value P(c) calculated by the P operator is:
[0108] P(c) = LayerNorm(GELU(Conv1d(ReflectionPad1d(c))));
[0109] Predict the detail coefficient, which is expressed by the formula:
[0110] d = X odd - P(c);
[0111] In this embodiment, a learnable one-dimensional convolution is designed to extract the local patterns of the signal in the tool wear signal analysis. These local patterns correspond to the characteristic changes in different wear stages, such as the periodicity and impact of the vibration signal, etc.; and during the training process, the convolution kernel weights of the learnable one-dimensional convolution are continuously adjusted through the backpropagation algorithm, so as to automatically learn the most suitable pattern for feature extraction according to the characteristics of the input signal, thereby realizing adaptive feature extraction; in addition, non-linear factors are introduced into the model through reflection padding, GELU activation, and layer normalization, enabling the model to learn more complex non-linear relationships in the signal, thereby enhancing the expression ability of the model.
[0112] In the traditional wavelet transform lifting scheme, the prediction and update operators are usually designed based on fixed filters, relying on prior knowledge and fixed parameter settings, and it is difficult to adapt to different types and complexities of signals. However, the dynamically adaptive wavelet forget-me-not designed in the present invention breaks the fixed pattern of the traditional method.
[0113] S3. Perform interpolation upsampling processing on the obtained approximation coefficient and detail coefficient to retain the original size; then apply instance normalization to the approximation coefficient and use it as the frequency domain feature of the vibration signal;
[0114] As a preferred implementation manner, step S3 specifically includes:
[0115] S31. Perform interpolation upsampling processing on the obtained approximation coefficient c and detail coefficient d to keep the same size as the original input signal, which is expressed by the formula:
[0116]
[0117] Among them, c up and d up are the approximate coefficient and the detail coefficient after interpolation upsampling respectively; x.size(2) is the length of the original input signal, Interpolate is the interpolation operation, and mode = linear indicates the use of linear interpolation;
[0118] In this application, linear interpolation is selected to restore the low-frequency approximate coefficient and the high-frequency detail coefficient after wavelet decomposition to the length of the original signal, which is convenient for subsequent feature fusion. Traditional wavelet processing usually directly discards the high-frequency components or only retains the low-frequency components. By interpolation, the integrity of multi-scale features is retained, which is compatible with the subsequent neural network layers (to avoid size mismatch). And the early wear of the tool is manifested as a small continuous increase in vibration energy, and quasi-periodic impact components appear during severe wear. Linear interpolation can perfectly reconstruct the progressive change trend of the wear signal.
[0119] S32. Apply instance normalization to the interpolated approximate coefficient c up to improve the stability and expression ability of the features; the formula is expressed as:
[0120] c norm = InstanceNorm1d(c up );
[0121] Among them, InstanceNorm1d is a one-dimensional instance normalization operation, which normalizes each channel separately. Finally, return the instance-normalized approximate coefficient c norm as the frequency-domain feature of the vibration signal;
[0122] In the milling cutter wear experiment, the energy growth of the approximate coefficient shows a monotonic increase during the severe wear stage, while the detail coefficient shows irregular fluctuations. Comparing the feature robustness of the approximate coefficient and the detail coefficient, the influence of sensor noise on the approximate coefficient changes by <5%, and the influence on the detail coefficient changes by >50%. The influence of rotational speed fluctuation on the approximate coefficient is negligible, and the influence on the detail coefficient is significant; therefore, this application selects the instance-normalized approximate coefficient as the frequency-domain feature of the vibration signal, that is, the output of the dynamic adaptive wavelet network;
[0123] S4. Construct a bidirectional gated spatio-temporal feature fusion device BGSFF to process the preprocessed signal data in parallel with the dynamic adaptive wavelet network, splice the input with the horizontal and vertical hidden states, and dynamically update the two states through a multi-head gated mechanism to capture the long-term wear trend and local transient features in the input vibration signal data;
[0124] The BGSFF module designed in the present invention introduces multi-head dynamic gating and residual connections; the tool vibration signal contains high-frequency chipping impacts (short-term bursts) and low-frequency wear trends (long-term gradual changes), which are difficult to balance with traditional single gating; therefore, the design of the present invention adopts multi-head division of labor, which can not only capture high-frequency impacts (chipping events), but also model low-frequency energy accumulation (progressive wear), and can also analyze the phase difference between multi-sensor channels. Each attention head passes through an independent W i / B i parameter to learn diverse and differentiated features in different frequency bands; in addition, the early wear characteristics are weak (signal change <5%), and the deep network is prone to gradient disappearance. Introducing residual links can ensure that the gradient passes directly to the bottom layer. Residual connections allow the model to utilize both local transient features (such as chipping pulses) extracted from the shallow layer and the global wear state learned from the deep layer at the same time.
[0125] As a preferred implementation, as Figure 3 shown, step S4 specifically includes:
[0126] S41. At each time step t, the input of the BGSFF module is divided into: the preprocessed vibration signal x t at the current time step, the horizontal hidden state the vertical hidden state These three parts are concatenated together to form a comprehensive input vector
[0127] S42. For each attention head i, calculate the gating signal through an independent weight matrix W i and bias B i , and the formula is expressed as:
[0128] gate i =W i ·gate_input t +B i ;
[0129] Among them, W i is the weight matrix of the i-th attention head, used to learn different frequency band features from the linearly transformed concatenated input vector; B i is the bias vector of the i-th attention head, used to learn the reference threshold of the gating signal. gate i is the gating signal of the i-th attention head, which is split into four parts of Sigmoid gating signals, namely the update gate in the horizontal direction, the update gate in the vertical direction, the output gate in the horizontal direction, and the output gate in the vertical direction, and two parts of Tanh gating signals, namely the input gate in the horizontal direction and the input gate in the vertical direction; the Sigmoid gating signal is used to control the information retention degree of the hidden state and the influence degree on the output; the Tanh gating signal is used to control the degree of information addition;
[0130] S43. On each attention head, update the horizontal and vertical hidden states according to the Sigmoid gating signal and the Tanh gating signal respectively, and then calculate the difference between the hidden states before and after the update (that is, subtract the hidden state before the update from the hidden state after the update) to obtain the output increment of each attention head to the hidden state;
[0131] More specifically, step S43 specifically includes:
[0132] S431. On each attention head, first generate an intermediate state through a non-linear transformation as a candidate feature for providing a new state to be fused; the formula is expressed as:
[0133]
[0134] Among them, is the candidate feature, h t is the hidden state, W c is the candidate feature weight matrix, b c is the candidate feature bias term; tanh() represents the Tanh gating signal, which compresses the feature to the interval [-1,1]; first of all, it should be noted here that since the processing methods of the horizontal hidden state and the vertical hidden state are the same, and they only represent the hidden states in the time dimension and the feature dimension respectively, they are collectively referred to as the hidden state in the formulas of steps S431 - S434;
[0135] S432. Calculate the new state fusion ratio through the update gate in the Sigmoid gating signal, and the formula is expressed as:
[0136] z t+1 = σ(W z ·[h t ; x t +b z );
[0137] Among them, W z is the update gate weight matrix, b z is the update gate bias, z t+1 is the new state fusion ratio; σ(.) is the Sigmoid gating signal;
[0138] S433. Calculate the hidden state update amount, and the formula is expressed as:
[0139]
[0140] Among them, (1 - z t ) represents the proportion of the old state retained, and ⊙ is element-wise multiplication to achieve dimension-independent weight allocation
[0141] S434. Then, the updated hidden state is obtained through the output gate, which is expressed by the formula:
[0142]
[0143] where, W o is the output gate weight matrix, and b0 is the output gate bias; o t+1 is the output gate value; is the updated hidden state; the update amount of the hidden state first passes through a tanh gating signal and then is element-wise multiplied by the output gate value to prevent gradient explosion and enhance numerical stability.
[0144] S44. Enable the residual connection. Sum the output increments of each attention head to the hidden state and add it to the original hidden state, which is used as the updated horizontal hidden state and vertical hidden state of the BGSFF module at each time step; the formula is expressed as:
[0145]
[0146] where, are the vertical hidden state and horizontal hidden state at time step t respectively, output_slice_row i and output_slice_col i are the output increments of the i-th attention head to the horizontal hidden state and vertical hidden state respectively, num_heads is the total number of attention heads, are the updated, that is, the horizontal hidden state and vertical hidden state at the next time step;
[0147] Then, the updated horizontal hidden state and vertical hidden state are combined (that is, the output states are added element-wise) as 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 the BGSFF to obtain the comprehensive features; obtain the classification result of tool wear according to the comprehensive features;
[0149] As a preferred implementation manner, step S5 specifically includes:
[0150] S51. Concatenate the frequency features extracted by the dynamic adaptive wavelet network and the spatio-temporal features extracted by the BGSFF together on the channel dimension to obtain the comprehensive features and capture richer signal characteristics;
[0151] S52. Then, input the comprehensive features into a single-layer LSTM to capture the 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. Use the training set data to train the model, and use the test set for verification. Monitor the performance of the model during the training process to obtain the final tool wear classification model.
[0154] As a preferred implementation manner, step S6 specifically includes:
[0155] S61. First, use the training set to train the tool wear classification model, 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] Among them, θ is the parameter of the model, f θ is the mapping function of the model, L train () is the training loss function, θ * is the optimal configuration parameter. In this embodiment, the cross-entropy loss function is selected, and the formula is expressed as:
[0158]
[0159] Among them, N train represents the total number of training samples, CA is the total number of categories (including initial wear, normal wear, severe wear), Y i,c is the true label (one-hot encoding) of sample i, f θ (X i ) ca is the predicted probability of the model for category ca.
[0160] S62. After obtaining the optimal parameter configuration model, use the test set to verify the model, calculate the accuracy, recall rate, and F1-Score indicators through the confusion matrix, and evaluate the performance of the obtained tool wear classification model.
[0161] In addition, in this embodiment, to verify a tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition proposed by the present invention, the following experimental examples are also carried out:
[0162] This method was implemented on the open dataset of the 2010 High-Speed CNC Machine Tool Tool Health Prediction Competition organized by the Society for Prediction and Health Management in New York, USA. The vibration signals generated during the machining of milling cutter C1 and their corresponding wear values were collected. The tool was fed 315 times, and the wear value of the cutting edge was measured after each feed. The vibration signals collected during the machining of C1 were used as the dataset.
[0163] The sampling frequency of the original vibration signal was 50 kHz. If the original signal was directly input into the network for training, the number of model parameters would be too large, and the performance of ordinary devices would be difficult to meet the requirements. Therefore, 80% of the dataset was used as the training set and 20% as the test set. According to 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, and the initial wear, intermediate wear, and late wear were represented by labels 0, 1, and 2 respectively. The labels were converted into a format suitable for the deep learning model through one-hot encoding. The division results are shown in Table 1.
[0164] Table 1 Classification labels for tool wear degree
[0165]
[0166] During the actual acquisition process, the tool machining signal data in some time periods was incomplete. Therefore, the signal segments with abnormal data volumes were removed, and the original segmented data was downsampled. Finally, data samples with a shape of (250, 40) were obtained. This dataset was used as the input of the deep learning model to verify the effects of each model. The initial learning rate of the model was set to 0.001. After every 10,000 steps, the learning rate became 0.9 times the original. The batch size was 64, and the number of training epochs was set to 100.
[0167] For illustration, Figure 4 and Figure 5 show the accuracy and loss changes of the model of the present invention during training. In the present invention, the number of training times was set to 100, the batch processing volume was set to 64, and the Adam algorithm with an initial learning rate of 0.001 was used. The samples after normalization processing and data cutting were used as the inputs of the bidirectional gated spatio-temporal feature fusion device and the dynamic adaptive wavelet network respectively. The wavelet output and the output of the bidirectional gated spatio-temporal feature fusion device were concatenated in the channel dimension. The single-layer LSTM was used to process the time series features, and the final state was taken as the input of the fully connected layer for classification. As can be seen from Figure 4 it can be seen that the training accuracy of the model of the present invention can be higher than 97%; as can be seen from Figure 5 it can be seen that the training loss of the model of the present invention can be lower than 0.1; as can be seen from Figure 6It can be seen that the model of the present invention has a high recognition accuracy for the wear of mechanical equipment. Figure 7 By comparing the present invention with the prior art, it can be seen that the present invention has a significant improvement in aspects such as the classification accuracy of tool wear and the generalization ability, which proves the technical advantages and innovation of the present invention. Therefore, the wear recognition method proposed by the present invention is reliable.
[0168] In summary, the classification method proposed by the present invention combines a dynamic adaptive wavelet network and a bidirectional gated spatio-temporal feature fusion device BGSFF to cover the full-scale features from micro to macro, enhancing the model's joint perception of local signal mutations and global evolution laws; the wavelet module suppresses noise interference through filtering, and BGSFF filters redundant information through a gating mechanism, and the double denoising improves the classification robustness of the model in complex environments; the present invention can more effectively identify the wear state and provide strong support for tool maintenance.
[0169] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0170] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in combination with these instruction execution systems, apparatus, or devices.
[0171] The above embodiments have introduced the present invention in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition, characterized in that, Including the following steps; S1. Collect vibration signal data during the operation of the tool, divide the obtained original data set into a training set and a test set, and preprocess the data simultaneously; S2. Construct a dynamic adaptive wavelet network, take the preprocessed signal data as input, decompose it according to odd and even indices to obtain the approximate coefficients and detail coefficients of the input; S3. Perform interpolation upsampling on the obtained approximate coefficients and detail coefficients to retain the original size; then apply instance normalization to the approximate coefficients, which are used as the frequency-domain features of the vibration signal; S4. Construct a Bidirectional Gated Spatiotemporal Feature Fuser (BGSFF) to process the preprocessed signal data in parallel with the dynamic adaptive wavelet network, concatenate the input with the horizontal and vertical hidden states, and dynamically update the two states 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 and the output of the BGSFF to obtain comprehensive features; Obtain the classification result of tool wear according to the comprehensive features; S6. Use the training set data to train the model, use the test set for verification, monitor the performance of the model during the training process, and obtain the final tool wear classification model.
2. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition according to claim 1, wherein Step S1 specifically includes: S11. Obtain the original vibration signal data \(X\in R\) during the operation of the cutting tool from the public data N×C , where \(N\) is the total length of the signal and \(C\) is the feature dimension; S12. Normalize the original vibration signal data X and scale it to the range [0, 1] to obtain the normalized data X norm ∈R N×C ; S13. Cut the normalized data according to the specified sample length L to generate multiple samples; the formula is expressed as: X samples = {X norm [i:i + L] | i = 0, L, 2L, ..., N - L}; where X samples is the set of cut samples, and each sample X samples [k] ∈ R L×C , k = 1, 2,..., K, S14. Assign corresponding wear labels to each sample, and the formula is expressed as: Y samples = {y k | k = 1, 2,... k}; where y k is the wear label of the k-th sample. The wear label is the classification label, which characterizes the tool wear degree; S15. Divide the dataset into a training set x train and a test set x test , and add noise to the training set to dynamically generate augmented data, expand the training dataset, and improve the generalization ability and robustness of the model.
3. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that Step S2 specifically includes: S21. The input signal \(x\in R\) B×C×L , is split into two subsequences according to odd and even indices, and the formula is expressed as: where x even and x odd are 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, one element is taken every 2 elements, and finally a subsequence at even index positions is obtained; x[:, :, 1::2] means that in the sample length dimension, starting from index 1, one element is taken every 2 elements, and finally a subsequence at odd index positions is obtained; S22. Process the split signal using learnable P operator and U operator; the P operator and U operator consist of reflection padding, 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 and update the approximate coefficients, and then predict the detail coefficients d from the updated and corrected approximate coefficients c through the P operator.
4. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that Step S3 specifically includes: S31. Perform interpolation upsampling on the obtained approximate coefficients c and detail coefficients d to maintain the same size as the original input signal, and the formula is expressed as: Among them, c up and d up are the approximate coefficient and the detail coefficient after interpolation upsampling respectively; x.size(2) is the length of the original input signal, Interpolate is the interpolation operation, and mode=linear indicates the use of linear interpolation; S32. Normalize the interpolated approximate coefficient c up Apply instance normalization to improve the stability and expressiveness of features; The formula is expressed as: c norm = InstanceNorm1d(c up ); Among them, InstanceNorm1d is a one-dimensional instance normalization operation that normalizes each channel separately; finally, the approximate coefficient c after instance normalization is returned. norm As the frequency domain feature of the vibration signal.
5. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that Step S4 specifically includes: S41. At each time step t, the input of the BGSFF module is divided into: the preprocessed vibration signal x at the current time step t , the horizontal hidden state , the vertical hidden state These three parts are concatenated together to form a comprehensive input vector S42. For each attention head i, calculate the gating signal through an independent weight matrix W i and bias B i using the formula: gate i = W i ·gate_input t + B i ; Among them, W i is the weight matrix of the i-th attention head, which is used to learn different frequency band features from the input vector after linear transformation splicing; B i is the bias vector of the i-th attention head, which is used to learn the reference threshold of the gating signal, gate i is the gating signal of the i-th attention head, which is split into four parts of Sigmoid gating signals, namely the update gate in the horizontal direction, the update gate in the vertical direction, the output gate in the horizontal direction and the output gate in the vertical direction, and two parts of Tanh gating signals, namely the input gate in the horizontal direction and the input gate in the vertical direction; the Sigmoid gating signal is used to control the degree of information retention of the hidden state and the influence on the output; the Tanh gating signal is used to control the degree of information addition; S43. On each attention head, update the horizontal and vertical hidden states according to the Sigmoid gating signal and Tanh gating signal respectively, and then calculate the difference between the updated and previous hidden states to obtain the output increment of each attention head for the hidden state; S44. Enable residual connection, sum the output increments of each attention head for the hidden state and add it to the original hidden state as the updated horizontal hidden state and vertical hidden state of the BGSFF module at each time step; the formula is expressed as: Among them, are respectively the vertical hidden state and the horizontal hidden state at time step t, output_slice_row i , output_slice_col i are respectively the output increments of the i-th attention head to the horizontal hidden state and to the vertical hidden state, and num_heads is the total number of attention heads. are respectively the updated, that is, the horizontal hidden state and the vertical hidden state at the next time step; Then combine the updated horizontal hidden state and vertical hidden state as the final output of the BGSFF model at each time step.
6. A tool wear classification method based on bidirectional gated time fusion and adaptive wavelet decomposition according to claim 5, characterized in that, Step S43 specifically includes: S431. On each attention head, first generate an intermediate state through a non-linear transformation as a candidate feature for providing a new state to be fused; the formula is expressed as: Among them, is a candidate feature, h t is a hidden state, W c is a candidate feature weight matrix, b c is a candidate feature bias term; tanh() represents the tanh gating signal, which compresses the feature to the interval [-1, 1]; S432. Calculate the new state fusion ratio through the update gate in the Sigmoid gating signal, and the formula is expressed as: z t+1 = σ(W z · [h t ; x t + b z ); Among them, W z is the updated gate weight matrix, b z is the updated gate bias, z t+1 is the new state fusion ratio; σ(.) is the Sigmoid gating signal; S433. Calculate the hidden state update amount, and the formula is expressed as: Among them, (1 - z t ) represents the proportion of the old state retained, and ⊙ is element-wise multiplication; S434. Then, obtain the updated hidden state through the output gate, which is expressed by the formula: Among them, W o is the output gate weight matrix, and b0 is the output gate bias; o t+1 is the output gate value; is the updated hidden state.
7. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that Step S5 specifically includes: S51. Concatenate the frequency features extracted by the dynamic adaptive wavelet network and the spatio-temporal features extracted by BGSFF 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 the 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.
8. A tool wear classification method based on bidirectional gated spatio-temporal fusion and adaptive wavelet decomposition according to claim 1, characterized in that, Step S6 specifically includes: S61. First, use the training set to train the tool wear classification model, optimize the model parameters, and obtain the optimal parameter configuration model; which is expressed by the formula: θ * = argminL train (f θ (X train ), Y train ); Among them, θ is the parameter of the model, and f θ is the mapping function of the model, and L train () is the training loss function, and θ * is the optimal configuration parameter; S62. After obtaining the optimal parameter configuration model, use the test set to verify the model, calculate the accuracy, recall rate, and F1-Score metrics through the confusion matrix, and evaluate the performance of the obtained tool wear classification model.
Citation Information
Patent Citations
Tool life complete cycle wear diagnosis method and device based on multiple wavelet optimal features and neural network and storage medium
CN113408182A
Cutter wear state prediction method based on spatial-temporal feature parallel extraction
CN113609789A
Milling tool wear monitoring method based on wavelet noise reduction and attention mechanism fused GRU network
CN114619292A
Cutter wear state monitoring method based on multi-scale space-time fusion network model
CN115828754A
Analog-circuit fault diagnosis method based on continuous wavelet analysis and elm network
US20200300907A1
Cited By
Mortise broach wear state identification method
CN120995069A