# Deep Learning Stranded Neural Network Model for the Detection of Sensory Triggered Events
## 3 Materials and Methods
### Proposed Stranded-NN Model  
The authors proposed a new NN model for detecting semi-critical or critical machinery errors during operation. The proposed stranded-NN model includes a series of different NN strands (different neural networks of arbitrary depth). Each strand comprises a set of NN layers with layer depth depending on the input and specific rules. The data input of the model is a time series of sensory measurement data. The data output of the model is a set of classes that determine the criticality of the event. Our proposed model was constructed using the tensorflow keras framework [43; 44]. Let us assume an \(m\) number of time-series sensory machinery measurements. Given model input as a 1D array of \((m,1)\), where measurements are from different sensors of a specific machinery location or operation, \(s_{i}\), where \(1<i\leq m\). All measurements are entered as a chronological order stream. The stranded-NN is structured from different neural network sub-models, each capable of accepting a specific data input size of batch size \((m,1)\). The following equation determines each model strand depth of hidden layers \(q\):  
\[q= \begin{cases}2&2\leq m\leq 32\\ int(log_{2}(m))-3&m>32,\end{cases}  \tag{1}\]  
where \(int(x)\) corresponds to taking the integer part of the value \(x\) and \(m\) is the number of sensory batch observations. If the number of intervals collected measurements \(m\leq 32\), then the instantiated NN-strand for this case is a model of two hidden layers \(L|64|16|\) of 64 and 16 perceptrons accordingly. For probing intervals of more than 32 measurements, the strand depth of \(q\) hidden layers is according to Equation (1). The number of neurons \(nn\) per \(i\)th layer is defined as \(nn=2^{n}\) neurons/layer. The sum of trainable parameters \(p\), for each strand, is defined by Equation (2). \[p= \begin{cases}2^{6}+2^{4}&2\leq m\leq 32\\ \sum_{i=1}^{q}2^{q^{\prime}-i}&m>32,\end{cases}  \tag{2}\]  
where \(q\) is the total number of hidden layers calculated by Equation (1), and \(q^{\prime}=int(log_{2}(m))\), signifying the number of perceptrons of the first hidden layer. The input batches of each NN-strand enter its first hidden layer with the maximum number of perceptrons, and as they progress layer by layer, the number of neurons per layer is reduced by a power of two. The minimum number of neurons at the last hidden layer is always \(2^{4}=16\). That means that the maximum number of classes \(C_{max}\) that can be introduced per strand can be no more than 16. For the NN-strand neurons, the ReLU activation function is used, and the soft-max activation function's output layer applies for the detection class selection. The stranded-NN model accepts different time series sensory measurements over time (m) as input. Then, according to the m value, it automatically generates fully-connectedhidden layers of perceptrons. For example, let us assume that a piece of monitoring equipment has a set of \(k=16\) temperature sensors, transmitting data every \(dt=30\) s. In order to perform real-time malfunction detection every \(T_{p}=3\) min, a time series of sensory measurements needs to be created to form a measurement data input batch of \(m=k\cdot\frac{T_{p}}{dt}=96\) measurement values. This batch of measurements needs to be annotated to an operational class. For the input value of \(m=96\), the stranded-NN algorithm generates a model of three hidden layers (\(L_{1}^{64}-L_{2}^{32}-L_{3}^{16}\)), where 64, 32, 16 is the number of perceptrons for each layer. Then, the last layer is connected, collecting \(L_{3}\) for the classification output \(i\) classes layer. For close-to-real-time detection of 10 min intervals, a batch of the total size of \(m=16\cdot 20=320\) measurements data needs to be annotated (classified). For this batch input, the stranded-NN algorithm generates a model of five hidden layers (\(L_{1}^{256}-L_{2}^{128}-L_{3}^{64}-L_{4}^{32}-L_{2}^{16}\)), where 256, 128, 64, 32, 16 is the number of perceptrons per layer accordingly.