With the development of science and technology, the hotness of target recognition detection has increased year by year in recent years, and the subject has its wide application value in various aspects such as medical, daily life and military. This design on the subject, based on the popular target detection algorithm in recent years - Yolo algorithm, based on the latest Yolov5 algorithm model, the improvement and optimization of the algorithm, combined with the hot topics of current affairs, real-time monitoring of whether the target is wearing a mask, using the dataset provided by Aliyun Tianchi, to conduct experiments. The experimental results are: with Yolov5s base model as the prototype, after optimization and improvement, the fusion rate of target features is improved on the basis of maintaining the original training speed, which effectively improves the accuracy and precision of target recognition.