Drivers' smoking behavior is one of the causes of traffic accidents. The traditional sensor-based smoking detection methods are expensive. Therefore, the method based on deep learning is used for smoking detection. However, due to the limitation of GPU computing hardware, deep learning detection algorithm is difficult to deploy. To solve this problem, this paper designs an improved YOLO-V4 lightweight target detection algorithm model, namely, SmokeNet, to detect smoking behavior, which not only has high recognition accuracy, but also can meet the conditions of real-time detection on the edge devices. First, we established a smoking data set, according to the characteristics of the dataset, we reconstructed the network structure of yolov4, reduced a large number of convolution layers, and retained only one head detection layer. Then, attention mechanism is introduced to improve the model fitting ability. Finally, we deploy the trained model in Jetson Xavier NX. Experiments show that the detection accuracy of smokenet is slightly lower than that of the original yolov4 model, but the size of the model is only 1/10 of that of yolov4, and the detection speed is increased by 57%.