# Automatic Crack Classification by Exploiting Statistical Event Descriptors for Deep Learning
## 3 Framework for the Real-Time Classification of Acoustic Emission Data
### Deep Learning and Bidirectional Long-Short Time Memory  
The DL represents a relatively recent branch of machine learning research [34], which attempts to model hierarchical representations behind data and classify or predict patterns by combining multiple features [10; 11; 12; 13]. A DL network is composed of several layers, each representing a function able to apply a transformation from the input to the output. Such layers are stacked together according to the main scope (i.e., classification, prediction, recognition) and are characterized by independent properties and parameters, that affect the way they contribute to the final objective. In addition, other variables of the DL structure (i.e., number of layers, input size and characteristics, number of elements used for the training and validation purposes) are able to impact on its performance, for which we commonly refer to as model-parameters. Here, we propose a DL-based model with the aim to identify the AE among different classes of crack events. We use the Bi-LSTM network which is a promising solution for the problem of time series identification [86]. Considering the theoretical fundamentals of RNNs, in a standard LSTM cell [38], the response (output) to a given input \(x(t)\), at time \(t\), is determined by the interplay of various elements, called gates, which have different behaviors. Among them, the \"forget gate\" \(f(t)\) controls which information should be forgotten from the previous cell hidden state, \(h(t-1)\). The output gate \(y(t)\) highlights which information should be going to the next hidden state \(h(t)\). The flow diagram is shown in Figure 6 where an unfolded structure for a sequence of three consecutive steps (\(t-1\), \(t\), \(t+1\)) is provided. Figure 6: Unfolded Bi-LSTM architecture with three consecutive steps (\(t-1\), \(t\), \(t+1\)). At each time step \(t\), the hidden state \(h(t)\) is updated by a combination of: (1) current data of the input vector at the same time step, \(\mathbf{x}(t)\), (2) the hidden state at the previous time-step \(h(t-1)\), (3) the input gate \(i(t)\), (4) the forget gate \(f(t)\), (5) the output gate o(\(t\)), (6) the weight matrix \(\mathbf{W}\), (7) and a memory cell \(c(t)\). Specifically, \(\mathbf{W}_{i}\), \(\mathbf{W}_{f}\), \(\mathbf{W}_{o}\) and \(\mathbf{W}_{c}\) are the weight matrices mapping the hidden layer input \(h(t)\) to the three gates \(i(t)\), f(\(t\)), o(\(t\)) and the input cell state \(c(t)\), while \(\mathbf{V}_{i}\), \(\mathbf{V}_{f}\), \(\mathbf{V}_{o}\) and \(\mathbf{V}_{c}\) are the weight matrices connecting the previous cell output state \(y(t-1)\) to the three gates and the input cell state. On the other hand, \(\mathbf{b}_{f}\), \(\mathbf{b}_{i}\), \(\mathbf{b}_{o}\), \(\mathbf{b}_{c}\) are the bias vectors of LSTM cell during training, which are regarded as parameters of the input, forget, output gates and cell state \(c(t)\) respectively. This such architecture, the Bi-LSTM is able to process the input sequence in both directions (forward and backward) with two separate hidden layers in order to account for the full input context. The following equations define the corresponding hidden layer function, whereas the \(\rightarrow\) and \(\leftarrow\) denote the forward and backward process, respectively. We can express the forward \(\rightarrow\) direction of the process such as:  
\[