Font Size: a A A

Violence Detection Algorithm Based On Contrastive Learning And Implementation By TensorRT Platform

Posted on:2024-08-16Degree:MasterType:Thesis
Country:ChinaCandidate:Y L ChenFull Text:PDF
GTID:2568307079971419Subject:Electronic information
Abstract/Summary:PDF Full Text Request
Despite the continuous improvement of social civilization,violence still occur frequently,which has a bad impact on society and public safety.Although a large number of surveillance cameras are popular,they can only play the role of recording violence events,but can not remind the staff in real time to deal with violence,interrupt violence in advance,and avoid further harm.The method of watching monitoring screen by security personnel not only requires a large number of labor costs,but also reduces work efficiency due to visual fatigue,and can not produce good detection effect.With the development and application of artificial intelligence(AI),a group of violence detection algorithms based on deep learning have been proposed,which promotes the application of machine instead of human to monitor violence behavior.However,the following problems exist in the actual application deployment.The training of the model requires a large amount of label data,which brings time cost and labor cost.The hardware performance of the edge deployment environment is limited,which poses a challenge to the real-time performance of violence detection.Firstly,in order to ensure the real-time requirements of violence detection,this thesis avoided the use of 3D network model with high complexity and adopted 2D residual network and Temporal Shift Module(TSM),as the basic violence detection model.Since violence occurs only in the human area,attention mechanism was introduced.On the basis of Motion Saliency Map(MSM)attention mechanism,this thesis replaced the euclidene distance calculation of frame difference with a channel encoder and the attention module was changed to a dual channel structure,processing frame data and frame difference data simultaneously.In RWF2000 dataset,the accuracy was improved by 1.85 % compared to the base model without attention,and improved by 0.9 % compared to the MSM.Secondly,aiming at the problem of high labeling cost,this thesis designed a training framework for violence models based on contrastive learning.By using unlabeled data through contrast learning and pseudo-labeling,the detection accuracy of the model is improved under limited labeling dataset.As for the generation of positive samples,two generation methods was designed,one is based on different sampling rates and the other is based on global sampling and local sampling.In view of the existing contrastive framework which either focuses on the comparison of positive and negative samples or just positive samples,this thesis designed a more balanced contrastive framework which enhance the comparison of positive samples on the basis of a lot of comparison between positive and negative samples.Under the 25 % RWF2000 training data and the mixed method of generating positive samples,the accuracy of the designed contrastive framework is 3.2 % higher compared with the basic model without contrastive learning.Finally,aiming at the deployment problem of violence detection application,this thesis designed an edge deployment scheme based on Jetson Xavier NX,optimizes model inference through Tensor RT platform,and implements model deployment using Python and C++ interfaces provided.Compared with Py Torch model,inference delay is lower and smaller memory and video memory resources are required.
Keywords/Search Tags:Violence Detection, Contrastive Learning, Attention Mechanism, TensorRT, Jetson Xavier NX
PDF Full Text Request
Related items