In order to remind people in some scenarios, which need mask protection, we need to realize high precision and efficiency mask wearing detection. In this paper, a mask wearing intelligent detection system was created based on YOLOv5. Specifically, a YOLOv5 model with 8 convolution layers was utilized, and the data set was trained and fine-tuned by collecting and labeling data of masks and none masks. The data set includes more than 5000 images of mask wearing state in real scenes, the majority of which were taken by the author and then reprocessed to increase the model’s capacity of generalization. In order to train and evaluate the model, the data set was divided into training set, verification set and test set, respectively. The results indicated that the system’s accuracy rate and recall rate achieved 0.924, 0.950, respectively. Also, in the test set, the detection speed was between 0.007 and 0.008 seconds. The system can detect mask wearing efficiently and accurately, which has good applicability prospects.