An indoor swimming pool drowning detection method based on an ATT-YOLO-V7 network
By optimizing the recognition of swimmers' movement status through the ATT-YOLO-V7 network, the problem of low accuracy in drowning detection in indoor scenarios has been solved, enabling timely rescue and ensuring life safety.
Patent Information
- Application Number
- CN202311178583.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-09-12
AI Technical Summary
Existing drowning detection systems have low accuracy in recognizing swimmers' movements in indoor settings, leading to misjudgments and missed detections. This results in a failure to effectively relay information to lifeguards and miss the optimal rescue time.
The ATT-YOLO-V7 network is adopted, and the swimmer motion state recognition is optimized by combining the Extra feature extraction module, the Atten attention module, and the Pred prediction module. This includes image acquisition and preprocessing, feature extraction, attention fusion, and prediction. A loss function is constructed for training to improve recognition accuracy.
It improves the accuracy and precision of swimmer movement status recognition, enabling timely identification of drowning and rescue, ensuring swimmer safety, and improving rescue efficiency.
Smart Images

Figure CN117132924B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target detection in computer vision, and more specifically, it is an indoor swimming pool drowning detection method based on the ATT-YOLO-V7 network. Background Technology
[0002] Currently, the primary focus in dealing with drowning incidents is on effective risk prevention and control, closely monitoring key dangerous water areas, implementing safety responsibilities, and achieving early prevention. However, relying solely on manual supervision cannot effectively prevent accidents from occurring. Therefore, there is an urgent need for a system that can detect and identify drowning swimmers in places such as swimming pools, so that rescuers can take rescue measures within the effective rescue time.
[0003] The existing drowning detection systems rely on neural network models that have low accuracy in recognizing swimmers' movements in indoor scenarios, leading to misjudgments and missed detections of swimmers' movements. When a swimmer is drowning, the system cannot effectively relay information to lifeguards, thus missing the best rescue time and causing accidents. Summary of the Invention
[0004] This invention addresses the shortcomings of existing technologies by proposing an indoor swimming pool drowning detection method based on the ATT-YOLO-V7 network. The aim is to quickly and effectively identify the swimmer's movement state through an optimized model with superior recognition performance, thereby improving the accuracy and precision of drowning detection and ensuring the safety of swimmers.
[0005] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0006] The present invention provides an indoor swimming pool drowning detection method based on an ATT-YOLO-V7 network, characterized by the following steps:
[0007] Step 1: Image Acquisition and Preprocessing
[0008] Step 1.1: Acquire video data of swimmers' movements in the pool, perform frame extraction and preprocessing to obtain a video image sequence F. Let I denote the RGB image of any frame of swimmer movement in the video image sequence F. r ;
[0009] Step 1.2, process the RGB image I r The positions and motion states STA_IN of N swimmers in the image are labeled to obtain a feature image I with N position labels and motion state labels. pro The motion state STA_IN includes: swimming S_SW, standing S_ST, and drowning S_DR.
[0010] Let feature image I pro Let c be the location label of the i-th swimmer.i And c i =(c i_x ,c i_y ), where c i_x This indicates that the i-th swimmer is in the RGB image I. r The top-left corner coordinates (x, y) of the rectangle where the location is located i_ltc ,y i_ltc ), c i_y This represents the coordinates (x, y) of the lower right corner of the rectangle. i_rbc ,y i_rbc ), where x i_ltc The x-coordinate of the upper left corner of the rectangle is represented by y. i_ltc The x-coordinate represents the top-left corner of the rectangle. i_rbc The x-coordinate of the lower right corner of the rectangle is represented by y. i_rbc This represents the ordinate of the lower right corner of the rectangle;
[0011] Let feature image I pro The motion status label of the i-th swimmer is denoted as label. i label i ∈{S_SW,S_ST,S_DR};
[0012] Step 2: Build the ATT-YOLO-V7 network, which includes the following modules in sequence: Extra (feature extraction module), Atten (attention module), and Pred (prediction module);
[0013] Step 2.1: The feature extraction module Extra is composed of U basic units connected in parallel and one activation layer Sig, wherein any u-th basic unit is composed of g1 convolutional layers Conv and g2 normalized layers Norm in sequence.
[0014] The feature image I pro The input is fed into the Extra feature extraction module, and then processed by the g1 convolutional layers Conv of each basic unit to obtain a coarse feature set {I}. u,Extra |u=1,2,…,U}, where, I u,Extra This represents the coarse feature output by the u-th basic unit;
[0015] {I u,Extra |u=1,2,…,U} is then processed by g2 normalization layers Norm for each basic unit to obtain the standard feature set {I u,Norm |u=1,2,…,U}, where, I u,Norm This represents the standard feature output by the u-th basic unit;
[0016] The standard feature set {I u,NormThe input of |u=1,2,…,U} into the activation layer Sig is processed to obtain the activation feature set I. act ={I u,act |u=1,2,…,U}, where, I u,act Represents the u-th activation feature;
[0017] Step 2.2: The attention module Atten is composed of g3 randomly fused feature branches connected in parallel;
[0018] The activation feature set I act The inputs are respectively fed into g3 feature random fusion branches, where the g-th feature random fusion branch calculates the g-th fusion feature I using equation (1-1). g,Fus_act Thus, the fused feature set I is obtained by randomly fusing the g3 feature branches. Fus_act ={I g,Fus_act |g=1,2,…g3};
[0019]
[0020] In equation (1-1), W g,br_f This represents the attention weight of the g-th branch. I represents the attention bias of the g-th branch. i',act I represents the i'th activation feature. j',act This represents the j'th activation feature, where i' ≠ j'; i', j' ∈ 1, 2, ..., U;
[0021] Step 2.3: The prediction module Pred consists of R basic units connected in parallel, wherein any r-th basic unit is composed of C n One convolutional layer, P n Pooling layer, K n The system consists of several fully connected layers in sequence;
[0022] The fusion feature set I Fus_act The input is fed into the prediction module Pred, and then processed by the c of each basic unit. n After processing by each convolutional layer, the convolutional feature set {I} is obtained. r,conv |r=1,2,…R}, where I r,conv Represents the c-th basic unit of the r-th unit. n The convolutional features output by each convolutional layer;
[0023] {I r,conv |r=1,2,…R} passes through P of each basic unit respectively n After downsampling by each pooling layer, the downsampled feature set {I} is obtained. r,pool |r=1,2,…R}, where I r,poolRepresents the Pth term of the r-th basic unit. n The downsampled features of the pooling layer output;
[0024] {I r,pool |r=1,2,…R} passes through K of each basic unit respectively n After processing by a fully connected layer, the predicted location features {I} are obtained. r,pr |r=1,2…R} and motion state characteristics {I r,sta |r=1,2…R};where I r,pr Represents the Kth basic unit of the r-th unit. n The predicted location features output by each fully connected layer, and I r,pr The predicted position feature of the i-th swimmer is denoted as c. o_i =(c o_i_x ,c o_i_y ), where c o_i_x c represents the predicted location feature of the i-th swimmer. o_i The coordinates of the top left corner (x lto_i ,y lto_i ), c o_i_y c represents the predicted location feature of the i-th swimmer. o_i The lower right corner coordinate (x rbo_i ,y rbo_i ),
[0025] I r,sta Represents the Kth basic unit of the r-th unit. n The predicted motion state features output by each fully connected layer, and I r,sta The predicted motion state feature of the i-th swimmer is denoted as label. o_i ∈{S_SW,S_ST,S_DR};
[0026] Step 3: Construct the loss function Loss(x,y) and train the ATT-YOLO-V7 network:
[0027] Step 3.1: Construct the loss function Loss for the motion state of the i-th swimmer using equation (1-2). i :
[0028] Loss i =(x ltc_i -y lto_i ) 2 +(y ltc_i -y lto_i ) 2 +(x rbc_i -x rbo_i ) 2 +(y rbc_i -y rbo_i ) 2(1-2)
[0029] Step 3.2: Construct the total loss function Loss using equation (1-3):
[0030]
[0031] Step 3.3: Iteratively train the ATT-YOLO-V7 network using the Adam optimizer and calculate the total loss function Loss to adjust the network parameters until the total loss function Loss converges, thereby obtaining a trained indoor swimming pool drowning detection model, which is used to detect the drowning state of swimmers in video images.
[0032] The indoor swimming pool drowning detection method based on the ATT-YOLO-V7 network described in this invention is characterized by obtaining the label through the following process. o_i Category m i :
[0033] Let STA_IN[m] represent the m-th motion state, and STA_IN[m] = {S_SW, S_ST, S_DR}. When m = 1, it means that the m-th motion state STA_IN[m] is swimming S_SW, that is, STA_IN[1] = S_SW; when m = 2, it means that the m-th motion state STA_IN[m] is standing S_ST, that is, STA_IN[2] = S_ST; when m = 3, it means that the m-th motion state STA_IN[m] is drowning swimming S_DR, that is, STA_IN[3] = S_DR;
[0034] The label of the true motion state of the i-th swimmer is calculated using equation (2-1). i The state motion characteristics of the i-th swimmer predicted by the ATT-YOLO-V7 network Intersection over Union (IOU) i Thus, the category m of the movement state of the i-th swimmer can be obtained using equation (2-3). i :
[0035]
[0036] In equation (2-1), STA_PRED[q] represents the motion state feature label of the i-th swimmer predicted by the prediction module Pred. o_i Let STA_IN[m] represent the label of the actual motion state of the i-th swimmer, which is the q-th motion state. i S represents the m-th motion state. c (STA_IN[m],STA_PRED[q]) represents the feature image I proIn the prediction, the label represents the motion state feature of the i-th swimmer. o_i For the q-th motion state, the feature of the actual motion state of the i-th swimmer is shown in Figure 1. l The area of overlap between the two; S u (STA_IN[m],STA_PRED[q]) represents the feature image I pro In the middle, the predicted motion state features of the swimmer are labeled o_i For the q-th motion state, the label is the motion state feature of the actual swimmer. i Let m be the total area occupied by both in the m-th motion state; where the type m of motion state is obtained as shown in equation (2-2).
[0037]
[0038] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the indoor swimming pool drowning detection method, and the processor is configured to execute the program stored in the memory.
[0039] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of the indoor swimming pool drowning detection method.
[0040] Compared with existing technologies, the beneficial effects of the present invention are as follows:
[0041] 1. The Extra feature extraction module in the ATT-YOLO-V7 network of this invention consists of U parallel basic units and one activation layer Sig. Each u-th basic unit is composed of g1 convolutional layers (Conv) and g2 normalized layers (Norm). This overcomes the deficiency of insufficient coarse feature extraction in the original YOLO-V7 network, providing more refined features for the Atten attention mechanism. This facilitates further feature fusion processing by the Atten attention mechanism, enabling the model to more accurately identify the swimmer's motion state, determine whether the swimmer is drowning, and promptly rescue drowning swimmers, ensuring their safety.
[0042] 2. The Atten module of the ATT-YOLO-V7 network in this invention consists of g3 randomly fused feature branches connected in parallel. It randomly combines the features extracted by each branch, overcoming the deficiency of the original YOLO-V7 network in not collecting fine features in depth. This allows for deeper extraction of the swimmer's position and motion state features, enabling the prediction module to more accurately classify and identify the swimmer's motion state and send it to the lifeguard, thus improving rescue efficiency.
[0043] 3. The prediction Atten module in the ATT-YOLO-V7 network of this invention is composed of C n One convolutional layer, P n Pooling layer, K n This system consists of several parallel micro-units formed by fully connected layers. After feature extraction and downsampling of each micro-unit, the position and motion characteristics of swimmers can be predicted. This overcomes the shortcomings of the original YOLO-V7 network prediction module, which had incomplete predictions, thus achieving more accurate predictions of swimmers' position and motion characteristics. Lifeguards can then take timely rescue measures based on the swimmer's predicted position and motion characteristics to prevent accidents. Attached Figure Description
[0044] Figure 1 This is a diagram of the architecture of the ATT-YOLO-V7 indoor swimming pool drowning detection system in this invention;
[0045] Figure 2 This is a flowchart of the ATT-YOLO-V7 indoor swimming pool drowning detection method in this invention;
[0046] Figure 3 This is a diagram of the ATT-YOLO-V7 network structure in this invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0048] In this embodiment, the hardware system upon which the ATT-YOLO-V7 indoor swimming pool drowning detection method is based is described below. Figure 1 The system includes: a base, a steel pole, Hikvision cameras, and a server. The base is used to secure the steel pole, which is vertically mounted on the base and is 3 meters high. Eight Hikvision cameras are installed at a height h (h < 3 meters) on the steel pole, each with a resolution of 640px × 480px. The eight cameras are evenly distributed around the pool, with two cameras in each group pointing towards the pool and capturing high-definition video of swimmers moving within. The server stores the swimmers' movement video, and the processor performs frame extraction on the stored video data to obtain several RGB images of the swimmers' movements within the pool.
[0049] For the ATT-YOLO-V7 indoor swimming pool drowning detection method, please refer to [link / reference]. Figure 2The specific steps are as follows:
[0050] Step 1: Use a Hikvision camera to capture images of swimmers in motion and perform preprocessing:
[0051] Step 1.1: Acquire video data of swimmers' movements in the pool, perform frame extraction and preprocessing to obtain a video image sequence F. Let I denote the RGB image of any frame of swimmer movement in the video image sequence F. r In this embodiment, due to unreasonable hardware parameter settings of the Hikvision camera itself, the resulting video image sequence F may exhibit image distortion after frame extraction of the recorded video data. Therefore, for each frame of the RGB image sequence F, ... r All images were normalized, and image I was obtained. p .
[0052] Step 1.2, for image I p The positions and motion states STA_IN of N swimmers in the image are labeled to obtain a feature image I with N position labels and motion state labels. pro Among them, the motion state STA_IN includes: swimming S_SW, standing S_ST, and drowning S_DR;
[0053] Let feature image I pro Let c be the location label of the i-th swimmer. i And c i =(c i_x ,c i_y ), where c i_x This indicates that the i-th swimmer is in the RGB image I. r The top-left corner coordinates (x, y) of the rectangle where the location is located i_ltc ,y i_ltc ), c i_y Represents the coordinates of the bottom right corner of the rectangle (x) i_rbc ,y i_rbc ), where x i_ltc The x-coordinate of the top-left corner of the rectangle is represented by y. i_ltc The x-coordinate represents the top-left corner of the rectangle. i_rbc The x-coordinate of the bottom right corner of the rectangle is represented by y. i_rbc Represents the ordinate of the bottom right corner of the rectangle;
[0054] Let feature image I pro The motion status label of the i-th swimmer is denoted as label. i label i ∈{S_SW,S_ST,S_DR}.
[0055] Step 2: Establish an ATT-YOLO-V7 network, such as... Figure 3As shown, the network sequentially includes: a feature extraction module Extra, an attention module Atten, and a prediction module Pred;
[0056] Step 2.1: The feature extraction module Extra consists of U parallel basic units and one activation layer Sig. Each u-th basic unit is composed of g1 convolutional layers (Conv) and g2 normalized layers (Norm). In this embodiment, U is 4, g1 is 4, g2 is 2, and the feature image I... pro After entering the convolutional layer, the image is first decomposed into several feature pixels, thus allowing for the initial extraction of the input feature image I. pro The feature information in.
[0057] Feature Image I pro The input is fed into the Extra feature extraction module, and then processed by the g1 convolutional layers Conv of each basic unit to obtain a coarse feature set {I}. u,Extra |u=1,2,…,U}, where, I u,Extra This represents the coarse feature output by the u-th basic unit;
[0058] {I u,Extra |u=1,2,…,U} is then processed by g2 normalization layers Norm for each basic unit to obtain the standard feature set {I u,Norm |u=1,2,…,U}, where, I u,Norm This represents the standard feature output by the u-th basic unit;
[0059] The standard feature set {I u,Norm The input of |u=1,2,…,U} into the activation layer Sig is processed to obtain the activation feature set I. act ={I u,act |u=1,2,…,U}, where, I u,act Represents the u-th activation feature;
[0060] In this embodiment, each normalization layer Norm applies a coarse feature set {I} to the input. u,Extra The regularization process is applied to the group |u=1,2,…,U} to transform it into a standard feature I consisting of features with a mean of 0 and a variance of 1. u,Norm This can prevent data in the coarse feature set from falling into the saturation region of the activation function and reduce the problem of vanishing gradients.
[0061] Step 2.2: The attention module Atten is composed of g3 randomly fused feature branches connected in parallel; in this embodiment, g3 is 8, so that the attention module Atten can be connected to the activation feature set I of many inputs. actThe focus is on information that is more critical for identifying the swimmer's movement status, reducing or even filtering attention to redundant information. This can solve the problem of server overload and improve data processing efficiency.
[0062] Activate feature set I act The inputs are respectively fed into g3 feature random fusion branches, where the g-th feature random fusion branch calculates the g-th fusion feature I using equation (1-1). g,Fus_act Thus, the fused feature set I is obtained by randomly fusing the g3 feature branches. Fus_act ={I g,Fus_act |g=1,2,…g3};
[0063]
[0064] In equation (2-1), W g,br_f This represents the attention weight of the g-th branch. I represents the attention bias of the g-th branch. i',act I represents the i'th activation feature. j',act Let i' represent the j'th activation feature, i' ≠ j'; i', j' ∈ 1, 2, ..., U.
[0065] Step 2.3: The prediction module Pred consists of R basic units connected in parallel, where any r-th basic unit is composed of C... n One convolutional layer, P n Pooling layer, K n The system consists of several fully connected layers sequentially; in this embodiment, R is 8, and C... n Take 4, P n Take 2, K n Take 1.
[0066] Any convolutional layer Conv in the prediction module Predict is determined by L n It consists of several filters, each with a size of 4*4, and each filter contains 4*L. n There are 1 convolutional kernel, and the stride of each convolutional kernel is 2;
[0067] In the Predict module, any pooling layer Pool has a size of 3*3 and a stride of 2.
[0068] The size of any fully connected layer FCN in the Predict module is 2*2*L. n In this way, the hidden information in each fusion feature can be fully extracted and utilized to map with the labeled feature information, thereby predicting the type of swimmer's motion state;
[0069] Fusion Feature Set I Fus_actThe input is fed into the prediction module Pred and then processed by the c of each basic unit. n After processing by each convolutional layer, the convolutional feature set {I} is obtained. r,conv |r=1,2,…R}, where I r,conv Represents the c-th basic unit of the r-th unit. n The convolutional features output by each convolutional layer.
[0070] {I r,conv |r=1,2,…R} passes through P of each basic unit respectively n The downsampling process of each pooling layer makes the fused features better match the labeled features, facilitating further processing and obtaining the downsampled feature set {I}. r,pool |r=1,2,…R}, where I r,pool Represents the Pth term of the r-th basic unit. n The downsampled features of the pooling layer output;
[0071] Downsampling features {I r,pool |r=1,2,…R} passes through K of each basic unit respectively n After processing by a fully connected layer, it can be more accurately associated with the position labels and motion state labels marked in step 1.2, thereby obtaining the predicted position features {I}. r,pr |r=1,2…R} and motion state characteristics {I r,sta |r=1,2…R};where I r,pr Represents the Kth basic unit of the r-th unit. n The predicted location features output by each fully connected layer, and I r,pr The predicted position feature of the i-th swimmer is denoted as c. o_i =(c o_i_x ,c o_i_y ), where c o_i_x c represents the predicted location feature of the i-th swimmer. o_i The coordinates of the top left corner (x lto_i ,y lto_i ), c o_i_y c represents the predicted location feature of the i-th swimmer. o_i The lower right corner coordinate (x rbo_i ,y rbo_i ), I r,sta Represents the Kth basic unit of the r-th unit. n The predicted motion state features output by each fully connected layer; and I r,sta The predicted motion state feature of the i-th swimmer is denoted as label. o_i ∈{S_SW,S_ST,S_DR}.
[0072] Step 2.4: Let STA_IN[m] represent the m-th motion state, and STA_IN[m] = {S_SW, S_ST, S_DR}. When m = 1, it means that the m-th motion state STA_IN[m] is swimming S_SW, that is, STA_IN[1] = S_SW; when m = 2, it means that the m-th motion state STA_IN[m] is standing S_ST, that is, STA_IN[2] = S_ST; when m = 3, it means that the m-th motion state STA_IN[m] is drowning swimming S_DR, that is, STA_IN[3] = S_DR;
[0073] The label of the true motion state of the i-th swimmer is calculated using equation (2-1). i The motion state feature label of the i-th swimmer predicted by the ATT-YOLO-V7 network o_i Intersection over Union (IOU) i Thus, the category m of the motion state of the i-th swimmer can be obtained using equation (2-2). i :
[0074]
[0075] In equation (2-1), STA_PRED[q] represents the motion state feature label of the i-th swimmer predicted by the prediction module Pred. o_i Let STA_IN[m] represent the label of the actual motion state of the i-th swimmer, which is the q-th motion state. i S represents the m-th motion state. c (STA_IN[m],STA_PRED[q]) represents the feature image I pro In the prediction, the label represents the motion state feature of the i-th swimmer. o_i For the q-th motion state, the label is the actual motion state feature of the i-th swimmer. i The area of overlap between the two; S u (STA_IN[m],STA_PRED[q]) represents the feature image I pro In the middle, the predicted motion state features of the swimmer are labeled o_i For the q-th motion state, the label is the motion state feature of the actual swimmer. i Let m be the total area occupied by both in the m-th motion state; where the type m of motion state is obtained as shown in equation (2-2).
[0076]
[0077] Step 3: Construct the loss function Loss(x,y) and train the ATT-YOLO-V7 network:
[0078] Step 3.1: Construct the loss function Loss for the motion state of the i-th swimmer using equation (3-1). i :
[0079] Loss i =(x ltc_i -x lto_i ) 2 +(y ltc_i -y lto_i ) 2 +(x rbc_i -x rbo_i ) 2 +(y rbc_i -y rbo_i ) 2 (3-1)
[0080] Step 3.2: Construct the total loss function Loss using equation (3-2):
[0081]
[0082] Step 3.3: Use the Adam optimizer to iteratively train the ATT-YOLO-V7 network so that the parameter updates are not affected by the gradient scaling transformation. This allows for the rapid calculation of the total loss function Loss and the adjustment of the network parameters until the total loss function Loss converges, thus obtaining a trained indoor swimming pool drowning detection model, which is used to detect the drowning state of swimmers in video images.
[0083] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the methods described above, and the processor is configured to execute the program stored in the memory.
[0084] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.
Claims
1. A method for detecting drowning in indoor swimming pools based on an ATT-YOLO-V7 network, characterized in that, Includes the following steps: Step 1: Image Acquisition and Preprocessing Step 1.1: Acquire video data of swimmers' movements in the pool, perform frame extraction and preprocessing to obtain a video image sequence. Make the video image sequence The RGB image of any frame of a swimmer's movement is denoted as ; Step 1.2: Process the RGB image The positions and motion states (STA_IN) of N swimmers in the image are labeled to obtain a feature image with N position labels and motion state labels. The motion state STA_IN includes: swimming S_SW, standing S_ST, and drowning S_DR. Let feature image The Middle The location tag for each swimmer is recorded as follows: ,and ,in, Indicates the first A swimmer in an RGB image The coordinates of the top left corner of the rectangle where it is located ( ), This represents the coordinates of the lower right corner of the rectangle. ),in, This represents the x-coordinate of the top-left corner of the rectangle. This represents the ordinate of the top-left corner of the rectangle. This represents the x-coordinate of the lower right corner of the rectangle. This represents the ordinate of the lower right corner of the rectangle; Let feature image The Middle The activity status label of each swimmer is recorded as follows: , ∈{S_SW,S_ST,S_DR}; Step 2: Build the ATT-YOLO-V7 network, which includes the following modules in sequence: Extra (feature extraction module), Atten (attention module), and Pred (prediction module); Step 2.1: The feature extraction module Extra consists of parallel connections... It consists of 1 basic unit and 1 activation layer Sig, wherein any u-th basic unit is composed of 1 basic unit and 1 activation layer Sig. Conv, a convolutional layer The standardized layers Norm are composed of sequentially; The feature image The input is fed into the Extra feature extraction module and then processed by each basic unit. The feature extraction process of each convolutional layer (Conv) yields a coarse feature set { | =1,2,…, },in, Indicates the first The coarse features output by each basic unit; { | =1,2,…, Then, each basic unit passes through... The standardization layer Norm process yields a standard feature set { },in, Indicates the first Standard characteristics output by each basic unit; The standard feature set { | =1,2,…, The input to the activation layer Sig is processed to obtain the set of activation features. ,in, Indicates the first One activation feature; Step 2.2, the attention module Atten is composed of The features are randomly fused and the branches are connected in parallel; The activation feature set Enter them separately In the feature random fusion branch, the first one is... The feature random fusion branch is calculated using equation (1-1) to calculate the first feature. One fusion feature Thus by The fused feature set is obtained by randomly fusing the features along the branch. ; (1-1) In equation (1-1), Indicates the first Attention weights for each branch Indicates the first Attention bias in each branch, Indicates the first One activation feature, Indicates the first One activation feature, ; ; Step 2.3, the prediction module Pred consists of parallel... It consists of 3 basic units, where any 3 ... Each basic unit consists of Each convolutional layer Each pooling layer The system consists of several fully connected layers in sequence; The fusion feature set The input is fed into the prediction module Pred and then processed by each basic unit. After processing by each convolutional layer, a set of convolutional features is obtained. ,in, Indicates the first The first basic unit The convolutional features output by each convolutional layer; Each basic unit After downsampling by each pooling layer, the downsampled feature set is obtained. ,in, Indicates the first The first basic unit The downsampled features of the pooling layer output; Each basic unit After processing by a fully connected layer, the predicted location features are obtained. and motion state characteristics ;in, Indicates the first The first basic unit The predicted location features output by each fully connected layer, and The Middle The predicted location features of each swimmer are denoted as follows: ,in, Indicates the predicted first Location characteristics of individual swimmers The coordinates of the top left corner ( ), Indicates the predicted first Location characteristics of individual swimmers The coordinates of the lower right corner ( ), Indicates the first The first basic unit The predicted motion state features output by each fully connected layer, and The Middle The predicted motion state characteristics of each swimmer are denoted as […]. ; Step 3: Construct the loss function And train the ATT-YOLO-V7 network: Step 3.1: Construct the first equation using equation (1-2). Loss function of the motion state of each swimmer : = (1-2) Step 3.2: Construct the total loss function using equation (1-3) : (1-3) Step 3.3: Iteratively train the ATT-YOLO-V7 network using the Adam optimizer and calculate the total loss function. Adjust the network parameters until the total loss function is achieved. The training continues until convergence, resulting in a well-trained indoor swimming pool drowning detection model, which can be used to detect drowning status in swimmers in video images.
2. The indoor swimming pool drowning detection method based on ATT-YOLO-V7 network according to claim 1, characterized in that, It is obtained through the following process Category : Let STA_IN[ ] indicates the first A kind of motion state, and STA_IN[ ]={S_SW, S_ST, S_DR}, when When =1, it means the first... Type of motion state STA_IN[ ] is for swimming S_SW, that is, STA_IN[1] = S_SW; when When =2, it means the first... Type of motion state STA_IN[ ] is standing S_ST, that is, STA_IN[2] = S_ST; when When =3, it means the first... Type of motion state STA_IN[ ] is S_DR for drowning swimming, that is, STA_IN[3] = S_DR; Calculate the first using equation (2-1) The true movement characteristics of individual swimmers The first prediction of the ATT-YOLO-V7 network The state and movement characteristics of individual swimmers intersection ratio Thus, by using equation (2-3), we can obtain the first... The category of the swimmer's movement status : (2-1) In equation (2-1), This indicates the prediction module Pred's prediction of the first... The movement characteristics of individual swimmers For the first A state of motion, Indicates the first The true movement characteristics of individual swimmers For the first A state of motion; Represents in feature image In the middle, the predicted first The movement characteristics of individual swimmers For the first The first state of motion, and the second state of motion. The true movement characteristics of individual swimmers The area of overlap between the two; Represents in feature image In the prediction of swimmers' motion state characteristics For the first This type of motion state, and the characteristics of the motion state of actual swimmers. For the first The total area occupied by both states of motion; among which, the types of motion states The method for obtaining is shown in equation (2-2); (2-2)。 3. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing the indoor swimming pool drowning detection method according to claim 1 or 2, and the processor is configured to execute the program stored in the memory.
4. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when run by the processor, executes the steps of the indoor swimming pool drowning detection method according to claim 1 or 2.
Citation Information
Patent Citations
Urban road sign automatic identification method
CN111444821A
Beach drowning monitoring protection system
CN115171336A
Cited By
River drowning monitoring method based on lossless downsampling network and multi-modal semantic disambiguation
CN121725430A
A River Drowning Monitoring Method Based on Lossless Downsampling Network and Multimodal Semantic Disambiguation
CN121725430B