A tool wear prediction method and system

By constructing a tool wear prediction model that includes KAN network, LSTM network and self-attention mechanism, the problem of difficulty in capturing the complex features of milling data in the existing technology is solved, and more efficient tool wear prediction is achieved, improving prediction accuracy and stability.

CN119910504BActive Publication Date: 2026-07-24BEIJING INFORMATION SCI & TECH UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INFORMATION SCI & TECH UNIV
Filing Date
2025-03-11
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies struggle to simultaneously capture the complex nonlinear and temporal characteristics present in milling data, resulting in low accuracy in tool wear prediction.

Method used

A tool wear prediction model is constructed using a KAN network, a three-layer long short-term memory network, a two-layer fully connected layer, and a random deactivation layer. A weight penalty term and a self-attention mechanism are introduced. By preprocessing the data to remove noise and outliers and dynamically adjusting the weights, the adaptability and accuracy of the model are improved.

Benefits of technology

It significantly improves the accuracy and efficiency of tool wear prediction, better captures complex dynamic features and time series information, reduces overfitting, and enhances the model's generalization ability on unknown data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119910504B_ABST
    Figure CN119910504B_ABST
Patent Text Reader

Abstract

The present application relates to the field of tool wear prediction, and specifically to a tool wear prediction method and system, the method comprising: obtaining milling data related to tool milling, and preprocessing the milling data to obtain sample data; constructing a tool wear prediction model using a KAN network, a three-layer long short-term memory network, a two-layer fully connected layer, and a random inactivation layer; setting a weight penalty term related to the weight of the tool wear prediction model, and adding the weight penalty term to the loss function of the tool wear prediction model to obtain a weight-optimized tool wear prediction model; introducing a self-attention mechanism into the weight-optimized tool wear prediction model to obtain an optimized tool wear prediction model; training and evaluating the optimized tool wear prediction model using the sample data, and predicting tool wear using the optimized tool wear prediction model according to the evaluation result. The present application solves the problem of inaccurate tool wear prediction in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tool wear prediction, specifically a tool wear prediction method and system. Background Technology

[0002] In the industrial manufacturing sector, the efficient operation of CNC machine tools is crucial to the entire industrial system. As a key actuator of the machine tool, the performance of the cutting tool directly affects machining efficiency and workpiece quality. During machining, friction between the cutting tool and the workpiece leads to material loss and wear, which not only reduces machining efficiency and extends cycle time but also affects workpiece surface quality and increases costs. Therefore, accurately predicting tool wear is of great significance for improving machining efficiency, ensuring workpiece quality, and reducing costs. Traditional tool wear monitoring methods include cutting force measurement, motor current monitoring, sound feature analysis, and vibration signal detection. While these methods can reflect the tool wear state, they have limitations under complex cutting conditions. In recent years, research models based on machine learning and deep learning have gradually become the mainstream methods for tool wear prediction due to their advantages in handling complex data relationships. Domestic and international scholars have conducted extensive research on tool wear prediction, proposing various algorithms such as least squares support vector machines, residual variational autoencoders, and reinforcement learning algorithms. These methods have improved the accuracy of prediction to some extent. Deep learning models, especially those combining techniques such as convolutional neural networks, long short-term memory networks, and particle swarm optimization, perform better in automatic feature extraction and handling complex functions, thereby improving prediction accuracy and efficiency. Despite significant progress, challenges remain in capturing complex long-term dependencies in time series data, improving computational efficiency for large-scale data processing, and addressing the computational resource requirements of these models. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a tool wear prediction method and system, which solves the problem of low tool prediction accuracy caused by the difficulty in simultaneously capturing the complex nonlinear and temporal characteristics present in milling data.

[0004] To achieve the above objectives, one aspect of the present invention provides a tool wear prediction method, the method comprising: acquiring milling data related to tool milling, and preprocessing the milling data to obtain sample data; constructing a tool wear prediction model using a KAN network, a three-layer long short-term memory network, two fully connected layers, and a random deactivation layer; setting a weight penalty term related to the weights of the tool wear prediction model, and adding the weight penalty term to the loss function of the tool wear prediction model to obtain a weight-optimized tool wear prediction model; introducing a self-attention mechanism into the weight-optimized tool wear prediction model to obtain an optimized tool wear prediction model; training and evaluating the optimized tool wear prediction model using the sample data, and predicting tool wear using the optimized tool wear prediction model based on the evaluation results.

[0005] The KAN network and three-layer long short-term memory network in the tool wear prediction model of this invention can effectively capture the complex dynamic features and temporal information in the tool wear process. A weighted penalty term is set for the loss function of the tool wear prediction model to prevent overfitting during training. A self-attention mechanism is introduced, enabling the model to automatically focus on key features that have a significant impact on tool wear, further improving the accuracy and efficiency of prediction.

[0006] Optionally, the preprocessing of the milling data to obtain sample data includes: truncating the milling data using the third quartile method to obtain first data; performing outlier analysis on the first data and adjusting the first data based on the results of the outlier analysis to obtain second data; performing noise reduction on the second data using wavelet thresholding to obtain third data; performing time-domain and frequency-domain analysis on the third data to obtain multiple feature data; performing correlation analysis on the feature data using the Spearman correlation coefficient to obtain the most relevant feature data; and normalizing the most relevant feature data to obtain the sample data.

[0007] This invention truncates the original data using the third quartile method, removing the interference of extreme values ​​and ensuring data centrality and stability. Outlier analysis and data adjustment further eliminate erroneous or unreasonable data points, guaranteeing data accuracy. Wavelet threshold denoising is used to reduce noise interference in subsequent analysis, making the data clearer. Time and frequency domain analysis extracts multiple feature data, and Spearman correlation coefficient is used to select the most relevant feature data, avoiding redundant information and improving data representativeness. Normalization of the most relevant feature data ensures data scaling, facilitating model training and prediction. This series of preprocessing steps significantly improves the quality of the sample data, laying a solid foundation for efficient training and accurate prediction of the tool wear prediction model.

[0008] Optionally, the step of performing outlier analysis on the first data and adjusting the first data based on the results of the outlier analysis to obtain the second data includes: introducing a sliding window mechanism, using a window to slide and sample on the first data to obtain sampled data, the sampled data including multiple data points; calculating the median of the sampled data, and calculating the absolute deviation of the data points from the median using the median; comparing the data points with the absolute deviation, and adjusting the data points based on the comparison results to obtain the second data.

[0009] This invention uses a sliding window to sample multiple local samples from a first set of data, calculating the median and the absolute deviation of each data point from the median. By comparing the median and the absolute deviation, outlier data points are accurately identified and adjusted, avoiding local anomalies that might be missed in global analysis. This method can dynamically adapt to the local characteristics of the data, flexibly handle outliers in different regions, and preserve the overall trend and key information of the data, thus improving the stability and accuracy of the data.

[0010] Optionally, training the optimized tool wear prediction model using the sample data includes: assigning attention weights to the feature data in the sample data according to the self-attention mechanism to form weighted sample data; extracting nonlinear change features in the weighted sample data using the KAN network to obtain first feature data; extracting temporal features of the first feature data using the three-layer long short-term memory network to obtain second feature data; and adjusting the weights of the optimized tool wear prediction model using the second feature data until training is complete.

[0011] This invention utilizes a self-attention mechanism to dynamically allocate attention weights based on the importance of feature data in the sample data, forming weighted sample data. This allows the model to focus on features that have a greater impact on tool wear prediction, improving the representativeness of the features. The KAN network extracts nonlinear variation features from the weighted sample data, further exploring complex nonlinear relationships within the data and enhancing the model's adaptability to complex working conditions. A three-layer Long Short-Term Memory (LSTM) network deeply mines the temporal features of the extracted first feature data, effectively capturing the dynamic information of tool wear changes over time. This compensates for the shortcomings of traditional methods in extracting temporal features and improves the training effect of optimizing the tool wear prediction model.

[0012] Optionally, the step of assigning attention weights to the feature data in the sample data according to the self-attention mechanism to form weighted sample data includes: performing a linear transformation on the feature data to obtain a query matrix, a key matrix, and a value matrix; calculating the attention score of the feature data based on the query matrix and the key matrix; introducing a Softmax function and using the Softmax function to convert the attention score into the attention weight; obtaining weighted feature data based on the attention weight and the value matrix, and forming the weighted sample data based on the weighted feature data.

[0013] This invention performs a linear transformation on feature data to generate a query matrix, a key matrix, and a value matrix, providing a foundation for subsequent attention calculation. Attention scores are calculated using the query and key matrices to quantify the correlation between features. A Softmax function is introduced to convert the attention scores into normalized attention weights, ensuring the rationality and uniqueness of weight allocation. Finally, weighted feature data is obtained based on the attention weights and the value matrix, forming weighted sample data. This approach highlights the features in the data that have a greater impact on tool wear prediction, while suppressing the interference of unimportant features, thereby improving the quality of training samples for optimizing the tool wear prediction model.

[0014] Optionally, the weighted feature data satisfies the following formula: For the weighted feature data, For the query matrix, The key matrix, For the value matrix, For the permutation of the key matrix, Let be the dimension of the key matrix.

[0015] This formula has a simple structure and is easy to calculate.

[0016] Optionally, adjusting the weights of the optimized tool wear prediction model using the second feature data includes: making a prediction using the optimized tool wear prediction model based on the second feature data to obtain a prediction result; calculating the loss value of the loss function based on the prediction result; calculating the gradient of the loss function relative to the weights of the optimized tool wear prediction model based on the loss value; calculating the weighted moving average of the gradient and the weighted moving average of the square of the gradient to obtain a first estimate and a second estimate; and adjusting the weights of the optimized tool wear prediction model based on the first estimate and the second estimate.

[0017] The formula of this invention achieves weighting of feature data through the interaction of query matrix, key matrix and value matrix. It has a simple structure and is easy to calculate.

[0018] Optionally, adjusting the weights of the optimized tool wear prediction model based on the first estimate and the second estimate includes: obtaining optimized weights based on the first estimate and the second estimate; and adjusting the weights of the optimized tool wear prediction model using the optimized weights. The optimized weights satisfy the following formula: For the optimized weights, The current weights of the optimized tool wear prediction model, The current learning rate of the optimized tool wear prediction model. For the first estimate, For the second estimate, To prevent extremely small numbers with a denominator of 0.

[0019] This invention improves the adaptability and prediction accuracy of the tool wear prediction model by dynamically adjusting and optimizing the weights of the model by combining the first and second estimates. This method based on dynamic weight adjustment enables the model to better capture the complex changes in the tool wear process.

[0020] Optionally, the first feature data satisfies the following formula: This is an approximate function of the weighted sample data. For the KAN network The number of nodes in the layer To connect the KAN network The first layer The first neuron and the first The first layer Activation function of a neuron For the KAN network The number of nodes in the layer This represents the number of nodes in the second layer of the KAN network. To connect the second layer of the KAN network The first neuron and the third layer of the third layer Activation function of a neuron This represents the number of nodes in the first layer of the KAN network. To connect the first layer of the KAN network The first neuron and the second layer of the second layer Activation function of a neuron This represents the number of nodes in layer 0 of the KAN network. To connect the 0th layer of the KAN network The first neuron and the first layer of layer 1 Activation function of a neuron For the weighted sample data of the first Each component.

[0021] It should be noted that the number of nodes in layer 0 of the KAN network refers to the number of nodes in the input layer of the KAN network.

[0022] The activation function of each layer in the formula of this invention is responsible for converting the output of the previous layer into the input of the current layer. In this way, the model can capture complex patterns and high-order features in the data.

[0023] Another aspect of the present invention provides a tool wear prediction system, the system comprising: a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprising program instructions, and the processor is configured to invoke the program instructions to execute a tool wear prediction method as described in any of the preceding aspects of the present invention.

[0024] The tool wear prediction system of the present invention has a compact structure, stable performance, high integration and simple configuration. It can stably execute the tool wear prediction method provided in the preceding aspect of the present invention, further improving the overall applicability and practical application capability of the present invention. Attached Figure Description

[0025] Figure 1 This is a flowchart of a tool wear prediction method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a tool wear prediction system according to an embodiment of the present invention. Detailed Implementation

[0026] Specific embodiments of the present invention will now be described in detail. It should be noted that the embodiments described herein are for illustrative purposes only and are not intended to limit the invention. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that these specific details are not necessary to practice the invention. In other instances, well-known circuits, software, or methods have not been specifically described to avoid obscuring the invention.

[0027] Throughout this specification, references to "an embodiment," "an embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in connection with that embodiment or example is included in at least one embodiment of the invention. Therefore, the phrases "in an embodiment," "in an embodiment," "an example," or "an example" appearing in various places throughout the specification do not necessarily refer to the same embodiment or example. Furthermore, specific features, structures, or characteristics can be combined in one or more embodiments or examples in any suitable combination and / or sub-combination. Moreover, those skilled in the art will understand that the illustrations provided herein are for illustrative purposes and are not necessarily drawn to scale.

[0028] Figure 1 This is a flowchart of a tool wear prediction method according to an embodiment of the present invention. In order to solve the problem of low tool prediction accuracy caused by the difficulty in simultaneously capturing the complex nonlinear and temporal characteristics existing in milling data in the prior art, the method shown in Figure 2 includes the following steps: Step S1: Obtain milling data related to tool milling, and preprocess the milling data to obtain sample data.

[0029] In this embodiment, the milling data comes from the publicly available dataset of the tool remaining life prediction competition held by the American Society for Predictive and Health Management (PHM) in 2010. The experimental conditions of the dataset are shown in the table below: Under the above conditions, a full life cycle test was conducted on the HRC52 stainless steel material, involving a total of 315 milling operations. The milling data included cutting force signals in the X, Y, and Z directions, acceleration vibration signals, and acoustic emission signals during the machining process.

[0030] The preprocessing of the milling data to obtain sample data specifically includes the following sub-steps: Step S101: The milling data is truncated using the third quartile method to obtain the first data.

[0031] In this embodiment, to remove unstable signals during the cutting and shearing phases, the third quartile method is used for truncation. The third quartile method is a statistical method commonly used in data processing to identify and handle outliers or unstable data. Compared to other truncation methods, the third quartile method is suitable for processing such dynamic signals: it has strong robustness and can effectively filter out outliers. Secondly, this method does not depend on the distribution characteristics of the data, therefore it performs well when processing non-normally distributed force and vibration signals.

[0032] The first data refers to the data obtained after truncating the milling data using the third quartile method.

[0033] Step S102: Perform outlier analysis on the first data, and adjust the first data according to the results of the outlier analysis to obtain the second data.

[0034] The process of performing outlier analysis on the first data and adjusting the first data based on the results of the outlier analysis to obtain the second data specifically includes the following sub-steps: Step S10201: Introduce a sliding window mechanism to sample data by sliding the window over the first data. The sample data includes multiple data points.

[0035] The sliding window mechanism is a widely used technique in data processing and analysis. It acts like a moving "window" across a data sequence, allowing for localized observation and processing of the data. First, a fixed-size window is set, representing the number of data points included in each sample; for example, a window size of 100 data points. The window starts from the beginning of the first data point, "enclosing" the initial 100 data points, forming a sample set. Then, the window slides forward at a pre-defined step size, which is the number of data points the window traverses in each movement. Assuming a step size of 10, the window will move forward 10 data points, enclosing another 100 data points, forming a new sample set. This process repeats until the window reaches the end of the data sequence.

[0036] Step S10202: Calculate the median of the sampled data, and calculate the absolute deviation of the data points from the median using the median.

[0037] In this embodiment, the median is the value located in the middle after the data is arranged in ascending or descending order. If the number of data points is even, the average of the two middle values ​​is taken. After calculating the median, the absolute deviation of each data point from the median can be calculated. The absolute deviation is the absolute value of the difference between the data point and the median, reflecting the degree to which each data point deviates from the center position. By analyzing these absolute deviations, the dispersion of the sampled data can be understood, providing a basis for subsequent more accurate data analysis and processing.

[0038] Step S10203: Compare the data points with the absolute deviation, adjust the data points according to the comparison result, and then obtain the second data.

[0039] In this embodiment, data points are compared with the absolute deviation. If a data point is more than three times the absolute deviation, it is considered an outlier and replaced with the median within the window. This method effectively filters out outliers and is robust to non-normally distributed data.

[0040] The second data refers to the data obtained by replacing the median with the first data.

[0041] Step S103: Denoise the second data using wavelet threshold denoising method to obtain the third data.

[0042] In this embodiment, wavelet threshold denoising is used to denoise the second data. First, a multi-scale wavelet decomposition operation is performed on the second data, which decomposes the second data into several levels of approximate signals and detail signals. The approximate signals represent the main features and overall trends of the data, while the detail signals contain local variations and possible noise information in the data.

[0043] Next, thresholding is applied to each layer of detail signal. A soft threshold is used here, which effectively reduces or removes noise components smaller than the soft threshold while preserving signal characteristics. When a value in the detail signal is less than the soft threshold, that value is adjusted or set to zero, thereby reducing the impact of noise on the data.

[0044] Finally, the processed approximate and detail signals are reconstructed using inverse wavelet transform. Through this series of operations, noise in the second dataset is effectively suppressed, providing a more reliable foundation for subsequent data analysis and processing.

[0045] Step S104: Perform time-domain and frequency-domain analysis on the third data to obtain multiple feature data.

[0046] In this embodiment, when conducting in-depth analysis of the third data obtained after noise reduction processing, its feature information is comprehensively mined from three dimensions: time domain, frequency domain, and time-frequency domain.

[0047] In the time domain, a total of 12 feature signals were extracted, including maximum value, peak value, and variance. The maximum value reflects the maximum amplitude reached by the data in the time series, the peak value reflects the instantaneous fluctuation intensity of the data, and the variance measures the degree of dispersion of the data relative to the mean. These time-domain feature signals can clearly show the changing patterns and fluctuation characteristics of the data in the time dimension.

[0048] Frequency domain analysis focuses on four characteristic signals, including spectral power. Spectral power reveals the proportion of energy in a signal that is composed of different frequency components. By analyzing the frequency domain characteristics, we can understand the frequency distribution of the signal and identify the main frequency components.

[0049] The time-frequency domain analysis employed a three-level wavelet decomposition, extracting nine feature signals. Wavelet decomposition enables simultaneous localized analysis of the signal in both time and frequency domains, and these time-frequency domain feature signals help capture the details of signal variations across different time and frequency scales.

[0050] Therefore, 175 feature data can be extracted with each pass.

[0051] Step S105: Perform correlation analysis on the feature data using the Spearman correlation coefficient to obtain the most relevant feature data.

[0052] In this embodiment, Spearman's correlation coefficient is used to perform correlation analysis in order to filter out the most valuable information for the analysis. Spearman's correlation coefficient is a nonparametric statistical method that does not depend on the distribution of the data and mainly measures the monotonic relationship between two variables.

[0053] In practice, the Spearman correlation coefficient between any two variables in the feature data is calculated. The coefficient ranges from -1 to 1, with values ​​close to 1 indicating a positive correlation, close to -1 indicating a negative correlation, and close to 0 indicating a weak correlation. By comparing the magnitudes of the various correlation coefficients, the features most strongly correlated with the target variable can be identified. Finally, these most strongly correlated features are determined as the most relevant feature data, as they more accurately reflect the inherent patterns in the data and provide strong support for subsequent analysis.

[0054] Spearman's correlation coefficient satisfies the following formula: in It is the Spearman correlation coefficient. It is the rank difference of each pair of observations, where n is the number of observations. Step S106: Normalize the most relevant feature data to obtain the sample data.

[0055] In this embodiment, normalization is a data preprocessing technique that transforms data according to certain rules so that the data falls within a specific range.

[0056] Normalizing the most relevant feature data is a crucial step in obtaining high-quality sample data. As a data preprocessing technique, normalization transforms data into a specific range according to certain rules. Because different feature data have different units and dimensions, some features may dominate numerically, affecting model training. Normalization eliminates the influence of units, ensuring that all features have equal importance. The convergence speed of machine learning algorithms is affected by the data scale; normalization makes the data scale similar, accelerating model convergence. Simultaneously, it weakens the impact of outliers on the model, improving model stability and generalization ability. After normalization, sample data more suitable for subsequent analysis and modeling can be obtained.

[0057] Step S2: Construct a tool wear prediction model using a KAN network, a three-layer long short-term memory network, two fully connected layers, and a random deactivation layer.

[0058] In this embodiment, the KAN network is the Kolmogorov-Arnold Networks, a novel neural network architecture. The KAN network architecture indicates that the activation function is no longer a fixed sigmoid or ReLU; instead, it is learnable and applied to connections rather than nodes. Compared to traditional MLP algorithms, the KAN algorithm has the advantage of achieving higher accuracy with fewer parameters and can perform indirect learning rather than linear learning.

[0059] The KAN algorithm demonstrates that any continuous multivariable function can be decomposed into a series of simple univariate functions, exhibiting a nested structure. The mathematical expression of the Kolmogorov-Arnold theorem clarifies that each node can be viewed as a highly nonlinear mapping. This network effectively approximates complex functional relationships through combinations of these mappings, its key advantages being efficient expressive power and compact model structure. KAN relies on supervised learning and aims to approximate a function f such that input data points x can be mapped to corresponding output y. Using the Kolmogorov-Arnold theorem, any multivariate function can be decomposed into several univariate functions and their summation. Furthermore, for each input dimension... There exists a single variable function. It can aggregate the outputs of multiple univariate functions. The flexibility of this structure gives KAN a significant advantage in capturing complex data patterns, especially when combined with Long Short-Term Memory (LSTM) networks, which can enhance the model's ability to process time series data, thereby improving the accuracy and stability of predictions.

[0060] The core of KAN lies in its unique structural design, which differs significantly from the architecture of traditional neural networks. KAN learns activation functions as part of the network, ensuring that each connection not only has weight parameters but also a trainable activation function. This characteristic enables the network to adaptively discover optimal nonlinear transformations, providing greater flexibility in handling complex nonlinear problems, especially excelling in scenarios with complex data distributions or highly nonlinear relationships.

[0061] Furthermore, KAN's design allows switching between coarse-grained and fine-grained meshes, utilizing a parameterized B-spline activation function. This flexibility enables the network to capture subtle features while effectively simplifying computation and improving training efficiency. In this way, KAN not only enhances the model's expressive power but also demonstrates better generalization ability in practical applications, particularly in complex time series analysis fields such as tool wear value prediction.

[0062] Long Short-Term Memory (LSTM) networks are a special type of recurrent neural network designed to address the vanishing and exploding gradient problems that traditional recurrent neural networks may encounter when processing long sequences. The tool wear force signals, acceleration vibration signals, and acoustic emission signals used in the dataset are time-varying sequence data, reflecting how tool wear changes over machining time. Therefore, LSTM networks are suitable for predicting tool wear.

[0063] LSTM networks satisfy the following formula: In the formula: These are the weights of the forget gate, input gate, coupled forget gate, and output gate, respectively. These are the biases for the forget gate, input gate, coupled forget gate, and output gate, respectively.

[0064] Forget Gate: Used to determine the current moment. The previous moment is retained in the middle. The amount of information in the input. It is calculated by measuring the current input. Output at the previous moment It determines which information needs to be forgotten and which needs to be retained, and stores the retained information in the cell state. middle.

[0065] Input gate: Controls the writing of new information. The new information that a neuron decides to store is combined with the current input. Output at the previous moment Generate candidate memory units It is used to update the current cell state.

[0066] 3. Cell state update: Cell state This is the result of the combined action of the forget gate and the input gate. The forget gate determines which old information needs to be discarded, while the input gate determines which new information needs to be added.

[0067] Output Gate: Output gate Based on the current cell state The input determines the final output value. Cellular state After being processed by a nonlinear function, and then connected to the output gate Combined, to generate output .

[0068] The tool wear prediction model uses a KAN network to extract complex nonlinear features from the data, with a three-layer LSTM as the core temporal feature extraction unit. LSTM effectively solves the gradient vanishing problem inherent in traditional recurrent neural networks (RNNs) for long-term series modeling, and through its memory and forget gate mechanisms, it efficiently models the potential long- and short-term dependencies in tool wear data. To enhance the model's nonlinear expressive power, a modified linear unit (ReLU) activation function is introduced after the LSTM layers, improving the model's ability to capture complex wear patterns. To prevent overfitting, a dropout layer is added to the model, randomly deactivating some neurons to enhance its generalization ability.

[0069] Furthermore, the original single fully connected layer is expanded to two fully connected layers, further enhancing the model's feature representation capability and ensuring the stability and accuracy of the output results. Regarding hyperparameter optimization, the powerful capabilities of the Kolmogorov-Arnold representation theorem are utilized to map complex multidimensional nonlinear systems into linear combinations. By modeling the implicit laws within the system, the limitations of traditional optimization algorithms—fast convergence but prone to getting trapped in local optima—are overcome. This enhances the algorithm's global search capability and the diversity of its exploration space, ensuring that the optimal hyperparameter configuration is found during training.

[0070] Step S3: Set a weight penalty term related to the weights of the tool wear prediction model, and add the weight penalty term to the loss function of the tool wear prediction model to obtain a weight-optimized tool wear prediction model; In this embodiment, a weight penalty term is introduced into the loss function of the tool wear prediction model to prevent overfitting. During model training, if the weights are too large, the model tends to overemphasize noise and outliers in the training data. The introduced weight penalty term is the product of the sum of squared weights and a coefficient. This encourages the optimization process to reduce the weights. Smaller weights mean the model won't overly rely on any single feature, but will consider all features more evenly, resulting in a smoother performance. This effectively reduces overfitting to the training data, enhances its generalization ability on unknown data, and makes the tool wear prediction model more stable and reliable.

[0071] The weighted penalty term satisfies the following formula: in, As a weighted penalty term, The regularization coefficient is . Let be the vector dimension of the weights in the tool wear prediction model. This is a vector of weights for the tool wear prediction model.

[0072] Step S4: Introduce a self-attention mechanism into the weighted optimized tool wear prediction model to obtain an optimized tool wear prediction model; In this embodiment, the introduction of a self-attention mechanism into the weight-optimized tool wear prediction model can significantly improve the model's performance and prediction accuracy, thereby obtaining a more optimized tool wear prediction model.

[0073] While tool wear prediction models can estimate tool wear to some extent, their ability to capture long-distance dependencies between data is limited when dealing with complex and variable machining data. The introduction of a self-attention mechanism overcomes this limitation, allowing the model to perform correlation analysis on data from different locations when processing tool wear-related data sequences.

[0074] By employing a self-attention mechanism for querying, key-value calculation, and attention score allocation, the model can adaptively focus on the larger, key data features in the input data, assigning them higher weights while relatively weakening the influence of secondary features. This not only more accurately captures complex patterns and potential regularities in tool wear data but also effectively improves the predictive ability of tool wear conditions. Consequently, the optimized tool wear prediction model can more reliably provide early warnings of tool wear in practical production applications, offering strong support for rationally scheduling tool changeover times, improving production efficiency, and reducing production costs.

[0075] Step S5: Use the sample data to train and evaluate the optimized tool wear prediction model, and use the optimized tool wear prediction model to predict tool wear based on the evaluation results.

[0076] The training of the optimized tool wear prediction model using the sample data specifically includes the following sub-steps: Step S501: According to the self-attention mechanism, attention weights are assigned to the feature data in the sample data to form weighted sample data.

[0077] Specifically, according to the self-attention mechanism, attention weights are assigned to the feature data in the sample data to form weighted sample data, including: Step S50101: Perform a linear transformation on the feature data to obtain a query matrix, a key matrix, and a value matrix.

[0078] In this embodiment, the feature data is a multi-dimensional set of information reflecting the wear condition of the tool. In order for the model to more effectively explore the potential relationships between these data, a linear transformation is required. The linear transformation is achieved by using a learnable weight matrix.

[0079] For the feature data matrix composed of feature data, it is multiplied by three different weight matrices to obtain the query matrix, key matrix, and value matrix. These three matrices serve different purposes. The query matrix is ​​used to explore the relationships between data in subsequent steps; the key matrix works with the query matrix to determine the importance of different data elements by calculating similarity; and the value matrix is ​​the actual carrier of feature information, used for information aggregation based on the degree of correlation. This linear transformation lays the foundation for the subsequent calculation of the self-attention mechanism, enabling the model to more accurately capture long-distance dependencies in tool wear feature data and improve the accuracy of tool wear prediction.

[0080] Step S50102: Calculate the attention score of the feature data based on the query matrix and the key matrix.

[0081] In this embodiment, calculating the attention score of the feature data based on the query matrix and key matrix is ​​a crucial step in the tool wear prediction model based on the self-attention mechanism. First, a dot product is performed between each query vector in the query matrix and all key vectors in the key matrix, as the dot product measures the similarity between vectors. For the i-th query vector in the query matrix and the j-th key vector in the key matrix, their dot product reflects the degree of attention paid by the data at position i to the data at position j. All these dot product results constitute the initial attention score matrix. Subsequent scaling and other processing can be performed as needed to obtain an attention score that accurately reflects the correlation between feature data, providing a basis for accurate tool wear prediction.

[0082] Attention scores satisfy the following formula: To score attention, For the query matrix, The key matrix, For the permutation of the key matrix, Let be the dimension of the key matrix.

[0083] Step S50103: Introduce the Softmax function and use the Softmax function to convert the attention score into the attention weight.

[0084] In this embodiment, after calculating the attention scores based on the query matrix and key matrix, the Softmax function is introduced to transform these scores into meaningful attention weights. The Softmax function has a unique advantage: it can map any real number of attention scores to the (0,1) interval, and the sum of all attention weights is 1.

[0085] Specifically, for each query vector's attention score, the weight of each key vector is calculated using the Softmax function. A larger weight indicates that the feature information represented by the corresponding key vector is more important under that query. This transformation allows the model to weight feature data according to importance, thereby focusing more on key information in subsequent processing and improving the model's accuracy and efficiency in predicting tool wear. Step S50104: Obtain weighted feature data based on the attention weights and the value matrix, and form the weighted sample data based on the weighted feature data.

[0086] The weighted feature data satisfy the following formula: For the weighted feature data, For the query matrix, The key matrix, For the value matrix, For the permutation of the key matrix, Let be the dimension of the key matrix.

[0087] Step S502: Use the KAN network to extract the nonlinear variation features in the weighted sample data to obtain the first feature data.

[0088] In this embodiment, the KAN network is built based on the Kolmogorov-Arnold theorem and possesses powerful nonlinear mapping capabilities, enabling it to decompose complex multidimensional nonlinear relationships in weighted sample data into a series of simple one-dimensional functions. When weighted sample data is input into the KAN network, it processes the data in a unique way. Through a series of basis function combinations, the network can adaptively fit complex patterns in the data.

[0089] When processing weighted sample data, the neurons of the KAN network are activated and adjusted according to the dynamic changes in the data. It can identify non-linear features in the data at different scales and dimensions.

[0090] After meticulous analysis and feature extraction of the weighted sample data using the KAN network, the first feature data was obtained. This data contains key nonlinear information about the tool wear process, providing a deeper and more accurate characterization of the tool wear state. The first feature data provides the core basis for subsequently building a more accurate tool wear prediction model, helping to manage tools more scientifically in actual production and improve production efficiency and product quality.

[0091] Step S503: Use the three-layer long short-term memory network to extract the temporal features of the first feature data to obtain the second feature data.

[0092] In this embodiment, after acquiring the first feature data, the temporal features are extracted using a three-layer long short-term memory network to obtain more valuable second feature data.

[0093] A three-layer LSTM network processes the first feature data in a progressive manner. Each LSTM unit has an input gate, a forget gate, and an output gate; these gating mechanisms control the inflow, retention, and outflow of information. When processing the first feature data, the first LSTM layer first captures shallower temporal patterns in the data; the second layer further mines more complex and longer-term dependencies based on this; and the third layer integrates and deepens the features extracted by the previous two layers.

[0094] After processing by a three-layer LSTM network, the temporal features closely related to the change of tool wear over time can be accurately extracted from the first feature data, ultimately obtaining the second feature data. This data more comprehensively and deeply reflects the dynamic process of tool wear, providing strong support for the accurate prediction of subsequent tool wear conditions. It also helps to take timely measures such as tool replacement in actual production, ensuring smooth production operations.

[0095] Step S504: Adjust the weights of the optimized tool wear prediction model using the second feature data until training is complete.

[0096] The adjustment of the weights of the optimized tool wear prediction model using the second feature data specifically includes the following sub-steps: Step S50401: Based on the second feature data, use the optimized tool wear prediction model to make a prediction and obtain the prediction result.

[0097] In this embodiment, the second feature data is input into the optimized tool wear prediction model, and the optimized tool wear prediction model outputs the prediction result.

[0098] Step S50402: Calculate the loss value of the loss function based on the prediction result.

[0099] In this embodiment, the loss value of the loss function is a quantitative indicator that measures the degree of difference between the model's predicted result and the true label. Specifically, the predicted result and the true value are substituted into the mathematical expression of the loss function to calculate the loss value of the loss function.

[0100] Step S50403: Calculate the gradient of the loss function relative to the weights of the optimized tool wear prediction model based on the loss value.

[0101] In this embodiment, the loss value is obtained by comparing the tool wear amount predicted by the model with the actual tool wear amount through the loss function. This directly reflects the degree of deviation between the current model prediction and the actual situation. The gradient of the loss function relative to the model weights, which we need to calculate, essentially explores how the loss function changes with the model weights. The error information between the prediction and the actual situation contained in the loss value is the key basis for calculating this change. During the gradient calculation process, the magnitude of the error reflected by the loss value affects the calculation result, determining the direction and magnitude of the gradient, thus deriving the gradient of the loss function relative to the weights of the optimized tool wear prediction model.

[0102] Specifically, starting from the loss value, the partial derivative of the loss function with respect to the weights of the optimized tool wear prediction model is calculated layer by layer using the chain rule to obtain the gradient of the weights of the optimized tool wear prediction model.

[0103] In this embodiment, starting from the loss value, the gradient of the loss function with respect to the model weights is calculated layer by layer using the chain rule. Specifically, for each weight, the partial derivative of the loss function with respect to the weights is calculated.

[0104] Step S50404: Calculate the weighted moving average of the gradient and the weighted moving average of the square of the gradient to obtain the first estimate and the second estimate.

[0105] In this embodiment, the weighted moving average is a statistical method that assigns higher weights to recent data and lower weights to older data. In gradient optimization scenarios, using a weighted moving average can smooth gradient fluctuations, making model updates more stable. Initially, the gradient estimate is set to 0.

[0106] The first estimate satisfies the following formula: in, For the first estimate, The attenuation rate is typically taken as a value close to... , It is a weighted moving average of the gradient of the previous time step. For gradient.

[0107] The second estimate satisfies the following formula: in, For the second estimate, The attenuation rate is typically taken as a value close to... , It is a weighted moving average of the squared gradient of the previous time step. For gradient.

[0108] Step S50405: Adjust the weights of the optimized tool wear prediction model based on the first estimate and the second estimate.

[0109] The adjustment of the weights of the optimized tool wear prediction model based on the first and second estimates specifically includes the following sub-steps: Step S5040501: Obtain the optimized weights based on the first estimate and the second estimate.

[0110] In this embodiment, since the gradient estimate is 0 during initialization, the first and second estimates obtained in the early stages will also be biased towards 0. Therefore, the first and second estimates need to be corrected to satisfy the following formula: in, This is the first estimate after bias correction. This is the first estimate without bias correction. The first estimated attenuation rate of Power of 1 For time steps.

[0111] This is the second estimate after bias correction. This is the second estimate without bias correction. The second estimated attenuation rate of Power of 1 For time steps.

[0112] The optimized weights satisfy the following formula: For the optimized weights, The current weights of the optimized tool wear prediction model, The current learning rate of the optimized tool wear prediction model. For the first estimate, For the second estimate, To prevent extremely small numbers with a denominator of 0.

[0113] Step S5040502: Adjust the weights of the optimized tool wear prediction model using the optimized weights.

[0114] In this embodiment, the weights of the optimized tool wear prediction model are replaced by the optimized weights, thereby adjusting the weights and gradually optimizing the performance of the optimized tool wear prediction model.

[0115] In an optional embodiment, the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) are used as criteria for determining model accuracy.

[0116] The root mean square error satisfies the following formula: The mean absolute error satisfies the following formula: The mean absolute percentage error satisfies the following formula: In the above formula, n is the number of samples in the validation set. It predicts tool wear values. This is the actual tool wear value.

[0117] In one optional embodiment, the sample data is divided into six parts, namely C1, C2, C3, C4, C5, and C6. C1, C4, and C6 are then divided into training and test sets in an 8:2 ratio.

[0118] The following table was obtained through the above evaluation and evaluations using other models: As shown in the table, the LSTM model performs well only on dataset c1 and dataset c4 in terms of mean absolute error (MAPE) and mean absolute percentage error (MAPE) for tool wear prediction; in other cases, the variance is the largest. This indicates that the LSTM model has poor stability and accuracy, and is prone to problems such as gradient vanishing and underfitting during training. Furthermore, the figure shows that the LSTM model exhibits significant differences in tool travel when predicting tool wear conditions, with the largest errors reaching 17.31 μm, 16.74 μm, and 18.92 μm on datasets c1, c4, and c6, respectively.

[0119] Compared to the LSTM model, the KAN-LSTM model enhances the ability to extract features. Table 6 shows that the KAN-LSTM model performs well in terms of root mean square error (RMSE) and mean absolute error (MAE) for tool wear prediction on datasets c1, c4, and c6, but performs poorly in terms of mean absolute percentage error (MAPE). This indicates that while the KAN-LSTM model can capture local feature patterns, it has limitations in predicting the numerical scale and range of tool wear. It cannot effectively predict targets with large variations, and its performance in long-term sequence dependencies may be inferior to other tool wear prediction models that focus more on optimizing temporal features, potentially missing some important temporal information.

[0120] As can be seen from the figure, the LSTM model has significant differences in some tool paths when predicting tool wear conditions. The largest errors are 10.42 micrometers, 11.64 micrometers and 12.37 micrometers in datasets c1, c4 and c6, respectively.

[0121] The optimized tool wear prediction model outperforms the LSTM and KAN-LSTM models in terms of accuracy and fluctuation error in predicting tool flank wear, and has a better overall prediction effect.

[0122] In summary, this invention combines the complex function decomposition capability of the KAN network, the long-term dependency information capture capability of the LSTM, and the weighting capability of the attention mechanism for key features to provide an efficient prediction model for the nonlinear, multivariable, and temporal features of tool wear. Within this framework, the KAN network utilizes the Kolmogorov-Arnold representation theorem to decompose complex multidimensional nonlinear relationships into a series of simple one-dimensional functions, thereby effectively reducing the complexity of modeling. Then, the self-attention mechanism enhances the model's focus on key moments of tool wear by weighting the importance of features, improving prediction performance. Meanwhile, the LSTM, through its gating mechanism, preserves long-term dependency information in the sequential data, making it suitable for characterizing the gradual accumulation of tool wear over time.

[0123] By comparing performance metrics such as MSE, RMSE, MAPE, and recognition accuracy, it can be found that the proposed KAN-AM-LSTM neural network model has a greater advantage in prediction accuracy compared to the LSTM and KAN-LSTM models. The KAN-LSTM model exhibits lower values ​​in both MSE and RMSE, indicating that it outperforms the traditional LSTM and KAN-LSTM architectures in terms of error convergence speed and overall error level. Furthermore, in terms of MAPE (mean absolute percentage error), the optimized tool wear prediction model shows a significant reduction in the error ratio, indicating stronger robustness to data at different scales and contributing to more stable tool wear prediction.

[0124] The optimized tool wear prediction model reduces the complexity of nonlinear modeling through KAN function decomposition, efficiently processes temporal features using LSTM, and focuses on key features using an attention mechanism, reducing unnecessary computational overhead and thus significantly shortening the model training time.

[0125] like Figure 2 As shown, the present invention also provides a tool wear prediction system, including: a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to call the program instructions to execute the relevant steps of a relevant embodiment of a tool wear prediction method in the preceding aspect of the present invention.

[0126] This invention provides a tool wear prediction system where functional components can be integrated into a single processing unit, exist as individual physical entities, or be integrated into a single unit. These integrated components can be implemented in hardware or software, further enhancing the overall applicability and practical application capabilities of this invention.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.

Claims

1. A method for predicting tool wear, characterized in that, The method includes: Acquire milling data related to tool milling, and preprocess the milling data to obtain sample data; A tool wear prediction model was constructed using a KAN network, a three-layer long short-term memory network, a two-layer fully connected layer, and a random deactivation layer. Set a weight penalty term related to the weights of the tool wear prediction model, and add the weight penalty term to the loss function of the tool wear prediction model to obtain a weight-optimized tool wear prediction model; A self-attention mechanism is introduced into the weighted optimized tool wear prediction model to obtain an optimized tool wear prediction model. The optimized tool wear prediction model is trained and evaluated using the sample data, and based on the evaluation results, tool wear is predicted using the optimized tool wear prediction model, including: The sample data includes multiple feature data. According to the self-attention mechanism, attention weights are assigned to the feature data in the sample data to form weighted sample data. The KAN network is used to extract the nonlinear variation features in the weighted sample data to obtain the first feature data; The first feature data satisfies the following formula: This is an approximate function of the weighted sample data. For the KAN network The number of nodes in the layer To connect the KAN network The first layer The first neuron and the first The first layer Activation function of a neuron For the KAN network The number of nodes in the layer This represents the number of nodes in the second layer of the KAN network. To connect the second layer of the KAN network The first neuron and the third layer of the third layer Activation function of a neuron This represents the number of nodes in the first layer of the KAN network. To connect the first layer of the KAN network The first neuron and the second layer of the second layer Activation function of a neuron This represents the number of nodes in layer 0 of the KAN network. To connect the 0th layer of the KAN network The first neuron and the first layer of layer 1 Activation function of a neuron For the weighted sample data of the first One component; The temporal features of the first feature data are extracted using the three-layer long short-term memory network to obtain the second feature data; The weights of the optimized tool wear prediction model are adjusted using the second feature data until training is complete.

2. The tool wear prediction method according to claim 1, characterized in that, The process of preprocessing the milling data to obtain sample data includes: The milling data is truncated using the third quartile method to obtain the first data; Anomaly analysis is performed on the first data, and the first data is adjusted based on the results of the anomaly analysis to obtain the second data; The second data is denoised using wavelet threshold denoising to obtain the third data; The third data is analyzed in the time and frequency domains to obtain multiple feature data. The Spearman correlation coefficient was used to perform correlation analysis on the feature data to obtain the most relevant feature data. The most relevant feature data is normalized to obtain the sample data.

3. The tool wear prediction method according to claim 2, characterized in that, The step of performing outlier analysis on the first data and adjusting the first data based on the results of the outlier analysis to obtain the second data includes: A sliding window mechanism is introduced, which uses a window to slide and sample on the first data to obtain sampled data, the sampled data including multiple data points; Calculate the median of the sampled data, and use the median to calculate the absolute deviation of the data points from the median; The data points are compared with the absolute deviation, and the data points are adjusted according to the comparison result to obtain the second data.

4. The tool wear prediction method according to claim 1, characterized in that, The step of assigning attention weights to the feature data in the sample data according to the self-attention mechanism to form weighted sample data includes: Perform a linear transformation on the feature data to obtain a query matrix, a key matrix, and a value matrix; Calculate the attention score of the feature data based on the query matrix and the key matrix; A Softmax function is introduced, and the attention score is converted into the attention weight using the Softmax function; Weighted feature data is obtained based on the attention weights and the value matrix, and weighted sample data is formed based on the weighted feature data.

5. The tool wear prediction method according to claim 4, characterized in that, The weighted feature data satisfies the following formula: For the weighted feature data, For the query matrix, The key matrix, For the value matrix, For the permutation of the key matrix, Let be the dimension of the key matrix.

6. The tool wear prediction method according to claim 1, characterized in that, The step of adjusting the weights of the optimized tool wear prediction model using the second feature data includes: Based on the second feature data, the optimized tool wear prediction model is used to make a prediction, and the prediction result is obtained. Based on the prediction results, calculate the loss value of the loss function; Based on the loss value, calculate the gradient of the loss function with respect to the weights of the optimized tool wear prediction model; Calculate the weighted moving average of the gradient and the weighted moving average of the square of the gradient respectively to obtain the first estimate and the second estimate; The weights of the optimized tool wear prediction model are adjusted based on the first and second estimates.

7. The tool wear prediction method according to claim 6, characterized in that, The adjustment of the weights of the optimized tool wear prediction model based on the first estimate and the second estimate includes: Based on the first estimate and the second estimate, the optimized weights are obtained; The weights of the optimized tool wear prediction model are adjusted using the optimized weights; The optimized weights satisfy the following formula: For the optimized weights, The current weights of the optimized tool wear prediction model, The current learning rate of the optimized tool wear prediction model. For the first estimate, For the second estimate, To prevent extremely small numbers with a denominator of 0.

8. A tool wear prediction system, characterized in that, include: The system includes a processor, an input device, an output device, and a memory, all interconnected, wherein the memory stores a computer program comprising program instructions, and the processor is configured to invoke the program instructions to execute a tool wear prediction method as described in any one of claims 1 to 7.