Parts machining surface roughness prediction method based on attention and transfer learning
By integrating multivariate signal features and performing model migration based on the attention mechanism and transfer learning method, the problems of low efficiency, poor robustness and performance degradation under long-term service in CNC machining accuracy prediction are solved, and high-quality surface roughness prediction of CNC machining parts is achieved.
Patent Information
- Application Number
- CN202311144250.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-09-06
AI Technical Summary
Existing CNC machining accuracy prediction methods have problems such as low efficiency, high cost, poor robustness and prediction performance degradation after long-term service, especially the lack of universality of traditional data regression models and the lack of signal feature analysis and fusion processing of neural network models.
A method based on attention mechanism and transfer learning is adopted to collect key physical signals, construct a signal feature matrix, and use the improved SE Context Gating attention mechanism and particle filter algorithm to realize multi-signal feature fusion and model transfer, thereby improving the robustness and accuracy of the prediction model.
It achieves high-quality prediction of the surface roughness of parts processed by CNC machining, improves the robustness of the model and the prediction accuracy under long-term service, and is suitable for machine tool processing accuracy prediction in various situations.
Smart Images

Figure CN117047560B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for predicting the surface roughness of parts during CNC machining, and in particular to a method for predicting the surface roughness of parts during CNC machining based on an attention mechanism and transfer learning. Background Art
[0002] CNC machining significantly impacts part assembly precision, fatigue strength, and corrosion resistance. Therefore, machine tool accuracy is a crucial metric for evaluating machine tool performance. Traditionally, offline surface roughness measurement has been required to ensure machining quality. However, these offline methods suffer from low efficiency and high measurement costs, leading to reduced machining efficiency. Therefore, methods for predicting CNC machining accuracy are crucial for improving both machining quality and production efficiency.
[0003] Roughness prediction methods primarily include those based on traditional data regression and those using artificial intelligence (AI). While traditional data regression-based machining accuracy prediction methods can generate explicit machining accuracy prediction models, they require re-establishing the regression equation when experimental conditions change. Consequently, these models lack robustness and are not universally applicable to grinding machine machining accuracy prediction. Some AI-based roughness prediction methods fail to consider the time-varying characteristics of the input signal, resulting in poor robustness.
[0004] Currently, some neural network models, based on the signal characteristics of multi-source input data, directly output the predicted type through a fully connected layer after processing such as convolution operations. However, due to the large dimensionality of sensor data signals, different signal types have different capabilities in representing features, resulting in a lack of analysis and fusion of signal characteristics. Furthermore, over the long service life of CNC machine tools, wear and aging of various components affect machining, reducing the accuracy of the precision prediction model. Consequently, the performance of the network prediction models developed in most research studies degrades over time. Summary of the Invention
[0005] To address the issues presented in the prior art, this paper proposes a method for predicting surface roughness during CNC machining of parts based on an attention mechanism and transfer learning. This method overcomes the shortcomings of the aforementioned existing methods, enabling a prediction model to learn and integrate the signal features of multiple CNC machining parts. It also addresses the performance degradation of neural network prediction models over long timescales.
[0006] To achieve the above object, the technical solution of the present invention is as follows:
[0007] S1: Collect key physical signals that affect the evolution of surface roughness of CNC machine tool parts;
[0008] S2: After preprocessing and feature extraction of each key physical signal, the corresponding features are obtained, and the corresponding signal feature matrix is constructed according to the features corresponding to each key physical signal;
[0009] S3: Input each signal feature matrix into the machined surface roughness prediction model for training to obtain a trained machined surface roughness prediction model;
[0010] S4: Based on the measured degradation data of CNC machine tools, a single-exponential degradation model for machine tools is constructed. The degradation trend of the current CNC machine tools is determined using the single-exponential degradation model. In different degradation stages of the degradation trend, the network model of the trained surface roughness prediction model is migrated using a migration method based on the key physical signals of each degradation stage, thereby obtaining surface roughness prediction models for different degradation stages.
[0011] S5: Determine the degradation stage of the current CNC machine tool according to the machine tool single index degradation model, select the machining surface roughness prediction model of the current degradation stage, and then obtain the corresponding surface roughness prediction result.
[0012] In S2, the characteristics corresponding to each key physical signal include time domain signal characteristics and frequency domain signal characteristics.
[0013] The machined surface roughness prediction model includes a convolutional layer, a memory network layer, a random inactivation layer, a fully connected layer, a subpath random dropout block, an improved SE Context Gating attention mechanism block and a classification module;
[0014] Each signal feature matrix is input into the corresponding convolutional layer. The output of each convolutional layer is input into the classification module after passing through the corresponding first fully connected layer and sub-path random dropout block. The output of all convolutional layers is input into the random dropout layer after passing through the corresponding memory network layer. The random dropout layer is connected to the improved SE Context Gating attention mechanism block through the second fully connected layer. The improved SE Context Gating attention mechanism block is connected to the classification module. The classification module outputs the prediction result of the machined surface roughness.
[0015] The improved SE Context Gating attention mechanism block includes a third fully connected layer and an activation layer. The input of the improved SE Context Gating attention mechanism block is used as the input of the third fully connected layer. The third fully connected layer is connected to the activation layer. The output of the activation layer is fused with the input of the improved SE Context Gating attention mechanism block, and the fused features are used as the output of the improved SE Context Gating attention mechanism block.
[0016] In S4, the formula of the machine tool single exponential degradation model is as follows:
[0017] Y(t)=m t ·exp(n t ,t)+ε t
[0018] Where Y(t) is the degradation performance of the machine tool at time t, m t is the initial performance level of the machine tool at time t, n t represents the degradation rate of the machine tool at time t, ε t is Gaussian white noise.
[0019] In S4, based on the actual degradation data of the current CNC machine tool, the single exponential degradation observation equation is updated using the Monte Carlo particle filter method to obtain a single exponential degradation model of the machine tool.
[0020] The present invention uses a method for predicting the surface roughness of CNC machining parts based on an attention mechanism and transfer learning to perform convolution compression and time series feature extraction on CNC machining signals of parts; adopts an attention mechanism to learn and fuse multiple signal features; adopts an exponential degradation model to construct a state equation, and calculates the degradation trend of the tool machine through a particle filter algorithm; adopts a transfer learning method to improve the prediction performance of the prediction model, and achieves high-quality prediction of the surface roughness of CNC machining parts.
[0021] Compared with existing technologies and methods, the present invention has the following beneficial effects:
[0022] This paper incorporates the SE Context Gating mechanism into model training, feeding the concatenated features into SE Context Gating to obtain a fusion result of multiple features. By summing the fused features with the original features, it is possible to ensure that the original information of the original features is preserved and that the fused information of the original features contributes to the prediction results, allowing the model to learn more feature information.
[0023] The present invention further fuses the fused features with multiple input signal features and uses DropPath to randomly discard some samples in each batch size that is integrated into the network each time, thereby improving the robustness of the model.
[0024] The present invention calculates the degradation trend of machine tools through a particle filtering algorithm and improves the accuracy of the constructed neural network prediction model based on a transfer learning method of network layer freezing, making the prediction model applicable to machine tool processing accuracy prediction in various situations and solving the problem of neural network prediction performance degradation of machine tools after long-term service.
[0025] In summary, the present invention achieves multi-signal feature fusion and prediction model migration applicable to CNC machine tools, thereby realizing the prediction of surface roughness of CNC machined parts. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Schematic diagram of the process of the present invention.
[0027] Figure 2 Schematic diagram of the prediction model structure during the implementation of the method of the present invention.
[0028] Figure 3 Schematic diagram of the improved attention mechanism structure during the implementation of the method of the present invention.
[0029] Figure 4 The figure is a flow chart of particle filtering for solving degradation trend in the implementation of the present invention.
[0030] Figure 5 Schematic diagram of the transfer learning process during the implementation of the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described below with reference to the accompanying drawings and specific examples:
[0032] The embodiment of the present invention takes a surface forming grinder as an example to illustrate. Figure 1 As shown, the specific steps include:
[0033] S1: Collect key physical signals that affect the evolution of surface roughness of CNC machine tool parts. Key physical signals include temperature signals and vibration signals during the machining process.
[0034] In this embodiment, the surface roughness evolution characteristics of parts processed by CNC machining are analyzed. With the help of OPC UA protocol and various sensors, an experimental environment platform is built based on the existing CNC machine tools in the actual factory production and manufacturing workshop, and the temperature signal, vibration signal, and motor power signal during the machining process are collected respectively. Tool wear is one of the important factors in the machine tool machining process, which will directly affect the roughness of the machined surface. When the tool is worn, the cutting force increases, resulting in changes in the motor power. The vibration at the grinding head includes the vibration of the grinding wheel and the vibration of the motor. Since the workpiece is fixed to the workpiece table by a fixture during machining, the vibration characteristics of the table also affect the machining accuracy of the parts. Temperature sensors are arranged on the outside of the connection between the front and rear bearings of the spindle, and the operating environment temperature and coolant temperature of the machine tool need to be measured. During the machining process, the deformation and displacement of the workpiece table will also affect the grinding results, and the vibration signal of the workpiece table is mainly collected;
[0035] S2: After preprocessing and feature extraction of each key physical signal, the corresponding features are obtained, and the corresponding signal feature matrix is constructed according to the features corresponding to each key physical signal and used as the input of the prediction model, wherein a signal feature matrix is obtained corresponding to each type of key physical signal; affected by factors such as the environment, there are problems such as noise, data missing, and data redundancy in the collected original data. Therefore, in this embodiment, a series of operations such as denoising, deduplication, and data completion are performed on the collected signal data. According to the distribution of the collected surface roughness data, it can be seen that the majority of samples have a roughness below 0.5μm, while the number of samples with a roughness greater than 0.5μm on the processed surface is relatively small. Since most of the numerical values of processing accuracy are continuous and unique, it is obviously unrealistic to directly predict the numerical value of processing accuracy. Therefore, the present invention discretizes the processing accuracy samples and converts the processing accuracy prediction problem into an accuracy interval prediction problem. Take 0.1μm as the discretized segmented interval, and classify the number of samples greater than 0.5μm into one category. Extract relevant time domain and frequency domain signal features, and construct a signal feature matrix as the input of the prediction model;
[0036] Principal component analysis was used to screen features, removing signal features with strong correlation and low discrimination. Finally, the 18 signal features with the highest contribution rate were selected to form the feature matrix. A total of 1,000 sets of preprocessed sample data were collected, including 900 training sets and 100 test sets.
[0037] In S2, the characteristics corresponding to each key physical signal include time domain signal characteristics and frequency domain signal characteristics.
[0038] S3: Input each signal feature matrix into the machined surface roughness prediction model for training to obtain a trained machined surface roughness prediction model; due to the different scales of each signal data, the data is normalized in this embodiment to achieve the effect of accelerating training; the normalized current signal, temperature signal and vibration signal are input into the convolutional network model,
[0039] like Figure 2 As shown in the figure, the surface roughness prediction model includes convolutional layer, memory network layer, random inactivation layer, fully connected layer, subpath random dropout block, improved SE Context Gating attention mechanism block and classification module;
[0040] Each signal feature matrix is input into the corresponding convolutional layer. The output of each convolutional layer passes through the corresponding first fully connected layer and subpath random dropout block before being input into the classification module. The output of all convolutional layers passes through the corresponding memory network layer and is input into the random dropout layer. The random dropout layer is connected to the improved SE Context Gating attention mechanism block through the second fully connected layer. The improved SE Context Gating attention mechanism block is then connected to the classification module, which outputs the surface roughness prediction result. The convolutional layer is used to compress the signal feature matrix. To reduce signal information loss, pooling is not performed during the convolution process of the convolutional layer, only data compression is achieved. The long short-term memory network layer is used for preliminary feature extraction, and the random dropout layer is used to randomly drop some features to avoid overfitting caused by too many neurons. The subpath random dropout block is used to simulate the loss of some modalities, making the model more robust. The improved SEContext Gating attention mechanism block is used to suppress the activation of signal features with low contribution rates and perform feature fusion on the fused features again. Based on the SE structure of the attention mechanism, the present invention removes the first fully connected layer, that is, directly uses a fully connected layer to process the feature vector X in the attention channel. Assuming that the number of input signal channels is c, the sigmoid layer is used to obtain a 1×1×c feature vector, which retains more signal features while reducing the number of module parameters by c. 2 / r increases to c. The classification module is a SoftMax normalization layer, which is used to output the prediction results of the machined surface roughness. The distribution of the surface roughness prediction results in each probability interval is obtained through the fully connected layer. The final model prediction accuracy is 84%.
[0041] like Figure 3 As shown, the improved SE Context Gating attention mechanism block includes a third fully connected layer and an activation layer. The input of the improved SE Context Gating attention mechanism block is used as the input of the third fully connected layer. The third fully connected layer is connected to the activation layer. The output of the activation layer is fused with the input of the improved SE Context Gating attention mechanism block, and the fused feature is used as the output of the improved SE Context Gating attention mechanism block.
[0042] As a grinder ages, the established precision prediction model begins to degrade. Comparing the model's predictions with those of an experimental grinder after extended service reveals that the accuracy of the model is only about 40% after a significant time span from initial training. This indicates that grinder performance degrades over extended periods.
[0043] S4: Based on the measured degradation data of the CNC machine tool (this data is part of the existing degradation data of the current CNC machine tool), a single exponential degradation model of the machine tool is constructed to fit the nonlinear and non-Gaussian machine tool degradation system so that it can conform to and track the degradation trend of the current CNC machine tool. The single exponential degradation model of the machine tool is used to determine the degradation trend of the current CNC machine tool and the timing of transfer learning. In the different degradation stages of the degradation trend, according to the key physical signals of each degradation stage, the migration method of the network layered frozen training is used to migrate the trained surface roughness prediction model, thereby obtaining the surface roughness prediction model of the machine tool at different degradation stages; to address the performance degradation problem of the machine tool after long-term service, and to improve the accuracy of the constructed neural network prediction model. Specifically: such as Figure 5 As shown, during the network layer freeze migration process, a transfer learning rate needs to be set for each layer. Considering the multi-layer structure of the network model, the shallower the network knowledge, the more random it is, and the higher the retraining requirements. Therefore, as the number of network layers increases, the learning rate set during transfer learning decreases. The SGD optimization algorithm is used to update the parameters of transfer training. Freezing some network layers directly migrates the network parameters of the corresponding layers, and the unfrozen network layers are trained using data after machine tool performance degradation. The deeper the network layer, the lower the learning rate set during transfer learning. For example, the convolutional layer and memory layer are frozen, the learning rate of the convolutional layer is set, the convolutional layer is retrained, and then the memory layer and SCG fully connected layer are frozen and retrained in sequence. The SGD optimization algorithm is used to update the parameters of transfer training. In this embodiment, the learning rate of each network layer is frozen and retrained by a factor of 10, with a learning rate of 0.005 for the convolutional layer, 0.05 for the memory network layer, and 0.5 for the attention mechanism layer. The final transfer model prediction result has an accuracy of 76.8%, and an average offset distance of approximately 0.26.
[0044] In S4, the formula of the machine tool single exponential degradation model is as follows:
[0045] Y(t)=m t ·exp(n t ,t)+ε t
[0046]
[0047] Where Y(t) is the degradation performance of the machine tool at time t, m t is the initial performance level of the machine tool at time t, n t represents the degradation rate of the machine tool at time t, ε t is Gaussian white noise, The mean is 0 and the variance is The observation equation parameters are regarded as the system state reflecting the current degradation trend.
[0048] In S4, according to the actual degradation data of the current CNC machine tool, such as Figure 4 As shown in the figure, the Monte Carlo particle filter method is used to update the single exponential degradation observation equation to obtain the single exponential degradation model of the machine tool, so that the single exponential degradation model can conform to and track the degradation trend of the current CNC machine tool.
[0049] S5: Determine the degradation stage of the current CNC machine tool according to the machine tool single index degradation model, select the machining surface roughness prediction model of the current degradation stage, and then obtain the corresponding surface roughness prediction result.
[0050] This embodiment selects vibration characteristics, temperature signal characteristics and current signal characteristics as characteristic signals that affect the formation of surface roughness based on the main physical factors affecting the roughness of the grinding process. Through the multi-factor sensor data acquisition method, the data information of the grinding process is collected and the data is pre-processed. The SE ContextGating attention mechanism is integrated into the model training and the mechanism is improved. The three original features extracted by the neural network are spliced in the dimension direction, and the spliced features are sent to the SE Context Gating attention mechanism to obtain the fusion result of the three features. By adding the fused features and the original features, it can be ensured that the original information of the original features is retained and that the information after the fusion of the original features is helpful for the prediction results. Through the fusion of multiple features, the model has the ability to learn the features of the three modal signals separately and fusedly, so that the model learns more feature information. In response to the problem of the degradation of the neural network prediction performance of the grinding machine after long-term service, the accuracy of the constructed neural network prediction model is improved by the transfer learning method of network layer freezing. Compared with existing methods, the machining accuracy prediction model of the present invention can learn and fuse multiple signal features, while preventing the prediction model from overfitting. It is suitable for result prediction over a long time span and provides a neural network model for part CNC machining accuracy prediction.
[0051] Finally, it should be noted that the above embodiments and explanations are intended only to illustrate the technical solutions of the present invention and are not intended to limit the present invention. It should be understood by those skilled in the art that modifications or equivalent substitutions to the technical solutions of the present invention may be made without departing from the spirit and scope of the technical solutions disclosed herein, and all such modifications or equivalent substitutions shall be encompassed within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting surface roughness of parts processing based on attention and transfer learning, characterized in that: The following steps are involved: S1: Collect key physical signals that affect the evolution of surface roughness of CNC machine tool parts; S2: After preprocessing and feature extraction of each key physical signal, the corresponding features are obtained, and the corresponding signal feature matrix is constructed according to the features corresponding to each key physical signal; S3: Input each signal feature matrix into the machined surface roughness prediction model for training to obtain a trained machined surface roughness prediction model; The machined surface roughness prediction model includes a convolutional layer, a memory network layer, a random inactivation layer, a fully connected layer, a subpath random dropout block, an improved SE Context Gating attention mechanism block and a classification module; Each signal feature matrix is input into the corresponding convolutional layer. The output of each convolutional layer is input into the classification module after passing through the corresponding first fully connected layer and subpath random dropout block. The output of all convolutional layers is input into the random dropout layer after passing through the corresponding memory network layer. The random dropout layer is connected to the improved SE Context Gating attention mechanism block through the second fully connected layer. The improved SE Context Gating attention mechanism block is connected to the classification module. The classification module outputs the prediction result of the machined surface roughness. The improved SE Context Gating attention mechanism block includes a third fully connected layer and an activation layer, the input of the improved SE Context Gating attention mechanism block serves as the input of the third fully connected layer, the third fully connected layer is connected to the activation layer, and the output of the activation layer is fused with the input of the improved SE Context Gating attention mechanism block to obtain a fused feature as the output of the improved SE Context Gating attention mechanism block; S4: Based on the measured degradation data of CNC machine tools, a single-exponential degradation model for machine tools is constructed. The degradation trend of the current CNC machine tools is determined using the single-exponential degradation model. In different degradation stages of the degradation trend, the network model of the trained surface roughness prediction model is migrated using a migration method based on the key physical signals of each degradation stage, thereby obtaining surface roughness prediction models for different degradation stages. S5: Determine the degradation stage of the current CNC machine tool according to the machine tool single index degradation model, select the machining surface roughness prediction model of the current degradation stage, and then obtain the corresponding surface roughness prediction result.
2. The method for predicting surface roughness of parts processing based on attention and transfer learning according to claim 1, characterized in that: In S2, the characteristics corresponding to each key physical signal include time domain signal characteristics and frequency domain signal characteristics.
3. The method for predicting surface roughness of parts processing based on attention and transfer learning according to claim 1, characterized in that: In S4, the formula of the machine tool single exponential degradation model is as follows: Y(t)=m t ·exp(n t ,t)+ε t Where Y(t) is the degradation performance of the machine tool at time t, m t is the initial performance level of the machine tool at time t, n t represents the degradation rate of the machine tool at time t, ε t is Gaussian white noise.
4. The method for predicting surface roughness of parts processing based on attention and transfer learning according to claim 1, characterized in that: In S4, based on the actual degradation data of the current CNC machine tool, the single exponential degradation observation equation is updated using the Monte Carlo particle filter method to obtain a single exponential degradation model of the machine tool.
Citation Information
Patent Citations
Method and device for predicting residual service life of equipment
CN115659808A