# An Improved YOLOv5 Algorithm for Drowning Detection in the Indoor Swimming Pool
###### Abstract
In the context of real-time water surface image analysis, expedited identification of drowning signs facilitates early detection, potentially saving valuable rescue time, minimizing submersion duration, and decreasing the number of drowning accidents. In practical rescue scenarios, optimal outcomes can be achieved when the duration of submersion remains below six minutes [16; 17]. It is evident that incorporating deep learning techniques enhances the effectiveness and feasibility of drowning detection. While common, the deployment of wall-mounted cameras, overhead cameras, and underwater cameras is not without limitations. Fixed angles associated with these cameras may impose constraints on capturing comprehensive and adaptable visual data. In contrast, the use of drones equipped with aerial perspectives presents a promising solution to overcome these limitations, providing increased flexibility. Concurrently, some existing drowning detection models exhibit low accuracy, rendering them inadequate for practical drowning detection and rescue applications. [PERSON] et al. [18] proposed the practical and efficient use of uncrewed aerial vehicles (UAVs) and online machine learning models to detect simulated drowning victims. However, the potential drawback is that this online machine learning model can be trained with only a limited number of datasets, which is limited by its low precision. [PERSON] et al. [19] advocated for the use of UAVs in sea rescue missions, enhancing the quality and speed of rescue operations while ensuring the safety of lifeguards by keeping them away from perilous sea conditions. An enhanced Mask R-CNN algorithm [20] was introduced for timely drowning person detection within swimming pools, achieving a detection rate of 94.1% with a false detection rate of 5.9%. A novel drowning risk detection method based on YOLOv4 was proposed to establish an effective early-warning system [13], attaining a precision of 80.84% in identifying drowning categories. A video-based drowning detection system [21], rooted in background scene modeling, generated a large number of parameters, resulting in a red alert delay of 8.4 to 12.5 s from the onset of a crisis, wasting valuable rescue time. These examples highlight the potential use of drones instead of wall cameras for drowning detection, yet their classification accuracy in water behaviors remains insufficient, diminishing their value in drowning detection and rescue tasks. There is a need for drowning detection models with high accuracy. This paper proposes an improved YOLOv5 algorithm to improve the effectiveness of drowning detection, achieving a peak accuracy of 98.1%. To assess the improved YOLOv5 algorithm's accuracy, drones were employed to monitor swimming pools and create a self-made dataset. Experiments on self-made datasets demonstrate that the improved YOLOv5 algorithm yields enhanced drowning detection results with higher accuracy compared to the original YOLOv5 algorithm. In summary, the contributions of this paper encompass the following: (1) Proposing an improved coordinate attention (ICA) module and an improved YOLOv5 algorithm to augment drowning detection effectiveness and accuracy. (2) Utilizing a self-made dataset created by drones to evaluate the algorithm's accuracy. (3) Demonstrating via experiments on self-made datasets that the improved YOLOv5 algorithm achieves superior drowning detection results with higher accuracy than the original YOLOv5 algorithm, and the ICA module outperforms the CA module.