# An Improved YOLOv5 Algorithm for Drowning Detection in the Indoor Swimming Pool
## 6 Conclusions  
This article introduces a novel self-made dataset obtained via drone-based data collection specifically designed for drowning detection. The dataset comprises two distinct categories: drowning and non-drowning postures (Figure 3). While previous research primarily relied on fixed camera types such as wall-mounted cameras, overhead cameras, and underwater cameras for capturing imagery within pool areas or interiors [13; 14], fixed cameras inherently suffer from limitations due to their rigid perspective, making them sensitive to variations in distance. This sensitivity leads to challenges such as target deformation and posture changes easily. Our study reveals the exceptional flexibility of drones in tracking swimmers and efficiently collecting surface data from swimming pools. Compared to manual supervision, drone-based aerial surveys prove to be a time-saving approach, providing expedited access to critical swimming posture data more conveniently. The aerial perspective not only facilitates the identification of high-risk drowning behaviors, such as near-vertical body postures or ineffective movements but also enhances drowning detection accuracy, thereby improving the quality and efficacy of rescue efforts. Additionally, the original YOLOv5 inadequately addressed water behavior deformation and posture changes, necessitating the integration of an attention module. The coordinate attention (CA) module effectively enhances the representation of pertinent objects without imposing substantial computational complexity, making it an ideal candidate for integration with conventional networks. Previous studies have successfully employed the CA module to improve detection accuracy and robustness across various tasks. For example, adding the CA module to vehicle detection improved accuracy to almost 95% when used with the BiFPN structure for enhancing feature fusion [31]. Similarly, the CA module with position information accurately detected dense crowds by obtaining the effective width and height of the feature layer image [38]. In sea vessel detection, the CA module was applied to detect important ship features, suppress irrelevant information, increase the model's robustness to scale changes and noise interference, and effectively improve the model's overall performance [39]. However, there was insufficient attention to the nonlinearconcentration of water activity postures. The ICA module combines the CA module with the SiLU activation function. The SiLU activation function with self-stability outperforms the ReLU activation function [30]. Substituting the ReLU activation function in the CA module with the more stable SiLU activation function enhances the processing capacity of important non-linear features and attention to postures. The ICA module not only captures cross-channel information, direction awareness, and location sensitivity information like the CA module but also enhances non-linear sensitivity. This enhancement assists the model in more accurately locating and identifying objects of interest, resulting in improved target recognition accuracy. Incorporating the ICA module to improve the attention and sensitivity of important feature details in swimming postures, as demonstrated in Table 4, increased the model's accuracy by 0.8%. Furthermore, replacing the original PAN structure with the Bi-directional Feature Pyramid Network (BiFPN) structure to enhance feature fusion efficiency resulted in a 1.3% increase in the model's accuracy, as illustrated in Table 3.  
While several existing drowning datasets have utilized traditional camera setups, the accuracy of existing models for drowning detection remains insufficient, limiting their value in applications. In contrast, our improved YOLOv5 model achieved an impressive precision of 98.1%, meeting the stringent criteria for high accuracy required in drowning recognition. This heightened accuracy instills greater confidence in the precise detection of drowning incidents, providing crucial support to rescue operations.