Machine tool thermal error prediction method, system and equipment based on machine learning and medium

By constructing a spatiotemporal feature map of a sensor network and a weighted adjacency matrix, and combining graph convolutional neural networks and Transformer networks, the accuracy problem of machine tool thermal error prediction methods when migrating between different machine tools is solved, and high-precision prediction across machine tools is achieved.

CN122065264APending Publication Date: 2026-05-19SHENZHEN HUAZHONG NUMERICAL CONTROL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN HUAZHONG NUMERICAL CONTROL
Filing Date
2026-04-03
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing machine tool thermal error prediction methods have low accuracy when migrating between different machine tools and ignore the spatial distribution correlation information between temperature sensors, resulting in a decrease in prediction accuracy under complex working conditions.

Method used

We construct a spatiotemporal feature map and a weighted adjacency matrix for the sensor network, combine graph convolutional neural networks and Transformer networks to extract the spatiotemporal features of the temperature sensor, and achieve feature distribution alignment across machine tools through a multi-kernel maximum mean difference loss function.

Benefits of technology

It significantly improves the cross-domain generalization ability of machine tool thermal error prediction, and enhances the applicability and prediction accuracy of the model across different machine tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122065264A_ABST
    Figure CN122065264A_ABST
Patent Text Reader

Abstract

The invention discloses a machine tool thermal error prediction method based on machine learning, and the method comprises the steps: firstly constructing a network spatial-temporal feature map which takes a sensor as a node and physical connection as an edge for a machine tool temperature sensor; the method comprises the following steps: extracting spatial features among sensors through a graph convolutional neural network, extracting time sequence features by means of a Transform network, extracting and fusing the features through multiple channels through a spatial-temporal feature extraction network, and inputting the fused features into a full connection layer to obtain a thermal error prediction result; and constructing a total loss function based on a mean square error and a multi-core maximum mean value difference, completing network training through joint optimization, and realizing data distribution alignment of a source domain and a target domain. The method effectively fuses the spatial-temporal characteristics, improves the generalization and robustness of cross-machine-tool thermal error modeling, can still guarantee the prediction precision in a target domain labeled sample scarce scene, reduces the experimental cost and data collection difficulty of multi-machine-tool modeling, and is suitable for a multi-machine-tool thermal error prediction task in an industrial scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of machine tool processing and manufacturing technology, specifically relating to a machine tool thermal error prediction method, system, equipment, and medium based on machine learning. Background Technology

[0002] As the "mother machines" of modern manufacturing, CNC machine tools directly determine the core quality of products through their machining accuracy. Research shows that thermal error is the main factor causing deviations in machine tool accuracy; therefore, accurately predicting and compensating for thermal error has become a key issue in improving the machining accuracy of machine tools.

[0003] Traditional thermal error prediction methods rely heavily on mathematical modeling and mechanistic analysis, demonstrating effectiveness only under specific operating conditions and fixed machine tool parameters. Their adaptability and generalization capabilities are significantly insufficient in complex and ever-changing real-world machining scenarios. With advancements in data acquisition technology and computing power, data-driven machine learning and deep learning methods have gradually become mainstream. Models such as Support Vector Machines (SVM), traditional neural networks, Convolutional Neural Networks (CNN), and Long Short-Term Memory (LSTM) networks have shown superior performance in thermal error prediction tasks. However, these methods generally depend on massive amounts of labeled data, are sensitive to fluctuations in machining conditions, and mostly focus on mining temporal features, neglecting the inherent spatial distribution correlations between temperature sensors. This leads to a significant decrease in prediction accuracy when the model is used across different machine tools or under complex operating conditions.

[0004] In existing technologies, some improvement methods attempt to introduce techniques such as Graph Convolutional Networks (GCNs) to capture spatial information and improve modeling accuracy. However, most existing GCN-based models assume that the training and prediction data follow a consistent distribution. Since different machine tools have significant differences in structural design and heat conduction characteristics, it is difficult to directly transfer a model trained on one machine tool to another. This not only increases the cost of experimentation and modeling but also limits the large-scale application of such technologies in real-world industrial scenarios. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the shortcomings of the existing machine tool thermal error prediction methods, which have low prediction accuracy and poor accuracy when transferred between different machine tools. The present invention provides a machine tool thermal error prediction method, system, device and medium based on machine learning.

[0006] This invention discloses a machine tool thermal error prediction method based on machine learning, comprising the following steps: For temperature sensors in machine tools, a spatiotemporal feature graph of the sensor network is constructed, where the nodes of the sensor network spatiotemporal feature graph are temperature sensors and the edges are physical connections between temperature sensors; the feature data of the sensor nodes are a set of time-series tensors, including the dimensional features of the sensor nodes at each time step; a weighted adjacency matrix of the sensor network spatiotemporal feature graph is constructed, where the elements of the weighted adjacency matrix are formed based on the relative positions of the nodes. A graph convolutional neural network is constructed, wherein the input of the graph convolutional neural network is the weighted adjacency matrix of the spatiotemporal feature graph of the network and the feature data of the sensor nodes, and the output is spatial features; Construct a Transformer network, where the input of the Transformer network is the feature data of the sensor nodes and the output is the time feature; A spatiotemporal feature extraction network is constructed to extract features through time, space, and spatiotemporal channels, and then the network is connected to obtain fused features. The fused features are input into the fully connected layer to obtain the thermal error prediction result; the mean squared error and the multi-kernel maximum mean difference loss are calculated based on the thermal error prediction result to construct the total loss function; the network is trained and optimized based on the total loss function.

[0007] Furthermore, the elements of the weighted adjacency matrix are represented as follows: ; in, Represents edge weight, Indicates control The threshold of the distribution Represents a node and nodes The distance between them threshold Represented as: ; in, This represents the mean. Indicates standard deviation, This indicates the adjustment parameter.

[0008] Furthermore, the graph convolutional neural network includes an input linear activation layer, at least one hidden layer, an output layer, and a fully connected layer connected in sequence.

[0009] Furthermore, the hidden layer of the graph convolutional neural network is represented as follows: ; in, This represents the output of the hidden layer. This represents the input to the hidden layer. The weighted adjacency matrix represents the spatiotemporal feature map of the network. This represents the activation function. Representation matrix The degree matrix, Indicates the index of the hidden layer. Represents the learnable weight matrix; , Represents the identity matrix.

[0010] Furthermore, the Transformer network is constructed, including the following steps: The Transformer network includes a sequentially connected input layer, a causal convolutional module, a multi-head self-attention module, and a feedforward network; The input layer is used to encode the absolute coordinate positions of the feature data of the sensor nodes with time-step distribution; The causal convolution module is used to perform one-dimensional causal convolution on the input data, mapping the input data to a query matrix and a key matrix, and to perform pointwise convolution on the input data, mapping the input data to a value matrix. The multi-head self-attention module is used to form a feature matrix that fuses attention weights; The feedforward network is used to independently perform nonlinear transformations on the features at each time step.

[0011] Furthermore, the multi-head self-attention module includes an attention input unit, a scaled dot product attention unit, and an attention output unit connected in sequence; The attention input unit is used to process the query matrix, key matrix, and value matrix through learnable linear transformation matrices to form multiple sets of head-level query matrices, key matrices, and value matrices respectively; The scaled dot product attention unit is used to calculate the attention weights of a set of query matrices, key matrices, and value matrices respectively through multiple attention heads; The attention output unit is used to concatenate attention weights according to feature dimensions and obtain multi-head self-attention output through linear transformation.

[0012] Furthermore, the total loss function is expressed as the sum of the mean squared error and the multi-core maximum mean difference loss; The mean squared error is expressed as: ; in, Represents the normalization coefficient. This represents the true value of the thermal error. This represents the predicted value of thermal error; The multi-core maximum mean difference loss is expressed as: ; ; in, Indicates the adaptive weight parameters. Indicates network layer index, Indicates the kernel function index. Represents the source domain characteristic distribution matrix. Represents the feature distribution matrix of the target domain. Indicates the number of iterations. This represents the total number of epochs. The expression represents the total number of samples in the source domain dataset.

[0013] A machine tool thermal error prediction system based on machine learning, used to predict the thermal error of a machine tool using the aforementioned machine tool thermal error prediction method based on machine learning, includes: A graph convolutional neural network is used as input to the weighted adjacency matrix of the network's spatiotemporal feature map and the feature data of the sensor nodes, and outputs spatial features. Transformer network, used as input for feature data from sensor nodes, outputs temporal features; The feature fusion module is used to connect features from the time channel, spatial channel, and spatiotemporal channel to obtain fused features. The prediction output module is used to input the fused features into the fully connected layer to obtain the thermal error prediction results; The loss calculation module is used to calculate the mean squared error and the multi-core maximum mean difference loss based on the thermal error prediction results.

[0014] A computer device includes a processor and a memory connected to the processor. The memory stores one or more programs that are executed by the processor to implement the steps in the machine tool thermal error prediction method described above.

[0015] A computer-readable storage medium storing one or more programs that are executed by a processor to perform the steps in the machine tool thermal error prediction method described above.

[0016] Beneficial Effects: This invention constructs a spatiotemporal feature map of a sensor network and its corresponding weighted adjacency matrix. It fully leverages the spatial dependencies between sensors using a Generative Network (GCN), and combines this with a Transformer to accurately extract the temporal features of temperature and displacement data. Furthermore, a multi-channel spatiotemporal feature extraction network achieves deep fusion of these two types of features. This addresses the shortcomings of traditional methods that focus solely on temporal features while neglecting spatial correlations, making the extracted features more closely aligned with the physical laws governing thermal errors and providing reliable support for accurate prediction. By introducing a multi-kernel maximum mean difference to construct the total loss function, the distribution of fused features between the source and target domains is aligned. This effectively alleviates the problem of thermal characteristic differences caused by assembly deviations and performance degradation among different machine tools, solving the pain point of existing models being difficult to transfer and apply across machine tools. This allows a model trained on one machine tool to be adapted to other similar machine tools, significantly improving the model's cross-domain generalization ability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic flowchart of the main method steps of the present invention; Figure 2 This is a schematic diagram of the graph convolutional neural network structure of the present invention; Figure 3 This is a schematic diagram of the Transformer network structure of the present invention; Figure 4 This is a schematic diagram of the multi-head self-attention module structure of the present invention; Figure 5 This is a schematic diagram of the multi-feature fusion of the present invention. Detailed Implementation

[0019] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0020] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0021] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0022] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0023] Reference Figure 1 As shown, this embodiment provides a machine tool thermal error prediction method based on machine learning, including the following steps: Step S1: For the temperature sensor of the machine tool, construct a spatiotemporal feature graph of the sensor network. The nodes of the spatiotemporal feature graph are temperature sensors, and the edges are the physical connections between temperature sensors. The feature data of the sensor nodes are a set of time-series tensors, including the dimensional features of the sensor nodes at each time step. Construct a weighted adjacency matrix of the spatiotemporal feature graph of the sensor network. The elements of the weighted adjacency matrix are formed based on the relative positions of the nodes. Step S2: Construct a graph convolutional neural network. The input of the graph convolutional neural network is the weighted adjacency matrix of the network's spatiotemporal feature graph and the feature data of the sensor nodes. The output is spatial features. Step S3: Construct a Transformer network, where the input of the Transformer network is the feature data of the sensor nodes, and the output is the time feature; Step S4: Construct a spatiotemporal feature extraction network, extract features through the time channel, spatial channel, and spatiotemporal channel respectively, and connect them to obtain fused features; Step S5: Input the fused features into the fully connected layer to obtain the thermal error prediction result; calculate the mean squared error and the multi-kernel maximum mean difference loss based on the thermal error prediction result, and construct the total loss function; train and optimize the network based on the total loss function.

[0024] In this embodiment, the thermal error of the machine tool is specifically the thermal error value of the spindle. This embodiment uses a graph convolutional neural network to model the topological relationship between temperature measurement points and extract spatial features; then, the spatial feature sequence output by the GCN is used as the input of the Transformer network to characterize the long-range dependency of the thermal error over time; finally, a fully connected regression layer maps the spatiotemporal joint features into predicted thermal error values.

[0025] Specifically, in step S1, the spatiotemporal feature map of the temperature sensor network can be represented as: ; Here, V represents the set of N sensor nodes, while E represents the set of physical connections between the nodes.

[0026] The feature data of the sensor nodes is a set of temporal tensors, including the dimensional features of the sensor nodes at each time step, represented as: ; Each time step T Feature matrix It can be represented as a characteristic tensor , , representing the dimensional features at any given time within the entire frame. In this embodiment, the feature data includes sensor readings and temperature values.

[0027] In this embodiment, considering the non-uniform thermal conductivity of the machine tool structural materials, the adjacency matrix weight design is optimized based on the differences in thermal conductivity at different locations. The elements of the weighted adjacency matrix are represented as follows: ; in, Represents edge weight , With nodes and nodes It depends on the location. Indicates control The threshold of the distribution Represents a node and nodes The distance between them was obtained by measuring on the three-dimensional model of the machine tool spindle; threshold Represented as: ; in, This represents the mean. Indicates standard deviation, This represents the adjustment parameter, which is used to evaluate different... k Performance of the model under the given value.

[0028] Specifically, in step S2, refer to Figure 2 As shown, the graph convolutional neural network includes an input linear activation layer, at least one hidden layer, an output layer, and a fully connected layer connected in sequence. Preferably, in this embodiment, the graph convolutional neural network includes three hidden layers.

[0029] In this embodiment, the hidden layer of the graph convolutional neural network is represented as follows: ; in, This represents the output of the hidden layer. This represents the input to the hidden layer. The weighted adjacency matrix represents the spatiotemporal feature map of the network. This represents the activation function. This represents the approximate spatial average feature clustering of the direct neighborhood, which is then transformed through an activated linear layer. 。 Representation matrix The degree matrix, , i and j These represent the numbers of the two corresponding nodes. Indicates the index of the hidden layer. Indicates the network number The learnable weight matrix of the layer; This indicates that self-loops have been added to the sensor map to maintain consistency. The identity matrix is ​​represented. When processing graph-structured data, GCN aggregates neighbor node information and performs feature transformation through graph convolution operations, capturing the spatial dependencies of sensor networks. This mechanism effectively extracts spatiotemporal features, significantly improving the accuracy of thermal error prediction. GCN achieves deep transformation from raw graph data to high-level feature representations, possessing powerful data processing capabilities.

[0030] Specifically, in step S3, refer to Figure 3 As shown, a Transformer network is constructed. The Transformer can efficiently capture the nonlinear and time-varying characteristics of thermal error data, including the following steps: The Transformer network includes a sequentially connected input layer, a causal convolutional module, a layer normalization layer, a multi-head self-attention module, a first residual connection and a layer normalization layer, a feedforward network, a second residual connection and a layer normalization layer, and a linear transformation layer. In this embodiment, the layer normalization layer, the multi-head self-attention module, the first residual connection and the layer normalization layer, the feedforward network, and the second residual connection and the layer normalization layer form an encoder. As a preferred embodiment, the Transformer network includes seven encoders connected in sequence. The input layer is used to encode the absolute coordinate positions of the feature data of the sensor nodes with time-step distribution; In this embodiment, the thermal error time step The time step data is normalized to standardize the feature distribution, ensuring that the input is in the linear region of the activation function, avoiding gradient saturation, and mitigating the gradient vanishing problem.

[0031] The method for normalizing time-step data is expressed as follows: ; in, E(x) This represents the average value. Indicates variance. It is a very small quantity used to prevent the denominator from being zero. and This represents two trainable parameters.

[0032] The causal convolution module is used to perform one-dimensional causal convolution on the input data, mapping the input data to a query matrix and a key matrix, and to perform pointwise convolution on the input data, mapping the input data to a value matrix. In this embodiment, since the spindle thermal deformation during precision machining has a significant temporal cumulative effect, the current state depends on past states, exhibiting a clear causal relationship. Therefore, one-dimensional causal convolution is used, relying solely on historical information, which aligns with the temporal characteristics of spindle thermal deformation.

[0033] For the query matrix and key matrix, respectively through 1×k One-dimensional convolutional kernels are used to extract local dynamic features and alleviate the redundant learning of Transformer layers for short-term dependencies, thereby improving efficiency and prediction accuracy.

[0034] The multi-head self-attention module is used to form a feature matrix that fuses attention weights; In this embodiment, the multi-head attention mechanism, based on the self-attention layer of scaled dot product attention, further enhances the model's performance and generalization ability in complex time series.

[0035] The feedforward network is used to independently perform nonlinear transformations on the features at each time step; In this embodiment, the calculation formula for the point-forward network is expressed as follows: ; in, This represents the output of the previous feedforward neural network (FFN) layer. The superscript (k) indicates the layer label, i.e., the k-th layer of the network, while the subscript and the label in R indicate the dimension label. The ReLU transformation function is the modified linear activation function. The superscript W indicates the weight matrix and bias vector of the first layer of the feedforward network, used to ensure the dimension of matrix multiplication and addition. The residual connection and layer normalization layer consist of residual connections (Add) and normalization (Norm). The former helps the network focus on the current differences and prevents degradation, while the latter accelerates convergence through layer normalization.

[0036] The first residual connection and layer normalization layer adds the input and output of the multi-head self-attention module and performs layer normalization, as shown below: ; The second residual connection and layer normalization layer add the input and output of the feedforward network and perform layer normalization, as shown below: ; in, This indicates self-attention processing. Indicates layer normal processing.

[0037] In this embodiment, refer to Figure 4 As shown, the multi-head self-attention module includes an attention input unit, a scaled dot product attention unit, and an attention output unit connected in sequence; The attention input unit is used to process the query matrix, key matrix, and value matrix through learnable linear transformation matrices to form multiple sets of head-level query matrices, key matrices, and value matrices, as follows: ; Among them w This represents the corresponding linear transformation matrix; The scaled dot product attention unit is used to calculate the attention weights of a set of query matrices, key matrices, and value matrices using multiple attention heads, respectively, as follows: ; in , Represents a query matrix with dimensions of , Represents the key matrix, with dimension . , Represents a value matrix with dimension 1. . and These represent the length of the query and the key, respectively. and These represent the dimensions of the key and the value, respectively.

[0038] The attention output unit is used to concatenate attention weights according to feature dimensions and obtain multi-head self-attention output through linear transformation.

[0039] In this embodiment, by calculating different Q, K and V The first group is used to reduce the dot product attention, and then the final output is obtained through matrix concatenation and linear transformation. Each matrix group focuses on different thermal error features. Feature extraction and representation can be achieved through multi-attention processing, as shown below: ; in, Represents the globally learnable linear transformation matrix of the multi-head attention mechanism.

[0040] In step S4, refer to Figure 5 As shown, the spatiotemporal feature extraction network consists of two cascaded convolutional blocks. The first convolutional block uses a 5×15×1 convolutional kernel, and the second uses a 3×13×1 convolutional kernel. Both are equipped with max pooling, ReLU activation, and layer normalization (LN) to progressively extract and abstract features while stabilizing the training process.

[0041] The spatiotemporal feature extraction network is represented as: ; in This represents the convolution operation. This represents the convolution kernel of the c-th channel. This represents the output of the c-th channel.

[0042] In this embodiment, considering that differences in spatiotemporal features may lead to information overload or redundant amplification, the network introduces a squeeze-and-excitation (SE) attention mechanism to achieve adaptive feature calibration through channel weighting. The SE module first extracts channel statistical features through global average pooling, then learns weight coefficients through fully connected layers, and finally recalibrates the channels to highlight key features and suppress noise. This design not only enhances the spatiotemporal feature fusion capability but also improves the model's discriminativeness and robustness in predicting complex thermal errors.

[0043] The method for extracting channel statistical features using global average pooling is expressed as follows: ; in, This represents a compression operation, with input features of size H×W×C. After global average pooling, the output is a global statistical vector of size 1×1×C, aggregating global information across the channel dimensions. In this embodiment, to utilize the aggregated information, channel dependencies are captured by learning the weights of each channel.

[0044] Reference Figure 5 As shown, the two channels represent the time channel ( ) and spatial information channels ( ), time channel ( Temporal features extracted via Transformer network Extraction time-enhanced features Spatial information channel ( Spatial features extracted via graph convolutional neural networks Extracting spatial augmentation features .

[0045] In the time channel ( ) and spatial information channels ( In the process, the temporal and spatial features, after being processed by a spatiotemporal feature extraction network composed of two cascaded convolutional blocks, are then... Channel compression yields a 1×1×C global statistical vector, which is then fed into a channel attention branch consisting of a multilayer perceptron (MLP). A weight coefficient is learned for each channel to represent its importance to the final task. Fscale feature weighting and recalibration then combine the learned channel weights with the original feature map. The H×W×C features before channel compression are multiplied channel by channel to recalibrate the original feature map. Features of important channels are enhanced, while features of unimportant channels are suppressed. Fscale(⋅) represents the weighting operation, and the output is the feature map after channel attention recalibration.

[0046] This embodiment further constructs a spatiotemporal feature extraction network, which extracts features through the time channel, spatial channel, and spatiotemporal channel respectively, and connects them to obtain fused features, represented as follows: ; in, Indicates the first i Temporal features extracted from each sample using a Transformer network Indicates the first i Spatial features extracted from each sample using a graph convolutional neural network and These represent the feature extraction processes in the time channel and the spatial information channel, respectively. This indicates the extraction of spatiotemporal channel features.

[0047] In this embodiment, spatiotemporal channel feature extraction is based on time-enhanced features. and spatial enhancement features A spatiotemporal joint feature representation is obtained through feature concatenation and nonlinear mapping.

[0048] Specifically, in step S5, the fused features are input into the fully connected layer to obtain the thermal error prediction result, and the obtained prediction value is used to calculate the MSE loss between the prediction and the true value.

[0049] This embodiment achieves domain adaptation through multi-kernel maximum mean difference (MK-MMD). MK-MMD forms a composite kernel by linearly combining multiple kernel functions, thereby comprehensively capturing the multidimensional feature differences between distributions, providing higher flexibility and discriminative ability compared to single-kernel MMD.

[0050] The total loss function is expressed as the sum of the mean squared error and the multi-core maximum mean difference loss, and is represented as follows: ; The mean squared error is expressed as: ; in, Represents the normalization coefficient. This represents the true value of the thermal error. This represents the predicted value of thermal error; The multi-core maximum mean difference loss is expressed as: ; ; in, Indicates the adaptive weight parameters. Indicates network layer index, Indicates the kernel function index. Represents the source domain characteristic distribution matrix. Represents the feature distribution matrix of the target domain. Indicates the current iteration number. This represents the total number of epochs. The expression represents the total number of samples in the source domain dataset.

[0051] This embodiment also discloses a machine tool thermal error prediction system based on machine learning, used to predict the thermal error of a machine tool using the aforementioned machine tool thermal error prediction method based on machine learning, including: A graph convolutional neural network is used as input to the weighted adjacency matrix of the network's spatiotemporal feature map and the feature data of the sensor nodes, and outputs spatial features. Transformer network, used as input for feature data from sensor nodes, outputs temporal features; The feature fusion module is used to connect features from the time channel, spatial channel, and spatiotemporal channel to obtain fused features. The prediction output module is used to input the fused features into the fully connected layer to obtain the thermal error prediction results; The loss calculation module is used to calculate the mean squared error and the multi-core maximum mean difference loss based on the thermal error prediction results.

[0052] This embodiment also discloses a computer device, which includes a processor and a memory. The memory is connected to the processor and stores one or more programs. The one or more programs are executed by the processor to implement the steps in the above-described machine tool thermal error prediction method based on machine learning.

[0053] This embodiment also discloses a computer-readable storage medium storing one or more programs that are executed by a processor to implement the steps in the machine tool thermal error prediction method described above.

[0054] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0055] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A machine tool thermal error prediction method based on machine learning, characterized in that, The process includes the following steps: For the temperature sensor of the machine tool, a spatiotemporal feature graph of the sensor network is constructed, where the nodes of the spatiotemporal feature graph are temperature sensors and the edges are the physical connections between temperature sensors; the feature data of the sensor nodes is a set of temporal tensors, including the dimensional features of the sensor nodes at each time step; a weighted adjacency matrix of the spatiotemporal feature graph of the sensor network is constructed, where the elements of the weighted adjacency matrix are formed based on the relative positions of the nodes; a graph convolutional neural network is constructed, where the input of the graph convolutional neural network is the weighted adjacency matrix of the spatiotemporal feature graph of the network and the feature data of the sensor nodes, and the output is spatial features; a Transformer network is constructed, where the input of the Transformer network is the feature data of the sensor nodes, and the output is temporal features; a spatiotemporal feature extraction network is constructed, where features are extracted through the time channel, spatial channel, and spatiotemporal channel respectively, and fused features are obtained by connecting them; the fused features are input into a fully connected layer to obtain the thermal error prediction result; based on the thermal error prediction result, the mean squared error and the multi-kernel maximum mean difference loss are calculated, and a total loss function is constructed; The network is trained and optimized based on the total loss function.

2. The machine tool thermal error prediction method based on machine learning according to claim 1, characterized in that, The elements of the weighted adjacency matrix are represented as follows: ; in, Represents edge weight, Indicates control The threshold of the distribution Represents a node and nodes The distance between them threshold Represented as: ; in, This represents the mean. Indicates standard deviation, This indicates the adjustment parameter.

3. The machine tool thermal error prediction method based on machine learning according to claim 1, characterized in that, The graph convolutional neural network includes an input linear activation layer, at least one hidden layer, an output layer, and a fully connected layer connected in sequence.

4. The machine tool thermal error prediction method based on machine learning according to claim 3, characterized in that, The hidden layer of the graph convolutional neural network is represented as follows: ; in, This represents the output of the hidden layer. This represents the input to the hidden layer. The weighted adjacency matrix represents the spatiotemporal feature map of the network. This represents the activation function. Representation matrix The degree matrix, Indicates the index of the hidden layer. Represents the learnable weight matrix; , Represents the identity matrix.

5. The machine tool thermal error prediction method based on machine learning according to claim 1, characterized in that, Building a Transformer network involves the following steps: The Transformer network includes a sequentially connected input layer, a causal convolutional module, a multi-head self-attention module, and a feedforward network; The input layer is used to encode the absolute coordinate positions of the feature data of the sensor nodes with time-step distribution; The causal convolution module is used to perform one-dimensional causal convolution on the input data, mapping the input data to a query matrix and a key matrix, and to perform pointwise convolution on the input data, mapping the input data to a value matrix. The multi-head self-attention module is used to form a feature matrix that fuses attention weights; The feedforward network is used to independently perform nonlinear transformations on the features at each time step.

6. The machine tool thermal error prediction method based on machine learning according to claim 5, characterized in that, The multi-head self-attention module includes an attention input unit, a scaled dot product attention unit, and an attention output unit connected in sequence. The attention input unit is used to process the query matrix, key matrix, and value matrix through learnable linear transformation matrices to form multiple sets of head-level query matrices, key matrices, and value matrices respectively; The scaled dot product attention unit is used to calculate the attention weights of a set of query matrices, key matrices, and value matrices respectively through multiple attention heads; The attention output unit is used to concatenate attention weights according to feature dimensions and obtain multi-head self-attention output through linear transformation.

7. The machine tool thermal error prediction method based on machine learning according to claim 1, characterized in that, The total loss function is expressed as the sum of the mean squared error and the multi-core maximum mean difference loss; The mean squared error is expressed as: ; in, Represents the normalization coefficient. This represents the true value of the thermal error. This represents the predicted value of thermal error; The multi-core maximum mean difference loss is expressed as: ; ; in, Indicates the adaptive weight parameters. Indicates network layer index, Indicates the kernel function index. Represents the source domain characteristic distribution matrix. Represents the feature distribution matrix of the target domain. Indicates the number of iterations. This represents the total number of epochs. The value represents the total number of samples in the source domain dataset.

8. A machine tool thermal error prediction system based on machine learning, used to predict the thermal error of a machine tool using the machine tool thermal error prediction method based on machine learning as described in any one of claims 1-7, characterized in that, include: A graph convolutional neural network is used as input to the weighted adjacency matrix of the network's spatiotemporal feature map and the feature data of the sensor nodes, and outputs spatial features. Transformer network, used as input for feature data from sensor nodes, outputs temporal features; The feature fusion module is used to connect features from the time channel, spatial channel, and spatiotemporal channel to obtain fused features. The prediction output module is used to input the fused features into the fully connected layer to obtain the thermal error prediction results; The loss calculation module is used to calculate the mean squared error and the multi-core maximum mean difference loss based on the thermal error prediction results.

9. A computer device, characterized in that, The computer device includes a processor and a memory connected to the processor. The memory stores one or more programs that are executed by the processor to implement the steps in the machine tool thermal error prediction method based on machine learning as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which are executed by a processor to implement the steps in the machine tool thermal error prediction method according to any one of claims 1-7.