Research on prediction method of tool wear degree based on SVM

Tool wear of machine tools not only directly affects the processing quality, but also leads to the life of processing equipment and production costs. It is of great significance to correctly identify, classify and predict the state of tool wear. In this paper, through the collection of machine tool operation data, using machine learning modeling, using the model to identify the tool wear state, and then predict and classify the tool wear state, using the classification results to determine whether the tool can continue to use. After simulation verification, the results show that the model can identify and predict the wear state more realistically, and has strong practicability.


Introduction
The wear degree of machine tool directly affects the product processing quality and production efficiency.The serious wear degree will cause the processed workpiece to become defective or waste, and the production cost will also rise.In the past, workers judged the condition of machine tool by observing with eyes and hearing with ears, and then determined whether the machine tool blade needed to be replaced.Because the worker's method is subjective judgment, it will misjudge the wear degree and life of the tool.How to scientifically and accurately judge the wear of machine tools, and accurately classify them, and then carry out corresponding treatment is an effective way to solve the product quality problems caused by machine tool wear and improve production efficiency [1] .It has important practical significance for enterprises to improve product quality and production efficiency.

Machine learning theory and the principle of SVM
Machine learning refers to the method of learning general rules from limited observation data and using these rules to predict unknown data.Traditional machine learning methods mainly focus on how to learn a prediction model by first representing the data as features, and then inputting these feature data into the prediction model to output the prediction results [2] .SVM is based on the Structural Risk Minimization criterion.Its topology is determined by support vectors, which overcomes the shortcomings of ANN structure that depends on designer's experience.It solves the inherent problems of ANN, such as high dimension, local minimum and small sample size, and takes into account the advantages of neural network and gray model.SVM was first proposed by Vapnik in 1995.It has many unique advantages in solving small samples, and is generally used in machine learning problems.SVM is a binary classification model, which is basically defined as a classification model that maximizes the margin in the space.Its learning strategy is to maximize the margin, which is usually suitable for solving classification problems.At present, it is more used in the business field.The classification model is to find the best classification according to the sample information by finding the minimum risk of the structure [3] .

Design of tool wear degree prediction model based on machine learning
The design of the prediction model mainly includes the preprocessing of blade data, feature selection, classifier construction, performance evaluation and other stages, and the specific process is shown in Figure 1.

Data collection and preprocessing
In this paper, the data set of 6828 data is formed after cleaning the data set.By observing the data, it can be learned that the second column to the eighth column is valid data.It is composed of the motor torque, the lag error of the position controller, the actual position of the position controller, and the actual speed of the position controller.These columns of data are used as the basis for judging the final result.The data in the last column are divided and classified according to the interval, [2000-3600] is the initial wear stage.[1500-2000] is the normal wear stage, [0-1500] is the sharp wear stage.Part of the data and label characteristics of the data set are shown in Figure 2.

Figure 2. Shows part of the data in the dataset
First, the nine columns of data are separated, and the last column is used as the target data Y value, which is the part that needs to be predicted.The data from the second column to the eighth column is used as the basis for judgment.The purpose of data normalization and flattening is: The purpose of data normalization is to make the preprocessed data be limited in a certain range, so as to eliminate the adverse effects caused by singular sample data.The purpose of the flattening process is to convert the original array into a one-dimensional array [4] .

Basic flow of SVM algorithm
The basic flow of the SVM algorithm is shown in Figure 3.

Model performance evaluation
The error of a model on the training set is often called training error or empirical error, while the error on new samples is called generalization error.Obviously, the goal of machine learning is to get learners with low generalization error.However, in practical applications, the new samples are unknown, so the training error can only be as small as possible.For the classification model, there are many evaluation metrics to determine whether the classification model meets our requirements.These evaluation metrics mainly refer to: Accuracy, Precision, Recall, F1 measure and ROC curve.

Simulation and result analysis
After simulation, the performance indicators of the model on the test set, such as precision, recall, F1 score and accuracy, are shown in Table 1.In terms of ROC curve, it is a curve on a two-dimensional plane, where the X-axis is false positive rate (FPR), and the Y-axis is true positive rate (TPR).The closer the curve is to the (0,1) coordinate, the better the model is.The radial basis kernel performs better than the linear kernel and polynomial kernel, as shown in Figure 4 [6] ..52539187, -0.00191497, 505649561, -2849.57885,3510246, 3588.86792,1.1940304].This set of data is selected from the data in the sharp wear state.The output result of this data is 3.0, which belongs to the third category: sharp wear stage.It is consistent with the result, and the verification result is correct.It is shown in Figure 5.

Figure 5. Making a prediction for randomly selected data
This design compares the SVM algorithm with linear regression algorithm, logistic regression algorithm and AdaBoost algorithm.The SVM using radial basis kernel function has a prediction accuracy of 94.6%, the prediction accuracy of linear regression algorithm is 64.3%, the prediction accuracy of logistic regression algorithm is 66.8%.The prediction accuracy of AdaBoost algorithm is 78.3%.It can be seen that compared with these algorithms, the SVM algorithm using radial basis kernel is the most suitable for the prediction of machine tool wear state.The prediction results of linear regression algorithm, logistic regression algorithm and AdaBoost algorithm are shown in Table 2.By plotting F1 score, precision and recall into histograms, it can be clearly seen that logistic regression, AdaBoost and linear regression are inferior to the SVM model using RBF kernel function in F1 score, precision and accuracy.Therefore, the SVM using RBF kernel function performs best in machine tool prediction.This is shown in Figure 6.

Conclusion
Aiming at the problem that the wear degree of machine tool blade cannot be accurately and objectively distinguished, the SVM model is used to design the prediction method of machine tool wear degree

Figure 3 .
Figure 3.The basic flow The steps of SVM algorithm are as follows [5] : (a) Determine the input and output vectors of the model.According to the characteristics of the sample data and the actual needs, the sample is divided into training set and test set; (b) Create the SVM classification model and determine the parameters of the model; (c) Use the trained classification model to test the data; (d) The results are analyzed and compared with the results of linear regression,logistic regression and AdaBoost algorithm.Linearly separable SVM was used to construct the classification model,and different kernel functions were set for comparison.When using radial basis function, the Gamma value is set to 1, the penalty coefficient of error term is set to 100, and the test set accounts for 20% of the total data set.After obtaining the model, the training set was used to train the model, and the classification of the test set data was verified.

Figure 4 .
Figure 4. ROC curve of each kernel function Select a set of data in the data set, such as [0.52539187, -0.00191497, 505649561, -2849.57885,3510246, 3588.86792,1.1940304].This set of data is selected from the data in the sharp wear state.The output result of this data is 3.0, which belongs to the third category: sharp wear stage.It is consistent with the result, and the verification result is correct.It is shown in Figure5.

Figure 6 .
Figure 6.Metrics for each algorithm The ROC curves of logistic regression and AdaBoost are plotted and compared with the ROC curves of SVM using radial basis kernel function.The superiority of SVM is obvious, as shown in Figure 7.

Figure 7 .
Figure 7. ROC curves for each algorithm

Table 1 .
Model evaluation metrics

Table 2 .
Model evaluation metrics Firstly, the data preprocessing, feature selection and model establishment are carried out to complete the training of the model, and the performance evaluation of the model is completed on the test set.The performance evaluation of the model is completed on the test set.The SVM is compared with logistic regression, AdaBoost and linear regression.The comparison results show that the accuracy rate is 96.2%, the precision rate is 94.6%, the recall rate is 94.5%, and the F1 score is 0.94, which is much higher than other models.The SVM has strong generalization ability, high precision, and good applicability.Lei Qian 2013 Research on Tool Wear Condition Monitoring of Milling with Variable Parameters Based on Support Vector Machine (Tianjin University) [2] Mei-yu Yuan 2018 Fundamentals of Machine Learning-Principle, Algorithm and Practice (Tsinghua University Press) [3] Pei-bin Tian, Bao-jin Wang and Jin-Tao Shen 2021 Research Status and Prospect of Intelligent Monitoring Technology for Tool Wear State (Forestry Machinery and Woodworking Equipment) [4] Juan-juan Zhao and Yan Qiang 2019 Python Machine Learning (China Machine Press) [5] Ming Fan and Hong-jian Fan 2011 Introduction to Data Mining (Posts and Telecommunications Press) [6] Yun-xiang Lv 2021 Big Data Visualization Technology (Posts and Telecommunications Press)