Tool wear inspection and classiﬁcation by Artiﬁcial Neural Network based on vision system and cutting force signal.

The current work focuses on the cutting tool condition monitoring of end milling based on direct and indirect approach in machining AISI H13 alloy steel. Indirect process parameters such as cutting force signals are measured as responses using force sensor. In order to successfully inspect the milling tool life online for direct approaches, an automated machine vision system was used for tool condition monitoring. The image processing algorithms are developed to extract different features of rotating milling tool. A detection and compensation system for tool wear based on machine vision is designed. Feedforward Back-Propagation Neural Network applied for tool wear classiﬁcation developed based on many force features. Ten time-domain features extracted and the sensitive features is determined based on Pearson’s correlation coefﬁcient. I-kaz method which in-tegrates between kurtosis and standard deviation is added as input feature with the ten time-domain features. A strong correlation is established between most of time-domain features and tool wear with high correlation coefﬁcient. ANN model applied for classiﬁcation tool states as normal and abnormal. Experiments with vision system have shown that area of wear at bottom and ﬂank is suitable to inspect in-process. Actual measurements of the tool wear stages are possible to identify the abnormality in cutting using vision system. ANN model showed superior results for tool states classiﬁcation. The mean squared Error (MSE) for classiﬁcation model was less than 6.7E-09 and R equal to 1. The model can be used to construct fault estimation mode for tool wear online classiﬁcation and inspection.


Introduction
Due to the globalization of production bases and increasing demand for accuracy in recent years, machines and applications that can achieve stable accuracy independently from the operator's skill are necessary. Also, increasing demands of process automation for un-manned manufacturing attracted many researchers in the field of online monitoring of machining processes. In view of this, extensive research work is taking place worldwide in the area of online tool condition monitoring system (TCMS) [1][2][3][4]. In the manufacturing industry, which is undergoing globalization, there is a growing demand for the creation of high-added value and the shortening of delivery time, as well as quality stabilization and the improvement of productivity in the global market. In respect to processing equipment, not only are basic machine capabilities such as high speed, high accuracy, high stability and high reproducibility increasingly in demand but so are peripheral applications such as on-machine measurement. For high precision machining, on-machine measurement including tool measurement and workpiece measurement is essential and one of the important factors equal to machine accuracy, because measurement errors directly result in machining error. Recently, small-diameter tools are being applied for advanced milling operations; they are essential for increasing product quality and productivity in man- ufacturing technology. However, these small diameter tools have some limitation such as easy breakage and wear rapidly. Therefore, in-process monitoring and measuring techniques are necessary for tool state during cutting [3]. Tool wear or tool life is one of the basic factors that affecting on machining accuracy and performance of milling process and dry cutting [2]. The tool condition monitoring has an important role in dry machining where cutting tool wear is accelerated with heat generated due to the friction due to interaction between cutting tool and material.
TCM methods are divided into indirect and direct [4]. In direct monitoring methods the tool geometries changes and tool parameters can be captured and inspected by vision and optical approaches, while in indirect methods, tool wear states and conditions achieved by correlating or deducing suitable signals of sensor related to tool state. Direct TCM is more suitable for practical application as it is less complicated setup and suitable for harsh cutting environment. However, the direct methods have advantages of capturing actual geometric changes arising from wear of the tool [5]. Regarding with indirect methods, Vibration, Acoustic Emission, sound, cutting force, and other signals can be used in the indirect TCM. Among the indirect online tool monitoring methods, cutting force is consider one of the significant physical signal, which have closely related correlation with the tool state and progressive tool wear [6]. A significant increasing in the cutting forces refer to progression wear of tool during machining operation. Therefore, cutting force variables are very suitable to be used as a reference for indirect measurement methods and for monitoring of tool wear [4].
Various methods for the interpretation of cutting force signals have been studied in literature reviews. Jemielniak et al. [7] Applied cutting forces average and standard deviations values to diagnose the tool wear in their study. They concluded that there is a significant relationship between standard deviation values and tool wear. Dimla and Lister [6] used static and dynamic cutting force components for analysis in time and frequency domains. In their work, they reported that the most sensitive indicator of cutting condition changes such as depth of cut and feed rate was static force. While the amplitude of the signal is more related to tool wear in the frequency domains. They found increasing monotonically with tool wear and fall sharply prior to the point of entry into the tertiary wear zone.
Malekian et al. [8] used many types of indirect methods to detect the tool condition during micro-milling. They used accelerometers, force, and acoustic emission sensors as monitoring objects to analyze tool conditions. Wang et al. [9] and Shi et al. [10] Developed a monitoring platform that detected cutting force signals to monitor tool wear. Das et al. [11] estimate tool wear by using cutting force average and analyzed using force ratio. The authors described that the increasing of force ratio (Fy/Fx) with the progress of tool wear is apparent. Chungchoo and Saini [12] extracted some features such as skewness and kurtosis of force distribution in the fixed frequency band. They reported that the frequency distribution pattern of cutting force signals is influenced by cutting conditions and tool wear. However, the cutting forces signals have characteristics that can be extracted in both time and frequency domain. The indirect method perhaps is easy to operate in the practical application. However, recently most of indirect on-machine monitoring tool condi- tion methods cannot get the accurate degree of tool wear, because they only depend on signals related to tool wear such as cutting force, acoustic emission, and spindle power, which might cause the measurement results profoundly affected by noise. This noise which comes from the surrounding environment will affect collected signal information.
Direct methods mainly are based on the vision techniques to collect tool wear information. The surface images of the tool, the surface texture of the workpiece, and the shape of the chip are mainly researched in the direct detection of tool conditions. Kim et al. [13] researched the mean values, maximum values, and area of tool wear, which improved the accuracy and efficiency of the detection. Loizou et al. [14] collected worn images in the case of spindle motion to analyze tool wear area. Zhang et al. [15] Used the new tool as the template and the gray level of the new tool image as the threshold. The wear boundary is extracted by comparing each column of pixels in the worn image with the threshold [16]. Bradley [17] compared the workpiece surface texture of the new tools with worn tools to analyze the changes in gray-histogram. The width of maximum wear was represented based on the spatial domain. Mannan et al. [18] Classified the workpiece surface texture in different types of machine tools and different cutting parameters by the method of rapid Hough transform, which applied to flexible manufacture system and tool condition monitoring. Sun et al. [19] researched the algorithm of principal component analysis (PCA) to reconstruct worn image, from which fractal character was extracted to estimate tool life. Although the direct methods are more intelligent and accurate than the contact detection, the offline detection and redundancy algorithm are the main issues to increase the response speed of the system. From literatures, one of the main challenges indirect tool condition monitoring is to merge hardware de-tection systems for the bottom and flank wear need into the same one.
In view of this, a novel configuration of machine vision system for online tool condition monitoring is presented to improve the part quality and for tool feature inspection and wear detection during milling operation. Inspection of tool wear is established by a dedicated milling cutter condition inspection system based on vision system. The system used to inspect small tool diameter 3 mm in this experimental study. The vision system is committed to automating onmachine vision inspection for monitoring the tool condition. This system consists of an image acquisition unit depending on CCD camera and a control calculation unit. It can effectively inspect milling cutter condition from both radial and axial directions. Most of the TCM researchers depends on the offline tool wear measurements by microscopes, Therefore more time and efforts consumed in the offline method consequently increasing operation cost and time for operation. Additionally, the loading and uploading tool and tool holder from machine spindle effect on the accuracy of machining and consequently on the acquired signals. In the current study, the direct and indirect methods were integrated in only online method as shown in Fig. 1.
Cutting force signals in three direction x, y, and z were used to detect the tool wear influence on the force signals. Force signal was used in the current study for tool wear detection based on artificial neural network. Recently, artificial intelligence-based modeling for different machining process has attracted widespread attention from researchers [20]. Artificial neural network (ANN) is the most promising technique in most TCM applications. ANN models can be apply for tool condition, in which monitoring force signal features are used to detect the tool states [21]. Attanasio et al. [22] used surface methodology (RSM) method and the ANN model to tool wear prediction during cutting alloy steel AISI 1045. They reported that the ANN models perform better than RSM in predicting tool wear during the cutting process.
ANN models one of the most supervised machine learning that can be used for both prediction and classification problems. One of the objectives of this work, is to develop a NN model based on milling force signals for tool wear detection by many features. Signal features can extracted from time, frequency, and time-frequency domain. Ten statistical based time-domain features extracted from raw force signals in the current work. To select the most effective signals and features that correlate well with tool wear, correlation analyses was applied. Also, adopting new combinations of signal pre-processing strategies to extract simple and robust time-domain features. The experimental setup for indirect and direct vision system has been shown in the Fig.2 The remainder of this study is structured as follows: in section 2, presents the experimental study and machining and materials used in the current work. Section 3, introduced a summery for vision system design of hardware and software used for online tool wear inspection. Section 4, about results and discussion, and it divided into 3 subsections, 4.1 will show the tool wear results from vision system and describes the tool inspection method. Section 4.2, presents the result of signal pre-processing method, in section 4.3, the results of correlation coefficients between tool wear and features extracted will present and results of ANN model discussed at section 4.4.

Experimental work setup:
The framework of this study as shown in Fig.3. Force signal was applied in the current study for online hardware part, while a new developed vision used for tool wear inspection. Several time-domain features extracted and the most well related features with the tool wear were selected according to correlation coefficients. Several research works which performed in TCM trend, used optical microscope in the offline system [23][24] [25][3] [26]. In our study, we used the new developed vision system to inspect of tool wear in the online system. To verify the feasibility and accuracy of the proposed method, actual cutting test was done by using CNC Vertical machining center (Fanuc 0i-Mate MF, the maximum speed of work shaft of 12,000 rpm, the operating pressure of 5.5 bar, and motor power of 15 kW) was used to conduct the cutting experiments. Cutting experiment was designed to expedite the tool wear progress of the end mill during the experiments, a bit harsher machining conditions were applied.
The cutting parameters were as following: Cutting speed 7200 rpm, axial depth of cut 0.5 mm, feed rate 100 mm/min. The cutting parameters were kept fixed during machining process. Carbide cutting tools end mill of 3 mm in diameter and 50 mm total length with dry cutting is used during slot milling of block surface. The tool overhang distance is kept fixed at 30 mm for all slotting passes. Facing operation was performed before slotting by 20 mm carbide flat end mill to ensure the proper surface flatness and to ensure constant depth of cut for the next operation. Hardened AISI H13 steel was selected as the workpiece material which has excellent properties of high-temperature strength and wear resistance. It has been widely applied in die and mold manufacture which bears impact loading, including forging die, hot extrusion dies and precision forging die. Block of H13 steel, 250 mm in length, 150 mm in width, and 40 mm in height was used in this study.
In this work, the direction of feed was parallel to positive Y axis and it represents the normal cutting force while the tangential force is considered the farce at X direction. The cutting forces were recorded by sampling rate 2 kHz cycles utilizing Kistler piezoelectric dynamometer (type 9257B) mounted on the machine table and Kistler charge amplifier type 5070A was used. DEWE-43 data acquisition card has been selected as the acquiring unit to collect all force signals during cutting with DEWEsoft software version x. Fig.  1 and 2 showed the force system used in the study.
Cutting force signals used in the current work for tool wear investigation with on-line inspection by the new developed vision system. Force signal carry many features based on time domain. Root mean square, signal peaks, kurtosis, standard deviation, and many other time domain features can be used as tool condition indicators. In monitoring the machining operations, a range of sensors has been used to evaluate these indicators, and a close correlation has been identified between sensor outputs and specific indicators. An accurate monitoring system depends on the selection of the most appropriate features from sensor data and calculated characteristics for input to the system [4].
The I-kaz is an acronym of an Integrated kurtosis-based algorithm for Z-filter. This method was applied to the statistical signal analysis to detect and monitor the tool condition in a few studies. Nuawi et al [27] introduced the Ikaz T M method for signals with different amplitudes with fixed frequency and different frequencies with fixed amplitudes. They used I-kaz 3D coefficient during machining process and 3D graphic presentation to automatically detect tool wear. The combination of kurtosis and standard deviation can be expressed by I-kaz method. The mathematical expression of used in the current research of time domain statistical features are showed in table 1

Vision system hardware and software
A new developed optical image type tool measurement system resolves various problems with existing tool measurement devices. The propose vision system in this work, can detect and measure the tool wear at the axial and radial direction. The vision system used in the current work presented at Fig.2. The vision system is fully integrated with NC control unit and can compensate of the tool wear for height and radius tool geometry. It consists of three types of units, these unit are image acquisition, pneumatic, and control calculation units.
The system has fully protected against dust and other particulates, including a vacuum seal and protected from moisture under high pressure. The protection level of the transmission cable is IP67. This level of protection will ensure the transmission stability of the acquired images by the camera to the control calculation unit in the harsh environment. The image processing is performed by an effective and reliable way through the control calculation unit. The vision inspection system based on the Surface of Revolution (SOR) and automatic 3D rotating tool modeling. The on-machine automatic 3D tool modeling system depends on the Surface of Revolution (SOR) method and on a single view reconstruction method. Considering these methods, a vision-based method is proposed [28]. The inspection of cutting tools during the cutting process was performed by subprogram inside NC code. When the tool goes to the optical device unit at the specific position, the inspection tool, run automatically by an inspection algorithm by taking enough number of tool image during rotation.
To extract the tool different features such as tool diameter, tool length, and wear values, the vision system acquire one hundred images during tool rotation between camera and backlight. After images acquiring process, all of images converted into gray scale then the comparing between grey scales for every two consequent images is performed at a few second by data acquisition unit. The control unit has ability to choose the image that has smaller pixel value of a gray scale. The output of the last operation is only one composite image and this image will be compared with the third image. Composing images process was performed by the image synthesis algorithm. The principle of image synthesis algorithm and composing process is shown in Fig.4a while the and steps of the algorithm was shown in Fig.4b.

Fig. 4: Principle of image synthesis algorithm
After converting image from RGB tool color to grey scale, adaptive filtering is used for image filtering from noise which will affect the measurement results. This step is necessary for removing all possible noise that may produce from image acquisition and synthesis step. In order to deal with the target area of the synthetic image, the adaptive threshold method used to binary the synthetic image in the third step. After binarization, canny edge detection operator is used to extracting the tool edge. The Canny edge detection algorithm was used to find the edge by finding the maximum value of the image intensity gradient, which can test the real weak edge. Image smoothing applied inside canny operator by Gaussian filter to remove the noise from acquired composed images. In the last step of image processing, the lowest point of tool profile tracked and it represent as the reference point of tool length marking.
3.2 Principle of measuring axial tool wear and compensating.
The principle of axial tool wear detection with compensation of the proposed system depends mainly on the machine coordinate system as shown in Fig.5. In the figure, the system depends on the main three points O, Q, and P. These points are zero point of the machine coordinate, position point of measurement for vision system, and zero point of workpiece respectively. The upper boundary of the CCD camera sensor will set as the reference plane for measuring tools. The tool wear in axial direction depended on the two image heights of the tool h1 and h1', where h1 is the height of fresh tool in the field of view, and h1' is the height of worn tool in the axial direction. In case of worn tool at axial direction, the h1' will be smaller than h1 and the difference will be negative value. This negative difference can be written automatically at the tool panel register in the wear length offset column for the active tool. Therefore, the axial compensation of this value added to the length offset value automatically by using G43 H02 G-word. The word H02 is refer to the tool number 2 in the machine tool magazine, at the sane time it is the active tool in the NC code of the active part program. More details about the tool length expansion was discussed at reference [29]. The authors used this vision system to detect and compensate the thermal expansion of main spindle with different rotational speeds.  Tool wear can be defined as the change in the tool geometrical shape from its original geometry during metal cutting process by gradual loss of the tool material [5]. During the cutting process, failure can occur in the cutting tool either by gradual wear or by tool breakage. In the most cutting applications, although tool wear is the normal phenomenon, it will cause undesirable results if wear increased with time or cutting length. Also, by increasing tool wear the power consumption increase due to higher friction between the tool and machined metal and it requires more energy for cutting [30]. Thus, it is important to monitor and prevent tool failure during cutting to achieve high product quality and highly efficient production. However, the main methods of tool wear detection are experience and offline measurement. In the offline measurement, the tool and tool holder are loaded and uploaded repeatedly, which reduces work efficiency and produces a large deviation [19] [9]. In this study, the onmachine tool inspection was applied in both axial and radial directions. Tool condition monitored in real-time can effectively reduce the waste of the workpiece and tool life. It is reported that real-time detection can save 30% of the processing cost [31]. In the current study, slotting operation is used to evaluate the vision system in tool wear detection.
The number of slots was 30 and the measurement of tool wear was performed by the optical device by high resolution (CCD) camera after every five slots. The machining time for every five slots was five minutes and cutting length for each slot was 70 mm so the total cutting length for the slot group was 370 mm along the y-direction. From the optical images, flank wear values, of each tool, were obtained by image acquisition of the tool images during fast and accurate online process. The proposed algorithm allows to determine the area of interested to measure the tool wear through NC block which integrated with used NC code. In this study seven distances levels measured were analyzed. The distance levels are the distance from the bottom of the tool to area of wear interest at the peripheral body of the tool. The distance levels were1.0, 0.5, 0.4, 0.3, 0.2, 0.15, and 0.1 mm from the bottom face of the tool as shown the Fig. 6.
After slotting operation, the machine paused during automatic mode to measure the tool wear in process at the position of a vision system on the worktable. The measuring time for the tool at every distance levels was 5 seconds only. The image synthesis process for all H distance level and the portion of wear interested is shown in Fig.7 . In this figure, the wear in axial (bottom) direction expressed as H axial and the radial (flank) wear in the tool diameter expressed by W radial . If the length of the tool decreased due to axial wear the vision system will give the wear values in a neg-ative number with high resolution. Form Fig.7, the radial tool wear not uniform along the peripheral tool length. It is clear that the maximum radial tool wears are, at the distance 0.1mm and this means that, by increasing the tool length the tool wear increases. The measured radial tool wear is related to flank tool wear on the tool flank face, while the axial tool wear is related to the bottom tool wear on the tool face. The tool wear values in the radial direction with the cutting length are showed in Fig.8, while the average absolute tool wear values at the axial direction are presented in Fig.8. From this figure, it is clear that the progression of radial and axial wear versus cutting length. In general, with the increase in the total cutting length, the average axial wear and radial wear of the cutting tool increased gradually. It must be noted that the values of axial tool wear (bottom wear) have a negative sign, as the measuring algorithm gives these values by the negative sign to allow the NC control to compensate it. This wear compensation technique, kept the axial depth to be fixed until the end of cutting operation. Also, this compensation method in axial direction affected on the increasing trend of cutting force in z direction, so investigation on the effect of worn tool on the cutting force will discuss in the next section.
4.2 Milling force feature and signal processing.
The signal processing stages for a given experiment were divided into two phases, the pre-processing and the postprocessing phases, as showed in Fig.9. Filtering and segmentation process were performed in the pre-processing phase. While post-processing consisting of two sub-phases: feature extraction and correlation analysis. In the pre-processing, the measured signals were rendered suitable for the subsequent feature extraction procedure, and the noise was reduced before feature extraction.
Signal pre-processing including signal de-noising and segmentation, was carried out on all force signals (Fx, Fy, and Fz) acquired by the force sensor system during the experimental milling test. The signals were denoised to remove the noise from the signal by the digital filtering method. Fast Fourier Transform (FFT) was performed first, for signals, to convert signal data from the time domain to the frequency domain. Linear filtering with 4th-order low-pass Butterworth filters with a 3 dB cutoff frequency of 100Hz was employed to render the signal free from noise. The filtering process was carried out through data acquisition DEWE-Soft software. Afterward, segmentation was carried out on all the acquired force signals to remove the signal portions not corresponding to the real state of milling tools, such as the signal entry and exit portions. The statistical timedomain features were extracted only from steady signals.
Sensor Signal Features Extraction. Ten general-purpose time domain features were computed from the three cutting forces beside two other features namely I-kaz 2D and I-kaz 3D coefficients in the current study. The time-domain features were (i) mean value, (ii) root mean square (RMS), (iii) peak force, (iv) minimum force (v) standard deviation (STD), (vi) variance, (vii) peak to peak values. (viii) Crest factor (ix) kurtosis, and (x) skewness. The mean force signal is taken to be the average of force signal amplitudes, while RMS is defined as the square root of arithmetic means of the squares of the signal. The root mean square is directly related to the amount of work done by the source that created the signal, and it is always positive value. Variance is the squared deviation of a random variable from its mean. The skewness is the measure of the symmetry of signal data around the mean. The kurtosis feature indicates the data sharpness of the distribution peak. The crest factor is defined as the ratio of maximum absolute value to the signal's RMS value and gives an idea about any impacts that exist in the force signal. The increasing value of the crest factor over time could be due to the presence of wear on the tool [31] [11]. Kurtosis indicates the degree of peakiness of a distribution compared to a normal distribution.
Milling process has three force components Fx, Fy, and Fz. The total number of features extracted from each milling slot was 30 for time-domain features besides I-kaz coefficient for xy(2D) and xyz(3D). The total number of features gathered for all slotting were 960 (32×30). It must be noted that, after features extraction process, the behavior of features for all filtered and raw signals were nearly similar. The filtering process could not provide a high advantage compared with raw force signals. Moreover, it decreased correlation coefficients of the most values of features. In summary, raw signals of Fx, Fy, and Fz can be used for feature extraction instead of filtered signals and filtering process can be ignored to save cost and time. It can be concluded that, it is better to extract tool wear information from raw signals instead of filtered signals. All features extracted and plotted for each signals Fx, Fy, and Fz with each slot pass in Fig.10. Similar feature group was normalized to figure out in the one plot. The observation related to mean and RMS force signals components, indicated that, the mean values of force at y-direction decreased with increasing of cutting passes due to negative sign of this component. While the RMS for the same direction (Fy) increased with increasing of cutting pass as the RMS value is always positive value. Also, the mean and RMS features trend of three force components Fx, Fy, and Fz was different. The trend of Fx mean and RMS features gradually increased with increasing of cutting time. While Fy,RMS suddenly increased at slot#5, then it approximately kept fixed between 0.2 and 0.4 on the normalized force axis until the slot#23, then, it suddenly increased to the end of cutting passes. Force component at z-direction from the first slot to slot#6, is slightly small have value comparing with Fx and Fy. This force component peaked to its maximum value from slot#7 to slot#15. Then it has some of fluctuation until the end of process. Peaks values for all raw force signals have increased gradually with increasing of machining time. The minimum values of force signals was different. The trend of Fy minimum features for x and y direction are similar, it was opposite trend. While minimum Fz curve feature jumped after slot#14 to its doubled value. STD and variance respectively, the behavior of curve features approximately similar, and features of both STD and variance increased gradually with number of cutting passes. It can be observed that, the peak to peak signal features increased with the number of cuts. It can noticed that the features crest factor, kurtosis and skewness had some of fluctuation with increasing of cutting passes. It mean that, there are a weak correlation for these features with the tool wear.
The I-kaz is integrate both of kurtosis and standard deviation features. Although kurtosis feature not correlated with cutting pass as shown in the Fig.10, the I-kaz increased gradually with the number of tool cuts. In addition to, the I-kaz of two dimension (x and y signals) is more accurate than three dimension signals (x, y, and z). The 3D I-kaz had some of outliers at slot# 13, 18 and 21, therefore only 2D I-kaz of raw signals x and y can be used instead of 3D I-kaz feature as ANN input feature beside sensitive time-domain features.
For all the ten time-domain features which were extracted and plotted in Fig.10, The first seven features, which were, mean, RMS, peaks, minimum, standard deviation, signal variance, and peak to peak had a strong correlation with increasing of cutting passes. Most of seven features increased with increasing of machining time, and some of them decreased gradually with increasing cutting passes. The other three features, which were crest factor, kurtosis, and skewness had fluctuating values and had weak correlation with increasing of machining time. To determine which features can be used for tool wear monitoring and to remove the redundant features which have little relevance to tool wear, correlation analyses was performed with the tool wear. Correlation analyses is utilized to describe the linear relation between two variables. Feature selection procedure and correlation analyses discussed in the following section.

Feature selection and correlation analyses:
The purpose of feature extraction is to use these features for tool classification or prediction using machine learning algorithms. The Artificial Neural Network (ANN) was selected in the current study. ANN consider one of the famous supervised machine learning algorithms used in TCM approaches. It provides monitoring models with strong fault tolerance, adaptability, and noise suppression. Numerous studies have applied ANNs to the TCM of machining process and have achieved outstanding results [11][21] [32]. The data set, such as cutting parameters and the extracted features for each slotting pass, can be fed to a machine learning system to diagnose tool wear conditions. However, the large dimensionality of this data set could increase the complexity of the machine learning algorithm. The complexity of any classification or prediction model depends on the number of inputs, determining the time and space complexity and the required number of training samples for the learning algorithm [12]. The only sensitive features should be fed into the learning algorithm to improve the classification model's efficiency for tool wear conditions. To determine which of these features are sensitive to tool wear, the correlation analysis was carried out to correlate between force features and tool wear obtained from the online vision system.
It is essential to reduce the number of features used for tool wear classification due to several reasons [12]. One of these reasons is to reduce the computation and memory needed for training and testing the used learning algorithm. The number and dimensional size of input datasets used for training machine learning classifiers directly affect the complexity of the learning problems, the increasing of size and number of input datasets increases memory and computation. Moreover, when some of the inputs proved to be insensitive to the problem target, the cost, and time of extraction of these inputs can be saved. Also the learning model with smaller input datasets is simpler and more robust due to less variation [12]. In general, it is necessary to determine which feature can be used for tool wear detection. Thus, in this work, correlation coefficients of different extracted features for radial and axial tool wear were adopted to determine which feature strongly correlates with the progressive tool wear. The scope of tool condition monitoring is based on extracting sensitive signal features related to tool condition. Pearson's correlation coefficient (Rcp) was used in this study. The Rcp can be calculated using the following equation: Where x is the signal feature, while y considered tool wear. The Rcp was calculated for all features used in the study for both axial and radial tool wear as shown in the table 2.
The correlation coefficients are classified in ref. [12] to three classes, weak, moderate, and strong. The weak class range from 0 to 0.3 and a moderate class range was from 0.3 to 0.7, while a strong correlation for Rcp larger than 0.7. Based on this classification, the features that can be excluded are bolded in the tables, while the rest of features can be used to wear detection through learning algorithms. After determine the sensitive features at x, y and z direction  Fig.7, were 37.5µm and 14 µm, respectively. After five slots, the values of radial wear nearly doubled, it increased to 73.1µm, while the axial wear increased to 18µm. In the current work, the wear values which occurred from slot#1 to slot#10 considered normal wear, while after ten tool passes the wear considered abnormal. Abnormal tool wear was divided to moderate wear from slot#10 to slot#15, and excessive wear was from slot#15 to the end of cutting operation.

Tool wear classification with a neural network model.
Background ANN was introduced in the past by McCulloch and coworkers in the early 1940 [33]. It considers a mapping technique between both input and output variables based on simulation like biological nervous system of human brain but on the computer science. In some engineering fields which has some of difficulties to derive by mathemat-  ical model, the using of ANNs feature can be very useful. In metal cutting operations, the wear phenomenon at tool tip considered notorious complicated process. This process associated with several cutting parameters and the relation between these parameters and tool wear perhaps non-linear in most cases. Therefore, ANN will be an appropriate technique for TCM modeling. In TCM systems the experimental data collected from cutting process and neural network can trained by these data. An ANN has multilayer architectures consist of nodes and there is massively interconnected processing between these nodes and known as neurons. After the network has been configured, the adjustable network parameters (called weights and biases) need to be tuned, so that the network performance is optimized. This tuning process is referred to as training the network. Each neuron accepts a weighted set of inputs and first forms the sum of the weighted inputs with a bias defined by [32].
Where wi and P are the weights of the input data xi and the number of elements respectively. While b is the bias for the neuron. The knowledge is stored in the neuron as a bias and a set of weights. Then, the neuron responds with an output. To this end, the sum of the weighted inputs with a bias is processed through an activation function, represented by f, and the output that it computes is: Finally, the net input is passed through the transfer function f, which produces the scalar output a. The names given to these three processes are: the weight function, the net input function and the transfer function. Current model is Backpropagation Feed-forward algorithm networks (BPNN), and it consider one of the most network type used for designing the ANN models in many engineering problems. Multilayer Layer Perceptron (MLP) is the most common type of backpropagation feed-forward network. MLP consists of three layers; an input layer, several hidden layers, and an output layer. The neural networks were designed, configured, trained, and tested using a Matlab code on Matlab software. For ANN design, the experimental data which used consist of 30 groups of data, The distribution of these groups was done so as for the training subset to include 18 groups (1, 5, 6, 7, 10, 11, 12, 13, 16, 17, 18, 20, 21, 23, 24, 26, 27 and 30) or 60 % of the data, ,the validation subset to include 5 groups (2, 4, 8, 14, and 29) or 20 % of the data, the training subset to include also 5  groups (3, 9, 15, 19, 25, and 28)  optimized to achieve the best performance of the network after training. A hidden layer with only one neuron is inadequate to establish a non-linear relationship between input and output variables, and multiple neurons are essential for predicting output better. In the current study, the number of neurons in the hidden layer was chosen as relation 2N+1 based on Kolmogorov theory [33], where N is the number of neurons in the input layer. In the input layer, only sensitive features which have a high correlation coefficient were feed into ANN model. The total number of neurons in the input layer is 8 for each force component.
The number of neurons in the hidden layer in case using only one component force features was 17, while was 45 neurons in case using all features of all force components. All input features were normalized as preliminary step before feeding to ANN model. Normalization is consider the process of rescale the features of input and output to make all features in the same range of values. The main advantage of normalization to decreasing the error function and make gradient in right direction to make the prediction value faster. Data normalization method is performed for both inputs and output values as follows: Where the xi is the value of any input features used, xmax is the maximum value of that feature elements in the dataset, and xmin is the minimum value of that feature elements in the dataset. As mentioned before, the tool wear state can be classified into two classes (normal and Abnormal) or three classes (Normal, Moderate, and Excessive wear) as shown in Fig.11 and Fig.13. Three and two tool wear classes can be category related to axial and radial tool wear as presented in table3. The performance of network can be estimated by the error function between ANN model predicted wear class and actual class. The most performance criteria which used in most studies are MSE (mean square error), RMSE (root mean square error), MAE (mean absolute error) and R (correlation coefficient). The MSE, and R formulation which are showed in Eq 5 to Eq 6 were used as performance function.
Where t j is the target of experimental data output, while p j is predicted ANN model outputs.

Conclusion:
In order to successfully inspect the milling tool life online, the paper develops an automated machine vision system for tool condition monitoring. The image processing algorithms are developed according to the characteristics of macro tool milling to extract the progressive tool wear. A detection and compensation system for tool wear based on machine vision was designed. The system includes an image acquisition unit and control calculation unit. Experimental work have shown that, the area of wear at axial (bottom) and radial (flank) direction can inspect in-process and the actual measurements of the tool wear stages and other variables are possible to identify the abnormality in cutting. The system is very accurate for correct and compensate the wear error in the axial direction during milling operation. Milling force signals Correlation coefficient applied to differentiate between sensitive and insensitive features. It was found that the raw force signals contain more valuable information than filtered signals and only raw signals used for analyses in the current work. Seven force time domain features namely mean, RMS, peaks, minimum, variance, standard deviation, and peak to peak were found to have the strong correlation with tool wear, whereas crest factor, skewness, and kurtosis had moderate or weak correlations with tool wear. BPNN was performed for tool wear classification to normal and abnormal tool states. Only a high correlated features from correlation analyses method, used as input nodes for BPNN classification model. Fresh tool to normal wear classified as normal tool state. While moderate and excessive wear classified as abnormal tool state.
The results presented in our study indicate that the accuracy of NN classification model for two tool state is higher than in case of three tool state. The LM algorithm with 22-45-1 architecture was found to have the lowest MSE (1.24E-09) for training data set. While the 8-17-1 architecture (2.8E-09) was found to have the lowest MSE for test data set. The regression coefficient values for both two models were 1, therefor, the accuracy of class prediction is 100%. The high classification accuracy for NN model guarantees it reliability and more robust in online tool wear inspection. Developing and implementation of machine learning model with online vision tool wear inspection system will part of our future effort. One of the requirements in Industry Revolution 4.0 is fully automated any production system. The current study, serve on full automation of machine condition monitoring.
Acknowledgements The authors would like to express their sincere appreciation to Hebei University Scientific Research Program ZD2018222 and Tianjin Science and technology program 18PTZWHZ00130 for supporting this research. Thanks to Shanghai WPT Company for providing all the hardware to support this study.

Ethical Approval
• The authors affirm that this manuscript has submitted only in this journal (The International Journal of Advanced Manufacturing Technology). Also, the authors affirm that, this study is a single study and not split up into several parts.
• The authors affirm that, the submitted work is original and have not been published elsewhere in any form or language (partially or in full), and the results that presented are clearly, honestly, and without any fabrication or falsification.
• The Authors understand and follow the guidelines of Committee on Publication Ethics (COPE) during produce their manuscript.

Consent to Participate
• Not applicable

Consent to Publish
• The Authors understand that the material may be published in The International Journal of Advanced Manufacturing Technology, on Web site or other form of publication. The authors give their full permission for the publication, reproduction, broadcast and other use of figures, charts and other material in all editions of this manuscript in any other publication (including books, journals, online and internet), as well as in any advertising or promotional material for such product or publications. Consequently, the Publisher shall have the exclusive right throughout the world to publish the Contribution in all languages, in whole or in part, including, without limitation.
•The Author guarantees that the Contribution to the Work has not been previously published elsewhere, or that if it has been published in whole or in part, any permission necessary to publish it in the Work has been obtained and provided to The International Journal of Advanced Manufacturing Technology Publishing together with a statement of the original copyright notice.
• The corresponding author declares that any person named as co-author of the contribution is aware of the fact and has agreed to being so named.

Authors Contributions
Xi Zhang: Project administration, idea, experimental resources support, Supervision.
Chaunjun Li : presentation of the published work, experimental resources support, Supervision.

Competing Interests
•The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Availability of data and materials Author statement
• The Authors guarantees that the original data and materials related to this Work is available for the journal and publisher and an editable source file (i.e. word or latex) of our manuscript is available after journal and reviewers decision about publication.