| Smoking can lead to various diseases that harm physical health,and a large number of people die every year worldwide due to smoking.In addition,improper smoking behavior can also cause many safety accidents,such as fires caused by discarded cigarette butts,resulting in economic losses and casualties.Therefore,it is of great significance to achieve rapid and accurate identification of smoking behavior.Compared with traditional manual supervision and smoke alarms,smoking behavior detection based on Deep Learning image analysis has the advantages of a wide monitoring range,low cost,and high efficiency.However,there are some shortcomings in existing smoking gesture detection models:(1)the models are often designed to be very complex to ensure detection accuracy,which leads to a large number of model parameters and computations,making it difficult to deploy the model and slow down its inference speed,and cannot meet the requirements of fast and accurate smoking behavior detection.(2)Lightweight models with fast detection speeds often lack accuracy and cannot accurately recognize smoking behavior.To address the above issues,this paper’s main work is as follows:(1)further lightweight improvements are used based on the lightweight single-object detection algorithm YOLOv7-tiny.Ghost module and Ghost bottleneck structure are introduced into the network structure,and the feature fusion part of the structure is cut,making the whole model more lightweight,to realize the rapid detection of smoking gestures.(2)To ensure the detection accuracy of the lightweight optimized YOLOv7-tiny,the CARAFE upsampling operator and ECA channel attention module are introduced in the network structure,and the K-medoids clustering algorithm and Alpha-Io U loss function are selected for clustering algorithm and loss function.These improvements improve model detection accuracy without affecting model lightweight.The new algorithm is named YOLOv7-tl(YOLOv7-tiny-lite).Experimental results show that compared with YOLOv7-tiny,m AP and other indexes of the improved YOLOv7-tl algorithm are improved.In addition,compared with other algorithms such as YOLOv5 s and YOLOX-tiny,YOLOv7-tl far exceeds five indicators such as m AP,Param,GFLOPs,Size,and FPS.Experimental results demonstrate the advancedness of the YOLOv7-tl algorithm proposed in this paper and YOLOv7-tl achieves a balance between accuracy and speed.In addition,the improved YOLOv7-tl algorithm is applied to Raspberry Pi to realize a smoking gesture detection system.The innovations of this article are as follows:(1)In response to the shortcomings of current smoking gesture detection algorithms,an improved YOLOv7-tl algorithm based on YOLOv7-tiny has been proposed,achieving a balance between accuracy and speed.(2)By combining the improved YOLOv7-tl algorithm model with the edge device Raspberry Pi,a smoking gesture detection system has been constructed with advantages such as high recognition accuracy,fast speed,and low cost and has certain practical significance. |