A fall detection method based on self-attention two-stream network

The self-attention dual-stream network combined with Darknet19 and S3D neural network solves the problem of non-real-time video real-time detection in the existing technology. The self-attention mechanism strengthens feature extraction and improves the accuracy and real-time performance of fall behavior detection.

CN114463844BActive Publication Date: 2024-10-18CHINA THREE GORGES UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210033684.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-12
Publication Date
2024-10-18
Estimated Expiration
2042-01-12

AI Technical Summary

Technical Problem

Existing behavior recognition methods do not have good real-time performance in real-time video detection, and it is difficult to extract deep information features, resulting in reduced prediction accuracy.

Method used

A fall detection method based on self-attention dual-stream network is adopted, through the combination of Darknet19 and S3D neural network, and the self-attention mechanism is used to fuse and weight channel feature information to improve feature extraction and prediction accuracy.

Benefits of technology

It improves the pertinence and prediction effect of network training, enhances the correlation of channel feature information, and improves the accuracy and real-time performance of fall behavior detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463844B_ABST
    Figure CN114463844B_ABST
Patent Text Reader

Abstract

A fall detection method based on a self-attention dual-stream network includes the following steps: Step 1: Collect image data of human behavior and action to form a sample data set of behavior and action; Step 2: Construct a self-attention dual-stream network for behavior and action detection; Step 3: Use a balanced simple and easy-to-divide sample manipulation focus loss function to optimize the self-attention dual-stream network; Step 4: Use the sample data set to train and test the self-attention dual-stream network to achieve detection accuracy; Step 5: Collect real-time images of people, input them into the trained self-attention dual-stream network, and detect whether there is a fall behavior. The present invention is a fall detection method based on a self-attention dual-stream network, which is proposed based on a computer vision method to detect and track people in a video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of behavior recognition, and in particular relates to a real-time fall detection and tracking method based on dual-stream convolution. Background Art

[0002] With the continuous progress of society, artificial intelligence has become more and more common in people's lives. Artificial intelligence-related technologies are also playing an increasingly important role in people's lives. Behavior recognition technology, as a technology in artificial intelligence technology, plays a very important role in analyzing pedestrian behavior in videos. For some dangerous behaviors, relevant behavior recognition algorithms can be used to process the video and issue warnings at the same time. Behaviors in dangerous areas can be handled in a timely manner.

[0003] In the field of behavior recognition, the more popular algorithms are based on wearable devices, posture estimation, and computer vision. Although the wearable device method has advantages such as simplicity and convenience, it may cause some problems for some elderly people, which may cause comfort problems or even cause them to forget to wear it. For posture estimation algorithms, due to the calculation of multiple joint points when using the algorithm, the real-time performance is reduced to a certain extent.

[0004] At present, the development of fall detection based on video detection is not very mature. Although there are many public data sets available, these data sets are very different for actual application scenarios. For the problem of real-time detection in video, there are currently related methods such as 3D convolution, 2D+3D, CNN+LSTM, etc. The method based on 3D convolution to directly obtain the spatiotemporal features of the video can directly obtain the spatiotemporal features of the video, but the problem is that due to the excessive number of convolution kernel parameters, the calculation amount is large and the time consumption is long; based on 2D+3D and convolution, the spatial features of the image are mainly obtained through 2D convolution, and the motion information of the video is obtained by 3D convolution, and finally the spatiotemporal information is fused. The CNN+LSTM model obtains the importance of information through some forget gates to obtain the relevant feature information of the video, and finally the obtained results are predicted.

[0005] In many existing behavior recognition methods, first of all, for the network architecture, many network architectures use 3D convolution, so when training the network, due to the large number of parameters, the training time is very long. Then for many multi-stage network models, although the accuracy has been greatly improved, due to the complexity of the network, there are great problems in real-time prediction, that is, the real-time detection of the video is not good. When the network performs deep information feature extraction, some important information cannot be extracted well, and a large amount of important information cannot be highlighted, thereby reducing the accuracy of the model in prediction. Summary of the invention

[0006] The present invention is a fall detection method based on a self-attention dual-stream network, which is proposed based on a computer vision method to detect and track the behavior of people in videos. The purpose is to solve the technical problems that the existing behavior recognition methods do not have good real-time performance when performing real-time detection on videos, and cannot extract important information well when performing deep information feature extraction on the network, and cannot highlight a large amount of important information, thereby reducing the accuracy of the model in prediction.

[0007] A fall detection method based on a self-attention dual-stream network, comprising the following steps:

[0008] Step 1: Collect image data of human behavior and form a sample data set of behavior;

[0009] Step 2: Build a self-attention two-stream network for action detection;

[0010] Step 3: Use the balanced simple and easy-to-divided sample manipulation focus loss function to optimize the self-attention two-stream network;

[0011] Step 4: Use the sample data set to train and test the self-attention two-stream network to achieve detection accuracy;

[0012] Step 5: Collect real-time images of people and input them into the trained self-attention two-stream network to detect whether there is a fall.

[0013] In step 1, the human behavior action classification includes falling, running, jumping, walking, standing, and lying;

[0014] In step 1, the sample dataset is divided into a training set and a test set in proportion.

[0015] In step 2, the backbone network of the constructed self-attention dual-stream network is divided into two branches. The first branch includes the Darknet19 neural network, and the second branch includes the S3D neural network. The specific structure is: input layer → Darknet19 neural network → self-attention model; input layer → S3D neural network → self-attention model; the self-attention model takes the output of the network in the first branch and the second branch as input, uses channel fusion to fuse the information on the channel, obtains the attention feature map through the attention mechanism, and finally outputs it through a layer of convolution to obtain the output layer.

[0016] In step 2, the structure of the S3D neural network is: connect convolution, pooling, convolution, convolution, pooling in sequence, then connect two Inception1 Blocks and a maximum pooling layer in sequence, then connect 5 Inception1 Blocks and a maximum pooling layer, and finally connect two Inception2 Blocks;

[0017] When the S3D neural network is in use, it first obtains a time-series video frame, and then obtains shallow information in the time sequence through convolution, pooling, convolution, convolution, and pooling, and then extracts deeper feature information through multiple Inception1 Blocks. Then, the pooling layer is used to reduce the number of features to reduce the size of the merged feature map so that it can be sent to the next Inception1 Block. After passing through multiple Inception1 Blocks, it passes through multiple Inception2 Blocks.

[0018] The specific structure of Inception1Block is as follows: it has four branches. The first branch contains only one convolution kernel and operates in time series. The second and third branches first reduce the dimension in space and then in time series. The fourth branch first implements a maximum pooling in space and then processes in time series. Through multiple branches, richer feature information can be extracted from the video.

[0019] In step 2, the structure of the Darknet19 neural network is to connect 2D convolution, pooling, 2D convolution, pooling, Block1, pooling, Block1, pooling, Block2, pooling, Block2, and 2D convolution in sequence; among them, Block1 and Block2 are both multi-layer convolution structures.

[0020] In step 2, the self-attention two-stream network uses the Darknet19 neural network and the S3D neural network, and uses channel fusion to splice the feature information extracted by the 2D network with the timing information extracted by the 3D network. Through the self-attention mechanism, the weight of each channel is obtained, and the importance of the feature map on each channel is obtained. The correlation between the feature maps between channels is obtained through the Gram matrix. The self-attention mechanism effectively strengthens the feature information and has a good effect on behavior classification.

[0021] The backbone network of the self-attention two-stream network includes the Darknet19 neural network, S3D and self-attention model. The Darknet19 neural network is composed of convolutional layers and pooling layers; the S3D neural network is connected to the convolutional layer and pooling layer through multiple Inception Blocks; the self-attention model improves the importance of features.

[0022] The Inception Block of the S3D neural network all adopts a pseudo 3D structure.

[0023] When the self-attention model is used, the 2D and 3D network fusion feature map A is first obtained and A∈R (c’+c”)×H×W , after fusion, we get B and B∈R c×H×W , let B = [v 1 ,v 2 ,...,v c ], N = H × W, and then transform B to get F, the formula is as follows:

[0024] B∈R c×H×W →F∈R c×N (1)

[0025] E=F×F T (2)

[0026]

[0027] G=M×F (5)

[0028] G∈R c×N →G'∈R c×H×W (6)

[0029] Where B represents: the feature map after the fusion of 2D features and 3D features; E represents: the attention map of the feature map between channels; M represents: the attention map after mapping; G represents: the influence of the attention map on the original feature map;

[0030] After obtaining the fused feature map B, we transform B into a two-dimensional vector F by transforming its dimension. T Get the Gram matrix, and then get the attention map M through the softmax function;

[0031] The weight of each channel is obtained by globally pooling the feature map in space to measure the importance of feature maps on different channels, and finally the weighted feature information is obtained. The formula is as follows:

[0032]

[0033] Q=K×B (8)

[0034] C=G'+Q (9)

[0035] Where K represents: channel weight attention map; Q represents: weighted feature map; v represents: single feature map; C represents: new feature map.

[0036] A self-attention model, when used, first obtains the 2D and 3D network fusion feature map A, and then obtains B after fusion, let B = [v 1 ,v 2 ,...,v c ], N = H × W, and then transform B to get F. T Get the Gram matrix, and then get the attention map M through the softmax function;

[0037] The weight of each channel is obtained by globally pooling the feature map in space to measure the importance of feature maps on different channels, and finally the weighted feature information is obtained.

[0038] The formula used to obtain F after transforming the dimension of B is as follows:

[0039] B∈R c×H×W →F∈R c×N (1)

[0040] E=F×F T (2)

[0041]

[0042] G=M×F (5)

[0043] G∈R c×N →G'∈R c×H×W (6)

[0044] Where B represents: the feature map after the fusion of 2D features and 3D features; E represents: the attention map of the feature map between channels; M represents: the attention map after mapping; G represents: the influence of the attention map on the original feature map;

[0045] In the process of obtaining weighted feature information, the formula used is:

[0046]

[0047] Q=K×B (8)

[0048] C=G'+Q (9)

[0049] Where K represents: channel weight attention map; Q represents: weighted feature map; v represents: single feature map; C represents: new feature map.

[0050] Compared with the prior art, the present invention has the following technical effects:

[0051] The present invention proposes a new neural network model, namely the self-attention two-stream network, for detecting human falling behavior. Compared with the existing neural network model, it can find out the importance of the features of different channels, and conduct more targeted training during network training, so that the final prediction effect is better; the self-attention two-stream network of the present invention solves the problem of low correlation between feature information between channels, and at the same time strengthens useful feature information according to the self-attention mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0053] Figure 1 Schematic diagram of a self-attention dual-stream network according to an embodiment of the present invention.

[0054] Figure 2 Schematic diagram of the Darknet19 neural network structure.

[0055] Figure 3 This is a schematic diagram of the Block1 structure of the Darknet19 neural network structure.

[0056] Figure 4 This is a schematic diagram of the Block2 structure of the Darknet19 neural network structure.

[0057] Figure 5 Schematic diagram of the S3D neural network structure.

[0058] Figure 6 Schematic diagram of the Inception1Block structure of the S3D neural network structure.

[0059] Figure 7 Schematic diagram of the Inception2Block structure of the S3D neural network structure.

[0060] Figure 8 Schematic diagram of the self-attention mechanism structure. DETAILED DESCRIPTION

[0061] A fall detection method based on a self-attention dual-stream network comprises the following steps:

[0062] Step 1: Classify human behaviors into falling, running, jumping, walking, standing, and lying, collect image data of human behaviors, and form a sample data set of behaviors;

[0063] Step 2: Build a self-attention two-stream network for action detection;

[0064] Step 3: Use the balanced simple and easy-to-divided sample manipulation focus loss function to optimize the self-attention two-stream network;

[0065] Step 4: Use the sample data set to train and test the self-attention two-stream network to achieve detection accuracy;

[0066] Step 5: Collect real-time images of people and input them into the trained self-attention two-stream network to detect whether there is a fall.

[0067] like Figure 1 As shown in Figure 1, the backbone network of the self-attention two-stream network includes two branches, the first branch is the Darknet19 neural network, and the second branch is the S3D neural network.

[0068] The S3D neural network sequentially connects convolution, pooling, convolution, convolution, pooling, and then connects two Inception1Blocks and a layer of maximum pooling, then connects 5 Inception1 Blocks and a maximum pooling layer, and finally connects two Inception2Blocks; the self-attention model takes the output of the two branch networks as input, uses channel fusion to fuse the information on the channel, and obtains the attention feature map through the attention mechanism. Finally, it is output through a layer of convolution.

[0069] The neural network model of the present invention uses an S3D neural network, which first obtains a time-series video frame, and then obtains shallow information on the time sequence through convolution, pooling, convolution, convolution, and pooling, and then extracts deeper feature information through multiple Inception blocks. The structure of Inception1 Block is as follows: Figure 6 As shown in the figure, it contains 4 branches, each of which is a pseudo 3D convolution. After extracting the features, the concat function is used to concatenate the features of the four branches together, and then a pooling layer is used to reduce the number of features by half to reduce the size of the merged feature map so that it can be sent to the next Inception1Block.

[0070] The first branch of Inception1Block contains only one convolution kernel and operates in time series. The second and third branches first reduce the dimension in space and then in time series. The fourth branch first implements a maximum pooling in space and then processes in time series. Through multiple branches, richer feature information can be extracted from the video. Figure 7 Inception2Block also contains 4 branches, but the difference from Inception1 Block is that the middle two branches lack the information on processing timing. The Inception Block module uses a pseudo 3D convolution kernel module, which reduces a large number of parameters compared with the 3D convolution kernel. The use of pseudo 3D convolution plays a great role in the single-stage neural network model of the present invention when performing behavior prediction, and can improve the real-time performance of network detection.

[0071] The neural network model of the present invention adopts the Darknet19 neural network, which includes 19 convolutional networks and 5 pooling layers; its structure is as follows Figure 2 As shown, it is used as a 2D branch network of the neural network model of the present invention. Wherein the Block1 and Block2 modules are as shown Figure 3 ,like Figure 4 As shown in the figure, it is a multi-layer convolution. The Darknet19 neural network can obtain the spatial features of key frames in the video. Compared with the 3D network for behavior recognition, the use of 2D network to extract key frames in the video can make the features extracted by the entire network richer, which is also very useful for the problem of spatiotemporal behavior detection. It can well locate the specific position of people in the video, and the network structure is relatively simple, which is very useful for real-time detection in the video.

[0072] After the branch network models of the two-stream network extract features respectively, the spatial information and the temporal information are fused. However, there will be a lot of noise, which makes the fused feature information unable to correctly represent the features required for training. At the same time, the special information between channels is independent of each other and has no correlation. Therefore, through the attention mechanism, the network model pays more attention to useful features and performs training, so as to obtain more effective features, which can more accurately predict the behavior of people in the video during prediction.

[0073] In step 2, the self-attention dual-stream network uses the Darknet19 neural network and S3D to splice the output of the 2D network with the output of the 3D network by channel fusion. The spatial feature information of the video key frames is extracted through the Darknet19 neural network, and the temporal feature information of the video is extracted by S3D. The spatial and temporal information is fused to the deep layer through channel fusion, and the spatial information and temporal information are aggregated together through fusion. Finally, the convolutional layer is used to classify the results and regress the bounding box.

[0074] Preferably, the S3D neural network of the self-attention two-stream network includes convolution, pooling, convolution, convolution, pooling connected in sequence, followed by 2 Inception Block1s; then connected to a Maxpool, then connected to 5 InceptionBlock1s, a Maxpool, and finally connected to two Inception Block2s, where the Inception Block separates the 3D convolution into a 2D plus 3D form, and the Inception Block is divided into 4 branches.

[0075] The self-attention network used in the neural network model of the present invention is as follows Figure 8 As shown in , it first obtains the features obtained by channel fusion. The features obtained are simply splicing spatial features and temporal features on the channel, but cannot characterize the correlation between channels. Then, it is impossible to know the importance of information features stored in each channel. Therefore, there is still a lot of noise in the fused features, and the information between each channel is independent of each other. The attention mechanism can solve these two problems. First, get the 2D and 3D network fusion feature map A and A∈R (c’+c”)×H×W , after fusion, we get B and B∈R c×H×W , let B = [v 1 ,v 2 ,...,v c ], N = H × W, and then transform B to get F, the formula is as follows:

[0076] B∈R c×H×W →F∈R c×N (1)

[0077] E=F×F T (2)

[0078]

[0079] G=M×F (5)

[0080] G∈R c×N →G'∈R c×H×W (6)

[0081] Where B represents (the feature map after the fusion of 2D features and 3D features), E represents (the attention map of the feature map between channels), M represents (the attention map after mapping), and G represents (the influence of the attention map on the original feature map).

[0082] After obtaining the fused feature map B in the above formula, B is transformed into a two-dimensional vector F by dimension transformation. T The Gram matrix is ​​obtained, and then the attention map M is obtained through the softmax function. M represents the correlation between different feature maps between channels and deepens the information fusion between channels. The above method strengthens the correlation between different features between channels, so that the deep layer can obtain new feature information and achieve better performance.

[0083] For the importance of different feature maps in the channel, the weight of each channel is obtained by global pooling of the feature map in space to measure the importance of feature maps on different channels, and finally obtain weighted feature information. The formula is as follows:

[0084]

[0085] Q=K×B (8)

[0086] C=G'+Q (9)

[0087] Where K represents (channel weight attention map), Q represents (weighted feature map), v represents (single feature map), and C represents (new feature map).

[0088] In the embodiment, the parameters of the self-attention two-stream network for fall detection are shown in Table 1.

[0089] Table 1. Parameters of deep learning algorithm recognition unit

[0090] Settings parameter learning_rate 0.0001 nms_thresh 0.4 iou_thresh 0.5 clip_duration 16 batch_size 12 epochs 100

[0091] In the embodiment, a two-stream network without an attention mechanism and a two-stream network with an attention mechanism are used for fall detection experiments, and the experimental results are shown in Table 2.

[0092] Table 2 Comparison of evaluation indicators of ordinary two-stream network and self-attention two-stream network

[0093]

[0094] From the evaluation index of the experimental results in Table 2, it can be concluded that the dual-stream network with self-attention is better than the dual-stream network without self-attention. The self-attention dual-stream network of the present invention strengthens the association between channel feature maps, making the feature information richer. In addition, the use of weighted feature maps can know the importance of each feature map to the overall feature map. The self-attention dual-stream network of the present invention has an accuracy of 64.02% and a recall rate of 93.20%. Compared with the ordinary dual-stream network, the accuracy is improved by 1.42% and the recall rate is improved by 0.4%. Its various indicators are improved compared with the ordinary dual-stream network. It can be seen that the self-attention mechanism can obtain richer spatiotemporal information of the video.

Claims

1. A fall detection method based on self-attention dual-stream network, characterized in that: It includes the following steps: Step 1: Collect image data of human behavior and form a sample data set of behavior; Step 2: Build a self-attention two-stream network for action detection; Step 3: Use the balanced simple and easy-to-divided sample manipulation focus loss function to optimize the self-attention two-stream network; Step 4: Use the sample data set to train and test the self-attention two-stream network to achieve detection accuracy; Step 5: Collect real-time images of people and input them into the trained self-attention two-stream network to detect whether there is a fall behavior; In step 2, the backbone network of the constructed self-attention dual-stream network is divided into two branches. The first branch includes the Darknet19 neural network, and the second branch includes the S3D neural network. The specific structure is: input layer → Darknet19 neural network → self-attention model; input layer → S3D neural network → self-attention model; the self-attention model takes the output of the network in the first branch and the second branch as input, uses channel fusion to fuse the information on the channel, obtains the attention feature map through the attention mechanism, and finally outputs it through a layer of convolution to obtain the output layer; In step 2, the structure of the S3D neural network is: connect convolution, pooling, convolution, convolution, pooling in sequence, then connect two Inception1 Blocks and a maximum pooling layer in sequence, then connect 5 Inception1 Blocks and a maximum pooling layer, and finally connect two Inception2 Blocks.

2. The method according to claim 1, characterized in that In step 1, the human behavior action classification includes falling, running, jumping, walking, standing, and lying; In step 1, the sample data set is divided into a training set and a test set in proportion.

3. The method according to claim 1, characterized in that When the S3D neural network is in use, it first obtains a time-series video frame, and then obtains shallow information in the time sequence through convolution, pooling, convolution, convolution, and pooling, and then extracts deeper feature information through multiple Inception1Blocks. Then, the pooling layer is used to reduce the number of features to reduce the size of the merged feature map so that it can be sent to the next Inception1 Block. After passing through multiple Inception1 Blocks, it passes through multiple Inception2 Blocks.

4. The method according to claim 1, characterized in that: The specific structure of Inception1 Block is as follows: it has four branches. The first branch contains only one convolution kernel and operates in time series. The second and third branches first reduce the dimension in space and then in time series. The fourth branch first implements a maximum pooling in space and then processes in time series. Through multiple branches, richer feature information can be extracted from the video.

5. The method according to claim 1, characterized in that In step 2, the structure of the Darknet19 neural network is to connect 2D convolution, pooling, 2D convolution, pooling, Block1, pooling, Block1, pooling, Block2, pooling, Block2, and 2D convolution in sequence; among them, Block1 and Block2 are both multi-layer convolution structures.

6. The method according to any one of claims 1 to 5, characterized in that: When the self-attention model is used, First, we get the 2D and 3D network fusion feature map A and A∈R (c’+c”)×H×W , after fusion, we get B and B∈R c×H×W , let B = [v1,v2,...,v c ], N = H × W, and then transform B to get F, the formula is as follows: B∈R c×H×W →F∈R c×N (1) E=F×F T (2) G=M×F (5) G∈R c×N →G'∈R c×H×W (6) Where B represents: the feature map after the fusion of 2D features and 3D features; E represents: the attention map of the feature map between channels; M represents: the attention map after mapping; G represents: the influence of the attention map on the original feature map; After obtaining the fused feature map B, we transform B into a two-dimensional vector F by transforming its dimension. T Get the Gram matrix, and then get the attention map M through the softmax function; The weight of each channel is obtained by globally pooling the feature map in space to measure the importance of feature maps on different channels, and finally the weighted feature information is obtained. The formula is as follows: Q=K×B (8) C=G'+Q (9) Where K represents: channel weight attention map; Q represents: weighted feature map; v represents: single feature map; C represents: new feature map.

Citation Information

Patent Citations

  • Violent behavior recognition method based on sequential guidance of spatial attention

    CN111414876A

  • Person re-identification method combining reverse attention and multi-scale deep supervision

    US20210232813A1