A tool residual life prediction method improved by sparrow search algorithm
By improving the Sparrow Algorithm and optimizing the MobileNet-BiLSTM-Attention model, and combining hyperparameter optimization and adaptive bandwidth kernel density estimation, the accuracy and uncertainty issues of deep learning models in tool remaining life prediction are solved, achieving higher accuracy and flexibility in prediction, supporting reasonable tool maintenance strategies and production efficiency improvement.
Patent Information
- Application Number
- CN202411686559.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Existing deep learning models have low accuracy in predicting remaining tool life and cannot effectively quantify the uncertainty of prediction results, which affects the formulation of tool operation and maintenance strategies and the adaptability of models in complex machining environments.
The MobileNet-BiLSTM-Attention model, optimized by an improved sparrow search algorithm, combines MobileNetV2, deep BiLSTM, and attention modules. Hyperparameters are optimized by a sparrow search algorithm that integrates sine, cosine, and Cauchy mutations. The network parameters are updated using the Adam optimizer, and adaptive bandwidth kernel density estimation is employed to quantify prediction uncertainty.
It improves the accuracy and flexibility of tool remaining life prediction, enabling more accurate prediction of tool status in complex environments, quantifying the uncertainty of prediction results, reducing production costs and improving production efficiency.
Smart Images

Figure GDA0005649007010000031 
Figure GDA0005649007010000032 
Figure GDA0005649007010000033
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of machining state monitoring, and particularly relates to a MobileNet-BiLSTM-Attention tool residual life prediction method improved by a sparrow algorithm. BACKGROUND
[0002] As the "teeth" of a machine tool, a tool is inevitably affected by thermal-mechanical coupling in the cutting process and is worn, and the wear condition is a key factor affecting the service life of the tool.
[0003] According to statistics, only 38% of tool life is fully utilized in industrial production, and the unreasonable use of tools leads to an increase of 10 billion US dollars in manufacturing costs per year, and effective tool residual life prediction can reduce 10%-30% of production costs and improve 10%-40% of production efficiency.
[0004] Therefore, it is crucial to realize accurate and reliable tool residual life prediction for formulating a reasonable tool replacement strategy, reducing production costs, and ensuring the stability of the machining process.
[0005] In recent years, deep learning has been widely applied to tool wear state monitoring due to its powerful data processing capability, although the tool wear monitoring method based on deep learning has achieved great success, but still faces two core challenges.
[0006] On the one hand, how to further optimize the deep learning model to realize more accurate tool residual life prediction.
[0007] On the other hand, there are many factors affecting the tool residual life in the cutting process, and the simple deep learning model prediction ignores the potential uncertainty in the prediction results, which limits the formulation of economic and efficient tool operation and maintenance strategies to some extent, and also affects the adaptability of the model in the actual complex and changeable machining environment. SUMMARY
[0008] The purpose of the present application is to solve the problems of low model prediction accuracy and inability to effectively quantify the uncertainty of the prediction results in the prior art.
[0009] To achieve the above purpose, the technical scheme of the present application is as follows: the present application provides a MobileNet-BiLSTM-Attention tool residual life prediction method improved by a sparrow algorithm, which adopts the following steps:
[0010] S1: acquiring the machining signals of the tool throughout the whole life cycle in the milling process.
[0011] S2: intercept the stable interval in the original signal and perform noise reduction and normalization processing.
[0012] S3: label the preprocessed data according to the remaining cutting times to form a data set, and divide it into a training set and a test set.
[0013] S4: Construct an improved sparrow algorithm optimized MobileNet-BiLSTM-Attention tool remaining life prediction model;
[0014] S4.1: The model is mainly composed of MobileNetV2 module, deep BiLSTM module and attention module;
[0015] S4.2: MobileNetV2 is a lightweight convolutional neural network, which can significantly reduce model parameters and computational complexity while maintaining accuracy compared to traditional convolutional networks. The network mainly introduces an inverted residual module, which first performs 1×1 convolution to capture more features, and then reduces the channel number by 1×1 convolution to reduce the model parameter quantity and complexity.
[0016] S4.3: Each inverted residual module in MobileNetV2 has a linear bottleneck layer, which uses a linear activation function instead of a traditional ReLU activation function to preserve more feature information.
[0017] S4.4: Deep BiLSTM module, BiLSTM can capture the dependency relationship in the sequence from the front and back two directions, overcome the problems of gradient disappearance and gradient explosion of traditional RNN when processing long sequences, and improve the expression ability and the ability to capture complex features of the model by stacking multiple BiLSTM layers. Since the number of neurons is the key to the performance of the BiLSTM layer, the improved sparrow algorithm is used to consider the model complexity and performance to find the best number of neurons.
[0018] S4.5: Attention module, Squeeze-and-Excitation (SE) attention mechanism can adaptively adjust the importance of different channels to improve network performance. Through global average pooling operation, feature compression is performed in the spatial dimension to make the features have global information, and then two fully connected layers are used to adaptively adjust the importance of different channels. The feature map is assigned different weights so that the neural network can focus on key information among numerous input information.
[0019] S5: The setting of hyperparameters plays a crucial role in the training process of the model, directly affecting the performance, training efficiency and stability of the model.
[0020] S6: Therefore, the present method introduces the sparrow search algorithm (SCSSA) fused with the sine cosine and Cauchy variation to determine the hyperparameters, the SCSSA algorithm is a new improved algorithm based on the sparrow search algorithm (SSA), which obviously improves the convergence speed and optimization ability, and the specific steps are as follows:
[0021] S6.1: Initialize the sparrow population and population parameters, and calculate the fitness value of each sparrow at present;
[0022] S6.2: Find out the sparrow individuals corresponding to the optimal and worst fitness values respectively, and record the positions;
[0023] S6.3: Introduce the sine cosine search strategy to the position of the sparrow search algorithm explorer, update the position of the explorer, and enhance the global search ability;
[0024] S6.4: Introduce the Cauchy variation to the follower position update formula, update the follower position, increase the diversity of search and the ability to jump out of local optimum;
[0025] S6.5: Update the position of the guard in the sparrow population to ensure the diversity of the population and the continuity of the search;
[0026] S6.6: Determine whether the preset iteration number is reached or other termination conditions are met, if yes, output the optimal fitness value and the best position, otherwise continue iteration.
[0027] S7: The optimization algorithm is used to determine the best initial learning rate to speed up the convergence of the model and avoid falling into a local optimal solution, and the best L2 regularization coefficient to prevent the model from overfitting and improve the generalization ability of the model.
[0028] S8: The Adam optimizer is used to update the network parameters, so as to minimize the loss function and make the model converge faster and achieve better performance in the training process, thereby realizing the prediction of the tool remaining life.
[0029] S9: In order to verify the effectiveness of the model proposed in the present application, three performance indicators are used to evaluate the prediction effect of the model, including mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R 2 ); The calculation formulas of the three performance indicators are as follows:
[0030]
[0031]
[0032]
[0033] In the formula, N is the number of test data, X(t) is the actual value, The smaller the values of the index MAE and RMSE are, the higher the prediction accuracy of the model is, and the closer the value of R 2 The closer the value of R
[0034] S10: taking the prediction result output by the model as an input of adaptive bandwidth kernel density estimation (ABKDE), estimating the probability density function of the prediction value, and then calculating the prediction interval according to a confidence level.
[0035] S11: in order to verify the reliability of the interval prediction result of the application, performance evaluation indexes interval coverage probability (PICP), normalized average width (PINAW) and coverage width criterion (CWC) are used for evaluation, and the calculation formula is as follows:
[0036]
[0037]
[0038]
[0039] In the formula: Count i Used for judging whether the i-th real value is in the prediction interval or not.
[0040] The application has the following beneficial effects:
[0041] The application builds a milling cutter wear monitoring test data collection platform to realize prediction of the residual life of the tool, collects original signal data, and carries out denoising and normalization processing on the vibration signal to improve the accuracy of the prediction result.
[0042] The application adaptively extracts features by constructing a MobileNet-BiLSTM-Attention model, without the need for subjective experience, so that the model has higher flexibility and accuracy when processing different types and complexities of signals.
[0043] The MobileNetV2 module in the model can realize more efficient calculation while maintaining high model performance, the deep BiLSTM module can make the model comprehensively understand the time dependence of the data and improve the prediction accuracy of the model, and the attention SE module adjusts the importance of information in the channel dimension to further enhance the feature expression ability of the model.
[0044] The application intelligently iteratively optimizes the BiLSTM layer neuron number, learning rate and L2 regularization coefficient of the deep BiLSTM module in the model through an optimization algorithm, obtains optimal parameters to fully exert the advantages of the model, and improves the prediction accuracy of the model.
[0045] The application estimates the uncertainty of the prediction value by using adaptive bandwidth kernel density estimation, and the traditional kernel density estimation method has the limitation of fixed bandwidth parameter, which further affects the smoothness and accuracy of estimation, and the adaptive bandwidth kernel density estimation can adaptively adjust the bandwidth parameter according to the local density of data, and can better adapt to the local characteristics and density changes of data to improve the estimation accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 A flowchart of the MobileNet-BiLSTM-Attention tool residual life prediction method based on the improved sparrow algorithm of the application;
[0047] Figure 2 A principle diagram of the sparrow search algorithm fusing sine and cosine variation and Cauchy variation;
[0048] Figure 3 A MobileNet-BiLSTM-Attention model diagram;
[0049] Figure 4 A MobileNetV2 module structure diagram;
[0050] Figure 5 A BiLSTM module structure diagram;
[0051] Figure 6 A SE attention module structure diagram;
[0052] Figure 7 A tool residual life prediction diagram based on a CNN-LSTM model;
[0053] Figure 8 A tool residual life interval prediction diagram based on the improved sparrow algorithm of the MobileNet-BiLSTM-Attention. DETAILED DESCRIPTION
[0054] In order to more clearly and specifically explain the technical content and effects of the application, the following further describes and explains the application by combining with the drawings and examples, and it should be understood that the embodiments described herein are only used to illustrate and explain the application, and are not used to limit the application.
[0055] As Figure 1 In the application, a MobileNet-BiLSTM-Attention tool residual life prediction method based on an improved sparrow algorithm is provided, and the specific steps are as follows:
[0056] S1: Collect X, Y, Z three-direction cutting force signals, vibration signals and acoustic emission signals in the whole life cycle of tool machining workpiece by installing piezoelectric force gauge, vibration sensor and acoustic emission sensor, to provide original data set for model training and testing.
[0057] S2: The vibration signals in the original data are preprocessed, including signal denoising and normalization in the data, as follows:
[0058] S2.1: Considering that the tool cutting in and cutting out will produce a part of invalid signal data, the sliding average filtering method is used for denoising in the signal stable interval, and the window number is set to 1000, to obtain relatively smooth and less noisy signal data;
[0059] S2.2: In order to reduce the influence caused by the difference of data scale or dimension, so as to better train the model and find the optimal solution faster, the normalized processing is carried out on the denoised data, and the calculation formula is as follows:
[0060] y = (x-x min ) / (x max -x min )
[0061] In the formula: x max is the maximum value in the data, x min is the minimum value in the characteristic data, and x is the input data.
[0062] S3: Construct the MobileNet-BiLSTM-Attention model optimized by improved sparrow algorithm, as shown in Figure 3
[0063] S3.1: This model is mainly composed of MobileNetV2 module, deep BiLSTM module and attention module;
[0064] S3.2: Referring to Figure 4 , the MobileNetV2 module introduces a reverse residual structure with linear bottleneck. The structure first uses 1x1 convolution kernel to upgrade the dimension, then uses deep convolution to process the upgraded features, and finally restores the dimension of the input features by 1x1 convolution kernel. Subsequently, the feature is mapped to a low-dimensional compressed expression by the linear bottleneck layer. In order to avoid information loss or damage caused by using ReLU activation function, the linear activation function is used instead of ReLU activation function in the last convolution layer of the bottleneck structure;
[0065] S3.3: Referring to Figure 5 , the deep BiLSTM module extracts features of different time scales, and the deep BiLSTM module includes two layers of BiLSTM, and the number of neurons in the first layer is 63 and the number of neurons in the second layer is 32 determined by an optimization algorithm; the BiLSTM structure is as shown in Figure 5 The implementation is as follows:
[0066]
[0067]
[0068] h t ′=a t h t +b t h i +c t
[0069] In the formula: is the forward hidden layer state, is the backward hidden layer state, a t , b t is the weight, and c t is the bias;
[0070] S3.4: Refer to Figure 6 , the SE module is a lightweight channel attention mechanism, mainly composed of three parts of Squeeze, Excitation and Scale;
[0071] The Squeeze operation mainly compresses the input feature map to have global spatial information, and the calculation formula is as follows:
[0072]
[0073] In the formula: u c is the input feature, and W and H represent the width and height of the feature map respectively;
[0074] The Excitation operation weights the features by adjusting the importance of different channels, and the calculation formula is as follows:
[0075] s=F ex (z,W)=σ(g(z,W))=σ(W2δ(W1z))
[0076] In the formula: W1 and W2 represent two fully connected layer weights for dimension reduction and dimension increase respectively, and σ is an activation function;
[0077] The Scale operation mainly multiplies the weight value obtained by the Excitation part with the corresponding channel of the original feature map, so that the network can pay more attention to important channel features.
[0078] S4: A fully connected layer is constructed after the MobileNetV2 module, the deep BiLSTM module and the attention module, and a regression layer is constructed based on the output result of the fully connected layer.
[0079] S5: The sparrow search algorithm fusing the sine-cosine and Cauchy variation is improved on the basis of the sparrow search algorithm, effectively solves the problems of insufficient search capability and difficulty in jumping out of local extreme value of the sparrow search algorithm in the later stage of optimization, mainly enhances the species diversity of sparrow population initialization by introducing a refraction reverse learning strategy, and then reduces the stagnation problem of the sparrow search algorithm in the later stage of search due to insufficient species diversity; secondly, the sine-cosine strategy is introduced in the position update of the discoverer of the sparrow search algorithm, and the sine-cosine algorithm is improved through a nonlinear decreasing search factor and a weight factor, so as to balance the local development and global exploration; finally, the Cauchy variation mechanism is used to disturb the optimal solution in the position update of the follower, expand the sparrow search range, and improve the probability of jumping out of the local extreme value.
[0080] S5.1: In the algorithm of the present application, the population size is 20, the iteration number is 10, the L2 regularization parameter in the model, the initial learning rate and the number of neurons in the BiLSTM layer are optimized;
[0081] S5.2: The best L2 regularization coefficient is 0.0070, the best initial learning rate is 0.0051, the best number of neurons in the first BiLSTM layer is 63, and the best number of neurons in the second BiLSTM layer is 32.
[0082] S6: The Adam algorithm is used to automatically update the network model weight according to data iteration, so as to better establish the mapping relationship between the signal features and the tool residual life, and realize the prediction of the tool residual life.
[0083] S7: In order to verify the effectiveness of the prediction result of the model, three performance indicators are used to evaluate the model, including mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R 2 ); The calculation formulas of the three performance indicators are as follows:
[0084]
[0085]
[0086]
[0087] In the formula, N is the number of test data, X(t) is the actual value, is the predicted value.
[0088] S8: MAE and RMSE can reflect the difference between the predicted value and the true value, the smaller the index value, the higher the prediction accuracy of the model, and R 2 indicates the goodness of the model fitting the original data, R 2 closer to 1 indicates better goodness of fit.
[0089] S9: In order to effectively verify the reliability of the interval prediction result of the application, performance evaluation indexes interval coverage rate (PICP), normalized average width (PINAW), and coverage width criterion (CWC) are used for evaluation, and the calculation formula is as follows:
[0090]
[0091]
[0092]
[0093] In the formula: Count i is used to determine whether the i-th true value is in the prediction interval.
[0094] S10: The interval coverage rate in the evaluation index represents the probability that the actual observation value falls within the prediction interval, and the closer the PICP value is to 1, the higher the coverage rate of the prediction interval. The normalized average width represents the average width of the prediction interval, and the coverage width criterion is a comprehensive index for measuring the width and coverage rate of the prediction interval. The three indexes can comprehensively and effectively measure the performance of the model.
[0095] Embodiment: Predict the remaining life of the milling cutter, and verify the effectiveness and feasibility of the application by predicting the uncertainty of the remaining life of the cutter.
[0096] I. Build a milling 508 III steel cutter wear test data collection platform and construct a data set. The data set has 3 sets of experimental data, numbered Cl-C3. Each set of experimental data contains 68 milling records. The test uses a piezoelectric force gauge, a vibration sensor, and an acoustic emission sensor to collect signal data under cutter milling operation. After each pass is completed, a small digital microscope industrial camera is used to observe and measure the wear morphology and wear amount (VB) of the cutter rear face offline. The main equipment used in the experiment and the machining parameters are shown in Table 1:
[0097] Table 1 Main equipment and machining parameters of the experiment
[0098]
[0099]
[0100] II. Noise reduction processing: the signals when the tool cuts in and cuts out are cut off, and the sliding average filtering method is used in the signal stable interval to reduce the influence of random noise on the overall data, so that simple and efficient noise reduction processing is realized.
[0101] III. According to 68 milling records contained in each group of experimental data, one group of data is selected as a test set, and the remaining group is selected as a training set, and the residual cutting number of the tool is used as a label; the normalized data is input into the MobileNet-BiLSTM-Attention model optimized by the improved sparrow algorithm, and the CNN-LSTM model is compared; the prediction result of the CNN-LSTM model is as shown in Figure 7 , the prediction result of the MobileNet-BiLSTM-Attention model optimized by the improved sparrow algorithm is as shown in Figure 8 , and the calculation results of the three indexes are as shown in Table 2:
[0102] Table 2 Comparison of tool residual life prediction results
[0103]
[0104] IV. The sliding average filtering method is used for signal processing, which is simple to operate and can better reduce redundant signals and noise interference in the signal; and the MobileNet-BiLSTM-Attention model optimized by the improved sparrow algorithm is used for tool residual life prediction, which has achieved good results, and the prediction error is smaller than that of the CNN-LSTM model, and has high accuracy.
[0105] V. The prediction error distribution of the model proposed in the application is fitted by the adaptive bandwidth kernel density estimation method, and the uncertainty range of the tool residual life prediction result is provided at a confidence level of 95%, the interval prediction result of the model is as shown in 8, and the calculation results of the three indexes are as shown in Table 3:
[0106] Table 3 Evaluation of model interval prediction results
[0107]
[0108] VI. The prediction result is evaluated from the reliability, effectiveness and calculation efficiency by three evaluation indexes of interval coverage rate, normalized average width and coverage width criterion, and the results show that it not only can realize accurate prediction of residual life, but also effectively quantifies the uncertainty range of the prediction value.
[0109] The application can effectively avoid the problems of tool waste, workpiece damage and reduced machining quality caused by premature or late tool replacement by predicting the tool residual life and determining the prediction result interval, and provides a certain theoretical basis and technical support for reasonable use and replacement of tools in actual production.
[0110] Finally, it should be pointed out that the above embodiments are only illustrative of the technical solutions of the present application and are not intended to limit the same. Although the present application has been described in detail in accordance with preferred embodiments, it should be apparent that modifications and equivalents to the embodiments could occur to one skilled in the art without departing from the fundamental principles and scope of the technical solutions of the present application.
Claims
1. A MobileNet-BiLSTM-Attention tool remaining life prediction method improved by sparrow algorithm, the method comprising the following steps: S1: acquiring multi-channel original signal data of the milling process in the entire life cycle of the tool through a sensor, and constructing an original data set sample; S2: data preprocessing is performed on the original vibration signal, the signal stable interval is intercepted to reduce the data fluctuation of the tool cutting in and cutting out in the milling process, and a sliding average filtering algorithm is used for noise reduction; S3: normalizing the data after noise reduction, the normalization formula is as follows: y = (x - x min ) / (x max - x min ) where: x max is the maximum value in the data, x min is the minimum value in the data, x is the input data; S4: inputting the normalized vibration data into the MobileNet-BiLSTM-Attention model optimized by the improved sparrow algorithm, combining the MobileNetV2 module with the SE attention mechanism to efficiently extract key spatial features and suppress redundant information, the deep BiLSTM layer extracts time sequence features, and the sparrow search optimization algorithm (SCSSA) optimized by the sine and cosine and Cauchy variation is used to determine the optimal configuration of the learning rate, L2 regularization coefficient and BiLSTM layer neuron number and other key parameters, and the tool remaining life prediction is realized; S5: The effectiveness of the prediction results of the disclosed model is verified by using mean absolute error (MAE), root mean square error (RMSE) and determination coefficient (R 2 ) S6: combining the model prediction result with the adaptive bandwidth kernel density estimation to calculate the prediction interval and quantify the uncertainty of the prediction result; S7: verifying the uncertainty of the model prediction result by using the interval coverage rate (PICP), the normalized average width (PINAW) and the coverage width criterion (CWC).
2. The MobileNet-BiLSTM-Attention tool remaining life prediction method for improving the sparrow search algorithm according to claim 1, characterized in that: The specific operation method of S1 is as follows: a three-dimensional coordinate system is established based on the tool, and the cutting force signal, vibration signal and acoustic emission signal data of the X, Y and Z directions of the real-time numerical control machine tool are collected.
3. The MobileNet-BiLSTM-Attention tool remaining life prediction method for improving the sparrow search algorithm according to claim 1, characterized in that: The specific operation method of S2 is as follows: the size of the sliding window is set and the sliding window is initialized, the data in the window is averaged to obtain a new output value, then the new output value is stored in the output sequence, and the window is moved to repeat the above process until the entire data sequence is traversed.
4. The MobileNet-BiLSTM-Attention tool remaining life prediction method for improving the sparrow search algorithm according to claim 1, characterized in that: The specific operation method of S6 is as follows: the adaptive bandwidth kernel density estimation method (ABKDE) is a non-parametric kernel density estimation method, which can automatically select the bandwidth of the kernel function, estimate the residual distribution of the model and construct the prediction interval by using the adaptive bandwidth kernel density estimation method.
Citation Information
Patent Citations
Numerical control machine tool cutter remaining service life prediction method and system and application
CN113560955A
Gastrointestinal endoscope video key frame extraction method and system based on reinforcement learning and reward mechanism
CN117437575A