The Y olov5 algorithm is optimized to improve the detection speed of the vision-based fall detection algorithm and the detection accuracy of overlapping targets. The loss function CIOU_Loss is used instead of GIOU_Loss, and the aspect ratio information is added to improve the speed and accuracy of the prediction box regression. The prediction box screening method is improved from the traditional NMS to DIOU_NMS, adding the center point of the boundary, which makes the detection effect of the occluded target better. The improved algorithm was trained and the verification showed that the improved Y olov5 has a detection accuracy of 97.45%, and the fastest detection speed is 30fps. A comparison with the detection results of the existing algorithm shows that the improved algorithm has better detection accuracy and detection speed, which can meet the real-time and accuracy requirements of fall detection.