# Real-Time Egress Model for Multiplex Buildings under Fire Based on Artificial Neural Network
## 3 Artificial Neural Network (ANN) Model for Estimating Available Safe Egress Time (ASET)  
### ANN Training Algorithm  
The ANN can be used to identify complex nonlinear relationships between input and output variables based on a database. In the ANN model, there exists information-processing units called neurons, and the neurons are connected to different weights indicating the strength of a relationship between the input and output variables. Training refers to a phase in which the weights are continuously adjusted to minimize the error [21; 22; 23; 24]. The ANN model consists of an input layer, hidden layer, and output layer, as shown in Figure 10. In addition, the weight is applied differently for each neuron, and the bias applies to the neurons in the hidden and output layers. In this study, a hyperbolic tangent sigmoid transfer function was used as the activation function for the transfer from the input layer to the output layer, and a pure linear activation function was applied in the output layer [25; 26; 27].  
ANN training was performed for the fire compartment and nonfire compartment, and all the influencing factors essential for the ASET evaluation were set as input variables. In the ANN model for the fire compartment, six input variables were considered: the temperature, time after fire, visibility and concentrations of oxygen (O\({}_{2}\)), carbon dioxide (CO\({}_{2}\)), and carbon monoxide (CO). In the case of the ANN model for the nonfire compartment, the distance from the fire compartment was additionally considered in the input layers. As shown in Figure 11, the ANN model consists of one input layer, seven hidden layers, and one output layer. The ratios of data used in the training, validation, and test of the ANN model in the constructed DB were 70%, 15%, and 15%, respectively, and the data  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Distance from Fire Compartment: 1 m to 15 m**} \\ \hline  & **Distance, m** & **Temperature, °C** & **CO, ppm** & **CO\({}_{2}\), \%** & **Time after Fire** & **O\({}_{2}\), \%** & **Visibility, m** & **Safe Time** \\ Min & 1 & 20.33 & 1.30 & 0.04 & 65 & 20.7 & 6.81 & 10 \\ Max & 15 & 23.47 & 9.34 & 0.06 & 318 & 20.7 & 48.27 & 217 \\ \hline  & \multicolumn{6}{c}{**Distance from Fire Compartment: 16 m to 25 m**} \\ \hline  & **Distance, m** & **Temperature, °C** & **CO, ppm** & **CO\({}_{2}\), \%** & **Time after fire** & **O\({}_{2}\), \%** & **Visibility, m** & **Safe time** \\ Min & 16 & 20.33 & 1.24 & 0.04 & 128 & 20.7 & 5.30 & 7 \\ Max & 25 & 22.71 & 11.95 & 0.07 & 434 & 20.7 & 46.23 & 229 \\ \hline  & \multicolumn{6}{c}{**Distance from Fire Compartment: 26 m to 50 m**} \\ \hline  & **Distance, m** & **Temperature, °C** & **CO, ppm** & **CO\({}_{2}\), \%** & **Time after fire** & **O\({}_{2}\), \%** & **Visibility, m** & **Safe time** \\ Min & 26 & 20.18 & 1.35 & 0.04 & 158 & 20.7 & 6.36 & 9 \\ Max & 50 & 21.70 & 9.94 & 0.06 & 493 & 20.7 & 46.53 & 283 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Range of input and output parameters at the nonfire compartment.  
Figure 10: Structure of an ANN model.  
were randomly selected. The output derived from the ANN algorithm proposed in this study can be represented by the following function:  
\[t_{n}=[1+f_{2}(W_{2}f_{1}(W_{1}(1-|2(p_{n}-1)|)+b_{1})+b_{2})]/2 \tag{3}\]  
where, respectively, \(p_{n}\) and \(t_{n}\) are the normalized input and output values, \(W_{1}\) and \(b_{1}\) represent the weight and bias between the input and hidden layer, \(W_{2}\) and \(b_{2}\) are the weight and bias between the hidden and output layer, and \(f_{1}\) and \(f_{2}\) are the activation function in hidden and output layer.