## 3 Methods  
### Model Structure  
Inspired by the spatial pyramid pooling model applicable to images of any size, as well as the recent success of densely connected networks in image classification tasks, we propose a new neural network structure, that is, a 3D DenseNet based on spatial pyramid pooling (3D-DenseNet-SPP) that is able to work on an action recognition task. In our model, we use the DenseNet as a major network branch and add the corresponding 3D module to it in order to form the 3D DenseNet. In the 3D DenseNet, the last pooling layer (the former pooling layer of the full connection layer) is replaced by the spatial pyramid pooling layer. In addition, each layer of the SPP represents average pooling. The structure of our model is shown in Figure 4.  
Before introducing our model, we introduce some related concepts: dense connectivity, composite function, and growth rate. Figure 4: The overall architecture of the 3D densely connected convolutional network with spatial pyramid pooling (3D-DenseNet-SPP). There are three dense blocks and two transition layers. Between “Dense Block3” and “Full connected” is the spatial pyramid pooling, while other pooling steps represent the 3D pooling. Figure 3: The overall architecture of DenseNet with three blocks. Figure 2: Dense connection structure with four layers. Dense connectivityDense connectivity is the direct connection from any layer to all subsequent layers. The purpose of dense connection is to improve the information flow between layers so that it has fewer network parameters and a faster running speed. (The layers are interconnected and can be reached directly through each other. There is no need to transition through the middle layer, so the speed will be faster). This structure can be found in Figure 2.  
Normally, suppose \(x_{I}\) is the output of the \(I\) th layer. In the traditional feed-forward networks, the output \(x_{I}\) is computed by:  
\[x_{I}=f_{I}(x_{I-1}), \tag{3}\]  
where \(f\) is a non-linear transformation of the \(I\) th layer. Usually, this way cannot avoid gradient disappearance or explosion, especially in deep neural networks. However, in the structure of dense connections, the \(I\) th layer needs to send the feature maps \(x_{I}\) to all subsequent layers. In turn, layer \(l\) will receive feature maps from all preceding layers as input:  
\[x_{I}=f_{I}\left([x_{0},x_{1},\ldots,x_{I-1}]\right), \tag{4}\]  
where \(\{x_{0},x_{1},\ldots,x_{I-1}\}\) is the concatenation of the feature maps produced in layers 0, 1, \(\ldots\), \(I-1\). \(f\) refers to the composite function. By using dense connections, the DenseNet architecture allows better information and gradient flow during training. In this paper, \(x_{I}\) contains not only spatial information but also time information. Composite functionThe composite function \(f\) consists of three consecutive operations; namely, BN, ReLU, and 3D convolution. To reduce the transfer of internal covariates, the BN layer is added before the ReLU layer of each composite function. The input of the ReLU layer is the output from the BN layer, while the output of the ReLU layer is used as the input of the 3D convolution layer. Growth rateAn important difference between DenseNet and existing network architectures is that DenseNet can have very narrow layers. If each composite function \(f_{I}\) of layer \(I\) in Equation (4) produces \(k\) feature maps, then the \(I\)th layer has \(k*(I-1)+k_{0}\) input feature maps, where \(k_{0}\) is the number of channels in the input image of the video clip. To prevent the network from developing too fast, \(k\) usually takes a smaller value, e.g., \(k=12\), and the hyper-parameter \(k\) is the growth rate. In this model, we can perform a local perception of spatial information and time information through 3D convolution, and quickly acquire spatiotemporal features through a parameter sharing mechanism.