# Combining Keyframes and Image Classification for Violent Behavior Recognition
## 4 Experiments
### Facilitation of Model Learning by Segmented-Original Images  
To explore the effect of segmentation on the distribution of the dataset features, we visualized the dimensionality-reduced segmented dataset and the original dataset. We set up two control groups. The first group contains 10,000 violent pictures and 10,000 non-violent pictures randomly selected from each original dataset. The second set contains 10,000 violent images and 10,000 non-violent images, which are the background-removed images of the first set. We used t-SNE to reduce the dimensionality of these pictures and then visualized them. In the violent behavior dataset, as shown in Figure 8b,d, the two sets of dimensionality-reduction results prove that segmenting the human pose can make the feature space of the dataset more aggregated. We designed six comparative experiments (Table 2) to verify the promotion effect of the segmented-original image pair on the model. We performed experiments on VGG19, GoogleNet, ResNet18, and DesNet121. On ResNet18 and DesNet121, we adopt two methods: let the fully connected layer features of the segmented-original image pair be close to each other (the hyperparameter \(\beta\) is 0.001); directly use the segmented-original image pair for training. Experiments show that both methods are effective. For VGG19 and \begin{table}
\begin{tabular}{c c} \hline \hline \multicolumn{2}{c}{**Hyperparameter**} \\ \hline backbone & xception \\ downsample & 16 or 8 \\ input\_shape & \(224\times 224\) \\ Freeze\_Epoch & 10 \\ Freeze\_lr & \(5.00\times 10^{-4}\) \\ UnFreeze\_Epoch & 80 \\ Unfreeze\_lr & \(5.00\times 10^{-5}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Hyperparameters for Deeplab-V3 plus. Figure 7: The training process of Deeplab-V3 plus. GoogleNet, we adopt the second methods. Figure 9 shows the change in the recognition rate for each group during the training process. The significant difference between the recognition rates of the first and second groups indicates that the model trained on the original image has not learned the essential features, which is mainly due to the interference of background information. The significant difference between the recognition rates of the third and fourth groups indicates that the model trained on the segmented images has not learned the essential features, which is mainly because the model trained on pure data is not robust. Moreover, the recognition rate of the third group is higher than that of the fourth group, indicating that segmented images can reduce the influence of the background on the model. The fifth and sixth groups have the highest recognition rates for both original and segmented images, indicating that the segmented-original pairs promote the model's learning of image features without increasing the model complexity. In summary, the segmented-original image pair aids the model in learning essential features, thereby improving the recognition rate (Table 3). \begin{table}
\begin{tabular}{c c c} \hline \hline
**No.** & **Training Dataset** & **Test Dataset** \\ \hline
1 & Original Image & Original Image \\
2 & Original Image & Segmented Image \\
3 & Segmented Image & Segmented Image \\
4 & Segmented Image & Original Image \\
5 & Segmented + Original Image & Original Image \\
6 & Segmented + Original Image & Segmented Image \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparative experiment grouping. Figure 8: Dimensionality-reduction visualization results for datasets. (**a**) Original nonviolence, (**b**) Segmented nonviolence, (**c**) Original violence, (**d**) Segmented violence. We design an encoder-decoder network to visualize the interaction between the segmented image and the original image (Table 4). The loss consists of three parts (7): the reconstruction loss of the segmented image, the reconstruction loss of the original image, and the distance between the hidden layers of the two images, while \(\beta\) is a hyperparameter.