A method for identifying drowning behavior in a swimming pool based on video temporal feature analysis

By constructing a 3D ResNet50 neural network and combining spatial and temporal semantic modulation modules, and optimizing the loss function, the problems of high computational cost and low accuracy in drowning behavior recognition in existing technologies are solved, and high-precision drowning behavior recognition and real-time processing in complex environments are realized.

CN114511927BActive Publication Date: 2024-10-22QINGDAO UNITED CREATIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210063414.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-10-22
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

Existing technologies for identifying drowning behavior suffer from problems such as high computational costs, inability to capture the temporal relationship of behavior, model overfitting, and slow convergence speed, making it particularly difficult to accurately identify drowning behavior in swimming pools in complex environments.

Method used

A video temporal feature analysis-based approach is adopted. By constructing a 3D ResNet50 neural network and combining spatial semantic modulation and temporal semantic modulation modules, human behavior features in the video are fused together. The model is optimized using the FocalLoss loss function to achieve efficient identification of drowning behavior.

Benefits of technology

It achieves high-precision identification of drowning behavior in complex environments, reaching an accuracy rate of 90.2%, while reducing computational costs and making it suitable for real-time processing on mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

The invention belongs to the technical field of video surveillance computer image processing, and relates to a method for identifying drowning behavior in a swimming pool based on video time series feature analysis, comprising: S1, constructing a data set; S2, preprocessing an image; S3, constructing a neural network model, comprising: constructing a feature extraction part, constructing a spatial semantic modulation module, constructing a temporal semantic modulation module, constructing a feature fusion module, and constructing a behavior identification module; S4, training the constructed neural network model; S5, preprocessing a collected swimming behavior video of a target person, inputting the video into the trained neural network model, and judging whether the behavior belongs to drowning behavior; the invention fuses the spatial information features and the time series information features of human behavior, can realize real-time processing of image information, and the constructed neural network model has fast calculation convergence speed, strong generalization ability, and strong robustness; the method is ingeniously conceived, and the accuracy of drowning behavior recognition reaches more than 90%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The present invention belongs to the technical field of video surveillance computer image processing, and relates to computer vision algorithms, and specifically to a method for identifying drowning behavior in a swimming pool based on video time series feature analysis. By analyzing and processing indoor swimming images, an effective early warning is given to drowning behaviors appearing in the images, thereby reducing the occurrence of drowning deaths. Background technology:

[0002] With the development of society and the improvement of people's living standards, swimming, a sport that exercises the whole body, is becoming more and more popular. However, because it is carried out in water, beginners often choke on water or even drown because they cannot breathe and move freely. In addition, swimmers may suffer muscle spasms, collisions, and physical exhaustion in the water, all of which may lead to drowning. Once a drowning incident occurs, it will directly affect the life safety of the swimmer. At present, research on the identification of drowning behavior has been reported, but the existing technology still has the following shortcomings:

[0003] (1) Traditional methods for identifying abnormal human behavior extract feature descriptors from original images and then combine them with classification algorithms such as SVM and KNN to solve the problem. However, with the development of deep learning technology, neural networks have shown significantly better performance in extracting features than traditional methods, and have achieved better recognition results.

[0004] (2) Currently, most monitoring-based human behavior recognition uses static image analysis technology, which manually annotates a large number of foreground targets and then uses a 2D CNN network framework to extract the foreground target frame of the image. Although the computational cost is low, it cannot capture the temporal relationship of the behavior, and thus lacks the behavioral action characteristics of the target, resulting in a serious lack of important behavioral features, resulting in low accuracy of behavior recognition. Especially for complex environments such as indoor swimming pools, affected by the installation angle of the monitoring equipment, lighting, water surface fluctuations, and shaking of the pool bottom pattern, the position of the moving target during swimming is sometimes above water and sometimes underwater, making it difficult to capture the target state, which increases the difficulty of target detection and makes it impossible to identify specific behaviors.

[0005] (3) The 3D CNN network framework has been proven to be effective in spatiotemporal modeling, but it cannot capture enough information contained in the video. By adding optical flow information, the performance can be significantly improved compared to the single-stream network framework, but the introduced optical flow calculation cost is very expensive, and thus cannot be deployed in real-world applications;

[0006] (4) Some designed 3D networks are affected by the size of the dataset, which leads to overfitting and slow convergence problems in the trained models. Summary of the invention:

[0007] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for identifying drowning behavior in a swimming pool based on video timing feature analysis. By analyzing and processing indoor swimming images, an effective early warning is given for drowning behaviors appearing in the images, thereby reducing the occurrence of drowning deaths.

[0008] In order to achieve the above object, the present invention provides a method for identifying drowning behavior in a swimming pool based on video time series feature analysis, and the specific steps include:

[0009] S1. Constructing a dataset: Using a camera to collect real or simulated drowning behavior videos and normal swimming behavior videos as the original dataset, the original dataset is divided into a training set and a validation set. The training set and the validation set each contain five types of human behavior data videos: freestyle, butterfly stroke, breaststroke, backstroke, and drowning. Each video clip represents a specific behavior, and the length of the video clip is selected to be 5s to 10s.

[0010] S2. Preprocess the image: preprocess the image of the data set so that the size of the preprocessed image is unified to 3×T×224×224;

[0011] S3. Build a neural network model. The specific steps are:

[0012] S31, construct the feature extraction part, use the benchmark network framework 3D resnet50 as the backbone network backbone, which is used to extract the behavior features of the video swimmer; the backbone network includes 6 layers, from top to bottom, conv1 layer, Pool1 layer, Layer1 layer, Layer2 layer, Layer3 layer and Layer4 layer, the output feature image of each layer is used as the input feature image of the next layer, and finally the feature images of Layer1 layer, Layer2 layer, Layer3 layer and Layer4 layer are extracted;

[0013] S32, constructing a spatial semantic modulation module, which is used to perform spatial size modulation on the feature images of each layer extracted in step S31, so that the spatial sizes of the feature images of each layer remain consistent;

[0014] S33, constructing a temporal semantic modulation module, which is used to perform temporal semantic modulation on the hierarchical feature image after the spatial semantic modulation in step S32;

[0015] S34, constructing a feature fusion module, for fusing the hierarchical feature images after the operation in step S32 and step S33 in two ways, top-down and bottom-up; and then aggregating the two fused features, and using the aggregated features as the high-level features of the video behavior;

[0016] S35, constructing a behavior recognition module, inputting the aggregated high-level features obtained in step S34 into the behavior recognition module, and predicting which of the five behaviors, freestyle, butterfly stroke, breaststroke, backstroke and drowning, the behavior in the video belongs to;

[0017] S4, training the constructed neural network model to obtain the optimal neural network model;

[0018] S5. Preprocess the video image of the target person's swimming behavior collected by the surveillance camera above the swimming pool to obtain an image with a size of 3×T×224×224, and then input it into the trained neural network model to determine whether the target person's swimming behavior constitutes drowning behavior.

[0019] Furthermore, the preprocessing step of step S2 is as follows: the format of the image data extracted from the original dataset video is 3×T×W×H, the W×H image is first scaled to 224×224, and then the scaled image is normalized with a mean of [0.485, 0.456, 0.406] and a variance of [0.229, 0.224, 0.225], so that the size of the preprocessed image is unified to 3×T×224×224.

[0020] Furthermore, the network layer structure of the backbone network is shown in the following table;

[0021]

[0022] Furthermore, the spatial semantic module includes module 0 and module 1; the layer3 feature image extracted in step S31 is input into module 0, and a convolution conv operation with a filter kernel size of 3×3, a step size of 2, and a pad filling of 1 is adopted in space, followed by a bn layer normalization operation, and then an operation through a relu activation function, and the size of the output feature image is 2048×T×7×7; the layer4 feature image extracted in step S31 is input into module 1, and an idenfify() function operation is performed, and the output size is the same as the input layer4 feature image size, that is, the size of the output feature image is 2048×T×7×7. After spatial semantic modulation, the spatial sizes of the layer3 and layer4 feature images are kept consistent.

[0023] Furthermore, the temporal semantic modulation module includes module 3 and module 4, and the hierarchical features after spatial semantic modulation are input into module 3 and module 4 respectively. The network structures of module 3 and module 4 both include conv layer and pool layer, wherein the conv layer 3×1×1 performs temporal operation processing, and features are extracted for every 3 frames of T frame images, with a stride of 1; the stride used in the temporal sequence of the pool layer is 8.

[0024] Furthermore, the specific training process of step S4 is as follows:

[0025] S41, set the initial learning rate of the model to 0.01;

[0026] S42, setting an auxiliary behavior recognition module to obtain stronger feature supervision, enhance semantic information, and enhance the training effect of the model; inputting the layer3 feature image or the layer4 feature image obtained in step S31 into the auxiliary behavior recognition module, and the recognition result acts on the loss function to judge the loss difference between the video behavior result predicted by the model and the actual behavior of the video;

[0027] S43. Select a loss function. The loss function is used to measure the quality of model parameter learning.

[0028] The selected loss function is:

[0029]

[0030] Among them, L FocalLoss,o Represents the FocalLoss loss function; L FocalLoss,i represents the loss function for the i-th auxiliary behavior identification; λ i Indicates the balance coefficient, set λ i =0.5; M represents the number of auxiliary behavior recognition modules selected, and i is a value between 1 and M;

[0031] The FocalLoss loss function has the following formula:

[0032] FocalLoss(p t )=-α t (1-p t ) γ log(p t )

[0033] Among them, p t Indicates the probability of the training sample corresponding to the real category in the result predicted by the neural network model; α t represents the category weight coefficient; where γ = 2; the swimming behaviors selected by this technical solution include five human behaviors: freestyle, butterfly stroke, breaststroke, backstroke, and drowning, where the weight parameter α of each behavior category is t =[1.2,1.5,1.3,0.5,1.2];

[0034] S44, inputting the video images of the training data set into the constructed neural network model to learn model parameters, and the loss function measures the quality of the model parameter learning;

[0035] S45, using the loss function to calculate the loss value of the real swimming behavior and the predicted swimming behavior, the smaller the loss value, the better the effect of the obtained model parameters; when training the 80th complete training set and the 150th complete training set, the learning rate is reduced to 0.001 and 0.0001 respectively; this technical solution uses 200 training complete training sets as the final parameter model;

[0036] S46. Use the test set to verify the accuracy of the prediction results;

[0037] After continuous improvement and optimization of the neural network model, the final maximum accuracy of the neural network model in identifying drowning behavior was 90.2%.

[0038] Compared with the prior art, the present invention mainly adopts the network framework 3D resnet50 to extract image features, and fuses the spatial information features and temporal information features of human behavior to form a new fusion mode. The method can realize real-time processing of image information, and the constructed neural network model has fast calculation convergence speed, strong generalization ability and strong robustness. The method is ingeniously conceived, with high accuracy in drowning behavior recognition, reaching more than 90%, and can also be applied to mobile devices to reduce computing costs. Specific implementation method:

[0039] The present invention is further described in detail below through specific examples.

[0040] Embodiment 1:

[0041] This embodiment relates to a method for identifying drowning behavior in a swimming pool based on video time series feature analysis, and the specific steps are as follows:

[0042] S1. Constructing a dataset: Using a camera to collect real or simulated drowning behavior videos and normal swimming behavior videos as the original dataset, the original dataset is divided into a training set and a validation set. The training set and the validation set each contain five types of human behavior data videos: freestyle, butterfly stroke, breaststroke, backstroke, and drowning. Each video clip represents a specific behavior, and the length of the video clip is selected to be 5s to 10s.

[0043] S2. Preprocess the image: The image data format extracted from the original dataset video is 3×T×W×H, where T represents the number of frames obtained from the video clip at a certain sampling interval; since the video image collected by the surveillance camera is in color, 3 represents the three channels of RGB of the color image; W×H represents the width and height of the extracted image respectively; before entering the backbone network, the image is preprocessed. The preprocessing steps are as follows: first scale the W×H image to 224×224 size, and then normalize the scaled image with a mean of [0.485, 0.456, 0.406] and a variance of [0.229, 0.224, 0.225], so that the size of the preprocessed image is unified to 3×T×224×224;

[0044] S3. Construct a neural network model. The specific process includes:

[0045] S31, construct feature extraction part:

[0046] The benchmark network framework 3D resnet50 is used as the backbone network backbone to extract the behavior features of the swimmers in the video; the backbone network includes a 6-layer structure, from top to bottom, conv1 layer, Pool1 layer, Layer1 layer, Layer2 layer, Layer3 layer and Layer4 layer, the output feature image of each layer is used as the input feature image of the next layer, and finally the feature images of Layer1 layer, Layer2 layer, Layer3 layer and Layer4 layer are extracted; specifically: the image preprocessed in step S2 is input to conv1, as shown in the network structure of conv1 in Table 1, 1×7×7 table It shows that the input 3-channel image is convolved with a filter kernel size of 7×7 and a stride of 2 on a spatial size of 224×224, the channels of the output image are 64, the image size is 112×112, and the output size is a feature image of 64×T×112×112; then it enters the Pool1 layer, and performs a maximum pooling operation with a filter kernel size of 3×3 and a stride of 2 in space, and outputs a feature image of 64×T×56×56; then it enters the Layer1 layer, and performs a convolution operation in layer1 according to the parameters set in the network structure in Table 1. ×3 means that the same operation is performed 3 times, and the output size is The obtained Layer1 feature image is input to the Layer2 layer, and the layer2 layer performs a convolution operation according to the parameters set in the network structure in Table 1. ×4 means that the same operation is performed 4 times, and the output is a layer2 feature image with a size of 512×T×28×28; the layer2 feature image is input to the Layer3 layer, and the layer3 layer performs a convolution operation according to the parameters set in the network structure in Table 1. The 3 in 3×1×1 means that 3 frames are used in the video frame time sequence, and 1×1 means that a filter of size 1 is used in the image space. The kernel is used for feature extraction, ×6 means that the same operation is performed 6 times, and the output is a Layer3 feature image with a size of 1024×T×14×14; finally, the Layer3 feature image is input into the Layer4 layer, and the convolution operation is performed in layer4 according to the parameters set in the network structure in Table 1. The 3 in 3×1×1 means that 3 frames are used in the temporal sequence of the video frame, 1×1 means that a filter kernel with a size of 1 is used in space, and ×3 means that the same operation is performed 3 times, and the output is a Layer4 feature image with a size of 2048×T×7×7; the network layer structure of the backbone network backbone is shown in Table 1;

[0047] Table 1 Network layer structure of the backbone network

[0048]

[0049] S32. Constructing spatial semantic modulation module:

[0050] The spatial semantic module performs spatial size modulation on the feature images of each layer extracted in step S31, so that the spatial size of the feature images of each layer remains consistent, which is convenient for subsequent operations; the spatial semantic module includes module 0 and module 1, module 0 is used to perform spatial size modulation on the layer3 feature image obtained in step S31, and module 1 performs spatial size modulation on the layer4 feature image; specifically: the obtained layer3 feature image is input into module 0 in the spatial semantic modulation module, and a convolution conv operation with a filter kernel size of 3×3, a step size of 2, and a pad filling of 1 is adopted in space, followed by a bn layer normalization operation, and then an operation is performed through a relu activation function, and the size of the output feature image is 2048×T×7×7; the layer4 feature image is input into module 1 in the spatial semantic modulation module, and an idenfify() function operation is performed, and the output size is the same as the input layer4 feature image size, that is, the size of the output feature image is 2048×T×7×7; after spatial semantic modulation, the spatial sizes of the layer3 and layer4 feature images are kept consistent, which is convenient for subsequent operations;

[0051] Since the multi-layer features of the video sequence are obtained through the 3D network framework in step S31, but the spatial sizes of the output feature images of the layer1 to layer4 layers are inconsistent, it is necessary to perform spatial size modulation on the extracted features so that the spatial sizes of the feature images of each layer are consistent, which is convenient for subsequent operations; this embodiment selects the results of the high-level semantic features layer3 and layer4 for analysis, but is not limited to selecting layer3 and layer4 for analysis; the structural design of the spatial semantic modulation module is shown in Table 2;

[0052] Table 2 Network structure of spatial semantic modulation module

[0053]

[0054] S33, constructing a temporal semantic modulation module:

[0055] The temporal semantic modulation module is to better control the relative difference of feature images on the time scale, so as to perform feature aggregation more effectively; the temporal semantic modulation module includes module 3 and module 4, which are used to perform temporal semantic modulation on the layer3 feature image and layer4 feature image after spatial semantic modulation; specifically: the two output results after spatial semantic modulation in step S32 are respectively input into module 3 and module 4 in the temporal semantic modulation module, wherein the 3×1×1 in conv is processed in time sequence, and feature extraction is performed for every 3 frames of images in the T frame image, and the stride is 1; the stride used in the pool layer time sequence is 8, and the number of sampling frames in step S2 in this embodiment is selected as T=8; the number of output feature channels is 1024; the output feature sizes of module 3 and module 4 are both [1024,1,7,7]; the temporal semantic modulation network structure design is shown in Table 3;

[0056] Table 3 Network structure of temporal semantic modulation module

[0057]

[0058]

[0059] S34. Construct feature fusion module:

[0060] The feature fusion module is used to fuse the hierarchical feature images after the operation of step S32 and step S33 in two ways, top-down and bottom-up; the layer3 feature image after spatial semantic modulation and temporal semantic modulation is recorded as spatial_temporal_layer3; the layer4 feature image after spatial semantic modulation and temporal semantic modulation is recorded as spatial_temporal_layer4; spatial_temporal_layer3 is downsampled, and the result is feature fused with spatial_temporal_layer4 to obtain bottom-up pyramid fusion features; spatial_temporal_layer4 is upsampled, and the result is feature fused with spatial_temporal_layer3 to obtain top-down pyramid fusion features;

[0061] Aggregate the above two pyramid fusion features and use the aggregated features as high-level features of the video behavior;

[0062] S35. Constructing behavior recognition module

[0063] The behavior recognition module is used to recognize which swimming behavior category the video behavior belongs to; the specific recognition steps are: inputting the aggregated high-level features obtained in step S34 into the behavior recognition module to predict which of the five behaviors of freestyle, butterfly stroke, breaststroke, backstroke and drowning the video behavior belongs to; the network structure of the behavior recognition module is shown in Table 4;

[0064] Table 4 Network structure of main behavior recognition module

[0065]

[0066] S4. Train the constructed neural network model to obtain the optimal neural network model:

[0067] S41, set the initial learning rate of the model to 0.01;

[0068] S42, setting an auxiliary behavior recognition module to obtain stronger feature supervision, enhance semantic information, and enhance the training effect of the model; the specific steps of the auxiliary behavior recognition module are: inputting the layer3 feature image obtained in step S31 into the auxiliary behavior recognition module, and predicting that the video behavior belongs to one of the five behavior categories; a neural network model can have multiple auxiliary behavior recognition modules, for example, respectively inputting the layer3 feature image and the layer4 feature image obtained in step S31 to obtain two auxiliary behavior recognition results, and the recognition results act on the loss function to judge the loss difference between the video behavior result predicted by the model and the actual behavior of the video; the network structure of the auxiliary behavior recognition module is shown in Table 5;

[0069] Table 5 Auxiliary behavior recognition module

[0070]

[0071] S43. Select a loss function. The loss function is used to measure the quality of model parameter learning.

[0072] The selected loss function is:

[0073]

[0074] Among them, L FocalLoss,o Represents the FocalLoss loss function; L FocalLoss,i represents the loss function for the i-th auxiliary behavior identification; λ i Indicates the balance coefficient, set λ i =0.5; M represents the number of auxiliary behavior recognition modules selected, and i is a value between 1 and M;

[0075] The FocalLoss loss function has the following formula:

[0076] FocalLoss(p t )=-α t (1-p t ) γ log(p t )

[0077] Among them, p t represents the probability of the training sample corresponding to the real category in the result predicted by the neural network model of this embodiment; α t represents the category weight coefficient; where γ = 2; the swimming behaviors selected by this method include freestyle, butterfly stroke, breaststroke, backstroke, and drowning. The weight parameter α of each behavior category is t =[1.2,1.5,1.3,0.5,1.2];

[0078] S44, inputting the video images of the training data set into the constructed neural network model to learn model parameters, and the loss function measures the quality of the model parameter learning;

[0079] S45, using the loss function to calculate the loss value of the actual swimming behavior and the predicted swimming behavior, the smaller the loss value, the better the model parameter effect; when training the 80th complete training set and the 150th complete training set, the learning rate is reduced to 0.001 and 0.0001 respectively; in this embodiment, the complete training set is trained 200 times as the final parameter model;

[0080] S46. Use the test set to verify the accuracy of the prediction results;

[0081] After continuous improvement and optimization of the neural network model, the neural network model designed in this embodiment has a maximum accuracy of 90.2% in drowning behavior identification;

[0082] S5. Preprocess the video image of the target person's swimming behavior collected by the surveillance camera above the swimming pool to obtain an image with a size of 3×T×224×224, and then input it into the trained neural network model to determine whether the target person's swimming behavior constitutes drowning behavior.

[0083] The installation position of the surveillance camera in step S5 is located above the swimming pool and at a certain distance from the water surface. It is an above-water camera. Depending on the specific swimming pool scene, the installation position is analyzed according to the specific situation, but it is necessary to ensure that the installation angle and height of the surveillance camera are appropriate so that the swimming behavior of the target person is obvious and clearly visible, which is conducive to improving the behavior identification results.

Claims

1. A method for identifying drowning behavior in a swimming pool based on video temporal feature analysis, characterized in that: The specific steps are as follows: S1. Constructing a dataset: Using a camera to collect real or simulated drowning behavior videos and normal swimming behavior videos as the original dataset, the original dataset is divided into a training set and a validation set. The training set and validation set each contain five types of human behavior data videos: freestyle, butterfly stroke, breaststroke, backstroke, and drowning. Each video clip represents a specific behavior. S2. Preprocess the image: preprocess the image size of the data set; S3. Build a neural network model. The specific steps are: S31, construct the feature extraction part, use the benchmark network framework 3D resnet50 as the backbone network backbone, which is used to extract the behavior features of the video swimmer; the backbone network includes 6 layers, from top to bottom, conv1 layer, Pool1 layer, Layer1 layer, Layer2 layer, Layer3 layer and Layer4 layer, the output feature image of each layer is used as the input feature image of the next layer, and finally the feature images of Layer1 layer, Layer2 layer, Layer3 layer and Layer4 layer are extracted; S32, constructing a spatial semantic modulation module, which is used to perform spatial size modulation on the feature images of each layer extracted in step S31, so that the spatial sizes of the feature images of each layer remain consistent; S33, constructing a temporal semantic modulation module, which is used to perform temporal semantic modulation on the hierarchical feature image after the spatial semantic modulation in step S32; S34, constructing a feature fusion module, for fusing the hierarchical feature images after the operation in step S32 and step S33 in two ways, top-down and bottom-up; and then aggregating the two fused features, and using the aggregated features as the high-level features of the video behavior; S35, constructing a behavior recognition module, inputting the aggregated high-level features obtained in step S34 into the behavior recognition module, and predicting which of the five behaviors, freestyle, butterfly stroke, breaststroke, backstroke and drowning, the behavior in the video belongs to; S4, training the constructed neural network model to obtain the optimal neural network model; S5. Pre-process the video image of the target person's swimming behavior collected by the surveillance camera above the swimming pool and input it into the trained neural network model to determine whether the target person's swimming behavior constitutes drowning behavior.

2. The method for identifying drowning behavior in a swimming pool based on video time series feature analysis according to claim 1, characterized in that: The preprocessing steps of step S2 are as follows: the image data format extracted from the original dataset video is 3×T×W×H, the W×H image is first scaled to 224×224, and then the scaled image is normalized with a mean of [0.485, 0.456, 0.406] and a variance of [0.229, 0.224, 0.225], so that the preprocessed image size is unified to 3×T×224×224.

3. The method for identifying drowning behavior in a swimming pool based on video time series feature analysis according to claim 1, characterized in that: The network layer structure of the backbone network is shown in the following table; 4. The method for identifying drowning behavior in a swimming pool based on video time series feature analysis according to claim 1, characterized in that: The spatial semantic module includes module 0 and module 1; the layer3 feature image extracted in step S31 is input into module 0, and a convolution conv operation with a filter kernel size of 3×3, a step size of 2, and a pad filling of 1 is used in space, followed by a bn layer normalization operation, and then an operation through a relu activation function, and the size of the output feature image is 2048×T×7×7; the layer4 feature image extracted in step S31 is input into module 1, and an idenfify() function operation is performed, and the output size is the same as the input layer4 feature image size, that is, the size of the output feature image is 2048×T×7×7; after spatial semantic modulation, the spatial sizes of the layer3 and layer4 feature images are kept consistent.

5. The method for identifying drowning behavior in a swimming pool based on video time series feature analysis according to claim 1, characterized in that: The temporal semantic modulation module includes module 3 and module 4. The hierarchical features after spatial semantic modulation are input into module 3 and module 4 respectively. The network structures of module 3 and module 4 include conv layer and pool layer. The conv layer 3×1×1 performs temporal operation processing, and features are extracted for every 3 frames of T frame images with a stride of 1. The stride of the pool layer in time sequence is 8.

6. The method for identifying drowning behavior in a swimming pool based on video temporal feature analysis according to claim 1, characterized in that: The specific training process of step S4 is: S41, set the initial learning rate of the model to 0.01; S42, setting an auxiliary behavior recognition module to obtain stronger feature supervision, enhance semantic information, and enhance the training effect of the model; inputting the layer3 feature image or the layer4 feature image obtained in step S31 into the auxiliary behavior recognition module, and the recognition result acts on the loss function to judge the loss difference between the video behavior result predicted by the model and the actual behavior of the video; S43. Select a loss function. The loss function is used to measure the quality of model parameter learning. The selected loss function is: Among them, L FocalLoss,o Represents the FocalLoss loss function; L FocalLoss,i represents the loss function for the i-th auxiliary behavior identification; λ i Indicates the balance coefficient, set λ i =0.5; M represents the number of auxiliary behavior recognition modules selected, and i is a value between 1 and M; The FocalLoss loss function has the following formula: FocalLoss(p t )=-α t (1-p t ) γ log(p t ) Among them, p t Indicates the probability of the training sample corresponding to the real category in the result predicted by the neural network model; α t represents the category weight coefficient; where γ = 2; the swimming behaviors selected by this technical solution include five human behaviors: freestyle, butterfly stroke, breaststroke, backstroke, and drowning, where the weight parameter α of each behavior category is t =[1.2,1.5,1.3,0.5,1.2]; S44, inputting the video images of the training data set into the constructed neural network model to learn model parameters, and the loss function measures the quality of the model parameter learning; S45, using the loss function to calculate the loss value of the real swimming behavior and the predicted swimming behavior, the smaller the loss value, the better the effect of the obtained model parameters; when training the 80th complete training set and the 150th complete training set, the learning rate is reduced to 0.001 and 0.0001 respectively; this technical solution uses 200 training complete training sets as the final parameter model; S46. Use the test set to verify the accuracy of the prediction results; After continuous improvement and optimization of the neural network model, the final maximum accuracy of the neural network model in identifying drowning behavior was 90.2%.