Spindle thermal error prediction modeling method based on Bayesian optimization and expansion convolution
Through the combination of Bayesian optimization and expanded convolutional neural network, the problem of the spindle thermal error prediction model in network structure and hyperparameter optimization is solved, and more efficient and accurate thermal error prediction is achieved, which significantly improves the computing efficiency and prediction. performance.
Patent Information
- Application Number
- CN202411150365.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-22
AI Technical Summary
Existing spindle thermal error prediction models have challenges in building effective network structures and determining the optimal hyperparameters, resulting in poor prediction performance and low computational efficiency.
Using the main axis thermal error prediction modeling method based on Bayesian optimization and expanded convolution, a more accurate thermal construction is established by constructing an expanded convolution neural network with a larger receptive field and using the Gaussian process to optimize hyperparameters during model training. Error prediction model.
It improves the accuracy and robustness of spindle thermal error prediction, reduces the computational complexity, and has advantages especially in big data environments, which is significantly better than traditional machine learning models.
Smart Images

Figure CN119002397A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of machine tool processing error analysis, and in particular relates to a spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution. Background Art
[0002] In the process of parts processing, geometric error and thermal error are the main factors affecting the machining accuracy of machine tools, among which thermal error accounts for 40% to 70% of the total error of machine tools. This is because each component of the machine tool will undergo thermal deformation, resulting in thermal errors, which affect the accuracy of the entire machine tool; therefore, it is necessary to take measures to reduce the impact of thermal errors on the machining accuracy of machine tools. The thermal error compensation method predicts the thermal error by establishing a thermal error prediction model and compensates for it during the machining process, thereby reducing the impact of thermal errors on machining accuracy. Therefore, establishing a thermal error model with high accuracy and high practicality is the key to thermal error compensation.
[0003] In recent years, many spindle thermal error prediction models have been developed. At present, the spindle thermal error modeling methods at home and abroad are mainly divided into two categories: mechanism-driven model and data-driven model. The mechanism model is based on the heat transfer relationship and the constraint relationship between displacement and force, and gives an accurate theoretical calculation formula for the heat and deformation of the spindle, and finally realizes the prediction of thermal error; although the mechanism model can provide a clear physical explanation for the thermal error prediction, when faced with factors such as changes in working conditions and equipment heterogeneity, the prediction using the mechanism model often has a large deviation from the actual value. Data-driven thermal error modeling is equivalent to a black box model, which takes the temperature and speed at the key points of the spindle as the input of the model, and the thermal error as the output of the model, without considering the generation, transfer and conversion of heat in the spindle. Since data-driven technology does not require prior knowledge about the machine tool spindle, research on spindle thermal error modeling based on big data and data-driven has become the mainstream in recent years.
[0004] Almost all the spindle thermal error prediction models based on machine learning can get rid of prior knowledge and expert experience by updating model parameters through a self-training mechanism to extract sensitive features. However, there are two key prerequisites for obtaining a powerful machine learning-based model. One is to design an effective network structure to build a machine learning-based model to effectively process data and fully extract sensitive features. Because when a large amount of data is used to ensure accuracy, an ineffective neural network will consume more time to train the model. With this in mind, some people have developed a new network that combines multiple models to improve the performance of the spindle thermal error prediction model. An effective prediction thermal error model based on the combination of a long short-term memory model (LSTM) and a convolutional neural network (CNN) is proposed, and the prediction performance and robustness are compared with the mainstream model; others have proposed a new method for static thermal deformation modeling based on a spatiotemporal correlation hybrid convolutional neural network and a long short-term memory model (ST-CLSTM). The above methods composed of multiple modules usually obtain a powerful structure by inheriting the advantages of the sub-network, but also retain their own shortcomings. Therefore, simply combining different network structures is usually not enough to obtain an effective network.
[0005] The other is to determine the best hyperparameter group, which directly determines the prediction performance of the thermal error model based on machine learning. The machine learning-based model contains many hyperparameters that are usually determined by experience or default values, so it is difficult to fully utilize the learning ability of the model. Improper hyperparameter settings may lead to underfitting or overfitting of the model. Therefore, it is of great significance to optimize the setting of hyperparameters to build a more powerful spindle thermal error prediction model. Many scholars have developed a series of methods for optimizing hyperparameters. For example, some people use particle swarm optimization (PSO) to optimize the penalty factor and kernel function of support vector machine (SVM) to establish a PSO-SVM-based electric spindle thermal error prediction model. Some people optimize the hyperparameters of the long short-term memory (LSTM) neural network through the gray wolf (GW) algorithm to eliminate the sensitivity of the prediction performance to its hyperparameters. The above methods for optimizing hyperparameters are all heuristic algorithms, which require a large number of iterations to update the object value and are prone to fall into local optimal values. Most importantly, the machine learning-based model, especially the deep learning-based model, has the characteristics of uncertainty in the learning process, which makes it difficult for the parameters of the heuristic algorithm to be updated in the right direction. Therefore, heuristic algorithms cannot effectively solve the hyperparameter optimization problem of machine learning based models.
[0006] The modeling method of this application mainly targets the above two challenges: how to build an effective network structure and determine the optimal hyperparameters. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide a spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution. By constructing a dilated convolutional neural network with a larger receptive field and introducing Bayesian optimization based on Gaussian process in the training process of the model data set, the hyperparameters of the model are efficiently optimized, so that the spindle thermal error prediction model has powerful spindle thermal error accurate prediction capabilities.
[0008] A technical solution adopted by the present invention to solve the above problem is: a spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution, which specifically includes the following steps:
[0009] a. Use a thermal imager to obtain a thermal image of the spindle;
[0010] b. Preprocess the obtained spindle thermal images to create a data set;
[0011] c. Input the data set into the dilated convolutional neural network for training;
[0012] d. Bayesian optimization based on Gaussian process is used to explore the entire hyperparameter space, determine the optimal hyperparameter combination of the dilated convolutional neural network, and establish a spindle thermal error prediction model.
[0013] Specifically, in step a, during the heating period of 75 minutes with the spindle speed of 1500r / min, and during the cooling period of 75 minutes with the spindle stopped, the thermal image of the spindle is taken every 1 minute. The thermal images of the spindle under two different working conditions, heating and cooling, are collected, so that the subsequent model data set training process is more comprehensive, the hyperparameter combination of the spindle thermal error prediction model obtained by Bayesian optimization is better, and the prediction ability of the constructed spindle thermal error prediction model is more accurate.
[0014] Specifically, in step b, first, batch crop the spindle thermal images to delete the image areas irrelevant to the spindle front bearing; second, resize and normalize the cropped spindle front bearing thermal images and convert them into tensors; then, subtract the pixel values of all converted spindle front bearing thermal images from the pixel values in the initial temperature state, only display the influence of the spindle incremental temperature change on the thermal error, and save them as 36x36 preprocessed thermal images; enhance and expand all preprocessed thermal image data to create a data set. The spindle front bearing temperature changes significantly, has obvious thermal image features, and is suitable for modeling; eliminate the interference of irrelevant image areas, improve the prediction accuracy of the spindle thermal error prediction model, reduce the amount of calculation, and reduce the time required for data set training.
[0015] Specifically, the enhancement of all pre-processed thermal image data is to add noise with a signal-to-noise ratio of 10db, 20db, and 30db to all pre-processed thermal images respectively; wherein the calculation formula of the signal-to-noise ratio SNR is:
[0016]
[0017] Where m and n are the number of pixels in the image length and width, respectively, and Y(m,n) is the preprocessed thermal image before noise addition. It is the output image after adding noise. It is used to improve the ability of the spindle thermal error prediction model to resist noise, that is, to improve the robustness of the spindle thermal error prediction model, while maintaining good quality of thermal images and clear details, and obtain more thermal images and import them into the data set.
[0018] Specifically, the expansion of all pre-processed thermal image data is to rotate all pre-processed thermal images counterclockwise by 90°, 180° and 270° respectively. The pixel values of the pre-processed thermal images are not changed, but more thermal images are simply obtained and imported into the data set, which will not reduce the accuracy of the spindle thermal error prediction model.
[0019] Specifically, the formula for the two-dimensional dilated convolution of the dilated convolutional neural network is:
[0020]
[0021] Here, z(i,j) is the output of the dilated convolution of the input x(i,j) and the filter w(m,n), the length and width of the filter are M and N respectively, and the parameter d is the dilation rate.
[0022] Compared with the prior art, the advantages of the present invention are:
[0023] 1. The dilation rate hyperparameter is introduced into the dilated convolutional neural network to control the distance between adjacent elements in the convolution kernel and increase the receptive field of the convolution kernel. This can effectively avoid the problems of reduced image resolution and inability to reconstruct information after downsampling in the pooling layer of the traditional convolutional neural network.
[0024] 2. The accuracy of the BO-DCNN model in predicting thermal errors in thermal images is significantly better than that of the traditional machine learning model that has also undergone Bayesian optimization;
[0025] 3. The BO-DCNN model has high computational efficiency and acceptable computational complexity, and has advantages in the era of big data, especially in parallel and distributed computing environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a schematic diagram of the process of the present invention.
[0027] Figure 2 These are the original view of the spindle of the present invention, the initial thermal image taken by the thermal imager, and the thermal images of the spindle after the spindle rotates for 1 hour and 2 hours.
[0028] Figure 3 It is a schematic diagram of the preprocessing process of the thermal image of the main shaft of the present invention.
[0029] Figure 4 Schematic diagram of creating a data set in two ways according to the preprocessed thermal image according to the present invention.
[0030] Figure 5 It is a schematic diagram of the main structure of the dilated convolutional neural network model of the present invention.
[0031] Figure 6 Schematic diagram of the receptive field of the dilated convolution with dilation rates of 1, 2, and 3 respectively.
[0032] Figure 7 This is a diagram of the main axis thermal image convolution + pooling + deconvolution and dilated convolution training process of the present invention.
[0033] Figure 8 It is the principle diagram of the PI acquisition function of the present invention.
[0034] Fig. 9 This is a trend graph of the search loss for Bayesian optimization in the validation dataset of the present invention.
[0035] Fig.10 It is a 5D visualization diagram of the change of BO-DCNN search loss under different hyperparameters of the present invention.
[0036] Fig.11 It is a real-time prediction performance diagram of various thermal error models of the present invention on the test data set.
[0037] Fig.12 It is the normal distribution diagram of the thermal error of the present invention. DETAILED DESCRIPTION
[0038] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0039] The present invention Figure 1 A spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution is proposed, which specifically includes the following steps:
[0040] a. Use a thermal imager to obtain a thermal image of the spindle;
[0041] b. Preprocess the obtained spindle thermal images to create a data set;
[0042] c. Input the data set into the dilated convolutional neural network for training;
[0043] d. Bayesian optimization based on Gaussian process is used to explore the entire hyperparameter space, determine the optimal hyperparameter combination of the dilated convolutional neural network, and establish a spindle thermal error prediction model.
[0044] After the spindle thermal error prediction model is created, step e is also included, in which the performance of the spindle thermal error prediction model is evaluated using various evaluation indicators.
[0045] Verification Example
[0046] a. Use a thermal imager to obtain a thermal image of the spindle;
[0047] The radial and axial thermal errors of the lathe spindle were measured. In the experiment, a high-precision displacement sensor was used to measure the thermal error of the spindle. For the horizontal spindle of the lathe, the radial thermal errors in the X and Y directions were measured, and the values were displayed on a digital display. The thermal image of the spindle was taken with a FLUKE Ti400 thermal imager. FLUKE Ti400 is an infrared thermal imager with a temperature measurement range of -20℃~+1200℃, a thermal image resolution of 320×240, and a thermal sensitivity of ≤0.05℃ when the target temperature is less than 30℃. The high resolution and thermal sensitivity ensure that the thermal image of the spindle can clearly capture the changes in the spindle temperature. Six PT100 temperature sensors were used to collect the temperature of the rear bearing, the middle of the spindle, and the ambient temperature respectively. The ambient temperature next to the machine tool was directly measured using temperature sensors placed in front and behind the machine tool, and the measured data were averaged.
[0048] The front bearing is the main heat source of the spindle and directly determines the thermal error of the spindle. Its thermal image can be easily obtained by a thermal imager. After the spindle rotates for 1 to 2 hours, the temperature of the front bearing changes significantly and has obvious thermal imaging characteristics, which is suitable for modeling. The thermal image taken by the thermal imager is as follows: Figure 2 shown.
[0049] A total of 6 groups of experiments were conducted over 6 days at different ambient temperatures. Each group of experiments included two parts: heating and cooling. During heating, the spindle speed was 1500r / min for 75 minutes; during cooling, the spindle stopped for 75 minutes. During this period, data collection was performed every 1 minute, that is, infrared thermal images of the spindle were taken, and the radial thermal errors of the front bearing in the X and Y directions were recorded. Each group of experiments obtained 150 spindle thermal images and the corresponding radial thermal error data of the front bearing in the X and Y directions. The initial temperature (Front bearing initial temp) and ambient temperature (Ambient initial temp) of the front bearing are shown in Table 1.
[0050] Table 1
[0051]
[0052] The spindle of the lathe will produce significant axial and radial thermal deformation when rotating. Each test lasts 150 minutes, that is, 75 minutes of heating process and 75 minutes of cooling process, and 450 thermal images of the heating and cooling spindles and the corresponding radial thermal error data are obtained. For the lathe spindle test, after the spindle rotates for 75 minutes, the radial thermal error in the Y direction is about 10-12μm, and the radial thermal error in the X direction is about 6-7μm. After the spindle stops for 75 minutes, the X and Y radial thermal errors remain at 4μm and 6μm, respectively, and do not drop to 0μm. The main reason for this phenomenon is that the ambient temperature changes within 150 minutes.
[0053] b. Preprocess the obtained spindle thermal images to create a data set;
[0054] After taking the thermal image of the spindle, unnecessary information in the thermal image is removed by cropping, and the front bearing is selected as the extracted thermal signal area; in order to eliminate interference and improve the prediction accuracy of the model, all spindle thermal images need to be preprocessed. First, the spindle thermal images are batch cropped to delete the image areas that are not related to the spindle front bearing. Secondly, the captured thermal image of the spindle front bearing is resized, normalized, and converted into a tensor. Then, since Table 1 shows that the ambient temperature of the lathe spindle has changed within 6 days, the pixel values of all spindle front bearing thermal images are subtracted from the pixel values in the initial temperature state, so as to only show the impact of the incremental temperature change of the spindle on the thermal error; finally, the image size is saved as 36x36 (pixel value) to obtain the preprocessed thermal image, as shown in Figure 3 shown.
[0055] In order to make the spindle thermal error prediction model more accurate, all pre-processed thermal image data need to be enhanced and expanded to create a dataset, such as Figure 4 shown.
[0056] Enhance all pre-processed thermal image data: In order to improve the model's ability to resist noise, that is, to improve the robustness of the spindle thermal error prediction model, while maintaining the good quality of the pre-processed thermal image and clear details, noise with a signal-to-noise ratio of 10db, 20db, and 30db was added to the pre-processed thermal image, and more thermal images were also obtained. In the field of image noise processing, the signal-to-noise ratio (SNR) is widely used as an indicator to evaluate the image noise effect, and its calculation formula is:
[0057]
[0058] Where m and n are the number of pixels in the image length and width, respectively, and Y(m,n) is the preprocessed thermal image before noise addition. is the output image after adding noise.
[0059] All pre-processed thermal image data are expanded: rotate counterclockwise 90°, 180°, and 270° to achieve the expansion of the pre-processed thermal image. Although there are many methods for image expansion, such as principal component analysis, color enhancement, contrast enhancement, and brightness enhancement, these methods will change the pixel value of the image. In this verification example, the pixel value of the image directly reflects the size of the thermal error, so these methods are not selected, and only the traditional rotation and cropping methods are selected for image enhancement.
[0060] After the enhancement and expansion of the preprocessed thermal image data and the initial preprocessed thermal image data, a data set of 3125 thermal images was formed.
[0061] c. Input the data set into the dilated convolutional neural network for training;
[0062] Among them, the dilated convolutional neural network (DCNN) is built by using the deep learning framework Keras in Tensorflow 2.9.0. The structure of the dilated convolutional neural network is as follows: Figure 5 As shown in the figure, excluding the input layer (Input) and the output layer (Output), the dilated convolutional neural network has a total of 8 layers. The dilated convolutional neural network is mainly composed of a two-dimensional convolution layer (Dilation Conv2D), an activation layer (Activation), a maximum pooling layer (MAP), a random dropout layer (Dropout) and a fully connected layer (dense). Each operation part consists of 1 two-dimensional convolution layer, 1 nonlinear activation layer and 2 Dropout layers. The maximum pooling layer is used between the convolution layer and the Dropout layer to simplify the hidden layer features and improve the grid training efficiency. After the convolution and pooling operations, the output layer is connected by a flatten layer and two fully connected layers. The loss function is the mean square error, and the Adam algorithm is used to set the network optimizer and loss function.
[0063] One of the key components of the design is the dilated convolution layer. A 2D dilated convolution can be defined as:
[0064]
[0065] Where z(i,j) is the output of the dilated convolution of the input x(i,j) and the filter w(m,n), the length and width of the filter are M and N respectively, and the parameter d is the dilation rate. If d = 1, the dilated convolution becomes a normal convolution.
[0066] Dilated convolution layers have been shown to significantly improve accuracy in segmentation tasks. While pooling layers (e.g., max pooling and average pooling) are widely used to maintain invariance and control overfitting, they also significantly reduce spatial resolution, meaning that spatial information in feature maps is lost. Deconvolution layers can mitigate this information loss, but the additional complexity and execution latency may not be suitable for all cases. Dilated convolution is a better choice, where the convolution kernel enlarges the receptive field by taking interval values without increasing the number of parameters or computation (adding more convolution layers can make the receptive field larger, but introduces more operations). In dilated convolution, a small kernel with k×k filters is enlarged to k+(k-1)(r-1) with a dilation stride of r. Therefore, it allows for flexible aggregation of multi-scale contextual information while maintaining the same resolution. Figure 6 An example can be seen in , where a normal convolution (a) obtains a 3×3 receptive field, while two dilated convolutions (b) and (c) provide 5×5 and 7×7 receptive fields respectively.
[0067] In terms of maintaining feature map resolution, dilated convolution has obvious advantages over the solution of convolution + pooling + deconvolution. Figure 7 Let’s take an example to illustrate. The input is a thermal image, which is processed in two ways to produce an output of the same size. In the first method, the input is first downsampled by a max pooling layer with a factor of 2, and then passed to a convolution layer with a Sobel kernel. Since the resulting feature map is only half the size of the original input, it needs to be upsampled by a deconvolution layer (using bilinear interpolation). In the other method, try using dilated convolution to convert the same Sobel kernel into a convolution kernel with a dilation factor of 2. In this way, the output has the same dimension as the input (no need to use pooling and deconvolution layers). Most importantly, the output of the dilated convolution contains more detailed information (referring to the enlarged part).
[0068] The activation function adds nonlinear factors to enhance the expression of features and improve the fitting performance of the network. Sigmoid function, Tanh function, and ReLU function are common activation functions. The ReLU function does not have the problem of gradient explosion, and is more sensitive to input data than the other two activation functions, while the Sigmoid function and Tanh function have the problem of gradient disappearance. The formula of the ReLU function is as follows:
[0069] f=max(0,x)
[0070] Among them, x is the feature map matrix obtained by convolution calculation.
[0071] The pooling layer is also called the downsampling layer. In DCNN, the pooling layer is located after the convolution layer, which plays a role in compressing features and reducing the computational complexity of the neural network. The pooling operation formula is shown below:
[0072]
[0073] Among them, down() represents the downsampling function, that is, the pooling function. For the upper layer The pooling value of is the weight of the current pooling layer, is the current bias.
[0074] The Dropout layer is a regularization technique used to prevent overfitting of neural networks. Dropout forces the model to not rely too much on certain neurons during training by randomly setting the output of some neurons to zero during training. This strategy of randomly discarding neurons can improve the generalization ability of the model and make it perform better on new data.
[0075] Fully connected layers often appear in the last few layers of DCNN and are generally used to drop hidden layer features onto target labels. The calculation formula for the fully connected layer is shown below.
[0076] x l =Σx l-1 *w l +b l ;
[0077] Among them, x l represents the neurons in the lth fully connected layer, w l is the weight of the neurons in the lth layer, b l is the bias of the neurons in the lth layer.
[0078] d. Bayesian optimization based on Gaussian process is used to explore the entire hyperparameter space, determine the optimal hyperparameter combination of the dilated convolutional neural network, and establish a spindle thermal error prediction model;
[0079] A neural network can be considered as a black box function f(). It is difficult to directly determine the specific functional relationship that exists, and the output y can only be obtained from the input sample point x. Therefore, a solvable function must be designed to transform the hyperparameter optimization problem into minimizing the unknown objective function f(x) and finding the optimal hyperparameter x. * :
[0080] x * = arg min x∈χ f(x);
[0081] Among them, χ is the high-dimensional hyperparameter space to be searched, minimizing the unknown objective function f(x) is the loss function of DCNN, and using the mean square error (MSE) function, x represents the hyperparameters instead of the input data. When the loss function reaches the minimum value, the optimal hyperparameters are obtained.
[0082] Bayesian optimization considers previous parameter information to continuously update the prior during the hyperparameter optimization process, and exhibits a small number of iterations and fast convergence speed. It remains robust when solving non-convex problems and can effectively avoid local optimality.
[0083] There are two key parts of Bayesian optimization: Gaussian process and acquisition function.
[0084] Among them, Gaussian processes (GP) are a commonly used non-parametric model. Currently, Gaussian processes have been widely used in regression, classification, and many black box functions that need to be inferred. Gaussian process is a generalization of multivariate Gaussian probability distribution. A Gaussian process consists of a mean function: m:x→R and a semi-positive definite (a valid covariance function must be semi-positive definite) covariance function k:x×x→R:
[0085] f(x)~GP(m(x),k(x,x′));
[0086] Among them, m(x)=E(f(x)), k(x,x')=E[(f(x)-m(x))(f(x')-m(x'))].
[0087] A widely used covariance sum function, called the squared exponential (SE), is shown in the following equation:
[0088]
[0089] in, is the maximum allowed value of the covariance matrix and l is the length parameter.
[0090] Through n observations (x i ,y i ),i=1,2,...,n, we can calculate the covariance function shown in the formula,
[0091]
[0092] Under the assumption of a Gaussian process, i.e., the finite number of observations of f(x) follows a multivariate Gaussian distribution, we can n+1 With y 1:n Combination: You can get a multivariate Gaussian distribution as shown below:
[0093]
[0094] Among them, y 1:n =[y1,y2,...y n ] T .
[0095] Predicted y n+1 Also follows a Gaussian distribution:
[0096]
[0097] y n+1 The best estimate of is:
[0098]
[0099] var(y n+1 The optimal estimate of ) is:
[0100]
[0101] Gaussian process regression predicts the probability distribution of the target function and can be used to construct the acquisition function.
[0102] Bayesian optimization uses the acquisition function to indirectly obtain the global optimal solution of f(x). In each iteration, the acquisition function weighs the development of high mean areas and the exploration of high variance areas to select appropriate sampling hyperparameter sample points. Common acquisition functions include probability of improvement (PI), expected improvement (EI), and upper confidence bound (UCB).
[0103] In the PI acquisition function, determine whether the value of the function at the unknown point is greater than f(x + ). Next, select the point with the highest probability among these points. By using the Z-scores normalization method, we can compare the function value of each unknown point greater than f(x + ) probability. The principle of PI acquisition function is as follows Figure 8 As shown; the maximum observed value f(x + ) is located at x + .x + The area on the left, divided by the hatched line on the right side of x3, represents the probability of improving PI(x3) at x3. Sampling at x3 is more likely to improve f(x) than sampling at x1 or x2. + ).
[0104] The PI acquisition function can be defined as:
[0105]
[0106] Among them, f(x + ) is the maximum value available, Φ(·) is the normal cumulative distribution function, μ(x) and σ(x) are the prediction expectation and variance, respectively, and ξ is a hyperparameter that can guide the model to explore more and find a more optimal solution.
[0107] The EI acquisition function solves the problem that the PI acquisition function only considers the probability of improvement without considering the magnitude of improvement at the next point. The EI acquisition function seeks the value of the function at the unknown point to be greater than f(x + )’s expectations:
[0108]
[0109] in, is the normal probability density function (PDF).
[0110] UCB takes into account the size and uncertainty of the predicted value. The Gaussian process has a smaller uncertainty (variance) at the observed location and a larger uncertainty in the unexplored area. The UCB expression is as follows:
[0111] UCB(x)=μ(x)+βσ(x);
[0112] Among them, β is a parameter that balances the exploitation and exploration capabilities of the acquisition function.
[0113] Here we explain the process of the DCNN hyperparameter search algorithm based on Bayesian optimization.
[0114] D 1:t-1 ={(x1,y1),(x2,y2),…,(x t-1 ,y t-1 )} means that assuming that n-1 samples have been tried, α(x|D 1:t-1 ) is the acquisition function obtained after calculating the probability proxy model based on the samples.
[0115] (1) The prior distribution of the probabilistic surrogate model has been initialized.
[0116] (2) The next observation point is to optimize the acquisition function x t = arg max x∈χ α(x|D 1:t-1 ) discovered.
[0117] (3) Train the DCNN model and calculate the loss function y of the validation set t =f(x t ) value and update the current best value.
[0118] (4) Add the result to the previous sample D 1:t =D 1:t-1 ,(x t ,y t ) and use GP to update the probability surrogate model to obtain the posterior distribution (as the prior distribution for the next step).
[0119] (5) Repeat steps (2)-(4) until the maximum number of iterations is reached.
[0120] RF is a classifier that uses multiple decision trees to fit data. It uses Bootstrap resampling technology to randomly extract data from the original sample to generate multiple samples, uses node random splitting technology to build multiple decision trees for each resampled sample, and combines multiple decision trees and voting to produce the final prediction result. The prediction result of RF is shown in the formula: Where n is the number of decision trees, y is the average output of n decision trees, and y i (x) is the prediction of the i-th tree.
[0121] SVM is a statistical method for machine learning. It is good at generalization and is effective for small sample problems. At the same time, it avoids the problem of being easily trapped in the local optimum and solves the problem of dimensionality disaster. SVM performs a nonlinear mapping of data from the input space to a high-dimensional feature space, and then performs nonlinear regression analysis in the feature space to find the optimal classification hyperplane. The main goal of SVM is to minimize the edge distance between the sample point and the hyperplane. Therefore, the objective function of SVM is as follows:
[0122]
[0123] in, represents the weight matrix, c is the penalty parameter that determines the trade-off between training error and model complexity, ξ i and i * is a slack variable that measures the deviation of training samples, b is the deviation, ε is the accuracy parameter, and Φ is the kernel function mapped to high-dimensional space.
[0124] The hyper-parameters of the DCNN model were adjusted by Bayesian optimization. The hyper-parameters of the DCNN model include filters, units, kernel size, dilations, batch size, dropout rate 1, dropout rate 2, learning rate (Lr), pool size, maximum number of iterations, activation, and the search space of hyper-parameters and the optimal hyper-parameter combination are shown in Table 2. The learning rate was dynamically adjusted using the early termination function, and the maximum number of iterations during training was 50. Fig. 9 (a) and (b) illustrate the search loss trend of Bayesian optimization in the validation dataset. The warming-up and cooling-down methods achieve the global optimum with the minimum loss in the 17th and 31st iterations, respectively. Fig.10 (a) to (c), (d) to (f) show the five-dimensional visualization diagram of the change of BO-DCNN search loss under different hyperparameters when heating and cooling. It can be seen from the figure that the best hyperparameter combination is obtained when the search loss is minimized, but the combination is different when heating (Heating) and cooling (Cooling). Parameter types (Type) are divided into integer (Integer), continuous (Continuous), discrete (Discrete) and preset.
[0125] Table 2 Range and optimal combination of DCNN model hyperparameters
[0126]
[0127]
[0128] Prediction results
[0129] This study aims to predict the radial thermal error of the spindle using the thermal image of the front bearing, which is the main heat source of the spindle. The proposed BO-DCNN is applied to the data collected in Section 3 to evaluate the real-time prediction performance of the proposed model. The data is divided into three parts: 60% as a training dataset, 20% as a validation dataset, and 20% as a test dataset.
[0130] Parameter settings and determination approaches employed in the comparative experiments are shown in Table 3. After all models were trained on the training set and verified on the validation set, the test set was used to verify the accuracy of model prediction. First, the BO-DCNN model was compared with the SVR and RF (BO-SVR and BO-RF) that were also Bayesian optimized. The hyperparameters of the three different models were optimized using the Bayesian optimization algorithm. The hyperparameters of BO-RF included the maximum depth, the minimum sample leaf, the minimum sample split, and the N estimators. The hyperparameters of BO-SVR included the penalty parameter c, ε (Epsilon), and γ (Gamma). The predicted values of the axial and radial thermal errors under the heating and cooling states were compared with the true values. The model BO-DCNN had the highest prediction accuracy. Among them, the prediction accuracy of X-direction and Y-direction thermal errors during the heating process was 94.76% and 95.17%, respectively, and during the cooling process was 95.15% and 95.75%, respectively. This experiment reflects the superiority of Bayesian algorithm in optimizing hyperparameters. Secondly, in the machine learning model for predicting thermal errors, different optimization algorithms for its hyperparameters were also considered. The representative grid search (GS-DCNN) of automatic tuning and the representative particle swarm optimization (PSO-DCNN) of evolutionary algorithms were selected for comparison. Different hyperparameter optimization methods were used to optimize the model DCNN. The BO-DCNN model can still obtain better results, emphasizing the superiority of DCNN in processing thermal images.
[0131] Table 3 Parameter settings and determination approaches employed in the comparative experiments
[0132]
[0133] e. Evaluate the performance of the spindle thermal error prediction model using various evaluation metrics.
[0134] In order to evaluate the performance of the spindle radial thermal error prediction model proposed in the application, the predicted values of the spindle radial thermal error prediction model were compared with the actual values to evaluate the prediction accuracy. The mean absolute error (MAE), root mean square error (RMSE) and coefficient of determination (R2 ) is used to evaluate the prediction accuracy, which is defined as follows:
[0135]
[0136]
[0137] in, is the predicted value at time t, y t is the actual value at time t, is the arithmetic mean of all actual values, and N is the number of samples.
[0138] Fig.11 Table 4 further illustrates the real-time prediction performance of various thermal error models on the test data set. The results show that under heating and cooling conditions, compared with the baseline model, the DCNN model can better extract the features of thermal images by stacking convolutional layers and increasing the receptive field of the convolution kernel; compared with different hyperparameter optimization methods, the DCNN optimized by Bayesian achieves the minimum prediction error, which is comparable to Fig.10 The results are consistent with the visual qualitative analysis in , verifying the high accuracy and robustness of BO-DCNN in practical applications.
[0139] Table 4 Four indicators for evaluating the performance of the prediction model. (a) X-direction heating, (b) X-direction cooling, (c) Y-direction heating, (d) Y-direction cooling
[0140]
[0141]
[0142] Further analysis of the prediction error. The superimposed prediction errors of the BO-DCNN model and other benchmark models at different time points are shown in Figure 2. Fig.11 As shown, the deviations of the individual models can be observed. Among the above hybrid models, the BO-DCNN based one produces a smaller thermal error because the prediction error of this model is relatively low when the thermal error varies.
[0143] The thermal error distribution of various models shows that the thermal error of BO-DCNN is more concentrated near zero and does not change much. Fig.12 As shown in Figure 2, the PDFs of thermal errors of various models conform to normal distribution. Compared with other baseline models, BO-DCNN has higher kurtosis, which proves its high accuracy and robustness.
[0144] In order to achieve accurate prediction of spindle thermal errors under different working conditions, this application proposes a thermal error prediction model of a dilated convolutional neural network based on Bayesian optimization. The dilated convolutional neural network with a larger receptive field is used to extract the temperature features of thermal images, and the hyperparameters of the dilated convolutional neural network are optimized using the Bayesian algorithm, which improves the prediction accuracy and robustness of the model and achieves the prediction of thermal errors. By comparing and analyzing with other benchmark models, the following conclusions can be drawn:
[0145] After downsampling through the pooling layer, traditional convolutional neural networks will have problems such as reduced image resolution and inability to reconstruct information. This study introduces the dilation rate parameter to control the distance between adjacent elements in the convolution kernel, increase the size of the convolution kernel's receptive field, and reduce the number of parameters required to obtain the same receptive field compared to ordinary convolutions.
[0146] (1) Calculation results (MAE, MSE, RMSE and R 2 ) verified the superiority of the proposed BO-DCNN model in dealing with thermal errors in thermal image prediction, which is significantly better than traditional machine learning models (BO-SVR and BO-RF) that have also been Bayesian optimized. In addition, Bayesian optimization can achieve better results than traditional particle swarm optimization and random search when finding the best DCNN hyperparameter combination.
[0147] (2) The model has high computational efficiency and acceptable computational complexity, which is advantageous in the era of big data, especially in parallel and distributed computing environments. In addition, the BO-DCNN model can also be used in other image semantic segmentation problems, video analysis, natural language processing and other fields.
[0148] (3) In the next study, the following improvements can be made to the BO-DCNN-based model: In terms of algorithms, the Gaussian function in Bayesian optimization is enhanced to better model the objective function; in terms of data, several sets of temperature sensor data are spliced when the image is one-dimensionalized to combine the image with the temperature sensor value, and on this basis, the research on multi-source fusion features is explored.
[0149] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution, characterized in that: The specific steps include: a. Use a thermal imager to obtain a thermal image of the spindle; b. Preprocess the obtained spindle thermal images to create a data set; c. Input the data set into the dilated convolutional neural network for training; d. Bayesian optimization based on Gaussian process is used to explore the entire hyperparameter space, determine the optimal hyperparameter combination of the dilated convolutional neural network, and establish a spindle thermal error prediction model.
2. The spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution according to claim 1 is characterized in that: In step a, during the temperature rise period of 75 minutes with the spindle rotating at 1500 r / min, and during the temperature drop period of 75 minutes with the spindle stopped, thermal images of the spindle are taken every 1 minute.
3. The spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution according to claim 2 is characterized in that: In step b, first, the spindle thermal images are cropped in batches to delete image areas irrelevant to the spindle front bearing; second, the cropped spindle front bearing thermal images are resized, normalized, and converted into tensors; Then, the pixel values of all converted thermal images of the front bearing of the spindle are subtracted from the pixel values of the initial temperature state to show only the effect of the incremental temperature change of the spindle on the thermal error, and saved as a 36x36 pre-processed thermal image; All preprocessed thermal image data are augmented and extended to create a dataset.
4. The spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution according to claim 3 is characterized in that: The enhancement of all pre-processed thermal image data is to add noise with a signal-to-noise ratio of 10db, 20db, and 30db to all pre-processed thermal images respectively; wherein the calculation formula of the signal-to-noise ratio SNR is: Where m and n are the number of pixels in the image length and width, respectively, and Y(m,n) is the preprocessed thermal image before noise addition. is the output image after adding noise.
5. The spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution according to claim 3 is characterized in that: The expansion of all pre-processed thermal image data is to rotate all pre-processed thermal images counterclockwise by 90°, 180° and 270° respectively.
6. The spindle thermal error prediction modeling method based on Bayesian optimization and dilated convolution according to claim 1, characterized in that: The formula for the two-dimensional dilated convolution of the dilated convolutional neural network is: Here, z(i,j) is the output of the dilated convolution of the input x(i,j) and the filter w(m,n), the length and width of the filter are M and N respectively, and the parameter d is the dilation rate.
Citation Information
Cited By
Road surface performance prediction algorithm for quantizing data and model uncertainty
CN120257816A
Information processing device, industrial system, and machine tool control method
JP7825793B1
