Implementation and Application of Violence Detection System Based on Multi-head Attention and LSTM
摘要
The extensive expansion of surveillance has enabled the identification of numerous threats in advance. By examining surveillance footage, violent activities can be identified in time to prevent disastrous repercussions. In this paper, a method for detecting violence is proposed. Initially, GoogLeNet is chosen for feature extraction in time and space based on the loss of pre-trained CNN feature extraction results and the running efficiency of each model. Some convolutional layers of GoogLeNet are frozen in accordance with the concept of migration learning to meet the demand for accurate feature extraction on tiny data sets. Multi-head Attention (MHA) was used in order to increase the model’s precision and operating efficiency by focusing on key features. The results are then input into the long short-term memory (LSTM) violence detection model. In addition, an ablation study on the input characteristics was carried out, comparing the outcomes with and without the MHA. It revealed that including the MHA enhanced the outcomes by 7.31%. Finally, the model obtains 100% accuracy on the Daily Violence and Movies Fight datasets and 94.36% accuracy on the RWF-2000 dataset, which is commendable. As can be seen, our model on daily violence and Movies Fight has produced the best results, and it is 4% more accurate than the best method currently available for RWF-2000. To put the model in this paper to use in practice, we also created an Android application (APP). Violence in hospitals is common, but not all hospitals can deal with it promptly. Our APP can detect violent behavior in hospital surveillance videos in real time and promptly alert security officers. The usefulness is excellent.