Aiming at the low accuracy of face detection caused by the high similarity between background and face and the small scale of face target, an improved face detection algorithm based on YOLOv3 is proposed. Firstly, the K-means clustering algorithm based on genetic algorithm is used to improve the influence of random initialization in the original algorithm and generate a prediction frame more in line with the target size. Secondly, the lightweight network is used to improve the original feature extraction network and improve the face detection speed. Finally, the frame regression loss is used to replace the YOLOv3 coordinate loss function and the confidence loss function is improved to improve the training convergence speed and result accuracy. The accuracy and speed of the designed face algorithm are improved on Wider Face dataset.