## 3 Smart Sensor Monitoring Approach
### Tool Wear Estimation Based on Recurrent Neural Networks  
Recurrent neural networks (RNN) are a family of machine learning algorithms designed to deal with sequential input data, such as time series [28], text [29], and video [30], that act as memory-based networks. As described by [PERSON] et al. [31], although Markovian chains, which model transition between states in an observed sequence, can be used to solve the same task, there are practical problems related to their implementation, such as the limitation for which each hidden state can depend only on the immediately previous state, and computational problems, since the operations become infeasible when the set of possible states grows. All these problems can be overcome using an RNN, as the latter can  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Signal** & **MSE T1** & **MSE T2**  
capture long-range time dependencies. A simple RNN has three layers: input-sequence, recurrent hidden, and output layer, as presented in Figure 8.  
The activation of the hidden states at timestep t, \(h_{t}\), is computed as a function of the current input \(x_{t}\) and the previous hidden states \(h_{t-1}\). This function is a composition of an element-wise nonlinearity with an affine transformation of both \(x_{t}\) and \(h_{t-1}\), as described in Equation (6):  
\[h_{t}=\Phi(W_{t}x_{t}+U_{t}h_{t-1}+b_{t}) \tag{6}\]  
where \(W_{t}\) is the input-to-hidden weight matrix, \(U_{t}\) is the state-to-state recurrent weight matrix, and \(\Phi\) is usually a logistic sigmoid function (\(\sigma\)) or a hyperbolic tangent function (_tanh_). As usual, the output layer, \(y_{t}\), is an element-wise nonlinear combination of the hidden state, as described by Equation (7). \[y_{t}=\Phi(V_{t}h_{t}+b_{o}) \tag{7}\]  
However, _tanh_ and \(\sigma\) activation functions saturate the neurons very fast and can vanish the gradient [32], and this makes it difficult to train standard RNNs [33]. Therefore, new architectures were studied to solve the problem of long-term sequence inputs, such as long short-term memory (LSTM) [34] and gated recurrent unit (GRU) [35]. GRU was proposed to make each recurrent unit adaptively capture dependencies at different time scales. As shown in Figure 9, a GRU is composed of several hidden paths that modify the behavior of the hidden layer compared to a standard RNN. A GRU cell has gating units that modulate the flow of information inside the unit; from a mathematical perspective, as reported in Equation (8), there is an update gate that decides how much of the past information (from previous time steps) needs to be passed along to the future. This part of the network takes in input the input vector at time step t, \(x_{t}\), and the cell hidden layer output at the time step \(t-1\), \(h_{t-1}\), generating an output at time step t, \(z_{t}\), used in another part of the network to generate the outcome, following Equation (8):  
\[z_{t}=\sigma(W_{z}x_{t}+U_{z}h_{t-1}) \tag{8}\]  
where \(W_{z}\) is the input-to-hidden weight matrix of the update gate, and \(U_{z}\) is the state-to-state recurrent weight matrix of the update gate. Another gate, called the reset gate, is used to decide how much of the past information to forget, as described in Equation (9):  
\[r_{t}=\sigma(W_{r}x_{t}+U_{r}h_{t-1}) \tag{9}\]  
where \(x_{t}\) is the input vector at time step t, \(h_{t-1}\) is the hidden layer output at the time step \(t-1\), \(W_{r}\) is the input-to-hidden weight matrix of the reset gate, and \(U_{r}\) is the state-to-state recurrent weight matrix of the reset gate. Even if the formulas in Equations (8) and 9 are the same, the different usage of these two gates in the output computation allows us to  
Figure 8: A standard RNN architecture. The feedback loop provided by the previous output \(U_{t}\) gives memory capabilities to these architectures. reach different goals, as reported above.