# Fire Video Recognition Based on Local and Global Adaptive Enhancement
## 4 Proposed LGAE
### LAME Block  
The LAME block is one of the important blocks in the proposed LGAE. An overview of LAME is shown in Figure 2. Let the input tensor of LAME be \(\mathbf{X}\in\mathbb{R}^{T^{\prime}\times H^{\prime}\times W^{\prime}\times C ^{\prime}}\), where \(T^{\prime}\) represents the quantity of sampled frames; \(H^{\prime}\) and \(W^{\prime}\) individually indicate height and width, respectively; and \(C^{\prime}\) denotes the quantity of channels. The process of LAME includes two stages.  
In the first stage of LAME, \(\mathbf{X}\) is fed to the first 3D convolutional layer [37]. Then, GELU is used as the activation function. In this stage, local features are activated, and the shape of the output tensor remains unchanged. The calculation of the first stage of LAME can be formulated as follows:  
\[\mathbf{A}=\text{GELU}(\text{Conv3d}_{1}(\mathbf{X})), \tag{1}\]  
where \(\mathbf{A}\) is the output tensor of the first stage of the LAME block, \(\text{GELU}(\cdot)\) represents the Gaussian Error Linear Units (GELUs) function, and \(\text{Conv3d}_{1}(\cdot)\) is function of the first convolutional layer.  
In the second stage of the LAME block, Tensor \(\mathbf{A}\) is fed into the second, third, and fourth 3D convolutional layers. To guarantee that the input and output have an identical shape, the input and output channels of these convolutional layers are fixed at 768, and the stride of these layers is set to 1. To obtain different perspectives, the kernel sizes of these convolutional layers are fixed at 5, 7, and 1, respectively. To extract multi-scale information, the dilation of \(\text{Conv3d}_{3}\) is set to 3. This process can be calculated as  
\[\mathbf{S}_{\text{L}}=\text{Conv3d}_{4}(\text{Conv3d}_{3}(\text{Conv3d}_{2}( \mathbf{A}))), \tag{2}\]  
where \(\text{Conv3d}_{2}(\cdot)\), \(\text{Conv3d}_{3}(\cdot)\), and \(\text{Conv3d}_{4}(\cdot)\) are the functions of the second, third, and fourth convolutional layers, respectively, and \(\mathbf{A}\) is calculated by Equation (1).  
The output tensor of the first Stage \(\mathbf{A}\) is adaptively enhanced by the tensor \(\mathbf{S}_{\text{L}}\) and the fifth convolutional layer. Finally, a residual connection is utilized to enhance the generalization capacity for this block. Therefore, the mapping function of LAME is as below.  
\[\mathbf{X}^{{}^{\prime}}=\text{LAME}(\mathbf{X})=\mathbf{X}+\text{Conv3d}_{5} (\mathbf{S}_{\text{L}}\otimes\mathbf{A}), \tag{3}\]  
where \(\mathbf{X}^{{}^{\prime}}\in\mathbb{R}^{T^{\prime}\times H^{\prime}\times W^{ \prime}\times C^{\prime}}\) is the output of LAME, \(\otimes\) is the Hadamard product with a broadcast mechanism, and \(\text{Conv3d}_{5}(\cdot)\) represents the function of the fifth convolutional layer. By establishing the adaptive local feature enhancement model, the ability to describe the local information of flames is improved.  
Moreover, the parameters and significance of convolutional layers are shown in Table 3, where \"Out.\" represents the number of output channels, \"Ker.\" denotes the size of the convolving kernel, \"Str.\" is the Stride, \"Pad.\" represents the padding, and \"Dil.\" is the spacing between kernel elements.