# A Real-Time Dynamic Gesture Variability Recognition Method Based on Convolutional Neural Networks
## 3 Materials and Methods
### Creating, Training, and Testing the Model Module  
One of the popular approaches to recognizing dynamic gestures is using convolutional neural networks. The number of convolutional layers in a CNN may affect its ability to extract features from tensors. However, too many layers can lead to overtraining, so balancing the number of layers is necessary. The size of the convolution kernel is also crucial for extracting certain features, but too large a size can increase the number of parameters and lead to overfitting. The pooling size also affects the preservation of important information and needs to be adjusted. The number of fully connected layers affects the network's ability to classify gestures, but too many layers can also lead to overtraining. The number of neurons in thoroughly combined layers is also essential for classification and needs to be adjusted for optimal network performance. Considering the above, the CNN architecture was successfully selected, as shown in Figure 4.  
The model architecture shown in Figure 4 is a sequential neural network consisting of convolutional layers, max pooling layers, a flatten layer, and two dense layers. The input to the model is a sequence of data points, and the output is a prediction for the sign language gesture being performed. Figure 4: The proposed model’s detailed architecture. The convolutional layers use filters to extract features from the input sequence, and the max pooling layers reduce the spatial size of the features while retaining the most important information. The flatten layer converts the 2D feature maps to a 1D feature vector, and the dense layers perform classification on the features. The first dense layer has 1024 units and uses a dropout layer to prevent overfitting. The final dense layer has 40 units, which corresponds to the number of sign language gestures being recognized by the model. The total number of parameters in the model is 669,320, all of which are trainable. The categorical cross-entropy loss function measures the distance between the actual and predicted probabilities of classes. For example, in the case of a classification problem with 10 categories, for each data element the model will output a probability vector of length 10, where each piece corresponds to the probability that the component belongs to a certain class. The prediction vector is compared with the actual class labels, represented as a one-ot-encoding vector. The loss function is minimized by optimizing the model parameters. By plotting the training and validation accuracy ('train_accuracy', 'val_accuracy'), the model's performance can be tracked during training to determine whether the model is over-trained or under-trained. If the accuracy of training increases but verification does not increase, this may indicate that the model is being rebuilt. Plotting training and validation losses ('loss', 'val_loss') allows one to track the model's performance during training and determine whether the model is overly or insufficiently adapted. If training losses decrease and validation losses increase, this may indicate that the model is being rebuilt (Figure 5). If both losses are high, this may mean that the model is not sufficiently adapted and it needs to be trained for more epochs or with other parameters. Both metrics are essential for evaluating the performance of a machine learning model. Still, factual accuracy is more often used in multiclass classification tasks, and training accuracy is more often used to assess the performance of a model in the learning process. The model was successfully trained with a 'train_accuracy' of 0.98 on a training sample consisting of a data array of 30,960,000 elements containing 40 dynamic gestures, which consists of 2000 records (each gesture is recorded in 50 instances, which consists of 60 frames), which are characterized by 258 parameters (pose coordinates: 33 x, y, z values and 33 visibility values, total 33 \(\times\) 4 = 132, hand coordinates: 22 x, y, z values for both hands, total 22 \(\times\) 2 \(\times\) 3 = 126).