Drowning detection method, device and equipment based on improved YOLOv8-pose, medium and product

By improving the YOLOv8-pose model and combining a lightweight network with a hybrid attention mechanism, the problem of low efficiency and accuracy in drowning detection in existing technologies has been solved, achieving efficient and accurate drowning behavior detection.

CN121904690APending Publication Date: 2026-04-21HEBEI UNIVERSITY OF ECONOMICS AND BUSINESS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEBEI UNIVERSITY OF ECONOMICS AND BUSINESS
Filing Date
2025-12-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies have low detection efficiency and accuracy when detecting drowning in densely populated areas, making it difficult to meet the needs of real-time monitoring.

Method used

An improved YOLOv8-pose model is adopted, combined with a lightweight MobileNetV4 module, a deformable keypoint awareness attention module, and an MPDIoU loss function, to detect drowning behavior, thereby improving feature extraction efficiency and detection accuracy.

Benefits of technology

In scenarios with high population density, it significantly improves the efficiency and accuracy of drowning detection, enabling real-time and accurate monitoring of drowning behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904690A_ABST
    Figure CN121904690A_ABST
Patent Text Reader

Abstract

The invention provides a drowning detection method, device and equipment based on improved YOLOv8-pose, a medium and a product, and relates to the technical field of image recognition. The method comprises the steps of determining a real-time monitoring image of a target swimming place based on a monitoring video of the target swimming place; inputting the real-time monitoring image of the target swimming place into the improved YOLOv8-pose model to obtain a drowning behavior detection result of each person in the target swimming place; wherein the improved YOLOv8-pose model comprises an improved MobileNetV4 module, a deformable key point perception attention module and an MPDIoU loss function. According to the invention, drowning behavior detection is carried out on the real-time monitoring image through the improved YOLOv8-pose model, and the detection efficiency and the detection accuracy can be effectively improved when drowning detection is carried out in a scene with a large personnel density.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology, and in particular to a drowning detection method, apparatus, equipment, medium and product based on an improved YOLOv8-pose. Background Technology

[0002] With the increasing popularity of swimming and the proliferation of swimming venues, drowning incidents are frequent, seriously threatening people's lives. Traditional drowning detection relies on lifeguards' manual observation, which has drawbacks such as limited field of vision and delayed reaction, making it difficult to comprehensively monitor the safety of swimming pools in real time. Therefore, researchers have turned to exploring drowning detection algorithms based on computer vision. However, with the surge in swimmer density in summer, how to quickly monitor and assess swimmers' conditions and ensure safety has become an urgent problem to be solved.

[0003] To address the need for drowning detection, existing technologies are mainly divided into two categories: one is computer vision-based solutions, which use target detection models to locate the position of people in the water and track their movement trajectories, or combine convolutional neural networks with human posture estimation to analyze drowning characteristics such as limb stiffness and irregular waving; the other is detection methods based on wearable devices and sensors, which use relevant devices to collect data to identify drowning behavior.

[0004] However, manual detection has obvious limitations. Sensor technology is susceptible to environmental interference, while deep learning algorithms have problems such as large computational load and high storage resource requirements. At the same time, they are difficult to deal with people occlusion and complex spatiotemporal feature capture. Therefore, existing technologies have low detection efficiency and low detection accuracy when performing drowning detection in scenes with high population density. Summary of the Invention

[0005] This invention provides a drowning behavior detection method, apparatus, device, and storage medium based on an improved YOLOv8-pose, to solve the problems of low detection efficiency and low detection accuracy in existing technologies when performing drowning detection in scenarios with high population density.

[0006] In a first aspect, embodiments of the present invention provide a drowning behavior detection method based on an improved YOLOv8-pose, comprising: Based on the surveillance video of the target swimming venue, determine the real-time surveillance image of the target swimming venue; The real-time monitoring images of the target swimming venue are input into the improved YOLOv8-pose model to obtain the drowning behavior detection results of each person in the target swimming venue. The improved YOLOv8-pose model includes an improved MobileNetV4 module, a deformable keypoint awareness attention module, and an MPDIoU loss function.

[0007] Secondly, embodiments of the present invention provide a drowning behavior detection device based on an improved YOLOv8-pose, comprising: The determination module is used to determine the real-time monitoring image of the target swimming venue based on the monitoring video of the target swimming venue; The detection module is used to input real-time monitoring images of the target swimming venue into the improved YOLOv8-pose model to obtain the drowning behavior detection results of each person in the target swimming venue. The improved YOLOv8-pose model includes an improved MobileNetV4 module, a deformable keypoint awareness attention module, and an MPDIoU loss function.

[0008] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect or any possible implementation thereof.

[0009] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect or any possible implementation thereof.

[0010] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect or any possible implementation thereof.

[0011] In this embodiment of the invention, real-time monitoring images of the target swimming venue are obtained through surveillance video. An improved YOLOv8-pose model and the real-time monitoring images are then used to detect drowning behavior, yielding drowning behavior detection results for each individual. Since the improved YOLOv8-pose model includes an improved MobileNetV4 module, using a lightweight MobileNetV4 module for feature extraction reduces the number of parameters and computational load, improving detection speed and enabling real-time detection. Furthermore, the deformable keypoint perception attention module in the improved YOLOv8-pose model combines deformable convolution and HAM hybrid attention mechanisms, strengthening feature constraint capabilities and addressing the feature saliency degradation caused by water reflection and crowd occlusion. Simultaneously, the MPDIoU loss function in the YOLOv8-pose model better handles rotation and distortion, further improving detection accuracy. Therefore, using the improved YOLOv8-pose model to detect drowning behavior in real-time monitoring images effectively improves detection efficiency and accuracy in scenarios with high population density. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating the implementation of the drowning behavior detection method based on the improved YOLOv8-pose provided in this embodiment of the invention. Figure 2 This is a network structure diagram of the improved YOLOv8-pose model for the drowning behavior detection method provided in this embodiment of the invention. Figure 3 This is a flowchart illustrating the implementation of step S120 of the drowning behavior detection method based on the improved YOLOv8-pose provided in this embodiment of the invention. Figure 4 This is a schematic diagram of the general inverted bottleneck block of MobileNetV4 based on the improved YOLOv8-pose drowning behavior detection method provided in the embodiments of the present invention; Figure 5 This is a schematic diagram of the deformable key point perception attention module of the drowning behavior detection method based on the improved YOLOv8-pose provided in the embodiments of the present invention; Figure 6 This is a network structure diagram of the hybrid attention mechanism in the drowning behavior detection method based on the improved YOLOv8-pose provided in the embodiments of the present invention; Figure 7 This is a channel attention network structure diagram of the drowning behavior detection method based on the improved YOLOv8-pose provided in the embodiments of the present invention; Figure 8 This is a spatial attention network structure diagram of the drowning behavior detection method based on the improved YOLOv8-pose provided in the embodiments of the present invention; Figure 9 This is a schematic diagram of the structure of the drowning behavior detection device based on the improved YOLOv8-pose provided in an embodiment of the present invention; Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0013] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0014] See Figure 1 The document illustrates a flowchart of the implementation of the drowning behavior detection method based on the improved YOLOv8-pose provided in an embodiment of the present invention, which is described in detail below: Step S110: Based on the surveillance video of the target swimming venue, determine the real-time surveillance image of the target swimming venue.

[0015] In some embodiments, the target swimming venue is a swimming pool or other swimming venue that needs to be monitored. These venues are equipped with monitoring facilities, and the monitoring video of the target swimming venue is collected by these monitoring facilities. The real-time monitoring image is extracted from the monitoring video.

[0016] In one possible implementation, step 110 is specifically processed as follows: extract the frame image at the current moment from the surveillance video of the target swimming venue, and determine the frame image at the current moment as the real-time surveillance image of the target swimming venue.

[0017] In some embodiments, since there may be multiple frame images within a unit of time, it is necessary to detect the image after extracting the frame image at the current time and determine the frame image with good image quality as the real-time monitoring image of the target swimming venue.

[0018] Step S120: Input the real-time monitoring image of the target swimming venue into the improved YOLOv8-pose model to obtain the drowning behavior detection results of each person in the target swimming venue; wherein, the improved YOLOv8-pose model includes an improved MobileNetV4 module, a deformable key point perception attention module and an MPDIoU loss function.

[0019] In some embodiments, the improved YOLOv8-pose model includes a backbone network, a neck network, a head network, and a detection network; the improved MobileNetV4 module is located in the backbone network; the deformable keypoint-aware attention module is located in the neck network; and the MPDIoU loss function is located in the detection network.

[0020] It should be noted that the model diagram of the improved YOLOv8-pose model is as follows: Figure 2 As shown, see Figure 2 , Figure 2 The Backbone network is the backbone network of the improved YOLOv8-pose model, the Neck network is the neck network of the improved YOLOv8-pose model, the Head network is the head network of the improved YOLOv8-pose model, and the Prediction network is the detection network of the improved YOLOv8-pose model.

[0021] See Figure 3 The specific processing method of the above step S120 includes steps S1201-S1204, and the specific content is as follows: Step S1201: Input the real-time monitoring image of the target swimming venue into the backbone network, and extract features through the improved MobileNetV4 module to obtain a multi-scale feature map.

[0022] In some embodiments, the improved MobileNetV4 module includes at least one general inverted bottleneck block, at least one Mobile MQA attention block, and a neural architecture search block; the neural architecture search block is used to determine the number of layers of the general inverted bottleneck block and the MobileMQA attention block.

[0023] It should be noted that real-time performance is crucial in drowning behavior detection. Therefore, to address the issues of large model parameters and slow detection speed, the lightweight MobileNetV4 network is used as the backbone of the Yolov8-pose model to improve detection speed. MobileNetV4 is a convolutional neural network (CNN) architecture proposed by Google for mobile and embedded devices. It achieves a balance between efficiency and accuracy by introducing a general inverted bottleneck block, Mobile MQA attention blocks, optimized neural architecture search, and a novel distillation technique.

[0024] In one possible implementation, step 1201 is specifically processed as follows: local feature extraction and channel transformation are performed on the real-time monitoring image through at least one general inverted bottleneck block to obtain a lightweight feature map; context information is captured on the lightweight feature map through at least one Mobile MQA attention block to obtain a multi-scale feature map.

[0025] In some embodiments, a schematic diagram of a general-purpose inverted bottleneck block is shown below. Figure 4 As shown, see Figure 4 The general inverted bottleneck block introduces two optional depthwise convolution (DW) operations within the inverted bottleneck block. The first optional DW occurs before the expansion layer, performing an initial depthwise convolution operation on the input feature map. The second optional DW occurs between the expansion and projection layers, further performing depthwise convolution operations on the feature map. The use of both convolution operations depends on the results of the neural architecture search. Depthwise separable convolution divides conventional convolution into two steps: first, depthwise convolution, performing convolution independently on each input channel; and second, pointwise convolution, merging the results of the depthwise convolution through 1x1 convolutions. Combining depthwise and pointwise convolutions reduces computational cost. Furthermore, the kernel size of the first convolutional layer in MobileNetv4 can be changed to 3x3, reducing the number of parameters and preserving detail.

[0026] It should be noted that, based on the reconstruction of the Yolov8-pose model feature extraction network using MobileNetV4, a lightweight first convolutional feature preservation module was designed. This module uses a 3×3 convolutional kernel followed by a batch normalization layer to accelerate training and improve model stability, employing the Hardswish activation function. The lightweight first convolutional feature preservation module replaces the first convolutional layer of MobileNetV4 (the traditional 7x7 convolutional kernel). While reducing the number of parameters, it preserves fine-grained features of human pose. Human pose detection needs to focus on subtle features such as joints (wrists, ankles) and limb angles. Compared to the original module, the lightweight first convolutional feature preservation module reduces the loss of details caused by downsampling, ensuring the integrity of features for subsequent drowning actions (such as limb stiffness), directly contributing to the accuracy of pose judgment.

[0027] Step S1202: Input the multi-scale feature map into the neck network, and perform feature fusion through multiple deformable key point perception attention modules to obtain the fused feature map.

[0028] In some embodiments, Figure 5 A schematic diagram of the deformable keypoint-aware attention module, see [link / reference]. Figure 5 It can be seen that the deformable keypoint perception attention module includes a deformable convolutional branch, a channel attention branch, a spatial attention branch, and an adaptive feature fusion unit. Because the improved Yolov8-pose model uses the lightweight MobileNetv4 network, it is difficult to achieve a good trade-off between performance and model complexity while reducing the number of model parameters and increasing computational speed, resulting in a decrease in detection accuracy. To improve the model's accuracy, it is necessary to integrate an efficient hybrid attention mechanism (HAM), which allows the model to focus more on important channels and spatial locations when extracting features, thereby improving feature quality and helping the model better recognize and understand human poses in subsequent detection and pose estimation tasks. The hybrid attention mechanism (HAM) includes... Figure 5 Channel attention branch and spatial attention branch in the process.

[0029] In one possible implementation, step 1202 is specifically processed as follows: the multi-scale feature map is input into the deformable convolution branch, the channel attention branch, and the spatial attention branch; feature extraction is performed through the deformable convolution branch to obtain deformable features; feature extraction is performed through the channel attention branch to obtain channel-enhanced features; feature extraction is performed through the spatial attention branch to obtain spatial-enhanced features; and the deformable features, channel-enhanced features, and spatial-enhanced features are input into the adaptive feature fusion unit to obtain the fused feature map.

[0030] In some embodiments, the network structure of the hybrid attention mechanism is as follows: Figure 6As shown, it includes a channel attention module and a spatial attention module. The channel attention module is responsible for processing channel information in the input features. It typically extracts channel features through average pooling and max pooling operations and emphasizes important features through an adaptive selection mechanism. Figure 6 As shown, the input features are first processed by two different pooling branches to obtain F_C^avg and F_C^max. Average pooling can capture the overall degree features of the target object, while max pooling is good at extracting the salient discriminative features of the object. When the two are used together, max pooling effectively supplements the global average features encoded by average pooling by emphasizing the key saliency information of the target, thereby enhancing the model's comprehensive understanding and representation of the target features.

[0031] It should be noted that the channel attention network structure is as follows: Figure 7 As shown, since average pooling and max pooling play different roles in different stages of image feature extraction, an adaptive selection mechanism is designed. The average pooling and max pooling are multiplied by learnable parameters (both are floating-point numbers between 0 and 1), and then each is multiplied by 1 / 2 before being added together. Finally, the three are added element-wise to obtain the result. This process can be expressed by the following formula:

[0032] The workflow of the channel attention network structure is as follows: 1. Input the feature map F to be processed into the module; 2. Obtain the channel-level average feature by performing global average pooling on F. Furthermore, by performing global max pooling on F, the channel-level maximum feature is obtained. 3. Implement dual-pooling channel feature extraction; 4. By introducing learnable parameters α and β, the outputs of average pooling and max pooling are weighted respectively, and then the weighted results are multiplied by 1 / 2 to balance the numerical scale. Finally, element-wise addition is performed to achieve effective feature integration; 5. Use a 1×K fully connected layer to... 5. Perform channel dimension transformation to learn the correlation between channels; 6. Use the Sigmoid function to map the output of the fully connected layer to [0,1] to obtain the channel attention weights. 6. As the final channel attention weight, it is used to perform channel-by-channel weighting with the original feature map.

[0033] The core of spatial attention mechanisms lies in focusing on information from different spatial locations in the input feature map, i.e., the importance of each pixel or pixel block. The spatial attention network structure is as follows: Figure 8As shown, the spatial attention network structure performs feature transformation on the data received by the input branch, performs cross-attention computation on the transformed image, then fuses the computation results and outputs the fused feature result. Spatial attention focuses on capturing spatial features such as target location, shape, and contextual information in the image. By dynamically adjusting the weight of each spatial location, the network can focus on spatial regions that are more critical to the task, thereby improving overall performance. The spatial attention module is mainly responsible for processing spatial information in the input features. It typically divides the channel refinement features into several groups along the channel axis and applies a spatial attention mechanism to each group. A 2D attention map is built by sharing convolutional layers, thereby achieving fine-grained capture of spatial features. Adding the HAM hybrid attention mechanism after C2f can strengthen the feature constraint capability.

[0034] Step S1203: Input the fused feature map into the head network to obtain the bounding box of the target person; where the target person is a person who has drowned.

[0035] In some embodiments, by processing the fused feature map through a head network, the bounding box of the target person exhibiting drowning behavior can be obtained.

[0036] Step S1204: Based on the bounding box and MPDIoU loss function, adjust the parameters of the backbone network, neck network, head network and detection network.

[0037] In some embodiments, the overlap between the bounding box and the standard bounding box is calculated using the MPDIoU loss function, and the network parameters are adjusted to make the bounding box closer to the standard bounding box, thereby improving detection accuracy. To improve the detection accuracy of drowning behavior with low computational complexity, this paper introduces a novel loss function, MPDIoU. This loss function provides a more accurate method to evaluate the similarity between polygons by incorporating a direct measure of polygon boundaries, rather than simply relying on the intersection and union of rectangles. Compared to traditional rectangular IoU, MPDIoU can still better evaluate the overlapping region of the target even with partial occlusion, without the significant bias in calculating occluded regions that occurs with rectangular IoU.

[0038] In one possible implementation, step 1204 is specifically processed as follows: the overlap between the bounding box and the standard bounding box is calculated using the MPDIoU loss function to obtain the loss function value; the parameters of the backbone network, neck network, head network, and detection network are improved based on the loss function value.

[0039] It should be noted that the loss function MPDIoU is a metric used to evaluate the degree of overlap and positional difference between the predicted bounding box and the ground truth bounding box. The formula indicates that the loss is 1 minus the MPDIoU value; that is, the higher the MPDIoU value (indicating a closer proximity between the predicted and ground truth bounding boxes), the lower the loss. The formula is shown below:

[0040] All relevant parameters of the existing bounding box regression loss function can be directly determined by the coordinates of the four vertices of the bounding box. These four coordinate points are sufficient to describe the position, size, and shape of the bounding box, thus enabling the calculation of the loss and optimization of the model's prediction accuracy. The conversion formula is as follows:

[0041]

[0042]

[0043] in, Indicates covering the true bounding box and predicted bounding boxes The minimum area of ​​the enclosed rectangle, with the coordinates of the center point of the true bounding box being... The coordinates of the center point of the predicted bounding box are Furthermore, the width and height of the actual bounding box are respectively... and This indicates that the predicted bounding box width and height are represented by... and express.

[0044] The following example illustrates the beneficial effects of this application: The baseline model Yolov8-pose and the proposed HAM-Yolov8 model were tested on a drowning dataset. A comparative analysis was also conducted with mainstream pose estimation models such as OpenPose, Mask-R-CNN, Yolov5n-pose, and Yolov11n. The evaluation metrics were mAP@0.5 and FPS, where mAP@0.5 represents the model's localization accuracy at an IoU threshold of 0.5, and FPS represents the model's real-time processing efficiency; a higher FPS indicates a faster detection speed. Experimental results are shown in Table 1. Table 1 Comparison of experimental results for different models

[0045] Based on the data in Table 1, we can see that the proposed HAM-Yolov8 model exhibits significant advantages in performance comparisons. Compared to the Mask-R-CNN model, the improved HAM-Yolov8 model achieves a 6.8 percentage point improvement in accuracy, while increasing the detection speed from 154 frames per second to 256 frames per second. The HAM-Yolov8 model improves accuracy by 2.7 percentage points compared to the Yolov5n-pose model. Compared to the Yolov11n model, it achieves a 1.5% accuracy advantage with the same parameter scale, and the detection speed increases from 1410 frames per second to 256 frames per second, representing a 71.8% increase in frame rate. In comparison with other mainstream pose detection algorithms, the proposed HAM-Yolov8 model shows significant advantages in both detection accuracy and detection speed. The improved Yolov8-pose model ultimately achieves a detection accuracy of 83.1% and a high frame rate processing capability of 256 FPS, successfully breaking through the bottleneck of the traditional algorithm's trade-off between accuracy and speed. This paper's improvements, achieved by reconstructing the backbone network using the lightweight MobileNetV4 network, employing the HAM hybrid attention mechanism, and proposing an improved MPDIoU loss function, significantly optimize keypoint detection performance while maintaining the original temporal processing efficiency. This is achieved by enhancing spatial feature representation capabilities and bounding box regression accuracy. Experimental comparisons demonstrate that, compared to other mainstream models, the proposed HAM-Yolov8 model achieves a dual breakthrough in accuracy and real-time performance in drowning behavior detection.

[0046] It should be noted that the data in Table 1 was obtained through experiments using 5806 images of drowning and swimming behaviors under different environments. The lightweight drowning behavior detection model provided in this application has an average accuracy of 83.1% and a parameter size of 3.24MB. Compared with the original model, the average accuracy is improved by 3.1%, and the parameter size is reduced by 2.26MB, better meeting the real-time requirements of drowning behavior detection. Through comparative and ablation experiments, this model demonstrates superior detection performance compared to traditional and other improved algorithms in drowning target detection tasks under different scenarios. Future work will focus on further optimizing the model structure, adopting a lighter backbone network, and combining pruning methods to compress the model size as much as possible while improving detection speed, thereby enhancing the model's portability and expanding its application scenarios.

[0047] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0048] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0049] Figure 9 A schematic diagram of the drowning behavior detection device based on the improved YOLOv8-pose provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below: like Figure 9 As shown, the drowning behavior detection device 9 based on the improved YOLOv9-pose includes: Module 91 is used to determine the real-time monitoring image of the target swimming venue based on the monitoring video of the target swimming venue; The detection module 92 is used to input real-time monitoring images of the target swimming venue into the improved YOLOv9-pose model to obtain the drowning behavior detection results of each person in the target swimming venue; wherein, the improved YOLOv9-pose model includes an improved MobileNetV4 module, a deformable keypoint perception attention module, and an MPDIoU loss function.

[0050] In one possible implementation, the determining module 91 is specifically used to: extract the frame image at the current moment from the monitoring video of the target swimming venue, and determine the frame image at the current moment as the real-time monitoring image of the target swimming venue.

[0051] In one possible implementation, the detection module 92 is specifically used for: inputting real-time monitoring images of the target swimming location into the backbone network, extracting features through an improved MobileNetV4 module to obtain a multi-scale feature map; inputting the multi-scale feature map into the neck network, fusing features through multiple deformable keypoint perception attention modules to obtain a fused feature map; inputting the fused feature map into the head network to obtain the bounding box of the target person; wherein the target person is a person exhibiting drowning behavior; and adjusting the parameters of the backbone network, neck network, head network, and detection network based on the bounding box and the MPDIoU loss function.

[0052] In one possible implementation, the detection module 92 is further configured to: extract local features and transform channels of the real-time monitoring image through at least one general inverted bottleneck block to obtain a lightweight feature map; and capture contextual information of the lightweight feature map through at least one Mobile MQA attention block to obtain a multi-scale feature map.

[0053] In one possible implementation, the detection module 92 is further configured to: input the multi-scale feature map into the deformable convolution branch, the channel attention branch, and the spatial attention branch; extract features through the deformable convolution branch to obtain deformable features; extract features through the channel attention branch to obtain channel-enhanced features; extract features through the spatial attention branch to obtain spatial-enhanced features; and input the deformable features, channel-enhanced features, and spatial-enhanced features into the adaptive feature fusion unit to obtain a fused feature map.

[0054] In one possible implementation, the detection module 92 is further configured to: calculate the overlap between the bounding box and the standard bounding box using the MPDIoU loss function to obtain the loss function value; and improve the parameters of the backbone network, neck network, head network, and detection network based on the loss function value.

[0055] Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 10 As shown, the electronic device 10 of this embodiment includes a processor 100 and a memory 101. The memory 101 stores a computer program 102. When the processor 100 executes the computer program 102, it implements the steps in the various method embodiments described above. Alternatively, when the processor 100 executes the computer program 102, it implements the functions of each module / unit in the various device embodiments described above.

[0056] For example, computer program 102 may be divided into one or more modules / units, which are stored in memory 101 and executed by processor 100 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 102 in electronic device 10.

[0057] Electronic device 10 may include, but is not limited to, processor 100 and memory 101. Those skilled in the art will understand that... Figure 10 This is merely an example of electronic device 10 and does not constitute a limitation on electronic device 10. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 10 may also include input / output devices, network access devices, buses, etc.

[0058] The processor 100 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0059] The memory 101 can be an internal storage unit of the electronic device 10, such as a hard disk or RAM of the electronic device 10. The memory 101 can also be an external storage device of the electronic device 10, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the electronic device 10. Furthermore, the memory 101 can include both internal and external storage units of the electronic device 10. The memory 101 is used to store the computer program 102 and other programs and data required by the electronic device 10. The memory 101 can also be used to temporarily store data that has been output or will be output.

[0060] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.

[0061] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.

[0062] This invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.

[0063] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0064] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0065] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A drowning detection method based on an improved YOLOv8-pose, characterized in that, include: Based on the surveillance video of the target swimming venue, determine the real-time surveillance image of the target swimming venue; The real-time monitoring images of the target swimming venue are input into the improved YOLOv8-pose model to obtain the drowning behavior detection results of each person in the target swimming venue; wherein, the improved YOLOv8-pose model includes an improved MobileNetV4 module, a deformable keypoint perception attention module, and an MPDIoU loss function.

2. The drowning detection method based on the improved YOLOv8-pose according to claim 1, characterized in that, The improved YOLOv8-pose model includes a backbone network, a neck network, a head network, and a detection network; the improved MobileNetV4 module is located in the backbone network; and the deformable keypoint awareness attention module is located in the neck network. The MPDIoU loss function is located in the detection network; The step of inputting real-time monitoring images of the target swimming area into an improved YOLOv8-pose model to obtain drowning behavior detection results for each person in the target swimming area includes: The real-time monitoring images of the target swimming venue are input into the backbone network, and feature extraction is performed through the improved MobileNetV4 module to obtain multi-scale feature maps. The multi-scale feature map is input into the neck network, and feature fusion is performed through multiple deformable key point perception attention modules to obtain a fused feature map; The fused feature map is input into the head network to obtain the bounding box of the target person; wherein, the target person is a person who has drowned. Based on the bounding box and the MPDIoU loss function, the parameters of the backbone network, the neck network, the head network, and the detection network are adjusted.

3. The drowning detection method based on the improved YOLOv8-pose according to claim 2, characterized in that, The improved MobileNetV4 module includes at least one general inverted bottleneck block, at least one Mobile MQA attention block, and a neural architecture search block; the neural architecture search block is used to determine the number of layers of the general inverted bottleneck block and the Mobile MQA attention block. The feature extraction using the improved MobileNetV4 module to obtain multi-scale feature maps includes: A lightweight feature map is obtained by performing local feature extraction and channel transformation on the real-time monitoring image using at least one general inverted bottleneck block. The lightweight feature map is obtained by capturing contextual information through at least one Mobile MQA attention block.

4. The drowning detection method based on the improved YOLOv8-pose according to claim 2, characterized in that, The deformable keypoint perception attention module includes a deformable convolution branch, a channel attention branch, a spatial attention branch, and an adaptive feature fusion unit; The feature fusion process, which involves multiple deformable keypoint perception attention modules, yields a fused feature map, including: Multi-scale feature maps are input into the deformable convolution branch, the channel attention branch, and the spatial attention branch. Feature extraction is performed through the deformable convolution branch to obtain deformable features, through the channel attention branch to obtain channel-enhanced features, and through the spatial attention branch to obtain spatial-enhanced features. The deformable feature, the channel enhancement feature, and the spatial enhancement feature are input into the adaptive feature fusion unit to obtain the fused feature map.

5. The drowning detection method based on the improved YOLOv8-pose according to claim 2, characterized in that, The adjustment of parameters for the backbone network, the neck network, the head network, and the detection network based on the bounding box and the MPDIoU loss function includes: The overlap between the bounding box and the standard bounding box is calculated using the MPDIoU loss function to obtain the loss function value; The parameters of the backbone network, the neck network, the head network, and the detection network are improved based on the loss function value.

6. The drowning detection method based on the improved YOLOv8-pose according to claim 1, characterized in that, The determination of real-time monitoring images of the target swimming location based on surveillance video includes: Extract the frame image of the current moment from the surveillance video of the target swimming venue, and determine the frame image of the current moment as the real-time surveillance image of the target swimming venue.

7. A drowning detection device based on an improved YOLOv8-pose, characterized in that, include: The determination module is used to determine the real-time monitoring image of the target swimming venue based on the monitoring video of the target swimming venue; The detection module is used to input real-time monitoring images of the target swimming venue into the improved YOLOv8-pose model to obtain the drowning behavior detection results of each person in the target swimming venue; wherein, the improved YOLOv8-pose model includes an improved MobileNetV4 module, a deformable keypoint perception attention module, and an MPDIoU loss function.

8. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.