# Leaking Gas Source Tracking for Multiple Chemical Parks within An Urban City
## 3 A Large-Region Sensor-Based Source Tracking Model Based on a Fully Connected Network  
### Main Structure  
The input of the source tracking model is the concentration data of the 61 sensors distributed in the modeling region. In this section, every part of the model will be described in detail.  
The proposed fully connected network aims to find out the position of the leaking sources after an accident has happened. It is not necessary to treat this as a regression problem because the positions of every potential leaking source are known for sure. Thus, a classification model can handle this problem well. At present, there are two main kinds of classification models in neural networks, the FCN (fully connected network) and CNN (convolutional neural network). CNNs shows a great ability to handle spatial information such as image classification. However, taking 61 sensors' concentration information as 61 points of data distributed irregularly in such a large region (2 km \(\times\) 2 km) makes this concentration image too sparse. The advantage of CNNs being able to extract spatial features is gone. In this paper, an FCN model is trained to learn the relations among the 61 pieces of concentration data and track the leaking source.  
In this paper, the proposed FCN model contains several parts: a fully connected layer, drop out layer, and activation function layer. The structure of the model is shown in Figure 3.  
The input of the 61 sensors' data is fed into a drop out layer [18]. The dropout layer deactivates the gas concentration of a certain sensor with a fixed probability. Dropout is a technique for improving neural networks by reducing overfitting. Implemented in this model, dropout can not only improve the performance of model but naturally simulate the situation of sensor failure. Then, FC layer 1, FC layer 2, FC layer 3, and FC layer 4 are four fully connected layers with 61 \(\times\) 1024 neurons, 1024 \(\times\) 2048 neurons, 2048 \(\times\) 256 neurons, and 256 \(\times\) 79 neurons.  
All the fully connected layers are followed by the activation function exponential linear unit, ELU [19], after comparing with other functions such as ReLu [20], SoftPlus [21], and sigmoid [22]. The expression of ELU with \(0<\alpha\) is as follows:  
\[f(x)=\begin{cases}x&\text{if }x>0\\ \alpha(exp(x)-1)&\text{if }x\leq 0\end{cases} \tag{4}\]  
The ELU hyperparameter \(\alpha\) controls the value to which an ELU saturates for negative net inputs.  
Figure 3: The overall structure of the proposed model with 61 sensors’ gas concentration data as the input and 79-class identification as the output.  
Cross-entropy loss [23], balanced cross-entropy loss, and focal loss [24] were evaluated to choose one as the loss function of our model. They are all widely used in deep learning for multi-class classification. Their expressions are as follows:  
\[H(p,q)=-\sum_{i=1}^{n}p(x_{i})log(q(x_{i})) \tag{5}\]  
The parameter \(p\) represents the target distribution and the parameter \(q\) represents the approximation of the target distribution. In a word, the cross-entropy loss shows the difference of distribution between the outputs and the ground truth. The key of balanced cross-entropy loss is adding weight coefficients for each category separately on top of the classical cross-entropy loss. The focal loss is defined as:  
\[FL(P_{t})=-\alpha_{t}(1-p_{t})^{\gamma}log(p_{t}) \tag{6}\]  
where \(\alpha_{t}\) and \(\gamma\) are both adjustable hyper-parameters. We set \(\alpha_{t}=0.25\) and \(\gamma=2\) as default. \(p_{t}\) is a parameter revealing the quality of a certain category classification. The closer the value of this parameter is to 1, the better the classification result is.  
As for the optimizer, Adam is chosen due to its better performance in convergence compared with the other two methods, SGD, and Adamax.