Abstract:Aiming at the hidden security risks caused by some mobile workers illegally smoking in no-smoking areas of the park, a deep learning method for smoking behavior detection combined with human bone key point detection and improved YOLOv7 cigarette detection was proposed. The method first extracts the coordinate information of the key points of the human body through OpenPose, calculates the ratio of the distance between the hand, nose and neck, and the angle between the hand, elbow and shoulder, and determines whether the smoking posture is met. Then, the improved YOLOv7 algorithm is combined to detect whether there is a cigarette in the image to finally determine whether there is smoking behavior. The improved YOLOv7 algorithm introduces a global attention mechanism module, strengthens the semantic and position information, uses transposed convolution to improve the upsampling method, reduces information loss, and adopts the MPDIOU loss function to enhance the accuracy of the regression results and improve the detection accuracy of small cigarette targets. Through experimental tests, the accuracy of this method reaches 95.45%, which can effectively detect smoking behavior.