## 3 Qualitative Tool Condition Monitoring System
### The Base Wear Classification Model  
A CNN is one of the most promising approaches to image processing and pattern recognition [33]. CNN layers are part of the architecture; it is standard practice to use convolution layers at the start of the model to develop feature descriptions of the images. These layers are good at narrowing down the ROI and require less computational memory when compared to conventional models. These are the reasons they have seen a wide range of applications in a variety of areas, from hand gesture recognition [38] to disease recognition in plants [39]. One of the other advantages of the convolution layers is their ability to extract features autonomously. Some of these transformations are shown in Figure 2. In Figure 2b, each row is the output of convolution or max pooling layers. It can be seen in the successive layers. The layer transformation and filtering further define the description of the wear features. This step in image processing techniques is done manually, which is the disadvantage of image processing techniques. Figure 1: Overview of the system architecture. Figure 2: Convolution layer image transformation: (**a**) original image of wear; (**b**) convolution transformation for region of interest (ROI) and feature extraction. Max pooling layer  
\[\text{O}_{\text{i,j}}=\text{max}\left\{\text{A}_{\text{i,j}},\text{A}_{\text{i+ 1,j}},\text{A}_{\text{i+1,j+1}}\right\} \tag{1}\]  
The output of the last max pooling layer is then flattened to a \(1\times n\) vector, which forms the input to the fully connected layers (FCLs) for further processing, where \(n\) is the number of inputs to the neural network. The number of inputs \(n\) also determines the width of the FCLs of the network. FCLs are the basic type of neural network where each input interacts with each output of the previous layer [40], the different layers in the network are modeled as different functions, which are the function of the previous layer. In the proposed base model shown in Figure 3, we have four FCL layers, which can be written as f\({}^{(1)}\), f\({}^{(2)}\), f\({}^{(3)}\), and f\({}^{(4)}\). Using the chain concept we can rewrite these functions as f\(\text{(x_{i})}=\) f\({}^{(4)}\)(f\({}^{(3)}\)(f\({}^{(2)}\)(f\({}^{(1)}\)(x_{n})))) [40], where x\({}_{n}\) is the data from the convolution layers. The objective of the neural network is to best estimate f\(\text{(x_{n};\theta)}\) to function f * (x\({}_{n}\)), where f * (x\({}_{n}\)) is the ideal (real-world relation) function that maps the inputs from the convolution layer to their classes of wear and \(\theta\) is a free parameter adjusted to optimize the best estimation of an ideal function [40]. The architecture in Figure 3 uses a rectified linear unit (ReLU) activation function in the intermediate layers, which is a common practice for CNNs to improve the training speed [39]. The ReLU returns zero for half of its domain and is the input for the other half of the domain that is zero for inactive nodes and is the node output for active nodes, which helps make the gradients of the loss function large and constant [40]. The ReLU is used in all the layers except the output layer in the proposed model shown in Figure 3. The ReLU is summarized in Equation (2), where z is the output of the node. \[\text{ReLU(z)}=\text{max}\{0,\text{z}\} \tag{2}\]  
Figure 3: Base convolution neural network (CNN) architecture for insert wear classification. The softmax activation function was used in the last layer of the base model architecture, which is also common in multiclass classification CNNs [39]. Softmax activation usually used in the output layers of the neural networks gives the probability distribution over n possible values. It ensures that the prediction of z belonging to a class for n different classes is between 0 and 1, and the sum of probabilities is equal to 1 [40]. This is summarized in Equation (3), where z\({}_{\text{P}}\) is the output of the node for the p class.