A machine tool thermal error prediction method based on multimodal deep learning and domain adaptation
Through multimodal deep learning and domain adaptation methods, combined with infrared images and machine tool multi-source data, the problems of single data sources and poor generalization of models in the prior art are solved, and high-precision thermal error prediction and cross-condition adaptability are achieved.
Patent Information
- Application Number
- CN202510720012.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-30
AI Technical Summary
The existing thermal error prediction methods have a single source of data, and it is difficult to capture complex thermal error generation relationships, resulting in limited prediction accuracy and poor generalization of the model.
Using a multimodal deep learning method, combining the spatio-temporal features of infrared images and machine tool multi-source data, we use the cross-attention mechanism and dynamic gated fusion network to perform feature fusion, and introduce a domain adaptation mechanism to improve model generalization by constructing infrared image feature extraction module, spatio-temporal feature extraction module and multimodal feature fusion module.
It realizes non-contact and global perception of the thermal state of the machine tool, significantly improves the accuracy of thermal error prediction and the generalization ability of the model under different operating conditions, and enhances robustness.
Smart Images

Figure CN120234592B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of thermal error prediction of CNC machine tools, and in particular to a machine tool thermal error prediction method based on multimodal deep learning and domain adaptation. Background Art
[0002] In modern precision manufacturing, machining errors caused by thermal deformation (i.e., thermal error) in CNC machine tools are a major factor affecting machining accuracy. During machine operation, heat generated by the spindle, motor, guideways, and cutting processes causes thermal expansion and deformation of machine components, altering the relative position between the tool and the workpiece, thus generating thermal error. Accurately predicting and compensating for thermal errors is essential to improving machining accuracy.
[0003] Among the existing thermal error prediction methods, most adopt the method of arranging temperature sensors at the key heating parts of the machine tool to obtain temperature data. For example, the Chinese patent document with publication number CN119472503A discloses a real-time thermal error compensation method for the entire machine tool based on CNN-BIGRU-A, which arranges temperature sensors by analyzing the heat-sensitive areas of the machine tool spindle and transmission shaft to obtain historical temperature data. However, this method has a single data source, limited prediction accuracy, and it also faces challenges in analyzing the accurate heat-sensitive points of the machine tool. Another Chinese patent document with publication number CN119668191A discloses a machine tool thermal error modeling method based on time convolutional network and transfer learning, which also adopts the method of arranging temperature sensors at the key heating parts of the machine tool to collect data.
[0004] Most existing thermal error prediction methods face challenges with single data sources and difficulty analyzing thermally sensitive points. This makes it difficult to capture the complex relationships that generate thermal errors, resulting in limited thermal error prediction accuracy and restricting the generalization of the model. Therefore, a new thermal error prediction method that can utilize multi-source data and avoid complex contact measurements is urgently needed. Summary of the Invention
[0005] The present invention provides a machine tool thermal error prediction method based on multimodal deep learning and domain adaptation. It can use the rich temperature field information of infrared images and the complex spatiotemporal characteristics of multi-source machine tool data to predict thermal errors. At the same time, it uses domain adaptation methods to improve the generalization of the model and improve the accuracy of prediction.
[0006] A machine tool thermal error prediction method based on multimodal deep learning and domain adaptation includes the following steps:
[0007] (1) Construct an infrared image feature extraction module. This module processes the input infrared image data based on the pre-trained ConvNeXt model to obtain a thermal feature map. After downsampling the thermal feature map, it captures the temporal dependency based on the multi-head self-attention mechanism. Finally, it obtains low-dimensional thermal features based on multi-layer 1D convolution. ;
[0008] (2) Construct a spatiotemporal feature extraction module, which extracts spatiotemporal features from current and power data based on a spatiotemporal convolutional network and a multi-head self-attention mechanism. ;
[0009] (3) Construct a multimodal feature fusion module, which combines low-dimensional thermal features and spatiotemporal characteristics After mapping to the same dimensional space, deep feature fusion is performed to obtain fused features ;
[0010] (4) Construct a thermal error predictor to fuse features As input, thermal error prediction is performed and the predicted loss of thermal error is calculated;
[0011] (5) Collect machine tool operation data from different working conditions as the source domain and target domain respectively. The machine tool operation data includes infrared image data of the machine tool spindle and current, power, and thermal error data of the machine tool; process the machine tool operation data of the source domain and the target domain simultaneously through steps (1) to (4) to obtain the fusion features of the source domain, the fusion features of the target domain, and the thermal error prediction loss of the source domain;
[0012] (6) The fused features of the source domain and the target domain are input into the deep transfer learning module based on the DTW distance to calculate the domain alignment loss of the source domain and the target domain; and the total loss function is constructed by combining the thermal error prediction loss of the source domain and the domain alignment loss to jointly optimize each module and the thermal error predictor;
[0013] (7) After the optimization is completed, the fused features of the target domain are input into the thermal error predictor to obtain the thermal error of the machine tool.
[0014] In step (1), after downsampling the thermal feature map, the temporal dependency is captured based on the multi-head self-attention mechanism, which specifically includes:
[0015] Use global average pooling to downsample the thermal feature map, add position encoding and layer normalization to the obtained pooled features, and obtain the normalized pooled features ;
[0016] Then use the multi-head self-attention mechanism to capture the normalized pooled features The temporal dependency in , and construct the residual connection to obtain the output features of the residual connection ;
[0017] The output features of the residual connection In dimension After normalization, the normalized output features are obtained , is the number of channels of the thermal feature map.
[0018] In step (1), the normalized output features are obtained based on multi-layer 1D convolution. Perform gradual dimensionality reduction to obtain low-dimensional thermal features .
[0019] The specific process of step (2) is:
[0020] Based on the fully connected layer, the current and power data of the input spatiotemporal feature extraction module are preliminarily mapped to obtain high-dimensional features. ;
[0021] High-dimensional features based on temporal convolutional networks Extract spatiotemporal features and further capture temporal dependencies based on a multi-head self-attention mechanism with residual connections to obtain the spatiotemporal features of current and power. .
[0022] The specific process of step (3) is:
[0023] Based on the fully connected layer, the low-dimensional thermal features and spatiotemporal characteristics Mapped to the same dimensional space;
[0024] Realizing low-dimensional hot features in the same dimensional space based on cross-attention mechanism and spatiotemporal characteristics complementary information;
[0025] Low-dimensional thermal features after information complementation based on dynamic gating fusion and spatiotemporal characteristics Fusion is performed to obtain fusion features .
[0026] In step (4), based on GRU fusion features The temporal information in the dataset is aggregated and then the thermal error is predicted through a fully connected layer.
[0027] In step (4), the prediction loss of thermal error is calculated using mean square error, which is expressed as:
[0028] ;
[0029] Where, is the source domain batch size; The source domain The actual thermal error of each sample is obtained through the collected machine tool operation data; is the corresponding predicted thermal error, Represents the predicted loss of thermal error.
[0030] In step (6), the DTW distance represents the similarity between the two time series, and the domain alignment loss represents the average DTW distance between the source domain fusion feature sequence and the target domain fusion feature sequence. The expression of this process is:
[0031] ;
[0032] Where, is the batch size, and Represent the first source domain fusion feature sequence and target domain fusion feature sequence, is the DTW distance calculation function, stands for domain alignment loss.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1. This invention deeply integrates the machine tool temperature field information provided by infrared thermal images with the spatiotemporal characteristics of multi-source data generated by the machine tool itself (such as current and power). This combination enables non-contact, global perception of the machine tool's thermal state, significantly reducing the complexity of traditional data acquisition using contact temperature sensors and avoiding the challenges of pre-analyzing complex thermally sensitive points on the machine tool. By integrating rich information from different modalities, it provides a more comprehensive input for thermal error prediction.
[0035] 2. This paper constructs a parallel feature extraction module for infrared images and time series data, capable of extracting deep, representative features from each modality. Furthermore, by introducing a cross-attention mechanism and a dynamic gated fusion network, deep interaction and information complementarity between features from different modalities are achieved. This refined feature fusion strategy can more effectively capture the complex nonlinear relationships between thermal errors and multi-source data.
[0036] 3. This invention improves the model's generalization across operating conditions through a domain adaptation mechanism. To address the potential variations in thermal characteristics and data distribution under different machine tool operating conditions, a deep transfer learning module based on DTW distance is constructed to align data features from different operating conditions (source and target domains). This domain adaptation mechanism effectively mitigates the degradation of model performance under varying operating conditions and significantly enhances the generalization and robustness of the thermal error prediction model when faced with unknown operating conditions or operating conditions that differ from the training environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a flow chart of a method for predicting thermal errors of machine tools based on multimodal deep learning and domain adaptation according to an embodiment of the present invention.
[0038] Figure 2 4 is a flowchart of the infrared image feature extraction module in an embodiment of the present invention.
[0039] Figure 3 4 is a flowchart of the spatiotemporal feature extraction module in an embodiment of the present invention.
[0040] Figure 4 4 is a flowchart of the working process of the multimodal feature fusion module and the thermal error predictor in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be noted that the following examples are intended to facilitate understanding of the present invention and do not have any limiting effect on the present invention.
[0042] like Figure 1 As shown, a machine tool thermal error prediction method based on multimodal deep learning and domain adaptation includes the following steps:
[0043] During the operation of the machine tool, the infrared image data of the machine tool spindle is continuously collected through the infrared imager at a set sampling frequency. Through the customized development of the machine tool CNC system, the CNC system can be used as a slave port to transmit the machine tool current and power data, and the PC can be used as a master port to collect data. Through the data interaction program written on the PC side, it can be ensured that the infrared image, current and power data are collected synchronously at the same sampling frequency.
[0044] An infrared image feature extraction module is constructed. The input infrared image data is processed based on the pre-trained ConvNeXt model to obtain a thermal feature map. Subsequently, the pooled features are obtained through global average pooling and dimensionality compression. After adding position encoding and layer normalization to the pooled features, the temporal dependency in the feature sequence is captured based on a multi-head self-attention mechanism with residual connections. Finally, the multi-dimensional thermal features are gradually reduced in dimensionality through multi-layer 1D convolution to obtain low-dimensional thermal features.
[0045] A spatiotemporal feature extraction module is constructed to preliminarily extract the spatiotemporal features in the current and power data based on a temporal convolutional network. Then, a multi-head self-attention mechanism with residual connections similar to that in the infrared image feature module is used to further capture the temporal dependencies in the feature sequence and obtain the spatiotemporal features of the current and power data.
[0046] The features obtained by parallel processing of the above two modules are mapped to the same dimensional space through a fully connected layer to construct a multimodal feature fusion module. The information complementarity between feature sequences is achieved based on the cross-attention mechanism, and the deep fusion of features is achieved based on the dynamic gating mechanism.
[0047] A thermal error predictor is constructed to predict the thermal error based on the fusion features based on the GRU model.
[0048] Data under different operating conditions is collected and divided into source and target domains. Both source and target domain data undergo the same feature extraction and feature fusion process to generate source and target fused features. The source fused features are input into the thermal error predictor for thermal error prediction, and the prediction loss is calculated with the corresponding thermal error. A transfer learning module based on DTW distance is constructed to calculate the domain alignment loss between the source and target fused features.
[0049] The total loss function is obtained by integrating the prediction loss and domain alignment loss, and the model is jointly optimized. After optimization, the target domain fusion features are input into the thermal error predictor for thermal error prediction.
[0050] Specifically, the infrared image feature extraction module in the embodiment of the present invention is as follows: Figure 2 As shown, the following steps are included:
[0051] S101. Process infrared image data based on the pre-trained ConvNeXt model to obtain a high-dimensional thermal feature map.
[0052] In detail, the input infrared image data is in the following form:
[0053] ;
[0054] Where, is the input infrared image data, is the batch size, is the time step, is the height of the image, is the width of the image, The construction of this five-dimensional input data can effectively integrate batch size, time series information, and spatial and channel features, providing a structured input format for subsequent deep learning model processing and supporting in-depth analysis of the spatiotemporal characteristics of infrared image sequences.
[0055] In detail, the expression of the thermal feature map obtained by processing the input data based on the pre-trained ConvNeXt is as follows:
[0056] ;
[0057] Where, is the output thermal feature map, is the height of the thermal signature, is the width of the thermal signature, is the number of channels in the thermal feature map. ConvNeXt is a pure convolutional neural network designed with reference to the Swin Transformer. It has good performance and low complexity. After pre-training, it can effectively extract infrared image features and does not participate in parameter updates during subsequent model training.
[0058] S102. Compress the thermal feature map through global average pooling to obtain pooled features.
[0059] In detail, the algorithm of global average pooling is as follows:
[0060] ;
[0061] ;
[0062] Where, is the feature after pooling, 、 、 is the index of batch, time step, channel, and its value range is 0 to , 0 to , 0 to , ensuring that every frame's feature map is pooled. Global average pooling calculates the average value of each channel to obtain a one-dimensional vector with the same number of channels. This vector represents the average activation value of the corresponding channel and can be regarded as the global statistical feature of each channel. This pooled feature can be used as a multi-dimensional hot feature in the subsequent time series feature extraction and feature enrichment steps.
[0063] S103: Add position encoding to the pooled features and perform layer normalization.
[0064] In detail, the expression for adding position encoding is:
[0065] ;
[0066] Where, is a learnable positional encoding, This is the pooled feature after adding position encoding. Position encoding is used to indicate the positional relationship between multi-dimensional hot features, making it easier to capture more accurate temporal dependencies based on the subsequent multi-head self-attention mechanism.
[0067] In detail, the algorithm for layer normalization is:
[0068] ;
[0069] Where, (*) is the layer normalization function, and They are exist The mean and variance over the dimensions, and are learnable parameters, is the normalized pooling feature. This layer normalization converts the multi-dimensional thermal features into Mapping data in the dimension to between 0 and 1 can accelerate training, stabilize model convergence, and reduce the problem of gradient disappearance or gradient explosion.
[0070] S104. Extract temporal dependencies in hot features based on a multi-head self-attention mechanism with residual connections.
[0071] In detail, the expression of the multi-head self-attention mechanism process including residual connection is:
[0072] ;
[0073] ;
[0074] ;
[0075] ;
[0076] ;
[0077] ;
[0078] In the formula, the multi-head self-attention mechanism splits Size, 、 、 Respectively The query matrix, key matrix, and value matrix of each head, 、 、 are the weight matrices of the query matrix, key matrix, and value matrix respectively, For the The attention output of the head, is the scaling factor, is matrix splicing, is the output weight matrix, is the output feature of the multi-head attention mechanism, is the output feature of the residual connection, for In dimension Normalized features on .
[0079] Specifically, the multi-head self-attention mechanism is designed to capture temporal dependencies in infrared image sequences. By calculating the similarity between the query (Q), key (K), and value (V) matrices, the model dynamically assigns different attention weights to each time step in the sequence, focusing on the features most relevant to the current time step. This multi-head design allows the model to learn different attention patterns in parallel across different representation subspaces, enhancing its ability to capture complex temporal dependencies. Residual connections add the output of the attention mechanism to the original input, helping to alleviate the vanishing gradient problem in deep networks and making it easier for the model to learn the identity mapping, preserving the original information. Subsequent layer normalization normalizes the features after the residual connections, stabilizing the training process and accelerating model convergence. This series of operations enables the model to effectively extract deep dynamic information related to thermal error from the temporal features of infrared images, laying the foundation for subsequent feature fusion and prediction.
[0080] S105. Based on multi-layer 1D convolution, features are gradually compressed to obtain low-dimensional thermal features.
[0081] In detail, the expression of the multi-layer 1D convolution process is:
[0082] ;
[0083] ;
[0084] Where, is a multi-layer 1D convolution function, It is a low-dimensional thermal feature.
[0085] In detail, Contains Layer 1D convolutional network, the algorithm for each layer is:
[0086] ;
[0087] Where, Representative The output of the layer, For the The 1D convolution kernel of the layer, represents the convolution operation, For the The bias term of the layer, is the Sigmoid function. Multi-layer 1D convolution condenses the hot features, which can reduce the computational complexity of subsequent models and also alleviate the problem of feature information loss caused by one-step dimensionality reduction.
[0088] Specifically, the spatiotemporal feature extraction module in the embodiment of the present invention is as follows: Figure 3 As shown, the following steps are included:
[0089] S201. Perform preliminary feature mapping on the current and power data based on the fully connected layer.
[0090] In detail, the expression of this process is:
[0091] ;
[0092] ;
[0093] Where, is the input current and power data, (*) is the fully connected layer, This process extracts the potential patterns in the current and power data and provides higher information density input for subsequent spatiotemporal feature extraction based on temporal convolutional networks.
[0094] S202: Extracting spatiotemporal features from the initially mapped features based on a temporal convolutional network.
[0095] In detail, the expression of this process is:
[0096] ;
[0097] Where, (*) is a temporal convolutional network, which contains multiple layers of causal and dilated convolutional blocks with residual connections. It is the feature output by the temporal convolutional network.
[0098] Specifically, the temporal convolutional network uses causal convolution to ensure that the model relies only on information from the current and previous time steps, making it suitable for time series modeling. Atrous convolution expands the receptive field to capture dependencies over longer timeframes. This process provides rich spatiotemporal context for the subsequent multi-head self-attention mechanism, enhancing the model's ability to capture dynamic features related to thermal errors.
[0099] S203. Further capture temporal dependencies based on a multi-head self-attention mechanism containing residual connections.
[0100] In detail, the expression of this process is:
[0101] ;
[0102] Where, It is a multi-head self-attention mechanism with residual connection, which is similar to the S104 process in the infrared image feature extraction module. are the temporal and spatial characteristics of current and power.
[0103] Specifically, the multimodal feature fusion module and thermal error predictor in the embodiment of the present invention are as follows: Figure 4 As shown, the following steps are included:
[0104] S301. Map the thermal features and current power features to the same dimensional space based on a fully connected layer.
[0105] In detail, the expression of this process is:
[0106] ;
[0107] ;
[0108] Where, and They are and A fully connected layer that maps to the same dimensional space, and The thermal, current, and power features are mapped to the same dimensional space. This mapping process ensures dimensional consistency across different modal features, providing comparable feature representations for subsequent cross-attention mechanisms and dynamic gating fusion. The application of fully connected layers not only preserves the core information of each modal feature but also enhances its expressiveness through nonlinear transformations, laying the foundation for deep fusion of multimodal features.
[0109] S302. Realize information complementarity between thermal features and current power features based on the cross-attention mechanism.
[0110] In detail, the expression of the cross attention mechanism is:
[0111] ;
[0112] ;
[0113] Where, and They are focus on and focus on The multi-head attention mechanism, whose key matrix and value matrix come from another modality, and is the output of the cross-attention mechanism. This process achieves information complementarity between infrared image features and current and power features through cross-modal attention allocation, improving the semantic richness of features and providing a more comprehensive feature representation for subsequent dynamic gating fusion.
[0114] S303. Realize deep fusion of thermal features and current power features based on a dynamic gating fusion mechanism.
[0115] In detail, the expression of the dynamic gate fusion mechanism is:
[0116] ;
[0117] ;
[0118] ;
[0119] ;
[0120] Where, is the hyperbolic tangent activation function, 、 、 All are fully connected layers. is the Sigmoid activation function, is the fusion weight matrix, stands for element-wise multiplication, For fusion features.
[0121] In detail, the dynamic gating fusion mechanism is implemented through the fully connected layer and Respectively and Perform feature transformation and use The activation function introduces nonlinear mapping to generate intermediate feature representations. Combine and Features, generate fusion weight matrix , constrained to the range [0,1] by the Sigmoid activation function. The weight matrix Dynamically adjust by element-by-element multiplication and The contribution of This process achieves a deep fusion of infrared image features with current and power features through adaptive weight allocation, providing a comprehensive and efficient feature representation for subsequent thermal error prediction.
[0122] S304: Predict the thermal error based on the fusion features based on the GRU model.
[0123] In detail, the expression of this process is:
[0124] ;
[0125] ;
[0126] Where, For the GRU model, is the fully connected layer that outputs the predicted value, is the output of the GRU model, is the predicted thermal error value, Indicates taking the hidden layer of the last time step of GRU output for prediction.
[0127] Specifically, the deep transfer learning module based on DTW distance in the present invention uses the average DTW distance between source domain features and target domain features as the domain alignment loss. The expression of this process is:
[0128] ;
[0129] Where, is the batch size, and Represent the first source domain feature sequence and target domain feature sequence, is the DTW distance calculation function, stands for domain alignment loss.
[0130] In detail, constructing the DTW distance calculation function includes the following steps:
[0131] To calculate the local cost, we use the squared Euclidean distance between two eigenvectors. The algorithm is:
[0132] ;
[0133] Where, Representation sequence No. Elements and sequence No. The local cost between elements, where , , each element in the sequence is dimensional vector.
[0134] Calculate the cumulative cost and construct the cumulative cost matrix, which is filled according to the following recurrence relationship:
[0135] ;
[0136] Where, Indicates that the sequence subsequence of with sequence subsequence of The minimum cumulative cost required to perform optimal time-warping alignment, and The value range is 1 to , the calculation of this recursive relationship must follow the preset boundary conditions, as follows:
[0137] ;
[0138] ;
[0139] ;
[0140] DTW distance is determined, and the cumulative cost matrix is constructed. and The DTW distance is the element value in the lower right corner of the matrix, as follows:
[0141] ;
[0142] In detail, the algorithm for calculating the source domain prediction loss using mean square error is:
[0143] ;
[0144] Where, is the source domain batch size, The source domain The true thermal error of the samples, is the corresponding predicted thermal error, Represents the prediction loss.
[0145] In detail, the total loss function combining prediction loss and domain alignment loss is:
[0146] ;
[0147] Where, is the total loss function, are learnable parameters. Based on the total loss function, the Adam optimizer is used to iteratively optimize the model parameters. The Adam optimizer combines the advantages of the momentum method and adaptive learning rate. By calculating the exponential moving average of the first-order momentum and second-order momentum of the gradient, it effectively accelerates the convergence process of gradient descent.
[0148] This embodiment significantly improves the accuracy and generalization of thermal error prediction by deeply fusing the spatiotemporal features of infrared thermal images with multi-source machine tool data. This method utilizes a parallel feature extraction module to mine deep features from infrared images and time series data, and achieves deep interaction and information complementarity between features through a cross-attention mechanism and a dynamic gated fusion network, effectively capturing the complex nonlinear relationship between thermal errors and multi-source data, thereby improving the accuracy of predictions. At the same time, the model introduces a deep transfer learning module based on DTW distance to achieve alignment of data features under different working conditions, enhance the adaptability and robustness of the model under unknown or changing working conditions, and reduce the limitations of traditional methods that suffer from performance degradation when working conditions change.
[0149] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A machine tool thermal error prediction method based on multimodal deep learning and domain adaptation, characterized in that: The following steps are involved: (1) Construct an infrared image feature extraction module. This module processes the input infrared image data based on the pre-trained ConvNeXt model to obtain a thermal feature map. After downsampling the thermal feature map, it captures the temporal dependency based on the multi-head self-attention mechanism. Finally, it obtains low-dimensional thermal features based on multi-layer 1D convolution. ; (2) Construct a spatiotemporal feature extraction module, which extracts spatiotemporal features from current and power data based on a spatiotemporal convolutional network and a multi-head self-attention mechanism. ; (3) Construct a multimodal feature fusion module, which combines low-dimensional thermal features and spatiotemporal characteristics After mapping to the same dimensional space, deep feature fusion is performed to obtain fused features ; (4) Construct a thermal error predictor to fuse features As input, thermal error prediction is performed and the predicted loss of thermal error is calculated; (5) Collect machine tool operation data from different working conditions as the source domain and target domain respectively. The machine tool operation data includes infrared image data of the machine tool spindle and current, power, and thermal error data of the machine tool; process the machine tool operation data of the source domain and the target domain simultaneously through steps (1) to (4) to obtain the fusion features of the source domain, the fusion features of the target domain, and the thermal error prediction loss of the source domain; (6) The fused features of the source domain and the target domain are input into the deep transfer learning module based on the DTW distance to calculate the domain alignment loss of the source domain and the target domain; and the total loss function is constructed by combining the thermal error prediction loss of the source domain and the domain alignment loss to jointly optimize each module and the thermal error predictor; (7) After the optimization is completed, the fused features of the target domain are input into the thermal error predictor to obtain the thermal error of the machine tool.
2. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 1 is characterized in that: In step (1), after downsampling the thermal feature map, the temporal dependency is captured based on the multi-head self-attention mechanism, which specifically includes: Use global average pooling to downsample the thermal feature map, add position encoding and layer normalization to the obtained pooled features, and obtain the normalized pooled features ; Then use the multi-head self-attention mechanism to capture the normalized pooled features The temporal dependency in , and construct the residual connection to obtain the output features of the residual connection ; The output features of the residual connection In dimension After normalization, the normalized output features are obtained , is the number of channels of the thermal feature map.
3. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 2 is characterized in that: In step (1), the normalized output features are obtained based on multi-layer 1D convolution. Perform gradual dimensionality reduction to obtain low-dimensional thermal features .
4. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 1 is characterized in that: The specific process of step (2) is: Based on the fully connected layer, the current and power data of the input spatiotemporal feature extraction module are preliminarily mapped to obtain high-dimensional features. ; High-dimensional features based on temporal convolutional networks Extract spatiotemporal features and further capture temporal dependencies based on a multi-head self-attention mechanism with residual connections to obtain the spatiotemporal features of current and power. .
5. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 1, characterized in that: The specific process of step (3) is: Based on the fully connected layer, the low-dimensional thermal features and spatiotemporal characteristics Mapped to the same dimensional space; Realizing low-dimensional hot features in the same dimensional space based on cross-attention mechanism and spatiotemporal characteristics complementary information; Low-dimensional thermal features after information complementation based on dynamic gating fusion and spatiotemporal characteristics Fusion is performed to obtain fusion features .
6. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 1, characterized in that: In step (4), based on GRU fusion features The temporal information in the dataset is aggregated and then the thermal error is predicted through a fully connected layer.
7. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 1 is characterized in that: In step (4), the prediction loss of thermal error is calculated using mean square error, which is expressed as: ; Where, is the source domain batch size; The source domain The true thermal error of each sample; is the corresponding predicted thermal error, Represents the predicted loss of thermal error.
8. The machine tool thermal error prediction method based on multimodal deep learning and domain adaptation according to claim 1 is characterized in that: In step (6), the DTW distance represents the similarity between the two time series, and the domain alignment loss represents the average DTW distance between the source domain fusion feature sequence and the target domain fusion feature sequence. The expression of this process is: ; Where, is the batch size, and Represent the first source domain fusion feature sequence and target domain fusion feature sequence, is the DTW distance calculation function, stands for domain alignment loss.
Citation Information
Patent Citations
CNN-BIGRU-A-based gantry machine tool overall real-time thermal error compensation method
CN119472503A
Machine tool thermal error modeling method based on time convolutional network and transfer learning
CN119668191A
Machine tool spindle Z-direction thermal deformation prediction method based on multi-source heterogeneous information fusion
CN115526424A
Main shaft thermal error prediction method and device based on multi-source heterogeneous data
CN116010903A