## 3 Smart Sensor Monitoring Approach
### Sensor Signal Feature Extraction Based on Autoencoder Architecture  
An autoencoder is an unsupervised machine learning algorithm that uses a neural network to learn efficient codings, also called latent representations, of unlabeled data. Given a set of data, the autoencoder learns a representation (encoding) by training the network to ignore irrelevant data (noise), generally for dimensionality reduction. The encoding is validated and refined by trying to reconstruct (decoding) the original input data from the encoding. A scheme of a generic autoencoder architecture consisting of an encoder and decoder is presented in Figure 5.  
The training process that is employed to learn the weights of the encoder and decoder hidden layers is not different from the usual backpropagation used for standard feedforward neural networks [23]. For autoencoders, a reconstruction loss, L, given by a mean squared error function in which the target is the input vector itself, is used as a loss function, as shown in Equation (3). \[L=\frac{1}{N}\cdot\sum_{i=0}^{N}(X_{i}-X_{i}^{\prime})^{2}=\frac{1}{N}\cdot \sum_{i=0}^{N}(X_{i}-f_{\theta}(X_{i}))^{2} \tag{3}\]  
Figure 4: Scheme of smart sensor monitoring architecture developed in this work. Using the acquisition system described in the introduction and the pre-processing methodology presented in Section 2.2, signals from different sensors are acquired. The raw signals are given in input to an autoencoder neural network that extracts features from the signals. These features are given in input to a memory-based neural network that is used to estimate the tool wear at the end of the current drilled hole. The two software modules are trained, tested, and deployed on an industrial GPU. where N is the batch size, i.e., the number of training samples in one forward pass, X is the original input vector, X' is the autoencoder output vector, and \(f_{\theta}\) is the neural network with weights \(\theta\). For this scope, the autoencoder uses two different parts, namely the encoder **c(X)**, in which the input vector is summarized in a set of features F, and the decoder **d(F)**, in which the features F in the latent space are used to reconstruct the input vector. \[F=c(X)=w_{xf}X+b_{xf} \tag{4}\]  
\[X^{\prime}=d(F)=w_{fx^{\prime}}F+b_{fx^{\prime}} \tag{5}\]  
The weights reported in Equations (4) and (5) are the weights of the network that extract features from the original signal (\(w_{xf}\)) and the weights that allow reconstructing the signal starting from the extracted features (\(w_{fx^{\prime}}\)). The parameters \(b_{xf}\) and \(b_{fx^{\prime}}\) are the biases of the encoder \(c(X)\) and decoder networks \(d(F)\). Autoencoders have become highly utilized since 1991, when [PERSON] [24] used this type of architecture to conduct nonlinear principal component analysis (PCA). [PERSON] et al. [25] compared the ability of autoencoders to perform dimensionality reduction with that of other methods, such as PCA, highlighting the capability of autoencoders to detect repetitive structures, which is a valuable attribute for anomaly detection tasks [26]. The effectiveness of autoencoders in feature extraction is more evident when the input data do not have a Gaussian distribution, since the first- and second-order statistics used in the PCA are not sufficient to describe the data otherwise. Furthermore, authors have used the autoencoder architecture to reduce signal noise [27]. In this research work, an autoencoder architecture was employed to solve a double task: extracting features from different acquired sensor signals and performing signal denoising. The first innovation introduced in this work is the usage of an auto-encoder architecture for the automatic feature extraction method applied to acquired sensor signals since industrial process data are usually nonlinear and, therefore, standard PCAs lose the capability to generalize.