# Disaster Recognition and Classification Based on Improved ResNet-50 Neural Network
## 2 Materials and Methods
### Model Architecture Design
#### 2.2.1 Construction of the Initial Convolutional Layer  
First, we preprocess the input disaster images and compute the corresponding input tensor, as shown in Equation (1):  
\[X\in\mathbb{R}^{N\times 3\times H\times W} \tag{1}\]  
where \(N\) represents the batch size, which is the number of samples fed into the neural network during each training iteration; \(H\) denotes the image height; and \(W\) represents the image width.  
Once the input tensor is obtained, the image data preprocessing is completed, ensuring that the deep learning network is well-prepared for feature extraction, gradient propagation, and optimization. Next, the \(7\times 7\) convolution operation is applied to the image data, with its mathematical formulation given in Equation (2).  
\[Y=W*X+b \tag{2}\]  
where \(W\) represents the parameters of each convolutional kernel. In this experiment, 64 convolutional kernels of size \(7\times 7\) are used, with each kernel covering all 3 input channels. Therefore, the parameter matrix has the following dimensions: \(W\in\mathbb{R}^{64\times 3\times 7\times 7}\). \(Y\) denotes the output feature map after the convolution operation, with dimensions given by \(W\in\mathbb{R}^{64\times 3\times 7\times 7}\); \(b\) represents the bias term, which has the following dimensions: \(\mathbb{R}^{64}\).  
For the convolutional output feature map mentioned earlier, the remaining parameters, namely, the spatial dimensions, are computed as shown in Equations (3) and (4).  
\[H^{\prime}=\frac{H+2p-k}{s}+1 \tag{3}\]  
\[W^{\prime}=\frac{W+2p-k}{s}+1 \tag{4}\]  
By substituting the parameters, the computed results are as follows:  
\[k=7,s=2,p=3\]  
\[H^{\prime}=\frac{H+2\times 3-7}{2}+1=\frac{H-1}{2}+1\approx\frac{H}{2}\]  
\[W^{\prime}=\frac{W+2\times 3-7}{2}+1=\frac{W-1}{2}+1\approx\frac{W}{2}\]  
From the above calculations, it can be observed that after the \(7\times 7\) convolution, the spatial dimensions of the disaster image feature maps are approximately reduced to half of the original size. Subsequently, we perform independent normalization on each channel of the feature maps to ensure a more stable activation distribution, thereby accelerating the convergence of the network. The normalization formula for each channel of the feature maps output by the \(7\times 7\) convolution is given in Equation (5).  
\[\hat{x_{i}}=\frac{x_{i}-\mu_{B}}{\sqrt{\sigma_{B}^{2}+\epsilon}}\cdot\gamma+\beta \tag{5}\]  
where \(\mu_{B}\) and \(\sigma_{B}^{2}\) represent the mean and variance of each channel within the current batch, respectively; \(\gamma\) and \(\beta\) are learnable parameters.  
After normalizing the feature maps of each channel, they are passed through the ReLU activation function. The primary role of the ReLU function is to enhance the nonlinear representation capability of the ResNet-50 model while suppressing negative activationvalues, thereby improving model sparsity and facilitating more effective feature learning. Following this, a \(3\times 3\) max pooling layer is applied to further reduce the feature map size. The purpose of this operation is to retain the strongest local responses, reduce spatial resolution, and enhance the invariance of local features. Specifically, a \(3\times 3\) pooling kernel with a stride of 2 is used for downsampling, as defined by Equation (6).  
\[y_{ij}=\max_{m,n\in\{0,1,2\}}x_{(2i+m)(2j+n)} \tag{6}\]  
Through calculation, it can be determined that the max pooling layer further reduces the spatial dimensions of the feature maps to half of the convolution output feature maps. Consequently, the final output feature map \(Z\) has the following dimensions: \(Z\in\mathbb{R}^{N\times 64\times\frac{H}{4}\times\frac{W}{4}}\).