# Human Activity Classification Using the 3 DCNN Architecture
## 2 Materials and Methods
### Proposed 3 DCNN Architecture  
The 3 DCNN-based methods using 3D convolution layers have become very popular in recent years for extraction of features from input video data [6]. For this reason, the three-dimensional (3D) convolution layer in our proposed 3 DCNN was used. The 3D convolution layer is based on the principle of a sliding 3D convolution window along input data. The 3D convolution window is above the data and identifies several filters (each filter detects a different pattern). These 3D filters in all three directions are moved. The architecture of the proposed 3 DCNN can be seen in Figure 3. This architecture is divided into following layers:  
* 3 DCNN layers, which improve the identification of 3D and moving images. Each layer contains a three-dimensional filter that moves in three directions (\(x,y,z\)). During the 3D convolution, a convolutional map is created, which is needed for data analysis as well as time and volumetric context. * MaxPooling layers for 3D data (MaxPooling3D), which are used to reduce the size of the image data. MaxPooling3D is a mathematical operation for 3D data as well as for spatial or spatiotemporal data. The layers are defined using \(n\times n\times n\) regions as corresponding filters for the max pooling operations. Additionally, a stride is defined, which sets the number of pixels that the filter moves in each step as it slides across the image. * Batch normalization is structure which is used to normalize the previous layer for each batch. Batch normalization transform standard deviation to 1 and mean activation to 0. * A dense layer, which is usually one of the last layers and mainly fully interconnected neurons. * A flatten layer, which is located at the end of the neural network and causes the matrix to be converted to an output vector. The architecture consists mainly of 3D convolution layers. However, it also contains layers that are found in every architecture as flattened and dense and are an integral part. We have already dealt with a 3D convolutional network in previous research [22], which led us to improve the existing network and achieve better results. The architecture in the previous research achieved lower results, which could be due to the unnecessarily large number of layers. Therefore, we have decided to reduce the number of layers in this proposal. As we can see in the results, we confirmed our assumptions and we really got better results. Hyperparameters such as the number of filters and the core size of 3D convolution layers and MaxPooling are bound by mathematical operations, where the output from the layer must not be negative and mus be integer output. However, in previous research [27], we proposed an optimization algorithm for ConvLSTM, which we slightly modified and applied to this network to achieve the best possible results. The architecture of the proposed 3 DCNN implemented in this work consists of six 3D convolutional layers and four MaxPooling3D layers. The number of filters and their size change with each new layer. The input to the neural network are images of size \(32\times 32\times 3\) (width, height, number of channels). The first 3D convolution layer has 64 filters with kernel of size \(3\times 3\times 3\). The input filter size and number of filters were determined by default based on previous research [22]. Behind the first 3D convolution layer, there is a MaxPooling3D layer of size \(2\times 2\times 2\) and stride 2. MaxPooling reduces the size of the data. The second 3D convolution layer contains the same number of filters, 64, and the same size filters \(3\times 3\times 3\) as the first 3D convolution layer. Behind the second 3D convolution layer, there is a MaxPooling3D with the same size \(2\times 2\times 2\) as the previous Maxpooling3D layer. Follows third and fourth 3D convolution layers have 128 filters of size \(3\times 3\times 3\). After the fourth 3D convolution layer, there is a MaxPooling3D of the same size \(2\times 2\times 2\) as the previous MaxPooling3D layers.