Aiming at the problem that dangerous operation behaviors in the laboratory is difficult to identify by monitoring the video. An algorithm of dangerous operation behavior detection in multi-task laboratory based on improved YOLOv5 structure is proposed. Firstly, the algorithm enhances, adaptively scales, and adaptively anchors box computing on the input of YOLO network. Then convolution operation is carried out to strengthen the ability of network feature fusion. Finally, the GIoU_Loss function is used at the output to optimize the network parameters and accelerate the convergence of the model. The experimental results show that the algorithm performs well in real-time head localization, head segmentation, and population regression, with significant innovation and superiority. Compared with traditional methods, this algorithm has better accuracy and real-time performance and can more effectively achieve human operation behaviors detection in laboratory application environments.