Numerical control machine tool key position temperature prediction method based on multi-modal deep learning
By fusing temperature, environmental, and process parameters through multimodal deep learning, an LSTM model is constructed, which solves the problems of accuracy and real-time performance in temperature prediction for CNC machine tools. This achieves high-precision temperature prediction and thermal deformation compensation, thereby improving the machining accuracy and stability of the machine tool.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2026-04-14
AI Technical Summary
Existing CNC machine tool temperature prediction methods rely on a single data source, ignoring environmental and process parameters, resulting in low prediction accuracy and non-real-time performance, making it difficult to meet the needs of high-precision machining.
A multimodal deep learning approach is adopted, which integrates temperature, environmental and processing parameters. Time series features are extracted through an LSTM network and static features are processed by a fully connected network to construct a multimodal LSTM deep learning model for real-time temperature prediction and thermal deformation compensation.
It achieves high-precision, real-time temperature prediction and thermal deformation compensation, significantly improving the machining accuracy and stability of machine tools. It is highly adaptable, reduces thermal deformation errors, and is easy to deploy.
Smart Images

Figure CN120012603B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CNC machine tool technology, specifically relating to a method for predicting the temperature of key parts of CNC machine tools based on multimodal deep learning. Background Technology
[0002] In modern manufacturing, CNC machine tools, as core processing equipment, play a decisive role in product quality and production efficiency due to their performance and machining accuracy. During machining, machine tools are affected by both internal heat sources and changes in external ambient temperature. Key components (such as spindles and cutting tools) generate varying degrees of heat due to long-term operation, leading to thermal deformation of the mechanical structure and reduced machining accuracy. Thermal error is the largest source of error in precision machining machinery such as CNC machine tools, accounting for 40%-70% of the total error. By predicting the temperature of key components, the temperature change trends of various machine tool parts can be anticipated in advance, allowing for more accurate calculation of the resulting thermal deformation. This enables appropriate deformation compensation, effectively reducing thermal error and improving machining accuracy. Therefore, achieving accurate temperature prediction of key components of CNC machine tools is of paramount practical significance for optimizing machining processes, improving machining quality, and extending equipment lifespan. Existing methods for predicting the temperature of key machine tool components have several drawbacks. They typically rely on simple physical modeling or single sensor data, resulting in low accuracy and difficulty in real-time prediction. Furthermore, the models suffer from large prediction errors and struggle to characterize complex nonlinear relationships. In terms of data processing, selecting temperature-sensitive points is difficult, and information feature extraction is insufficient. In terms of practicality, testing costs are high, adaptability is poor, and real-time performance is inadequate. These shortcomings limit its application in high-precision machining. The application of multi-source data fusion in machine tool temperature prediction has become a research hotspot. By integrating multiple data sources, such as temperature, vibration, current, and voltage, and combining them with advanced data analysis and machine learning algorithms, it significantly improves prediction accuracy. Compared to existing prediction models with single-data-structure input, it provides more comprehensive information and significantly reduces errors. Therefore, how to perform accurate temperature prediction using multimodal data (including temperature, environment, and machining process information) has become a key technology for improving machine tool machining accuracy.
[0003] The paper "Yu-Chi Liu, Kun-Ying Li, Yao-Cheng Tsai. Prediction of thermal error of CNC machine tool spindle based on LSTM deep learning. Applied Sciences (IF 2.5) Pub Date: 2021-06-11" proposes a key temperature point selection algorithm and thermal error estimation method for machine tool spindle displacement. The method performs well in spindle thermal displacement experiments with different temperature changes, but the LSTM model requires a large amount of historical data for training to ensure the accuracy and generalization ability of the model. In addition, the training process of the model may be time-consuming and has certain requirements for computing resources. The paper "Chen Geng, Guo Shijie, Ding Qiangqiang, et al. Prediction modeling of thermal error of CNC lathe spindle by SHO-LSTM. Engineering Science and Technology, 2024, 56(2): 277-288" proposes a precision lathe spindle thermal error prediction modeling method using the hippocampus optimization algorithm (SHO) to optimize the time-series prediction network (LSTM). Although the method improves the selection accuracy of temperature measurement points through optimization algorithm, the optimization process is relatively complex and the computational cost is high. Furthermore, tuning the hyperparameters of LSTM models requires extensive experimentation and experience to find the optimal model structure and parameters, which increases the difficulty of model development and debugging.
[0004] In summary, the existing technologies mainly have the following problems: (1) Single data source: Existing methods usually rely on only a single temperature sensor data, ignoring the influence of environmental and process parameters. (2) Non-real-time: Existing methods usually rely on offline analysis or empirical models, which cannot provide real-time temperature prediction. (3) Low prediction accuracy: Existing models do not make full use of the interactive characteristics of multimodal data, resulting in limited prediction accuracy. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a method for predicting the temperature of key components of CNC machine tools based on multimodal deep learning. By fusing multimodal information such as temperature data, environmental data, and machining process parameters, the method improves the accuracy and robustness of temperature prediction, enabling high-precision real-time temperature prediction and thermal deformation compensation at various locations of the machine tool, thereby enhancing the machining accuracy and stability of the machine tool.
[0006] The technical solution adopted in this invention is: a method for predicting the temperature of key parts of CNC machine tools based on multimodal deep learning, the specific steps of which are as follows:
[0007] S1. Collect experimental data and perform preprocessing;
[0008] By arranging multiple temperature sensors at key parts of CNC machine tools according to actual conditions, temperature change data is collected. At the same time, workshop environmental parameters and machining process parameters are also collected. The collected temperature, environmental and machining process parameter data are preprocessed, and data features and target values are extracted using the sliding window method, transforming the time series data into a format suitable for input to deep learning models.
[0009] The key components of the CNC machine tool include: spindle, guide rail, lead screw, bearing, motor, and tool tip; the workshop environmental parameters include: temperature, humidity, and airflow velocity, and the environmental data are collected through independent sensors; the machining process parameters are obtained from the CNC control system and include: motor power, motor current, spindle speed, feed rate, and depth of cut; the preprocessing includes: data alignment, normalization, and missing value imputation.
[0010] S2. Construct a multimodal LSTM deep learning model and train the model;
[0011] S3. Based on step S2, the trained model is deployed to the CNC machine tool control system to collect and input data in real time, perform temperature prediction, and perform thermal deformation compensation based on the prediction results to improve the machining accuracy of the machine tool.
[0012] S4. Use the SHAP framework to interpret the model and clarify the contribution of eigenvalues.
[0013] Furthermore, step S1 is specifically as follows:
[0014] S11. Collect experimental data;
[0015] Temperature sensors are installed in the machine tool and workshop to collect the temperature of key parts of the machine tool and the environment. Force sensors collect load data at the tool tip. Machining process parameter data is collected through the CNC control system. Detection instruments are placed to collect humidity and wind speed data in the workshop.
[0016] S12, Data Alignment;
[0017] Align timestamps to integrate data from different tables onto the same timeline, ensuring consistency of features and target variables over time.
[0018] S13, missing value handling and normalization;
[0019] First, perform forward filling, filling the missing values in the current row with the non-missing values from the previous row. The expression is as follows:
[0020]
[0021] Where, x i This represents the i-th data.
[0022] Then, the temperature data is normalized to the [0,1] interval using the Min-Max operation, as shown in the following expression:
[0023]
[0024] Where x represents the original data value, min(x) represents the minimum value in the dataset, max(x) represents the maximum value in the dataset, and x′ represents the normalized data value.
[0025] S14. Extract data features and target values using the sliding window method, and transform the time series data into a format suitable for input to the deep learning model;
[0026] First, the input features and target values are extracted, that is, the input feature matrix X and target value y are generated from the original data, and the features of the time series data are constructed.
[0027] The input feature matrix X is obtained by removing all columns except the last column from the normalized data in step S13. Each row represents all input features at a certain time point, including environmental features and process features. The target value y is obtained by using the last column of the normalized data in step S13 as the target value. Each target value y... i The corresponding row x' in the input feature matrix i .
[0028] The target value includes: temperature value.
[0029] Then, time series features are constructed. Since time series tasks require encoding time dependencies into features, the code constructs time series features using a sliding window.
[0030] The length of the sliding window is L, and it slides one time step at a time. The calculation expression is as follows:
[0031]
[0032] in, Let x' represent the i-th time series sample. j ∈R n Let R represent a row of the original feature matrix, i.e., the n features at the j-th time step, and let R represent a real matrix consisting of L rows and n columns.
[0033] The input feature matrix X generated by the sliding window seq It is a three-dimensional tensor with shape (N, L, n).
[0034] Where N = len(data) - L represents the number of sequence samples, L represents the length of each sequence, and n represents the number of features at each time step.
[0035] Then the target value y seq The target value for the next time step of the sliding window. The prediction target for the i-th time series sample is expressed as follows:
[0036]
[0037] Furthermore, step S2 is specifically as follows:
[0038] S21. Construct a multimodal LSTM deep learning model;
[0039] The multimodal LSTM deep learning model is a multi-input neural network model that combines time-series features and static features, including an LSTM layer and a fully connected layer. The model reduces the dimensionality of environmental and processing features from their original size to 32 by using separate fully connected layers. Then, the time-series features output from the LSTM layer are concatenated with the static features, and further processed by fully connected layers and Dropout to output predicted temperature values for key components.
[0040] The LSTM layer is used to extract time-series features, outputs the hidden state of the last time step, captures time dependencies, and includes n' neurons. The fully connected layer processes static features and includes an input layer, a hidden layer, and an output layer.
[0041] S22. Train the model constructed in step S21;
[0042] The preprocessed experimental data from step S1 is divided into training and test sets according to the actual situation and proportions. The training set is used for model training, with mean squared error (MSE) as the loss function and the Adam optimizer used for training. Once the loss function stabilizes after multiple iterations, the model is considered converged, and training stops.
[0043] The model performance is evaluated using a test set, and the evaluation metrics include: root mean square error (RMSE) and mean absolute error (MAE).
[0044] The loss function is the mean squared error (MSE), and its calculation expression is as follows:
[0045]
[0046] Among them, y' i Indicates the actual value. Let n represent the predicted value, n0 represent the number of samples, and θ represent the model parameters.
[0047] Furthermore, step S3 is specifically as follows:
[0048] First, the real-time temperature data of key components is input into the LSTM layer, and time series features are extracted through forward propagation. Then, the Long Short-Term Memory (LSTM) network is used to process the temperature sensor data and equipment status data to capture time-dependent features.
[0049] Then, static features are processed through fully connected layers, that is, environmental data and processing data are processed using a fully connected neural network (FCN) to complete static dimensionality reduction.
[0050] The static features are reduced to 32 dimensions using a single fully connected layer, as shown in the following expression:
[0051] env_out = ReLU(W env ·env_input+b env )
[0052] process_out = ReLU(W process ·process_input+b process )
[0053] Among them, W env W process Let b represent the weight matrix. env b process Indicates bias.
[0054] In the fully connected layer, the input layer receives time-series data, environmental data, and processing data respectively, and then inputs them into the hidden layer. Multimodal data is fused using splicing or attention mechanisms to enhance the model's sensitivity to different data sources.
[0055] The expression for splicing time series data, environmental data, and processing data is as follows:
[0056] merged∈R batch_size×(64+32+32)
[0057] Finally, a fully connected processing is performed, and the predicted temperature of key parts of the CNC machine tool is output through the output layer regression network to complete the temperature prediction. Based on the predicted temperature value, the tool path is adjusted or thermal deformation is compensated to ensure machining accuracy.
[0058] The fully connected processing is as follows:
[0059] The first layer performs a linear transformation of the data and activates it: α = ReLU(W1·merged+b1), which reduces the dimensionality to 64 dimensions. The activation function is ReLU, and some neurons are randomly dropped through Dropout to prevent overfitting.
[0060] The second layer multiplies the output of the first layer with the weight W2 of the second layer, and adds a bias b2 to obtain the final output: output = W2·α + b2.
[0061] Where W1 and W2 represent weight matrices, and b1 and b2 represent biases.
[0062] Furthermore, step S4 is specifically as follows:
[0063] The model explanation uses the SHAP framework, which first integrates the various input features of the multimodal LSTM deep learning model into a single matrix X. test_combined Time series features X test_tensor It is unfolded into a two-dimensional matrix, with each row representing a sample. Environmental feature X test_env and processing features X test_process After being directly concatenated with time series features, the expression is as follows:
[0064]
[0065] Where N1 represents the number of samples, d time The dimension d represents the features of a time series. env d represents the dimension of environmental characteristics. process Dimensions representing processing characteristics.
[0066] Next, KMeans is used to cluster the test set data, and representative data points are selected as background data. The clustered background data is used in the SHAP interpreter. The SHAP interpreter is defined, and X... test_combined It is decomposed into three parts: time series, environmental characteristics, and process characteristics.
[0067] Then calculate the SHAP value. The expression is defined as follows:
[0068]
[0069] Where F represents the feature set, S represents the feature subset, v(S) represents the model prediction using the feature subset S, and M represents the entire feature set, including all possible features.
[0070] The beneficial effects of this invention are as follows: The method of this invention designs a multimodal LSTM deep learning model that combines time-series data, environmental parameters, and machining process parameters. It uses LSTM to extract time-series features, processes environmental and process data separately through a fully connected network, and then integrates the multimodal features in a fusion layer to generate accurate prediction results. These results can guide machine tool temperature control operations and perform SHAP value analysis to help users understand the contribution of each feature to the prediction results. This method is applicable to predicting temperature changes in key parts of CNC machine tools in non-constant temperature environments. It can improve machine tool machining accuracy and achieve real-time error compensation. By utilizing multiple sensor data, environmental information, and machining process parameter data, combined with deep learning technology for modeling and prediction, it significantly enhances the transparency and reliability of the model while improving prediction accuracy. It can also be widely applied to other fields such as temperature prediction and control in industrial equipment process control.
[0071] The method of this invention has the advantages of high precision, real-time performance, strong adaptability, reduced thermal deformation error, and easy deployment. By fusing multimodal data, it can comprehensively consider environmental, temperature, and process parameters, significantly improving the accuracy of temperature prediction. Moreover, the model can acquire machine tool temperature data and process parameters in real time, perform dynamic prediction and temperature compensation, and cope with temperature changes under different machine tools and different working conditions. It has strong generalization ability. Through real-time temperature prediction and thermal deformation compensation, it significantly reduces machining errors caused by thermal deformation and improves machine tool machining accuracy. The trained model can be easily deployed to the relevant control system of CNC machine tools, which is convenient for practical application. Attached Figure Description
[0072] Figure 1 This is a flowchart of a method for predicting the temperature of key parts of a CNC machine tool based on multimodal deep learning, according to the present invention.
[0073] Figure 2 This is a structural diagram of the multi-source data LSTM deep learning model in an embodiment of the present invention.
[0074] Figure 3 This is a comparison chart of the prediction results of the multimodal LSTM deep learning model, the LSTM model, and the CNN-LSTM model in the embodiments of the present invention.
[0075] Figure 4 This is an error diagram showing the difference between the predicted temperature and the actual temperature in a practical application of the multimodal LSTM deep learning model in this embodiment of the invention. Detailed Implementation
[0076] The method of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0077] like Figure 1The flowchart shown is a method for predicting the temperature of key parts of CNC machine tools based on multimodal deep learning according to the present invention. The specific steps are as follows:
[0078] S1. Collect experimental data and perform preprocessing;
[0079] This embodiment uses a CNC gantry milling machine of a certain brand. Multiple PT100 temperature sensors are arranged in key parts of the CNC milling machine according to the actual situation to collect temperature change data. At the same time, workshop environmental parameters and machining process parameters are collected. The collected temperature, environmental and machining process parameter data are preprocessed, and data features and target values are extracted by the sliding window method. The time series data is converted into a format suitable for input to a deep learning model.
[0080] The key components of the CNC machine tool include: spindle, guide rail, lead screw, bearing, motor, and tool tip; the workshop environmental parameters include: temperature, humidity, and airflow velocity, and the environmental data are collected through independent sensors; the machining process parameters are obtained from the CNC control system and include: motor power, motor current, spindle speed, feed rate, and depth of cut; the preprocessing includes: data alignment, normalization, and missing value imputation.
[0081] S2. Construct a multimodal LSTM deep learning model and train the model;
[0082] S3. Based on step S2, the trained model is deployed to the CNC machine tool control system to collect and input data in real time, perform temperature prediction, and perform thermal deformation compensation based on the prediction results to improve the machining accuracy of the machine tool.
[0083] S4. Use the SHAP framework to interpret the model and clarify the contribution of eigenvalues.
[0084] In this embodiment, step S1 is specifically as follows:
[0085] S11. Collect experimental data;
[0086] Temperature sensors are installed in the machine tool and workshop to collect the temperature of key parts of the machine tool and the environment. Force sensors collect load data at the tool tip. Machining process parameter data is collected through the CNC control system. Detection instruments are placed to collect humidity and wind speed data in the workshop.
[0087] S12, Data Alignment;
[0088] Since the data is collected from different sources, their sampling frequencies and timestamps may not be entirely consistent. Therefore, it is necessary to align the timestamps and integrate the data from different tables onto the same timeline to ensure the consistency of features and target variables over time.
[0089] S13, missing value handling and normalization;
[0090] In data analysis, missing values can cause models to fail to learn correctly or training to fail, so they need to be handled. Forward imputation fills the missing values in the current row with the non-missing values from the previous row, as shown in the following expression:
[0091]
[0092] Where, x i This represents the i-th data.
[0093] Then, the temperature data is normalized to the [0,1] interval using the Min-Max operation, as shown in the following expression:
[0094]
[0095] Where x represents the original data value, min(x) represents the minimum value in the dataset, max(x) represents the maximum value in the dataset, and x′ represents the normalized data value.
[0096] S14. Extract data features and target values using the sliding window method, and transform the time series data into a format suitable for input to the deep learning model;
[0097] First, the input features and target values are extracted, that is, the input feature matrix X and target value y are generated from the original data, and the features of the time series data are constructed.
[0098] The input feature matrix X is obtained by removing all columns except the last column from the normalized data in step S13. Each row represents all input features at a certain time point, including environmental features and process features. The target value y is obtained by using the last column of the normalized data in step S13 as the target value. Each target value y... i The corresponding row x' in the input feature matrix i .
[0099] The target value includes: temperature value.
[0100] Then, time series features are constructed. Since time series tasks require encoding time dependencies into features, the code constructs time series features using a sliding window.
[0101] The length of the sliding window is L, and it slides one time step at a time. The calculation expression is as follows:
[0102]
[0103] in, Let x' represent the i-th time series sample. j ∈R nLet R represent a row of the original feature matrix, i.e., the n features at the j-th time step, and let R represent a real matrix consisting of L rows and n columns.
[0104] The input feature matrix X generated by the sliding window seq It is a three-dimensional tensor with shape (N, L, n).
[0105] Where N = len(data) - L represents the number of sequence samples, L represents the length of each sequence, and n represents the number of features at each time step.
[0106] Then the target value y seq The target value for the next time step of the sliding window. The prediction target for the i-th time series sample is expressed as follows:
[0107]
[0108] In this embodiment, step S2 is specifically as follows:
[0109] S21. Construct a multimodal LSTM deep learning model;
[0110] like Figure 2 As shown, the multimodal LSTM deep learning model is a multi-input neural network model that combines time-series features and static features, including an LSTM layer and a fully connected layer. The model reduces the dimensionality of environmental and processing features from their original size to 32 by using separate fully connected layers. Then, the time-series features output from the LSTM layer are concatenated with the static features, and further processed by fully connected layers and Dropout to output predicted temperature values for key components.
[0111] in, Figure 2 Chinese f t i t O t Let C represent the activation values of the forget gate, input gate, and output gate, respectively. t and h t σ and tanh represent memory units and hidden states, respectively. σ represents the Sigmoid activation function, and tanh represents the hyperbolic tangent function.
[0112] The LSTM layer is used to extract time-series features, outputs the hidden state of the last time step, captures time dependencies, and includes n' neurons. The fully connected layer processes static features and includes an input layer, a hidden layer, and an output layer.
[0113] S22. Train the model constructed in step S21;
[0114] In this embodiment, the experimental data preprocessed in step S1 is divided into a training set and a test set in an 8:2 ratio (the ratio is set according to the actual situation). The training set is used for model training, and the model uses mean squared error (MSE) as the loss function and the Adam optimizer for model training. When the loss function tends to stabilize after multiple iterations, the model is considered to have converged, and training stops.
[0115] The model performance is evaluated using a test set, and the evaluation metrics include root mean square error (RMSE) and mean absolute error (MAE).
[0116] The loss function is the mean squared error (MSE), and its calculation expression is as follows:
[0117]
[0118] Among them, y' i Indicates the actual value. Let n represent the predicted value, n0 represent the number of samples, and θ represent the model parameters.
[0119] In this embodiment, step S3 is specifically as follows:
[0120] First, the real-time temperature data of key components is input into the LSTM layer, and time series features are extracted through forward propagation. Then, the Long Short-Term Memory (LSTM) network is used to process the temperature sensor data and equipment status data to capture time-dependent features.
[0121] Then, static features are processed through fully connected layers, that is, environmental data (workshop environmental parameters) and processing data (processing parameters) are processed using a fully connected neural network (FCN) to complete static dimensionality reduction.
[0122] Static features (environmental and processing data) are reduced to 32 dimensions using a single fully connected layer, as shown in the following expression:
[0123] env_out = ReLU(W env ·env_input+b env )
[0124] process_out = ReLU(W process ·process_input+b process )
[0125] Among them, W env W process Let b represent the weight matrix. env b process Indicates bias.
[0126] In the fully connected layer, the input layer receives time-series data, environmental data, and processing data respectively, and then inputs them into the hidden layer. Multimodal data is fused using splicing or attention mechanisms to enhance the model's sensitivity to different data sources.
[0127] The expression for splicing time series data, environmental data, and processing data is as follows:
[0128] merged∈R batch_size×(64+32+32)
[0129] Finally, a fully connected processing is performed, and the predicted temperature of key parts of the CNC machine tool is output through the output layer regression network to complete the temperature prediction. Based on the predicted temperature value, the tool path is adjusted or thermal deformation is compensated to ensure machining accuracy.
[0130] The fully connected processing is as follows:
[0131] The first layer performs a linear transformation of the data and activates it: α = ReLU(W1·merged+b1), which reduces the dimensionality to 64 dimensions. The activation function is ReLU, and some neurons are randomly dropped through Dropout to prevent overfitting.
[0132] The second layer multiplies the output of the first layer with the weight W2 of the second layer, and adds a bias b2 to obtain the final output: output = W2·α + b2.
[0133] Where W1 and W2 represent weight matrices, and b1 and b2 represent biases.
[0134] In this embodiment, step S4 is specifically as follows:
[0135] The model interpretation uses the SHAP framework, a game theory-based tool for interpreting the output of machine learning models. First, the various input features of the multimodal LSTM deep learning model are integrated into a single matrix X. test_combined Time series features X test_tensor It is unfolded into a two-dimensional matrix, with each row representing a sample. Environmental feature X test_env and processing features X test_process After being directly concatenated with time series features, the expression is as follows:
[0136]
[0137] Where N1 represents the number of samples, d time The dimension d represents the features of a time series. env d represents the dimension of environmental characteristics. process Dimensions representing processing characteristics.
[0138] Then, KMeans is used to cluster the test set data, selecting representative data points as background data to reduce computational complexity. The clustered background data is used in the SHAP interpreter, reducing computation without sacrificing interpretability. The SHAP interpreter is defined, and X... test_combined It is decomposed into three parts: time series, environmental characteristics, and process characteristics.
[0139] Then, the SHAP value is calculated. The SHAP value is used to calculate the marginal contribution of each feature to the prediction result, generating an explanatory score that represents the importance of the feature. The expression is defined as follows:
[0140]
[0141] Where F represents the feature set, S represents the feature subset, v(S) represents the model prediction using the feature subset S, and M represents the entire feature set, including all possible features.
[0142] This embodiment also further performed simulation verification, such as Figure 3 As shown, the multimodal LSTM deep learning model of the present invention was used to predict temperature, and the existing LSTM neural network and CNN-LSTM neural network that only consider temperature data as input were used to evaluate and compare the results based on root mean square error (RMSE), mean absolute error (MAE), and mean percentage error (MAPE). The comparison results are shown in Table 1.
[0143] Table 1
[0144]
[0145] Depend on Figure 3 As shown in Table 1, the multimodal LSTM deep learning model of this invention has good MAE, RMSE, and R... 2 This demonstrates its high accuracy and good model fit in temperature prediction tasks. Furthermore, the excellent performance of the model, achieved through the use of multimodal data input during the modeling process, also proves its strong generalization ability and robustness in temperature prediction.
[0146] like Figure 4 As shown, this embodiment applies the multimodal LSTM deep learning model of the present invention to a practical application. The model predicts the temperature of key parts of a machine tool and compares the prediction with the actual values. This demonstrates that the prediction results of the multimodal LSTM deep learning model of the present invention have a high degree of fit with the actual data and a small relative error.
[0147] In summary, the method of this invention fully utilizes the correlations between various data sources, such as multi-point temperature sensor data, environmental parameters, and processing parameters. Through the combination of multimodal data fusion and a deep learning model, it achieves high-precision temperature prediction. It employs an LSTM network to extract time-series features, while simultaneously processing environmental and process data through an independent fully connected network, and integrating multi-source information at the feature fusion layer, thereby effectively improving prediction performance. The introduction of SHAP value analysis enhances the model's interpretability, allowing users to intuitively understand the contribution of each feature to the prediction results. Combined with GPU-accelerated and optimized data preprocessing, it ensures both high computational efficiency and good scalability.
[0148] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.
Claims
1. A method for predicting the temperature of key components of a CNC machine tool based on multimodal deep learning, the specific steps of which are as follows: S1. Collect experimental data and perform preprocessing; By arranging multiple temperature sensors at key parts of CNC machine tools according to actual conditions, temperature change data is collected. At the same time, workshop environmental parameters and machining process parameters are also collected. The collected temperature, environmental and machining process parameter data are preprocessed, and data features and target values are extracted using the sliding window method. The time series data is then converted into a format suitable for input to a deep learning model. in, The key components of the CNC machine tool include: spindle, guide rail, lead screw, bearing, motor, and tool tip; the workshop environmental parameters include: temperature, humidity, and airflow velocity, and the environmental data are collected through independent sensors; the machining process parameters are obtained from the CNC control system and include: motor power, motor current, spindle speed, feed rate, and depth of cut; the preprocessing includes: data alignment, normalization, and missing value imputation; S2. Construct a multimodal LSTM deep learning model and train the model; S3. Based on step S2, the trained model is deployed to the CNC machine tool control system to collect and input data in real time, perform temperature prediction, and perform thermal deformation compensation based on the prediction results to improve the machining accuracy of the machine tool. S4. Use the SHAP framework to interpret the model and clarify the contribution of eigenvalues.
2. The method for predicting the temperature of key parts of a CNC machine tool based on multimodal deep learning according to claim 1, characterized in that, The specific steps of S1 are as follows: S11. Collect experimental data; Temperature sensors are installed in the machine tool and workshop to collect the temperature of key parts of the machine tool and the environment. Force sensors collect load data at the tool tip. Machining process parameter data is collected through the CNC control system. Detection instruments are placed to collect humidity and wind speed data in the workshop. S12, Data Alignment; Align timestamps to integrate data from different tables onto the same timeline, ensuring consistency of features and target variables over time; S13, missing value handling and normalization; First, perform forward filling, filling the missing values in the current row with the non-missing values from the previous row. The expression is as follows: Where, x i This represents the i-th data; Then, the temperature data is normalized to the [0,1] interval using the Min-Max operation, as shown in the following expression: Where x represents the original data value, min(x) represents the minimum value in the dataset, max(x) represents the maximum value in the dataset, and x′ represents the normalized data value; S14. Extract data features and target values using the sliding window method, and transform the time series data into a format suitable for input to the deep learning model; First, the input features and target values are extracted, that is, the input feature matrix X and target value y are generated from the original data, and the features of the time series data are constructed. The input feature matrix X is obtained by removing all columns except the last column from the normalized data in step S13. Each row represents all input features at a certain time point, including environmental features and process features. The target value y is obtained by using the last column of the normalized data in step S13 as the target value. Each target value y... i The corresponding row x' in the input feature matrix i ; The target value includes: temperature value; Then, time series features are constructed. Since time series tasks require encoding time dependencies into features, the code constructs time series features using a sliding window. The length of the sliding window is L, and it slides one time step at a time. The calculation expression is as follows: in, Let x' represent the i-th time series sample. j ∈R n R represents a row of the original feature matrix, i.e., the n features at the j-th time step, and R represents a real matrix consisting of L rows and n columns. The input feature matrix X generated by the sliding window seq It is a three-dimensional tensor with shape (N, L, n); Where N = len(data) - L represents the number of sequence samples, L represents the length of each sequence, and n represents the number of features at each time step; Then the target value y seq The target value for the next time step of the sliding window. The prediction target for the i-th time series sample is expressed as follows: 。 3. The method for predicting the temperature of key parts of a CNC machine tool based on multimodal deep learning according to claim 1, characterized in that, Step S2 is as follows: S21. Construct a multimodal LSTM deep learning model; The multimodal LSTM deep learning model is a multi-input neural network model that combines time-series features and static features, including: LSTM layer and fully connected layer; the model reduces the dimensionality of environmental features and processing features by passing them through separate fully connected layers, changing the feature dimension from the original size to 32, and then concatenates the time-series features output by the LSTM layer with the static features, and further processes them through fully connected layers and Dropout to output the predicted temperature value of key parts; The LSTM layer is used to extract time series features, output the hidden state of the last time step, and capture time dependencies, including n' neurons; the fully connected layer processes static features and includes an input layer, a hidden layer, and an output layer. S22. Train the model constructed in step S21; The experimental data preprocessed in step S1 is divided into training and test sets according to the actual situation and proportions are set. The training set is used to train the model. The model uses mean squared error (MSE) as the loss function and the Adam optimizer is used for model training. When the loss function tends to stabilize after multiple iterations, the model is considered to have converged and training is stopped. The model performance is evaluated using a test set, and the evaluation metrics include: root mean square error (RMSE) and mean absolute error (MAE). The loss function is the mean squared error (MSE), and its calculation expression is as follows: Among them, y' i Indicates the actual value. Let n represent the predicted value, n0 represent the number of samples, and θ represent the model parameters.
4. The method for predicting the temperature of key parts of a CNC machine tool based on multimodal deep learning according to claim 1, characterized in that, Step S3 is as follows: First, the real-time temperature data of key parts is input into the LSTM layer, and time series features are extracted by forward propagation. Then, the long short-term memory network LSTM is used to process the temperature sensor data and equipment status data to capture time-dependent features. Then, static features are processed through fully connected layers, that is, environmental data and processing data are processed using a fully connected neural network (FCN) to complete static dimensionality reduction; The static features are reduced to 32 dimensions using a single fully connected layer, as shown in the following expression: env_out=ReLU(W env ·env_input+b env ) process_out=ReLU(W process ·process_input+b process ) Among them, W env W process Let b represent the weight matrix. env b process Indicates bias; In the fully connected layer, the input layer receives time series data, environmental data, and processing data respectively, and then inputs them into the hidden layer. Multimodal data is fused using splicing or attention mechanisms to enhance the model's sensitivity to different data sources. The expression for splicing time series data, environmental data, and processing data is as follows: merged∈R batch_size×(64+32+32) Finally, a fully connected process is performed, and the predicted temperature of key parts of the CNC machine tool is output through the output layer regression network to complete the temperature prediction. Based on the predicted temperature value, the tool path is adjusted or thermal deformation is compensated to ensure machining accuracy. The fully connected processing is as follows: The first layer performs a linear transformation of the data and activates it: α = ReLU(W1·merged+b1), which reduces the dimension to 64 and uses ReLU as the activation function. Dropout is used to randomly discard some neurons to prevent overfitting. The second layer multiplies the output of the first layer with the weight W2 of the second layer, and adds a bias b2 to obtain the final output: output = W2·α + b2; Where W1 and W2 represent weight matrices, and b1 and b2 represent biases.
5. The method for predicting the temperature of key parts of a CNC machine tool based on multimodal deep learning according to claim 1, characterized in that, Step S4 is as follows: The model explanation uses the SHAP framework, which first integrates the various input features of the multimodal LSTM deep learning model into a single matrix X. test_combined Time series features X test_tensor It is unfolded into a two-dimensional matrix, with each row representing a sample; environmental feature X test_env and processing features X test_process After being directly concatenated with time series features, the expression is as follows: Where N1 represents the number of samples, d time The dimension d represents the features of a time series. env d represents the dimension of environmental characteristics. process Dimensions representing processing characteristics; Next, KMeans is used to cluster the test set data, and representative data points are selected as background data. The clustered background data is used in the SHAP interpreter. The SHAP interpreter is defined, and X... test_combined It is decomposed into three parts: time series, environmental characteristics, and process characteristics; Then calculate the SHAP value. The expression is defined as follows: Where F represents the feature set, S represents the feature subset, v(S) represents the model prediction using the feature subset S, and M represents the entire feature set, including all possible features.
Citation Information
Patent Citations
Control method and device for air conditioner in machine room, storage medium and electronic equipment
CN117545240A
Intelligent integrated modular cabinet control method, system, equipment and medium
CN119322683A