# An Improved YOLOv5 Algorithm for Drowning Detection in the Indoor Swimming Pool
###### Abstract  
In order to mitigate the risk of irreversible drowning injuries, this study introduces an enhanced YOLOv5 algorithm aimed at improving the efficacy of indoor swimming pool drowning detection and facilitating the timely rescue of endangered individuals. To simulate drowning and swimming positions accurately, four swimmers were deliberately chosen and observed, with monitoring conducted by drones flying above the swimming pool. The study was approved by the ethics committee of our institution, with the registration number 2022024. The images captured by the drones underwent a meticulous evaluation, and only those deemed suitable were selected to construct the self-made dataset, comprising a total of 8572 images. Furthermore, two enhancements were implemented in the YOLOv5 algorithm. Firstly, the inclusion of the ICA module strengthened category classification and the localization of water behavioral postures, which is improved from the coordinated attention module (CA). Secondly, the PAN module was replaced with the bi-directional feature pyramid network (BiFPN). Subsequently, the improved YOLOv5 algorithm underwent training using the self-made dataset. Evaluation of the algorithm's performance revealed a notably improved detection accuracy rate, recall rate, and an impressive mean Average Precision (\(mAP\)) score of 98.1%, 98.0%, and 98.5%, respectively. Our paper introduces the improved YOLOv5 algorithm, surpassing the original YOLOv5 algorithm in terms of recognition accuracy for instances of drowning. YOLOv5; drowning detection; self-made dataset; coordinate attention; drone +
Footnote †: journal:  
by swimming pool drainage systems [6], necessitating constant lifeguard surveillance. But, the visual search task of a lifeguard is difficult. The visual search task for lifeguards becomes challenging with increased numbers of swimmers, causing visual clutter within the supervision zone and delayed reaction times [7]. Swimmers engage in various activities, such as chatting, floating, and deliberate submersion, leading to increased processing and judgment times [8]. Continuous water surface monitoring can induce dizziness in lifeguards, compromising the reliability of their supervision [9]. Several wearable devices have emerged to assess swimmers' behaviors, such as a proposed wearable pulse oximeter designed for swimming pool safety [10]. This device collects real-time data, including pulse oximetry, via sensors to analyze swimmers' current conditions. Researchers have also proposed a wearable self-rescue alarm system as a potential solution. This system monitors children's heart rates, water depth, and immersion time to promptly detect drowning accidents [11]. However, one drawback of wearable devices is their potential impact on the overall swimming experience. Additionally, wearable devices utilize methods like the transmission of acoustic signals, which present inevitable challenges. Swimming pools suffer from severe multipath propagation of underwater acoustic signals, potentially weakening their transmission [12]. Furthermore, the presence of strong noise in a pool can negatively affect the detection and accurate positioning of emergency signals, leading to positioning deviations [12]. Hence, there is a pressing need for the development of an automated, unsupervised drowning detection and identification system. Drowning recognition has recently emerged as a significant area of application in machine learning. Previous research predominantly relied on various cameras, including wall-mounted cameras, overhead cameras, and underwater cameras, for imagery capture within pool environments [13; 14]. [PERSON] et al. [15] introduced a water behavior dataset captured both above and below the water using cameras, comprising a water surface dataset and an underwater dataset for drowning detection. Analysis and experimentation conducted by [PERSON] et al. [15] reveal that the performance of the water surface dataset is superior to that of the underwater dataset.