Swimming pool drowning parallel monitoring method and system based on deep learning

By using the posture estimation model and the improved YOLOv11 model for parallel monitoring in swimming pool drowning detection, the problem of insufficient detection efficiency and accuracy in the prior art is solved, and higher reliability and real-time drowning detection are achieved.

CN119851213AInactive Publication Date: 2025-04-18NANJING WUMENG INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510315105.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-04-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing swimming pool drowning detection methods have shortcomings in detection efficiency and accuracy, especially in underwater environments. Traditional computer vision and object detection technologies are limited by factors such as insufficient light and turbid water quality, making it difficult to achieve real-time and accurate drowning detection.

Method used

The deep learning-based parallel monitoring method for swimming pool drowning was used, and parallel monitoring was carried out in combination with the pose estimation model and the improved YOLOv11 model. The pose estimation model uses the HRNet network to obtain the coordinates of the swimmer's key point, and judges drowning through distance vector similarity calculation; the improved YOLOv11 model uses VanillaNet as the backbone network, and adds a HAT module to the front end and RCCA module to the end to improve the target detection performance in fuzzy environments.

Benefits of technology

The accuracy and efficiency of drowning detection are improved, and through the coordinated work of the two models, higher detection reliability and real-time performance are achieved, and the error detection rate is reduced through multiple strategies, which has good scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119851213A_ABST
    Figure CN119851213A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine vision and artificial intelligence, and discloses a swimming pool drowning parallel monitoring method and system based on deep learning, so as to improve the detection precision and efficiency. The method comprises the steps that one path of collected images is transmitted to an image recognition model, and the other path is transmitted to a posture estimation model; summarizing and outputting the image recognition model and the attitude estimation model based on the processing result of the same image; wherein the image recognition model adopts an improved YOLOv11 model, a backbone network of the image recognition model adopts VanilaNet, an HAT module used for improving target detection performance in a fuzzy environment is added to the front end of the backbone network, and an RCCA module is added to the tail end of the backbone network; the posture estimation model adopts an HRNet network to obtain coordinates of all key points of the swimmer, then distance vectors between other key points and neck key points are calculated, and whether drowning occurs or not is judged according to the similarity result of the distance vectors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision and artificial intelligence technology, and in particular to a swimming pool drowning parallel monitoring method and system based on deep learning. Background Art

[0002] With the development of science and technology, the application of computer vision, target detection and artificial intelligence is becoming more and more extensive, especially in the field of security protection, such as fire detection, traffic monitoring, security patrol, etc. In these applications, computer vision and target detection technology can be used to identify and track specific objects, such as people and cars, to achieve monitoring and early warning of abnormal situations. In underwater environments, due to factors such as insufficient light and turbid water, the application of traditional computer vision and target detection technology is limited. However, with the development of deep learning technology, especially the advancement of target detection algorithms, it has become possible to perform target detection in underwater environments.

[0003] Existing solutions are mainly based on computer vision methods, which capture image information through cameras and then use machine learning algorithms to process the output images to achieve the purpose of drowning detection. For example, some researchers designed a swimming pool drowning detection system based on the Mask-RCNN model. They captured image information through cameras and selected a classifier model with multiple iterations, but there was a problem of slow detection efficiency. Other researchers proposed a method for searching for drowning people at sea based on the improved YOLOv3 algorithm. The residual module with a channel attention mechanism was used in the feature extraction network, and the linear transformation method was used to process the clustering algorithm to generate anchor boxes. The improved algorithm has a detection accuracy of 72.17% for human targets at sea, which does not meet the requirements of practical applications. Summary of the invention

[0004] The purpose of the present invention is to disclose a swimming pool drowning parallel monitoring method and system based on deep learning to improve the accuracy and efficiency of detection.

[0005] To achieve the above objectives, the present invention discloses a method for parallel monitoring of swimming pool drowning based on deep learning, which includes: Get real-time acquisition images; The collected images are transmitted to the image recognition model and to the posture estimation model; The processing results of the image recognition model and the posture estimation model based on the same image are aggregated and output; Among them, the posture estimation model adopts the HRNet network to obtain the coordinates of each key point of the swimmer, and then takes the neck key point as the origin to calculate the distance vector between other key points and the origin, and then calculates the similarity between the current distance vector and the drowning distance vector. If the number of consecutive frames whose similarity exceeds the set threshold reaches or exceeds the set quantity indicator, it is judged as drowning; the image recognition model adopts the improved YOLOv11 model, and the backbone network of the improved YOLOv11 model adopts VanillaNet, and a HAT (Hybrid Attention Transformer) module is added to the front end of the backbone network to improve the target detection performance in a fuzzy environment, and an RCCA module is added to the end of the backbone network.

[0006] Preferably, in the improved YOLOv11 model, features are aggregated at different scales through an SPPF module, and the SPPF module generates and fuses multi-scale feature maps by operating on pooling windows of different sizes.

[0007] Preferably, in the improved YOLOv11 model, the HAT module consists of three parts, including shallow feature extraction, deep feature extraction and image reconstruction; for a given low-resolution input, a convolutional layer is first used to extract shallow features, and then a series of residual mixed attention groups and a 3×3 convolutional layer are used to extract deep features, and then a global residual connection is added to fuse the shallow features and the deep features, and finally the high-resolution result is reconstructed through the reconstruction module.

[0008] Preferably, each residual mixed attention group comprises at least two mixed attention blocks, an overlapping cross attention block and a 3×3 convolutional layer with residual connection; wherein the mixed attention block first normalizes the input features, and then processes the features using the window self-attention mechanism and the channel attention mechanism, and the output is the weighted sum of the window self-attention mechanism and the channel attention mechanism, and is added to the input features through the residual connection; the overlapping cross attention block establishes cross connections between windows in the window self-attention.

[0009] Preferably, in VanillaNet, a 4×4×3×C convolutional layer with a stride of 4 is used to map an image with 3 channels to a feature with C channels; in stages 1, 2, and 3, a max pooling layer with a stride of 2 is used to reduce the size and feature mapping, and the number of feature channels increases by 2 times after each stage; average pooling is used in stage 4 without increasing the number of channels; the last layer is a fully connected layer that outputs the classification result; the activation function is applied after each 1×1 convolutional layer, and deep training techniques and superimposed nonlinear activation layers are used to improve training and network nonlinear capabilities.

[0010] Preferably, the deep training technology includes: At the beginning of the training process, one activation function is used to train two convolutional layers. As the number of iterations increases, the activation function is gradually simplified to an identity mapping, and at the end of the training, the two convolutions are merged into one convolution.

[0011] Preferably, in the stacked nonlinear activation layer, the stacked activation function is stacked simultaneously to input the neural network input A single activation function is expressed as , The formula for stacking at the same time is: ; where n represents the number of stacked activation functions, , are the scale and bias of each activation.

[0012] Preferably, during the processing of the RCCA module, the pixel features are looped twice based on the cross path. In the first loop, the cross attention takes the feature map H extracted after convolution as input and outputs the feature map H', where H and H' have the same shape; in the second loop, the cross attention takes the feature map H' as input and outputs the feature map H''.

[0013] Preferably, the improved YOLOv11 model adopts the WIoUv3 loss function, wherein WIoUv3 introduces a dynamic non-monotonic focusing mechanism, adopts a reasonable gradient gain allocation strategy to evaluate the quality of the anchor frame, uses the degree of overlap between the anchor frame and the target frame as a penalty factor, and adds a distance attention mechanism. When the anchor frame and the target frame overlap well, the distance between the center points is focused.

[0014] To achieve the above objectives, the present invention also discloses a swimming pool drowning parallel monitoring system based on deep learning, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0015] The present invention has the following beneficial effects: 1. The posture estimation model and the improved YOLOv11 model are used to monitor drowning situations in the swimming pool in parallel. The synergy between the two models is equivalent to double insurance, which improves the reliability of detection.

[0016] 2. In the improved YOLOv11 model, the location coordinates and category information of the target can be directly regressed without selecting the candidate area, thereby improving the detection speed and meeting the needs of real-time detection; at the same time, by changing the backbone network and introducing the HAT and RCCA modules, the efficiency and accuracy of detection are further improved.

[0017] 3. In the HRNet model, a drowning judgment rule library can be defined based on the characteristics of the drowning body, and the drowning of the person can be judged based on human posture recognition and time. The false detection rate can be further reduced through multiple strategies, and it has good scalability.

[0018] The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 It is a flow chart of a method for parallel monitoring of swimming pool drowning based on deep learning disclosed in an embodiment of the present invention.

[0020] Figure 2 It is a schematic diagram of the architecture of the improved YOLOv11 model disclosed in an embodiment of the present invention.

[0021] Figure 3 It is a schematic diagram of the HAT overall architecture and the RHAG and HAB structures disclosed in the embodiment of the present invention.

[0022] Figure 4 It is a schematic diagram of the structure of the CAB module disclosed in the embodiment of the present invention.

[0023] Figure 5 It is a schematic diagram of overlapping window partitions of OCA disclosed in an embodiment of the present invention.

[0024] Figure 6 It is a schematic diagram of the model architecture of VanillaNet disclosed in an embodiment of the present invention.

[0025] Figure 7 It is a structural diagram of the cross-attention module disclosed in an embodiment of the present invention.

[0026] Figure 8 It is a schematic diagram of parameters involved in the WIoUv3 loss function processing disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The embodiments of the present invention are described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.

[0028] Example 1 This embodiment discloses a parallel monitoring method for swimming pool drowning based on deep learning, such as Figure 1 As shown, including: Step S1, obtaining real-time collected images.

[0029] In this step, multiple cameras may be installed above the swimming pool, and the types of cameras include but are not limited to binocular cameras.

[0030] Step S2: The collected image is transmitted to the image recognition model and to the posture estimation model.

[0031] In this step, the posture estimation model uses the HRNet network to obtain the coordinates of each key point of the swimmer, and then takes the neck key point as the origin to calculate the distance vector between other key points and the origin, and then calculates the similarity between the current distance vector and the drowning distance vector. If the number of consecutive frames whose similarity exceeds the set threshold reaches or exceeds the set quantity index, it is determined to be drowning; the image recognition model uses an improved YOLOv11 model, and the backbone network of the improved YOLOv11 model uses VanillaNet, and a HAT module is added to the front end of the backbone network to improve the target detection performance in a fuzzy environment, and an RCCA module is added to the end of the backbone network.

[0032] Preferably, in the coordinate system in the posture estimation model, the horizontal rightward direction can be selected as the X-axis, and the vertical downward direction can be selected as the Y-axis.

[0033] Step S3: Summarize and output the processing results of the image recognition model and the posture estimation model based on the same image.

[0034] Furthermore, in this embodiment, a specific improved YOLOv11 model architecture is as follows: Figure 2 As shown in the figure, it adopts the HAT method for super-resolution processing, which makes full use of their complementary advantages in global statistical information and strong local fitting capabilities. It also introduces overlapping cross-attention modules to enhance the interaction between adjacent window features, effectively solving problems such as insufficient light and turbid water that may occur in underwater detection. The replaced backbone network VanillaNet achieves this goal by avoiding excessive depth, shortcut operations, and attention mechanisms, resulting in a series of simplified networks that solve inherent complexity problems and are very suitable for resource-limited environments. At the end of the backbone network, the added cyclic cross-attention module RCCA is equipped with two loops. By capturing the feature dependencies on the cross path, it can obtain full-image context information from all pixels to generate new features with dense and rich context information.

[0035] exist Figure 2The output of the improved YOLOv11 model shown in the figure can detect targets of three different scales: large, medium, and small. In the output of each scale, the two tasks focus on different features. The branch consisting of two CBS (i.e., a combination of a Conv convolution layer + BN batch normalization layer + Silu activation function, which is used to extract features and perform nonlinear transformation on feature maps) and a convolution layer is used for target detection, i.e., locating and drawing anchor boxes; the branch consisting of two DSC (depthwise separable convolution) and convolution layers is used for classification to determine whether it is drowning.

[0036] in, Figure 2 The object detection network shown consists of: (1) Input: Image preprocessing is performed during the model training phase, including mosaic data enhancement, adaptive anchor box calculation, and adaptive image scaling.

[0037] (2) Baseline network: It is the network in the classifier, including CBS, C3K2, C2PSA, and SPP / SPPF structures.

[0038] (3) Network neck: Located between the baseline network and the head network, the object detection network inserts the FPN+PAN structure between the baseline network and the final head output layer.

[0039] (4) Output layer: used to complete the output of target detection results, including the DWConv module and the loss function EIoU during training.

[0040] In the final detection frame regression stage, the WIoUv3 loss function can be used to introduce a dynamic non-monotonic focusing mechanism, adopt a reasonable gradient gain allocation strategy to evaluate the quality of the anchor frame, use the overlap between the anchor frame and the target frame as a penalty factor, and add a distance attention mechanism on this basis to dynamically optimize the weights of high-quality and low-quality anchor frames in the loss, so that the model focuses on samples of average quality. In this way, not only the training process is optimized, but also the reasoning efficiency is significantly improved.

[0041] The processing logic of the core functional modules of the YOLOv11 model introduced in this embodiment is detailed as follows: Hybrid Attention Transformer (HAT) In order to solve the problems of insufficient light and turbid water that may occur in underwater detection, this embodiment adopts the HAT hybrid attention Transformer method to solve it. HAT is a super-resolution reconstruction method that combines channel attention and window-based self-attention mechanism. It makes full use of their complementary advantages in global statistical information and strong local fitting capabilities. It also introduces overlapping cross-attention modules to enhance the interaction between adjacent window features. By applying HAT in the YOLOv11 target detection model, the performance of target detection in a fuzzy environment can be effectively improved.

[0042] like Figure 3 As shown in the figure, the overall network consists of three parts, including shallow feature extraction, deep feature extraction and image reconstruction. For a given low-resolution (LR) input, a convolutional layer is first used to extract shallow features. Then, a series of residual mixed attention groups (RHAGs) and a 3×3 convolutional layer are used for deep feature extraction. After that, a global residual connection is added to fuse the shallow features with the deep features, and then the high-resolution results are reconstructed through the reconstruction module. In addition, each RHAG contains multiple mixed attention blocks (HABs), an overlapping cross attention block (OCAB) and a 3×3 convolutional layer with residual connections. For the reconstruction module, a pixel shuffling method is used to upsample the fused features.

[0043] Hybrid Attention Block (HAB): HAB is used to combine different types of attention mechanisms to activate more pixels for better reconstruction. This module consists of two key components: Window-based Self-Attention and Channel Attention.

[0044] In the HAB module, the input features are first normalized and then processed using the window self-attention mechanism. The window self-attention mechanism divides the input features into local windows and calculates self-attention within each window. This can capture the correlation information of the local area. Next, through the channel attention mechanism, global information is introduced to calculate the channel attention weight. The channel attention mechanism can use global information to weight features, thereby activating more pixels.

[0045] The output of the HAB module is the weighted sum of the window self-attention mechanism and the channel attention mechanism, and is added to the input features through a residual connection. This design enables the network to utilize both local and global information, thereby achieving better reconstruction results.

[0046] Overlapping Cross-Attention Block (OCAB): The OCAB module introduces an overlapping cross-attention layer (OCA) to establish cross connections between windows in the window self-attention to enhance the representation ability of the network. The design of this module can better utilize the pixel information inside the window for query, thereby improving the performance of the reconstruction task.

[0047] The HAT process includes shallow feature extraction, deep feature extraction and image reconstruction. First, the low-resolution image is taken as input: ; Use a convolutional layer to extract shallow features: ; Where H and W represent the height and width of the image, and C represent the number of channels of input and intermediate features, The shape is A three-dimensional real tensor of , The shape is The three-dimensional real tensor of C then enters the HAB module in the RHAG module. After passing through the first LN layer, the channel attention module is parallel to the multi-head self-attention module. In order to avoid possible conflicts between the two modules in optimization and visual representation, a small constant η is added to the output of CAB. For a given input feature X, the calculation process of HAB is: ; ; .

[0048] in, and represents the intermediate features, LN represents layer normalization, represents the window-based self-attention module, CAB represents the channel attention module, Y represents the output of HAB, and MLP represents the multi-layer perceptron.

[0049] To calculate the self-attention module, given an input feature of size H×W×C, we first divide it into A local window of size M×M, and then calculate self-attention in each window. For the local window features: ; Calculate the query through linear mapping, key and value are Q, K, V, and then the window-based self-attention is expressed as: ; in, Indicates the query / key dimension, Encodes relative position.

[0050] Next, we calculate the channel attention module. The CAB module consists of two small modules: one is two standard convolutional layers sandwiched by a GELU activation function, and the other is a CA module. Its structure is as follows: Figure 4 shown.

[0051] After the calculation is completed, the OCAB module is used to establish window connections and enhance the network's representation capabilities. OCAB consists of an OCA layer and an MLP layer. The structure of the OCA layer is as follows: Figure 5 As shown, different window sizes can be used to divide the mapping features. , ,Will Divide into Size Non-overlapping windows, , Expand to The size is The overlapping window is calculated as: .in, is a constant used to control the overlap size. The standard window partition can be viewed as a sliding partition, with the kernel size and step size equal to the window size. , and the overlapping window partition can be regarded as a sliding partition with a kernel size of , the step length is , using a size of Zero padding is used to ensure the consistency of overlapping window sizes. The attention matrix is ​​calculated as: .

[0052] Finally, the calculation process of OCAB is: ; ; .

[0053] in, and represents the intermediate features, LN represents layer normalization, OCA represents overlapping cross attention mechanism, Y represents the output of OCAB, and MLP represents multi-layer perceptron.

[0054] Finally, a convolutional layer is used to extract deep features, which are fused with shallow features and reconstructed through two layers of convolution and pixel shuffle to obtain a high-resolution image.

[0055]

VanillaNet backbone network

[0056] Figure 6 Taking 6 layers as an example, the architecture of VanillaNet is shown in detail. For the backbone, a 4×4×3×C convolutional layer with a stride of 4 is used to map an image with 3 channels to a feature with C channels. In stages 1, 2, and 3, a max pooling layer with a stride of 2 is used to reduce the size and feature map, and the number of feature channels increases by 2 after each stage. In stage 4 (i.e., the 1×1 convolutional layer at the end of the middle box in the figure), the number of channels is not increased and average pooling is used. The last layer is a fully connected layer that outputs the classification result.

[0057] The kernel size of each convolutional layer is 1×1, because the goal is to preserve the feature map information while using the minimum computational cost per layer. The activation function is applied after each 1×1 convolutional layer. In order to simplify the training process of the network, batch normalization is also added after each layer.

[0058] Although the architecture of VanillaNet is simple and shallow, its weak nonlinearity limits its performance. Therefore, deep training techniques and stacking nonlinear activation layers are used to improve training and network nonlinear capabilities.

[0059] The main idea of ​​the deep training strategy is to train two convolutional layers with one activation function at the beginning of the training process. As the number of iterations increases, the activation function gradually simplifies to an identity map. At the end of training, the two convolutions can be easily merged into one convolution to reduce the inference time. , the identity mapping can be formulated as: .

[0060] in, is a hyperparameter used to modify the activation function The nonlinearity of the current epoch and the training epoch is represented as e and E respectively. . So at the beginning of training (e=0), , the network has very strong nonlinearity, As the number of training rounds increases linearly, eventually Degenerating into the identity mapping, we get , indicating that there is no activation function between the two convolutional layers, and further merging the two convolutional layers, first convert each batch normalization (BN) layer and its previous convolution into a single convolution. Respectively expressed as Input channels, The weight and bias matrix of the convolution kernel with output channels and kernel size k. The scale, offset, mean and variance in BN are expressed as , the combined weight matrix and bias matrix are: .

[0061] Represents the value in the i-th output channel.

[0062] After combining the convolution with BN, we start combining two 1×1 convolutions. , , represented as input features and output features, the convolution can be formulated as: .

[0063] in, represents the convolution operation, represents matrix multiplication, is a function that converts the input image into a matrix form suitable for convolution operation. The weight matrices of the two convolutional layers are expressed as , , the two convolutions without activation functions are formulated as: .

[0064] Therefore, 1×1 convolutions can be incorporated without increasing the inference speed.

[0065] The stacking activation function uses a simultaneous stacking method to input the neural network input A single activation function is expressed as , At the same time, stacking can be formulated as: ; where n represents the number of stacked activation functions, , is the scale and bias of each activation to avoid simple accumulation. To further enrich the approximation ability of the series, the series-based function is enabled to learn global information by changing its neighboring inputs. Specifically, given an input feature , the activation function formula is: ;in, It can be seen that when n=0, the activation function based on the series Degenerates to a pure activation function , which means that the proposed method can be regarded as a general extension of the existing activation function. The proposed activation function has a much lower computational cost than the convolutional layer. This allows VanillaNet to maintain the performance of the model while reducing the amount of computation and the number of parameters.

[0066]

Recurrent Cross Attention Module (RCCA)

[0067] Typically, the connection between a pixel and its surrounding non-cross paths is still missing. To solve this problem, this embodiment performs a recurrence operation on the cross attention module to form a recurrence cross attention (RCCA) module.

[0068] Preferably, during the processing of the RCCA module, the pixel features are circulated twice based on the cross path. In the first cycle, the cross attention takes the feature map H extracted after convolution as input and outputs the feature map H', where H and H' have the same shape. In the second cycle, the cross attention takes the feature map H' as input and outputs the feature map H''; thereby achieving the acquisition of global context information like the self-attention mechanism, while solving the problem of high computational complexity.

[0069]

WIoUv3 loss calculation

[0070] Then constructed The monotonic focusing coefficient Used to control the attenuation speed of the gradient gain. When , the gradient gain of high-quality anchor boxes is suppressed and the focus on medium-quality anchor boxes is enhanced. Indicates the average of the current batch , considering that during the model training process, Will follow The decrease of decreases leads to a slow convergence speed. The exponential moving average Come to Normalize it and then pass Adjust the attenuation strength to suppress the competition between high-quality and low-quality anchor boxes: ; Will Defined as an outlier to measure the quality of the anchor box, a dynamic non-monotonic focusing mechanism is constructed, and a non-monotonic focus factor r is designed to adjust the gradient gain distribution. Assigning a smaller gradient gain can reduce the harmful gradients generated by low-quality anchor boxes; dynamically optimize the weights of high-quality and low-quality anchor boxes in the loss, so that the model focuses on the average quality samples, and applies it to WIoUv1 to obtain: ; .

[0071] Among them, here is the learning parameter of the dynamic non-monotonic focusing mechanism, is the gradient gain attenuation coefficient, controlling The decay rate of The larger the gradient gain, the The more it increases the faster it decreases. is the outlier threshold, which is used to distinguish between “normal quality” and “low quality” anchor boxes and can control the shape of the gradient gain curve. When , the anchor box is considered to be of low quality, the gradient gain is suppressed, and the To ensure that the model learns a balance between high-quality, medium-quality, and low-quality samples.

[0072]

Drowning detection based on posture recognition algorithm (HRNet)

[0073] Construct the distance vectors between 17 key points and the origin , It represents the distance from key point 2 to the origin, and then the current distance vector is calculated for similarity with the drowning distance vector. If the number of consecutive frames whose similarity exceeds the set threshold reaches or exceeds the set number index, it is determined to be drowning.

[0074] Among them, the drowning distance vector is a standard distance vector used for reference. When there are at least two groups of standard distance vectors, the calculation of the approximation takes the maximum value of the current distance vector and each standard distance vector. The calculation of the approximation can be flexibly set. It is an existing technology well known to those skilled in the art and will not be elaborated on.

[0075] Example 2 Corresponding to the above embodiment, this embodiment discloses a swimming pool drowning parallel monitoring system based on deep learning, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following method when executing the computer program: Acquire real-time captured images, transmit the captured images to the image recognition model and to the posture estimation model; then summarize and output the processing results of the image recognition model and the posture estimation model based on the same image. Among them, the posture estimation model uses the HRNet network to obtain the coordinates of each key point of the swimmer, and then takes the neck key point as the origin to calculate the distance vector between other key points and the origin, and then calculates the similarity between the current distance vector and the drowning distance vector. If the number of consecutive frames with similarity exceeding the set threshold reaches or exceeds the set number index, it is determined to be drowning; the image recognition model uses an improved YOLOv11 model, and the backbone network of the improved YOLOv11 model uses VanillaNet, and a HAT module for improving the target detection performance in a fuzzy environment is added to the front end of the backbone network, and an RCCA module is added to the end of the backbone network.

[0076] Preferably, in the improved YOLOv11 model, features are aggregated at different scales through an SPPF module, and the SPPF module generates and fuses multi-scale feature maps by operating on pooling windows of different sizes.

[0077] Preferably, in the improved YOLOv11 model, the HAT module consists of three parts, including shallow feature extraction, deep feature extraction and image reconstruction; for a given low-resolution input, a convolutional layer is first used to extract shallow features, and then a series of residual mixed attention groups and a 3×3 convolutional layer are used to extract deep features, and then a global residual connection is added to fuse the shallow features and the deep features, and finally the high-resolution result is reconstructed through the reconstruction module.

[0078] Preferably, each residual mixed attention group comprises at least two mixed attention blocks, an overlapping cross attention block and a 3×3 convolutional layer with residual connection; wherein the mixed attention block first normalizes the input features, and then processes the features using the window self-attention mechanism and the channel attention mechanism, and the output is the weighted sum of the window self-attention mechanism and the channel attention mechanism, and is added to the input features through the residual connection; the overlapping cross attention block establishes cross connections between windows in the window self-attention.

[0079] Preferably, in VanillaNet, a 4×4×3×C convolutional layer with a stride of 4 is used to map an image with 3 channels to a feature with C channels; in stages 1, 2, and 3, a max pooling layer with a stride of 2 is used to reduce the size and feature map, and the number of channels is increased by 2; an average pooling layer is followed in stage 4 without increasing the number of channels; the last layer is a fully connected layer that outputs the classification result; an activation function is applied after each 1×1 convolutional layer, and deep training techniques and stacked nonlinear activation layers are used to improve training and network nonlinear capabilities.

[0080] Preferably, the deep training technology includes: At the beginning of the training process, one activation function is used to train two convolutional layers. As the number of iterations increases, the activation function is gradually simplified to an identity mapping, and at the end of the training, the two convolutions are merged into one convolution.

[0081] Preferably, in the stacked nonlinear activation layer, the stacked activation function is stacked simultaneously to input the neural network input A single activation function is expressed as , The formula for stacking at the same time is: ; where n represents the number of stacked activation functions, , are the scale and bias of each activation.

[0082] Preferably, during the processing of the RCCA module, the pixel features are looped twice based on the cross path. In the first loop, the cross attention takes the feature map H extracted after convolution as input and outputs the feature map H', where H and H' have the same shape; in the second loop, the cross attention takes the feature map H' as input and outputs the feature map H''.

[0083] Preferably, the improved YOLOv11 model adopts the WIoUv3 loss function, wherein WIoUv3 introduces a dynamic non-monotonic focusing mechanism, adopts a reasonable gradient gain allocation strategy to evaluate the quality of the anchor frame, uses the degree of overlap between the anchor frame and the target frame as a penalty factor, and adds a distance attention mechanism. When the anchor frame and the target frame overlap well, the distance between the center points is focused.

[0084] In summary, the methods and systems disclosed in the above two embodiments of the present invention respectively have at least the following beneficial effects: 1. The posture estimation model and the improved YOLOv11 model are used to monitor drowning situations in the swimming pool in parallel. The synergy between the two models is equivalent to double insurance, which improves the reliability of detection.

[0085] 2. In the improved YOLOv11 model, the location coordinates and category information of the target can be directly regressed without selecting the candidate area, thereby improving the detection speed and meeting the needs of real-time detection; at the same time, by changing the backbone network and introducing the HAT and RCCA modules, the efficiency and accuracy of detection are further improved.

[0086] 3. In the HRNet model, a drowning judgment rule library can be defined based on the characteristics of the drowning body, and the drowning of the person can be judged based on human posture recognition and time. The false detection rate can be further reduced through multiple strategies, and it has good scalability.

[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A parallel monitoring method for swimming pool drowning based on deep learning, characterized in that: include: Get real-time acquisition images; The collected images are transmitted to the image recognition model and to the posture estimation model; The processing results of the image recognition model and the posture estimation model based on the same image are aggregated and output; Among them, the posture estimation model uses the HRNet network to obtain the coordinates of each key point of the swimmer, and then takes the neck key point as the origin to calculate the distance vector between other key points and the origin, and then calculates the similarity between the current distance vector and the drowning distance vector. If the number of consecutive frames whose similarity exceeds the set threshold reaches or exceeds the set quantity index, it is judged as drowning; the image recognition model uses an improved YOLOv11 model, and the backbone network of the improved YOLOv11 model uses VanillaNet, and a HAT module is added to the front end of the backbone network to improve the target detection performance in a fuzzy environment, and an RCCA module is added to the end of the backbone network, and the WIoUv3 loss function is used to calculate the loss function.

2. The method according to claim 1, characterized in that In the improved YOLOv11 model, features are aggregated at different scales through the SPPF module, which generates and fuses multi-scale feature maps by operating on pooling windows of different sizes.

3. The method according to claim 1, characterized in that In the improved YOLOv11 model, the HAT module consists of three parts, including shallow feature extraction, deep feature extraction and image reconstruction; for a given low-resolution input, a convolutional layer is first used to extract shallow features, and then a series of residual mixed attention groups and a 3×3 convolutional layer are used to extract deep features, and then a global residual connection is added to fuse the shallow features with the deep features, and finally the high-resolution result is reconstructed through the reconstruction module.

4. The method according to claim 3, characterized in that Each residual mixed attention group contains at least two mixed attention blocks, an overlapping cross attention block and a 3×3 convolutional layer with residual connection; wherein the mixed attention block first normalizes the input features, and then processes the features using the window self-attention mechanism and the channel attention mechanism, and the output is the weighted sum of the window self-attention mechanism and the channel attention mechanism, and is added to the input features through the residual connection; the overlapping cross attention block establishes cross connections between windows in the window self-attention.

5. The method according to claim 1, characterized in that In VanillaNet, a 4×4×3×C convolutional layer with a stride of 4 is used to map an image with 3 channels to a feature with C channels; in stages 1, 2, and 3, a max pooling layer with a stride of 2 is used to reduce the size and feature map, and the number of feature channels increases by 2 times after each stage; average pooling is used in stage 4 without increasing the number of channels; the last layer is a fully connected layer that outputs the classification result; The activation function is applied after each 1×1 convolutional layer, and deep training techniques and stacked non-linear activation layers are used to improve training and network non-linear capabilities.

6. The method according to claim 5, characterized in that The deep training technology includes: At the beginning of the training process, one activation function is used to train two convolutional layers. As the number of iterations increases, the activation function is gradually simplified to an identity mapping, and at the end of the training, the two convolutions are merged into one convolution.

7. The method according to claim 6, characterized in that In the stacked nonlinear activation layer, the stacked activation function uses a simultaneous stacking method to input the neural network input A single activation function is expressed as , The formula for stacking at the same time is: ; where n represents the number of stacked activation functions, , are the scale and bias of each activation.

8. The method according to claim 1, characterized in that In the processing of the RCCA module, the pixel features are circulated twice based on the cross path. In the first cycle, the cross attention takes the feature map H extracted after convolution as input and outputs the feature map H', where H and H' have the same shape; and in the second cycle, the cross attention takes the feature map H' as input and outputs the feature map H''.

9. The method according to claim 1, characterized in that: The improved YOLOv11 model adopts the WIoUv3 loss function, wherein WIoUv3 introduces a dynamic non-monotonic focusing mechanism, adopts a reasonable gradient gain allocation strategy to evaluate the quality of the anchor frame, uses the degree of overlap between the anchor frame and the target frame as a penalty factor, and adds a distance attention mechanism. When the anchor frame and the target frame overlap well, the distance between the center points is focused on.

10. A swimming pool drowning parallel monitoring system based on deep learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Drowning detection method and device

    CN113345205A

  • Water surface lifesaving method and system and medium

    CN115158606A

  • Human body drowning detection method and detection system based on ST-GCN

    CN118397700A

Cited By

  • Underwater sonar image small target detection method

    CN120219940A

  • Low-altitude unmanned aerial vehicle detection method based on super-resolution and multi-dimensional attention fusion

    CN120783029A

  • Swimming pool environment drowning risk identification management and control system based on VTN model

    CN120913158A

  • Swimming pool environment drowning risk identification and control system based on vtn model

    CN120913158B