# 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
\begin{split}\overset{\rightarrow}{i}(t)&=\alpha \left(\overset{\rightarrow}{\mathbf{W}_{i}}\overset{\rightarrow}{\mathbf{x} }(t)+\overset{\rightarrow}{\mathbf{V}_{i}}\overset{\rightarrow}{\mathbf{h} }(t-1)+\overset{\rightarrow}{\mathbf{b}_{i}}\right)\\ \overset{\rightarrow}{f}(t)&=\alpha\left(\overset{ \rightarrow}{\mathbf{W}_{f}}\overset{\rightarrow}{\mathbf{x}}(t)+\overset{ \rightarrow}{\mathbf{V}_{f}}\overset{\rightarrow}{\mathbf{h}}(t-1)+ \overset{\rightarrow}{\mathbf{b}_{f}}\right)\\ \overset{\rightarrow}{o}(t)&=\alpha\left(\overset{ \rightarrow}{\mathbf{W}_{o}}\overset{\rightarrow}{\mathbf{x}}(t)+\overset{ \rightarrow}{\mathbf{V}_{o}}\overset{\rightarrow}{\mathbf{h}}(t-1)+ \overset{\rightarrow}{\mathbf{b}_{o}}\right)\\ \overset{\rightarrow}{c}(t)&=\left[\overset{ \rightarrow}{f}(t)\odot\overset{\rightarrow}{c}(t-1)\right]+\left[\overset{ \rightarrow}{i}(t)\odot\tanh\left(\overset{\rightarrow}{\mathbf{W}_{c}} \overset{\rightarrow}{\mathbf{x}}(t)+\overset{\rightarrow}{\mathbf{V}_{c}} \overset{\rightarrow}{\mathbf{h}}(t-1)+\overset{\rightarrow}{\mathbf{b}_{c }}\right)\right]\\ \overset{\rightarrow}{h}(t)&=\overset{ \rightarrow}{o}(t)\odot\tanh\left(\overset{\rightarrow}{c}(t)\right)\end{split}  \tag{7}\]  
where \(\alpha\) is the activation function which normally is represented by the sigmoid function, the \(\tanh\) is the hyperbolic tangent function, and \(\odot\) is the element-wise product. We can express the formulas for the backward process using the same formula:  
\[ \begin{split}\overset{\leftarrow}{i}(t)&=\alpha \left(\overset{\leftarrow}{\mathbf{W}_{i}}\overset{\leftarrow}{\mathbf{x} }(t)+\overset{\leftarrow}{\mathbf{V}_{i}}\overset{\leftarrow}{\mathbf{h} }(t+1)+\overset{\leftarrow}{\mathbf{b}_{i}}\right)\\ \overset{\leftarrow}{f}(t)&=\alpha\left(\overset{ \leftarrow}{\mathbf{W}_{f}}\overset{\leftarrow}{\mathbf{x}}(t)+\overset{ \leftarrow}{\mathbf{V}_{f}}\overset{\leftarrow}{\mathbf{h}}(t+1)+ \overset{\leftarrow}{\mathbf{b}_{f}}\right)\\ \overset{\leftarrow}{o}(t)&=\alpha\left(\overset{ \leftarrow}{\mathbf{W}_{o}}\overset{\leftarrow}{\mathbf{x}}(t)+\overset{ \leftarrow}{\mathbf{V}_{o}}\overset{\leftarrow}{\mathbf{h}}(t+1)+ \overset{\leftarrow}{\mathbf{b}_{o}}\right)\\ \overset{\leftarrow}{c}(t)&=\left[\overset{ \leftarrow}{f}(t)\odot\overset{\leftarrow}{c}(t+1)\right]+\left[\overset{ \leftarrow}{i}(t)\odot\tanh\left(\overset{\leftarrow}{\mathbf{W}_{c}} \overset{\leftarrow}{\mathbf{x}}(t)+\overset{\leftarrow}{\mathbf{V}_{c}} \overset{\leftarrow}{\mathbf{h}}(t+1)+\overset{\leftarrow}{\mathbf{b}_{c }}\right)\right]\\ \overset{\leftarrow}{h}(t)&=\overset{\leftarrow}{ o}(t)\odot\tanh\left(\overset{\leftarrow}{c}(t)\right)\end{split}  \tag{8}\]  
Then, the complete Bi-LSTM hidden element representation \(h(t)\) is the concatenated vector of the outputs from both forward (Equation (7)) and backward (Equation (8)) processes, such that:  
\[h(t)=\overset{\rightarrow}{h}(t)\odot\overset{\leftarrow}{h}(t) \tag{9}\]  
Here, the two sub-layers compute forward \(\overset{\rightarrow}{h}(t)\) and backward \(\overset{\leftarrow}{h}(t)\) hidden sequences, respectively, which are then combined to generate the output sequence \(\mathbf{y}(t)\) as the concatenation of both input sequences, \(\mathbf{y}(t)=h(t)\mathbf{x}(t)\). Bi-LSTM units are a key element in our DL model because of their ability to classify, process and predict time series with time lags of unknown duration. Relative insensitivity to gap length gives an advantage to Bi-LSTMs over alternative RNNs, hidden Markov models and other sequence learning methods [87].