## 2 Materials and Methods
### Clustering Analysis  
In the processing of complex structural parts, due to the lack of off-line test to provide the necessary prior knowledge, unsupervised pattern recognition method becomes a necessary option, and clustering algorithm is commonly used in unsupervised pattern recognition algorithm. In this paper, a clustering method CAGS is used to perform data mining from the distribution of cutting force features.  
For a 2D space \(S\), a dataset \(D\) distributed in \(S\) can be defined as  
\[D=\{X_{1},X_{2},\ldots,X_{N}\} \tag{4}\]  
where \(N\) is the number of samples of \(D\), \(X_{i}\) is the \(i\)th sample of \(D\).  
\[X_{i}=\left\langle x_{i}(1),x_{i}(2)\right\rangle \tag{5}\]  
Figure 2: Unsupervised tool wear monitoring framework.  
A scale sequence \(SC_{i}\) is used to divide the \(i\)th dimension of \(S\) into \(R\) parts, which can be written as  
\[SC_{i}=\{sc_{i}(0),sc_{i}(1),\ldots,sc_{i}(R)\} \tag{6}\]  
As the result, the grid space \(G\) is generated.  
\[G=\{C_{1},C_{2},\ldots,C_{M}\} \tag{7}\]  
where \(C_{i}\) is the \(i\)th cell with following attributes in \(G\)  
\[C_{i}=\{location,member,density\} \tag{8}\]  
where _location_ is the cell coordinate in the grid space; _member_ records all samples in the cell; _density_ denotes the number of samples in the cell. The _location_ of \(C_{i}\) can be defined as follows.  
\[location(C_{i})=\langle c_{i1},c_{i2}\rangle \tag{9}\]  
where the subscript \(i\) can be calculated by  
\[i=\sum_{j=1}^{2}\left[\left(c_{ij}-1\right)R^{j-1}\right]+1 \tag{10}\]  
In Formula (6), \(sc_{i}(j-1)\) and \(sc_{i}(j)\) are the left and right boundaries of cells whose \(i\)th coordinate is \(c_{*j}\), where * denotes the subscript of the cells. Thus, each sample of \(D\) can be assigned to a cell by using Equations (5), (6) and (9). The resolution \(R\) in Formula (6) can be determined according to the scale of the input dataset by the following formula  
\[R=Int(\sqrt[4]{N}\cdot f_{R})+1 \tag{11}\]  
where \(Int(x)\) denotes the forward rounding function, \(f_{R}\) is the resolution coefficient.  
To achieve the clustering of \(D\), a traversal process is proposed by using an adjacent cell operator which can be defined as  
\[Aopt=\{\langle-1,1\rangle,\langle-1,0\rangle,\langle-1,1\rangle,\langle 0,-1 \rangle,\langle 0,1\rangle,\langle 1,-1\rangle,\langle 1,0\rangle,\langle 1,1\rangle\} \tag{12}\]  
By using the _Aopt_, the adjacent cells of \(C_{i}\) can be obtained as follows.  
\[location(AC_{i})=location(C_{i})+Aopt \tag{13}\]  
Before clustering, the halo threshold is used to divide the cells into peripheral cells and core cells.  
\[threeH=\frac{\sum_{i=1}^{M}density(C_{i})}{M}f_{H} \tag{14}\]  
where \(f_{H}\) is halo coefficient, \(M\) is the total number of non-null cells. If the _density_ of a cell is higher than \(threeH\), it could be defined as core cell. Otherwise, it is peripheral cells.  
The clustering process is performed through two main stages including a core cell traversal and a peripheral cell traversal. Figure 3 is the flowchart of the main process of CAGS. Different from other density-based clustering methods, CAGS calculates the mean density of each cluster as an interface to find the intrinsic information of the dataset. The mean density of the \(k\)th cluster is defined as  
\[density(k)=\frac{\sum_{i=1}^{N_{k}}density(C_{i})}{N_{k}} \tag{15}\]  
where \(N_{k}\) is the number of cells of the \(k\)th cluster.