Machining accuracy prediction method based on correlation alignment domain adaptation
By adopting the relevant alignment domain adaptive method in the deep learning network model and using other domain data to train the model, the problem of low prediction accuracy of the depth model when the target domain data is lacking, and high-precision prediction using a small amount of data in the target domain is achieved.
Patent Information
- Application Number
- CN202310640748.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-05-31
AI Technical Summary
In the absence of target field data in the prior art, the prediction accuracy of the depth model has significantly decreased, making it difficult to achieve high-precision processing accuracy prediction.
The processing accuracy prediction method based on the adaptive processing field of related alignment is adopted, and the model is trained by collecting data easily collected in other fields. Deep learning network models, including convolutional neural network CNN, bidirectional long and short-term memory neural network BiLSTM and adaptive layer, are used to extract and align features to achieve high-precision prediction using a small amount of data in the target field.
Using a small amount of data in the target field to achieve high-precision prediction, improving the prediction accuracy of the depth model when data in the target field is lacking.
Smart Images

Figure CN116662757B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machining accuracy prediction, and in particular to a machining accuracy prediction method based on correlation alignment field adaptation. Background Art
[0002] In modern industrial production, the processing of many products is completed by CNC machine tools. Automobiles, aerospace materials, molds, screws and precision parts are mainly manufactured by mechanical processing. And as people's requirements for product quality and processing efficiency are getting higher and higher, high speed and high precision have become the main trend of the development of CNC machine tools. Therefore, how to improve the processing capacity of machine tools and make them more intelligent is an important topic. Effective control and prediction of the production and processing process and processing accuracy of machine tools is an important means to improve the intelligence of machine tools.
[0003] For machine tool machining accuracy prediction, existing methods can be roughly divided into two categories, namely model-driven methods and data-driven methods. Most model-driven methods strongly rely on a large amount of prior knowledge or domain expert experience, and the prediction effect is poor, while data-driven methods can build a nonlinear mapping from the machining accuracy dimension to the feature dimension by learning a large amount of training data without additional prior knowledge. In recent years, with the development of computers, deep learning technology has been introduced into this research field due to its powerful representation learning ability. However, deep models can only perform well in prediction when there is enough labeled data available for training. In some practical situations, it is very difficult to collect enough data, which will lead to a significant decrease in the performance of data-driven deep models.
[0004] Therefore, it is necessary to propose a new prediction method that can improve the prediction accuracy of deep models when there is a lack of target domain data. Summary of the invention
[0005] In view of this, the present invention provides a processing accuracy prediction method based on related alignment field adaptation, which trains the model by collecting data that is easy to collect in other fields, so as to achieve high-precision prediction in the target field using a small amount of data.
[0006] The present invention provides a method for predicting machining accuracy based on correlation alignment domain adaptation, comprising the following steps:
[0007] S1. Collect the time series displacement data of the processed device as the target domain data, and collect the historical time series displacement data of the processed device under different working conditions, use the historical time series displacement data similar to the target domain data as the source domain data, and perform noise removal and standardization on the source domain data and the target domain data;
[0008] S2. Build a deep learning network model. The deep learning network model consists of two neural networks and an adaptive layer. The two neural networks have the same structure. The neural networks include: a convolutional neural network CNN, a bidirectional long short-term memory neural network BiLSTM, and a prediction module.
[0009] The output end of the convolutional neural network CNN is connected to the input end of the bidirectional long short-term memory neural network BiLSTM, the output end of the bidirectional long short-term memory neural network BiLSTM is connected to the input end of the prediction module, the output ends of the two bidirectional long short-term memory neural networks BiLSTM are connected to the input end of the adaptive layer, and the output end of the adaptive layer is connected to the input end of the prediction module;
[0010] S3. The source domain data and target domain data after noise removal and standardization are respectively input into two neural networks in the deep learning network model for training. The BiLSTM network layers in the two neural networks respectively extract features of the source domain data and the target domain data, map the source domain data features and the target domain data features to the feature space of the adaptive layer, use the Coral method to measure the difference between the source domain data features and the target domain data features in the adaptive layer, align the source domain data features and the target domain data features, and determine the objective function according to the difference measured by the Coral method;
[0011] S4. Determine whether the deep learning network model has been trained. If so, proceed to step S5. If not, update the model parameters and return to step S3 until the deep learning network model has been trained.
[0012] S5. Migrating the trained source domain neural network model parameters to the target domain neural network model to obtain the trained target domain neural network model;
[0013] S6. Input the target domain data into the trained target domain neural network model for prediction and output the prediction result.
[0014] Further, in step S1, when the maximum mean difference between the source domain data and the target domain data is less than 0.05, the source domain data and the target domain data are similar.
[0015] Furthermore, in step S1, zero mean normalization is used to process the source domain data or the target domain data. The zero mean normalization calculation formula is as follows:
[0016]
[0017] Among them, x′ i represents the standardized source domain data or target domain data, x i represents source domain data or target domain data, x mean represents the average value of source domain data or target domain data, xstd Represents the standard deviation of the source domain data or the target domain data.
[0018] Furthermore, in step S3, in the adaptation layer, the Coral method is used to measure the difference between the source domain data features and the target domain data features, including the following:
[0019] The covariance matrix of the source domain data features is linearly transformed, and the covariance matrix of the source domain data features after linear transformation is aligned with the covariance matrix of the target domain data features. The alignment formula is as follows:
[0020]
[0021]
[0022]
[0023] Among them, Coral represents the correlation alignment loss, C s represents the source domain data feature covariance matrix, C t Represents the covariance matrix of the target domain data features, represents the square of the matrix norm, n s Indicates the number of source domain data, n t represents the number of target domain data, D s Represents source domain data, represents the transposition of the source domain data, D t represents the unlabeled target data, represents the transpose of the unlabeled target domain data, I represents a column vector whose elements are all 1, T represents the transpose of the matrix, and I T represents the transpose of I;
[0024] The objective function expression of the deep learning network model is:
[0025]
[0026] Among them, Object represents the objective function, MAE represents the mean absolute error of the deep learning network model, e represents a positive natural constant, i represents the i-th source domain data, epoch represents the total number of trainings for all source domain data, and Coral represents the correlation alignment loss.
[0027] Further, in step S4, when the deep learning network model training times reaches the set training times or the objective function reaches the minimum value, the deep learning network model training is completed.
[0028] Beneficial effects of the present invention: The present invention provides a processing accuracy prediction method based on related alignment field adaptation, which trains the model by collecting data that is easy to collect in other fields, so as to achieve high-precision prediction in the target field using a small amount of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0030] Figure 1 It is a flow chart of the present invention;
[0031] Figure 2 This is a deep learning network framework diagram of the present invention;
[0032] Figure 3 This is a neural network framework diagram of the present invention; DETAILED DESCRIPTION
[0033] The present invention is further described below with reference to the accompanying drawings:
[0034] The present invention provides a method for predicting machining accuracy based on related alignment domain adaptation, comprising the following steps:
[0035] S1. Collect the time series displacement data of the processed device as the target domain data, and collect the historical time series displacement data of the processed device under different working conditions, use the historical time series displacement data similar to the target domain data as the source domain data, and perform noise removal and standardization on the source domain data and the target domain data;
[0036] S2. Build a deep learning network model. The deep learning network model consists of two neural networks and an adaptive layer. The two neural networks have the same structure. The neural networks include: a convolutional neural network CNN, a bidirectional long short-term memory neural network BiLSTM, and a prediction module.
[0037] The output end of the convolutional neural network CNN is connected to the input end of the bidirectional long short-term memory neural network BiLSTM, the output end of the bidirectional long short-term memory neural network BiLSTM is connected to the input end of the prediction module, the output ends of the two bidirectional long short-term memory neural networks BiLSTM are connected to the input end of the adaptive layer, and the output end of the adaptive layer is connected to the input end of the prediction module;
[0038] S3. The source domain data and target domain data after noise removal and standardization are respectively input into two neural networks in the deep learning network model for training. The BiLSTM network layers in the two neural networks respectively extract features of the source domain data and the target domain data, map the source domain data features and the target domain data features to the feature space of the adaptive layer, use the Coral method to measure the difference between the source domain data features and the target domain data features in the adaptive layer, align the source domain data features and the target domain data features, and determine the objective function according to the difference measured by the Coral method;
[0039] S4. Determine whether the deep learning network model has been trained. If so, proceed to step S5. If not, update the model parameters and return to step S3 until the deep learning network model has been trained.
[0040] S5. Migrating the trained source domain neural network model parameters to the target domain neural network model to obtain the trained target domain neural network model;
[0041] S6. Input the target domain data into the trained target domain neural network model for prediction, and output the prediction result. Through the above method, it is possible to use less target domain data to train a high-precision prediction model under different working conditions, improve the accuracy of target domain prediction, and achieve high-precision prediction of products.
[0042] In this embodiment, in step S1, a displacement sensor is used to collect time series displacement data of a processing device as target domain data, and historical time series displacement data under different working conditions are collected. The maximum mean difference is used to determine the source domain data from the historical time series displacement data collected under different working conditions. When the maximum mean difference between the historical time series displacement data and the target domain data is less than 0.05, the historical time series displacement data and the target domain data are similar, and the historical time series displacement data similar to the target domain data is used as the source domain data; wherein, the time series displacement data represents displacement data collected in chronological order, the historical time series displacement data under different working conditions represents historical time series displacement data in different fields, and the maximum mean difference is a prior art and is not described in detail here.
[0043] The Kalman filter is used to remove noise from the source domain data and the target domain data, and then the source domain data and the target domain data after noise removal are subjected to zero-mean normalization. The zero-mean normalization calculation formula is as follows:
[0044]
[0045] Among them, x i ′ represents the standardized source domain data or target domain data, x i represents source domain data or target domain data, x meanrepresents the average value of source domain data or target domain data, x std Represents the standard deviation of the source domain data or the target domain data. Through the above method, the data can be smoother and closer to the true value, and the prediction result can be more accurate.
[0046] In this embodiment, the pytorch deep learning framework is used in step S2 to build a deep learning network model, which consists of two neural networks and an adaptive layer. Figure 2 As shown in the figure, the two neural networks have the same structure. The neural network includes a convolutional neural network (CNN), a bidirectional long short-term memory (BiLSTM) neural network, and a prediction module. Figure 3 As shown;
[0047] Among them, the output end of the convolutional neural network CNN is connected to the input end of the bidirectional long short-term memory neural network BiLSTM, the output end of the bidirectional long short-term memory neural network BiLSTM is connected to the input end of the prediction module, the output ends of the two bidirectional long short-term memory neural networks BiLSTM are connected to the input end of the adaptive layer, and the output end of the adaptive layer is connected to the input end of the prediction module;
[0048] The output of a one-dimensional convolution layer C1 with a convolution kernel size of 11 in the convolutional neural network CNN is connected to the input of the ReLU activation function, and the output of the ReLU activation function is connected to the input of the maximum pooling layer P1, and the convolution kernel size of the maximum pooling layer P1 is 2. The output of the maximum pooling layer P1 is connected to the input of a one-dimensional convolution layer C2 with a convolution kernel size of 5, and the output of the one-dimensional convolution layer C2 is connected to the input of the maximum pooling layer P2, and the convolution kernel size of the maximum pooling layer P2 is 2;
[0049] The output end of the maximum pooling layer P2 is connected to the input end of the BiLSTM network. The BiLSTM network is a prior art and will not be described in detail here. The output end of the BiLSTM network is connected to the input end of the adaptive layer and the input end of the prediction module, and the output end of the adaptive layer is connected to the input end of the prediction module. When the deep learning model is being trained, the features output by the BiLSTM network are input to the adaptive layer, and the features output by the adaptive layer are input to the prediction module. When the deep learning model is trained, the features output by the BiLSTM network are directly input to the prediction module for prediction.
[0050] The output of the flattening layer in the prediction module is connected to the input of the discard layer D1, the output of the discard layer D1 is connected to the input of the linear layer L1, the output of the linear layer L1 is connected to the input of the ReLU activation function, the output of the ReLU activation function is connected to the input of the discard layer D2, the output of the discard layer D2 is connected to the input of the linear layer L2, and the linear layer outputs the prediction result. Through the above method, the dimension of the feature matrix can be reduced, the number of parameters can be reduced, and the model training speed can be improved.
[0051] In this embodiment, in step S3, the source domain data and the target domain data are respectively input into two neural networks in the deep learning network model for training, such as Figure 2 As shown in the figure, the BiLSTM network layer extracts features from the source domain data and the target domain data respectively, maps the source domain data features and the target domain data features to the feature space of the adaptive layer, and uses the Coral method to measure the differences between the source domain data features and the target domain data features, including the following:
[0052] The covariance matrix of the source domain data features is linearly transformed, and the covariance matrix of the source domain data features after linear transformation is aligned with the covariance matrix of the target domain data features. The alignment formula is as follows:
[0053]
[0054]
[0055]
[0056] Among them, Coral represents the correlation alignment loss, C s represents the source domain data feature covariance matrix, C t Represents the covariance matrix of the target domain data features, represents the square of the matrix norm, n s Indicates the number of source domain data, n t represents the number of target domain data, D s Represents source domain data, represents the transposition of the source domain data, D t represents the unlabeled target data, represents the transpose of the unlabeled target domain data, I represents a column vector whose elements are all 1, T represents the transpose of the matrix, and I T represents the transpose of I;
[0057] The objective function expression in the deep learning network model is:
[0058]
[0059] Among them, MAE represents the mean absolute error of the deep learning network model, and MAE is the loss function of the deep learning network model. MAE is an existing technology and will not be elaborated here. e represents a natural constant, i represents the i-th source domain data, epoch represents the total number of trainings for all source domain data, and Coral represents the correlation alignment loss. Through the above method, the performance of the target domain model can be improved by using abundant source domain samples.
[0060] In this embodiment, in step S4, when the deep learning network model training times reaches 500 times or the objective function reaches the minimum value, the deep learning network model training is completed and the process goes to step S5; when the deep learning network model training times does not reach 500 times and the objective function does not reach the minimum value, the model parameters are updated and the process goes back to step S3 to continue training until the deep learning network model training times reaches 500 times or the objective function reaches the minimum value. The training is completed and the process goes to step S5. The above method can accelerate the convergence speed of the deep learning network model.
[0061] In this embodiment, in step S5, the trained source domain neural network model parameters are migrated to the target domain neural network model to obtain a trained target domain neural network model.
[0062] In this embodiment, in step S6, the target domain data is input into the trained target domain neural network model, and the prediction result is output.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A method for predicting machining accuracy based on correlation alignment domain adaptation, characterized in that: The following steps are involved: S1. Collect the time series displacement data of the processed device as the target domain data, and collect the historical time series displacement data of the processed device under different working conditions, use the historical time series displacement data similar to the target domain data as the source domain data, and perform noise removal and standardization on the source domain data and the target domain data; S2. Build a deep learning network model. The deep learning network model consists of two neural networks and an adaptive layer. The two neural networks have the same structure. The neural networks include: a convolutional neural network CNN, a bidirectional long short-term memory neural network BiLSTM, and a prediction module. The output end of the convolutional neural network CNN is connected to the input end of the bidirectional long short-term memory neural network BiLSTM, the output end of the bidirectional long short-term memory neural network BiLSTM is connected to the input end of the prediction module, the output ends of the two bidirectional long short-term memory neural networks BiLSTM are connected to the input end of the adaptive layer, and the output end of the adaptive layer is connected to the input end of the prediction module; S3. The source domain data and target domain data after noise removal and standardization are respectively input into two neural networks in the deep learning network model for training. The BiLSTM network layers in the two neural networks respectively extract features of the source domain data and the target domain data, map the source domain data features and the target domain data features to the feature space of the adaptive layer, use the Coral method to measure the difference between the source domain data features and the target domain data features in the adaptive layer, align the source domain data features and the target domain data features, and determine the objective function according to the difference measured by the Coral method; S4. Determine whether the deep learning network model has been trained. If so, proceed to step S5. If not, update the model parameters and return to step S3 until the deep learning network model has been trained. S5. Migrating the trained source domain neural network model parameters to the target domain neural network model to obtain the trained target domain neural network model; S6. Input the target domain data into the trained target domain neural network model for prediction and output the prediction result.
2. The method for predicting machining accuracy based on correlation alignment domain adaptation according to claim 1, characterized in that: In step S1, when the maximum mean difference between the source domain data and the target domain data is less than 0.05, the source domain data and the target domain data are similar.
3. The method for predicting machining accuracy based on correlation alignment domain adaptation according to claim 1, characterized in that: In step S1, zero-mean normalization is used to process the source domain data or the target domain data. The zero-mean normalization calculation formula is as follows: Among them, x′ i represents the standardized source domain data or target domain data, x i represents source domain data or target domain data, x mean represents the average value of source domain data or target domain data, x std Represents the standard deviation of the source domain data or the target domain data.
4. The method for predicting machining accuracy based on correlation alignment domain adaptation according to claim 1, characterized in that: In step S3, in the adaptation layer, the Coral method is used to measure the difference between the source domain data features and the target domain data features, including the following: The covariance matrix of the source domain data features is linearly transformed, and the covariance matrix of the source domain data features after linear transformation is aligned with the covariance matrix of the target domain data features. The alignment formula is as follows: Among them, Coral represents the correlation alignment loss, C s represents the source domain data feature covariance matrix, C t Represents the covariance matrix of the target domain data features, represents the square of the matrix norm, n s Indicates the number of source domain data, n t represents the number of target domain data, D s Represents source domain data, represents the transposition of the source domain data, D t represents the unlabeled target data, represents the transpose of the unlabeled target domain data, I represents a column vector whose elements are all 1, T represents the transpose of the matrix, and I T represents the transpose of I; The objective function expression of the deep learning network model is: Among them, MinObject represents the objective function, MAE represents the mean absolute error of the deep learning network model, e represents a positive natural constant, i represents the i-th source domain data, epoch represents the total number of trainings for all source domain data, and Coral represents the correlation alignment loss.
5. The method for predicting machining accuracy based on correlation alignment domain adaptation according to claim 1, characterized in that: In step S4, when the deep learning network model training times reaches the set training times or the objective function reaches the minimum value, the deep learning network model training is completed.