Escalator pedestrian abnormal behavior recognition method, device and equipment and storage medium
By applying the human body key point detection model in the escalator environment, and using the combination of the backbone network layer and the attention module, the problem of insufficient accuracy of the traditional YOLOv8 model in detecting small target human body key points is solved, and higher detection accuracy is achieved. and the ability to identify abnormal behaviors.
Patent Information
- Application Number
- CN202410604785.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-09-03
AI Technical Summary
The traditional YOLOv8 model has poor accuracy when detecting key points of small targets in the escalator environment, especially when the pedestrian target is small due to the camera installation angle and height.
The human body key point detection model is adopted, including the fully connected convolution layer of the backbone network layer, the hole space convolution pooling pyramid layer and the attention module. Through the fully connected convolution operation, pooling operation and reconstructed feature map, combined with the neck The upsampling and downsampling feature maps of the layer are fused to improve detection accuracy.
It significantly improves the accuracy of human body key point detection, enhances the model's ability to detect small targets, and can more accurately identify abnormal behaviors of escalator pedestrians.
Smart Images

Figure CN118587760A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a method, device, equipment and storage medium for identifying abnormal behavior of pedestrians in an escalator. Background Art
[0002] Escalators (escalators for short) are usually installed in important places with dense flow of people, bringing convenience to people's travel. However, due to the lack of safety awareness of passengers when taking escalators, serious safety accidents can easily occur on escalators. Therefore, through intelligent video analysis algorithms, various riding behaviors on escalators are monitored in real time, and abnormal behaviors of passengers when taking escalators are automatically detected, which is of great significance to ensuring the safe operation of places with dense flow of people.
[0003] Most traditional abnormal behavior recognition algorithms are only suitable for a few specific actions in a single, simple environment. With the improvement of computing performance and the increasing maturity of algorithm research, behavior recognition algorithms based on deep learning have brought great changes to this field. Among them, single-stage behavior recognition algorithms are widely used, represented by the YOLO (You Only Look Once) algorithm. The YOLO algorithm is an object recognition and positioning algorithm based on a deep neural network that can directly analyze various behaviors in an image. The YOLOv8 model is the latest model in the YOLO algorithm series and has a human key point detection function. However, due to the installation angle and height of the camera in the escalator area, the pedestrian targets in the real-time escalator image are relatively small. The traditional YOLOv8 model has poor detection accuracy in detecting small targets, especially the key points of small targets with large traffic. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a method, device, equipment and storage medium for identifying abnormal behavior of pedestrians on an escalator, thereby improving the accuracy of key point detection of the human body.
[0005] In a first aspect, the present invention provides a method for identifying abnormal behavior of pedestrians in an escalator, the method comprising:
[0006] Inputting the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer;
[0007] Using the fully connected convolutional layer of the backbone network layer to perform a first convolution operation on the first feature map to obtain a second feature map with different sampling rates;
[0008] Using the atrous spatial convolution pooling pyramid layer of the backbone network layer, performing a second convolution operation and a pooling operation on the second feature maps with different sampling rates to obtain a third feature map;
[0009] Reconstructing the third feature map according to a preset cardinality and a preset number of iterations using the attention module of the backbone network layer to obtain a reconstructed fourth feature map;
[0010] Using the neck layer, upsampling the reconstructed fourth feature map, fully connecting it with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer, to obtain the upsampled feature map corresponding to each of the first convolutional layers, and fully connecting it with the downsampled feature map corresponding to each of the first convolutional layers, to obtain the target feature map corresponding to the output of each of the first convolutional layers;
[0011] Using the prediction layer, based on the target feature map corresponding to the output of each of the first convolutional layers, human key points are detected to obtain target position information corresponding to the human key points of the escalator pedestrian image;
[0012] Based on the target position information corresponding to the human body key points of the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
[0013] Optionally, each of the first convolutional layers uses regional dynamic perception depth separable convolution to perform the first convolution operation on the input first feature map, and the fully connected convolution C2f layer of the backbone network layer is used to perform the first convolution operation on the first feature map to obtain second feature maps with different sampling rates, including:
[0014] For any of the first convolutional layers, using the first convolutional layer to generate a guiding feature of the first feature map in the first convolutional layer according to the first feature map;
[0015] Based on the guiding features of the first feature map, dividing the first feature map into a plurality of spatial regions using the first convolutional layer;
[0016] Performing a two-dimensional convolution on the first feature map of each of the spatial regions to obtain a convolution image corresponding to each of the spatial regions;
[0017] The convolution images corresponding to the spatial regions are fused to obtain a second feature map of the sampling rate corresponding to the first convolution layer.
[0018] Optionally, the atrous spatial convolution pooling pyramid layer includes parallel convolution layers and pooling layers for at least two sampling rates; the atrous spatial convolution pooling pyramid layer of the backbone network layer is used to perform a second convolution operation and a pooling operation on the second feature maps of different sampling rates to obtain a third feature map, including:
[0019] Using the parallel convolution layer to perform a second convolution operation on the second feature maps with different sampling rates, respectively, to obtain feature maps with different sampling rates;
[0020] Performing a pooling operation on the feature maps of different sampling rates to obtain a pooling operation result, and performing a convolution and upsampling operation on the pooling operation result using a convolution kernel of a preset size to obtain an upsampling result;
[0021] The feature maps with different sampling rates and the upsampling results are fused to obtain the third feature map.
[0022] Optionally, the attention module includes a responsibility estimation module, a likelihood maximization module and a data re-estimation module; the using the attention module of the backbone network layer to reconstruct the third feature map according to a preset cardinality and a preset number of iterations to obtain a reconstructed fourth feature map includes:
[0023] Step a: according to the third feature map and the initial value of the preset cardinality, the responsibility estimation module is used to estimate a first latent variable corresponding to the third feature map, where the first latent variable is used to characterize the responsibility value of each pixel in the third feature map;
[0024] Step b: updating the preset cardinality using the likelihood maximization module according to the first latent variable corresponding to the third feature graph to obtain an updated value of the preset cardinality;
[0025] Step c, according to the third characteristic map and the updated value of the preset cardinality, using the responsibility estimation module to estimate the second latent variable corresponding to the third characteristic map, and determining the second latent variable as the new first latent variable, repeating the above steps a to c until the number of iterations reaches the preset number of iterations, and determining the updated value of the preset cardinality and the second latent variable corresponding to the third characteristic map at the end of the iteration as the target value of the preset cardinality and the target latent variable corresponding to the third characteristic map;
[0026] According to the target value of the preset cardinality and the target latent variable corresponding to the third feature map, the third feature map is reconstructed using the data re-estimation module to obtain a reconstructed fourth feature map; the reconstructed fourth feature map is used to instruct the human key point detection model to focus on the key parts.
[0027] Optionally, the determining whether a pedestrian in the escalator pedestrian image has abnormal behavior based on target position information corresponding to human body key points in the escalator pedestrian image includes:
[0028] Based on the target position information corresponding to the key points of the human body in the escalator pedestrian image and the preset abnormal behavior rules, determining whether the pedestrian in the escalator pedestrian image has abnormal behavior;
[0029] Among them, the preset abnormal behavior rules are used to characterize the key position information of the pedestrian's body corresponding to at least one abnormal behavior; the abnormal behavior includes at least one of the following: pedestrian falling, pedestrian walking in the opposite direction, pedestrian running and pedestrian squatting.
[0030] Optionally, the human key point detection model is obtained by training an initial human key point detection model according to the first sample image and the MPDIoU loss function, and the initial human key point detection model is a YOLOv8 model.
[0031] In a second aspect, the present invention further provides an escalator pedestrian abnormal behavior recognition device, the device comprising:
[0032] The key point detection module is used to input the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer; the first convolution operation is performed on the first feature map by using the fully connected convolution layer of the backbone network layer to obtain a second feature map with different sampling rates; the second convolution operation and pooling operation are performed on the second feature map with different sampling rates by using the hollow space convolution pooling pyramid ASPP layer of the backbone network layer to obtain a third feature map; the attention module of the backbone network layer is used to perform the attention operation on the second feature map according to a preset cardinality and a preset number of iterations. The third feature map is reconstructed to obtain a reconstructed fourth feature map; using the neck layer, the reconstructed fourth feature map is upsampled, and fully connected with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer to obtain the upsampled feature map corresponding to each of the first convolutional layers, and fully connected with the downsampled feature map corresponding to each of the first convolutional layers to obtain the target feature map corresponding to the output of each of the first convolutional layers; using the prediction layer, based on the target feature map corresponding to the output of each of the first convolutional layers, the key points of the human body are detected to obtain the target position information corresponding to the key points of the human body of the escalator pedestrian image;
[0033] The abnormality determination module is used to determine whether the pedestrian in the escalator pedestrian image has abnormal behavior based on the target position information corresponding to the human body key points in the escalator pedestrian image.
[0034] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for identifying abnormal behavior of pedestrians on an escalator as described above is implemented.
[0035] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for identifying abnormal behavior of pedestrians in an escalator.
[0036] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for identifying abnormal behavior of pedestrians in escalators.
[0037] The method, device, equipment and storage medium for identifying abnormal behavior of escalator pedestrians provided by the present invention obtain a first feature map by inputting an escalator pedestrian image into the input layer of a human key point detection model; then, a first convolution operation is performed on the first feature map by using a fully connected convolution layer of a backbone network layer to obtain a second feature map with different sampling rates; a second convolution operation and a pooling operation are performed on the second feature map with different sampling rates by using a dilated space convolution pooling pyramid layer of the backbone network layer to obtain a third feature map; the third feature map is reconstructed according to a preset cardinality and a preset number of iterations by using an attention module of the backbone network layer to obtain a reconstructed fourth feature map; and a neck portion is used to detect the neck portion of the pedestrian. The reconstructed fourth feature map is upsampled by the layer, and is fully connected with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer to obtain the upsampled feature map corresponding to each first convolutional layer, and is fully connected with the downsampled feature map corresponding to each first convolutional layer to obtain the target feature map corresponding to the output of each first convolutional layer; the prediction layer is used to detect the key points of the human body based on the target feature map corresponding to the output of each first convolutional layer to obtain the target position information corresponding to the key points of the human body in the escalator pedestrian image; and further, based on the target position information corresponding to the key points of the human body in the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
[0038] The attention module based on the backbone network layer in the present invention enables the model to focus on the key parts. The neck layer fuses the up-sampled and down-sampled feature maps to obtain the target feature maps corresponding to the outputs of each first convolutional layer. The key points of the human body are predicted based on the target feature maps, thereby improving the accuracy of human key point detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1This is one of the flow charts of the method for identifying abnormal behavior of pedestrians in an escalator provided by the present invention;
[0041] Figure 2 Schematic diagram of the network architecture of the human key point detection model provided by the present invention;
[0042] Figure 3 It is a schematic diagram of the structure of the regional dynamic perception depth separable convolutional layer provided by the present invention;
[0043] Figure 4 Schematic diagram of the structure of the dilated spatial convolutional pooling pyramid layer provided by the present invention;
[0044] Figure 5 is a schematic diagram of the structure of the attention module provided by the present invention;
[0045] Figure 6 It is a structural schematic diagram of the abnormal behavior identification device for escalator pedestrians provided by the present invention;
[0046] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] Combine the following Figure 1-Figure 7 The present invention describes the method, device, equipment and storage medium for identifying abnormal behavior of escalator pedestrians.
[0049] Figure 1 FIG. 1 is a flow chart of a method for identifying abnormal behavior of pedestrians in an escalator provided by the present invention. Figure 1 As shown, the method includes:
[0050] Step 101, inputting the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes an input layer, a backbone network layer, a neck layer and a prediction layer;
[0051] Specifically, the executor of the present invention is an electronic device, and the present invention is used to identify abnormal behavior of pedestrians on escalators.
[0052] The overall solution of this embodiment is: first obtain the escalator pedestrian image in the target area, use the human key point detection model to detect the human key points of the pedestrians in the escalator pedestrian image, and then determine whether the pedestrian has abnormal behavior based on the position information of the detected human key points and the preset abnormal behavior rules.
[0053] in, Figure 2 Schematic diagram of the network architecture of the human key point detection model provided by the present invention. Figure 2 As shown, the human key point detection model includes an input layer, a backbone network layer, a neck layer and a prediction layer, wherein the backbone network layer includes each convolution layer of a fully connected convolution C2f (convolution to Fully connected) module, an atrous spatial convolution pooling pyramid ASPP (Atrous Spatial Pyramid Pooling) layer and an attention module (modulation attention (Excitation and Modulation Attention, EMA) mechanism).
[0054] First, an image of a pedestrian on an escalator is obtained, and the image of the pedestrian on the escalator is input into the input layer of a human key point detection model to obtain a first feature map, which is, for example, a feature map of 640×640×3. The human key point detection model is, for example, a YOLOv8 model.
[0055] Step 102: Perform a first convolution operation on the first feature map using the fully connected convolutional layer of the backbone network layer to obtain a second feature map with different sampling rates;
[0056] Specifically, the first feature map obtained by the input layer is a 640×640×3 feature map, and the first feature map is input into the backbone network for feature extraction. First, the first feature map is subjected to a first convolution operation using the fully connected convolution C2f layer of the backbone network layer to obtain a second feature map. It can be understood that the fully connected convolution C2f layer includes at least one first convolution layer. Figure 2 The first convolutional layer includes four first convolutional layers, and the operation of each convolutional layer is similar, except that the input image is different. For any first convolutional layer, the second feature map corresponding to the first convolutional layer can be obtained.
[0057] Step 103, using the atrous spatial convolution pooling pyramid layer of the backbone network layer to perform a second convolution operation and a pooling operation on at least the second feature maps of different sampling rates, to obtain a third feature map;
[0058] Specifically, the atrous spatial convolution pooling pyramid ASPP layer uses multiple parallel convolution layers with different sampling rates, further processes the features extracted for each sampling rate in a separate branch, and fuses them to generate the final result, i.e., the third feature map.
[0059] After obtaining the second feature map, the atrous spatial convolution pooling pyramid ASPP layer of the backbone network layer is further used to perform a second convolution operation and a pooling operation on the second feature maps of at least two sampling rates to obtain a third feature map.
[0060] Step 104: Reconstruct the third feature map according to a preset cardinality and a preset number of iterations using the attention module of the backbone network layer to obtain a reconstructed fourth feature map;
[0061] Specifically, the backbone network includes an attention module, which adopts, for example, the Excitation and Modulation Attention (EMA) mechanism. The EMA mechanism is an attention mechanism used to improve the performance of neural network models. The core idea is to weight the input data or feature map so that the model can focus on the most important part of the current task. More specifically, the application process of the EMA mechanism is: the input data is weighted and summed with the calculated weight vector to obtain the network's weighted representation of the input data. This can extract the most relevant information in the input data for the current task and reduce the interference of irrelevant information. In some implementations, EMA can also refer to the exponential moving average of the attention distribution to smooth the attention weights and improve the robustness and generalization ability of the model.
[0062] After obtaining the third feature map, the attention module of the backbone network layer can be further used to reconstruct the third feature map according to a preset cardinality and a preset number of iterations to obtain a reconstructed fourth feature map, and the reconstructed fourth feature map can obtain the importance of each pixel part.
[0063] Step 105: using the neck layer, upsampling the reconstructed fourth feature map, fully connecting it with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer, obtaining the upsampled feature map corresponding to each first convolutional layer, and fully connecting it with the downsampled feature map corresponding to each first convolutional layer, obtaining the target feature map corresponding to the output of each first convolutional layer;
[0064] Specifically, it can be understood that since the downsampling multiple of the YOLOv8 model is relatively large, it is difficult to adapt to small target samples. Therefore, the human key point detection model in this embodiment also adds a small target detection layer in the neck layer to fuse the top-down sampling multiple feature map and the bottom-up sampling multiple feature map for detection to connect the shallow and deep feature maps. After the output is downsampled four times by the backbone network, it is connected to the upsampled feature map in the previous section at the neck. Finally, a feature map with a resolution of 160*160 can be obtained and input into the detection layer for reasoning and predicting small key points in the original image.
[0065] For example, the reconstructed fourth feature map is upsampled using the neck layer, fully connected with the second feature map of the first convolution layer corresponding to the output of each first convolution layer, and fully connected with the downsampled feature map corresponding to each first convolution layer to obtain the target feature map corresponding to the output of each first convolution layer. The target feature map is used to infer and predict small key points in the original escalator pedestrian image.
[0066] Step 106: Detect key points of the human body based on the target feature graphs outputted by the first convolutional layers using the prediction layer, and obtain target position information corresponding to the key points of the human body in the escalator pedestrian image;
[0067] Specifically, after obtaining the target feature map, the target feature map is input into the prediction layer. In this embodiment, the prediction layer uses a decoupled head. The prediction layer detects the key points of the human body based on the target feature map corresponding to the output of each first convolutional layer, and the target position information corresponding to the key points of the human body in the escalator pedestrian image can be obtained, wherein the target position information is represented by the coordinates of each key point, and the detection of the key points of the human body is completed.
[0068] Optionally, during the model training process, the model is also trained by calculating the regression loss and classification loss of each target position information.
[0069] Step 107: Determine whether the pedestrian in the escalator pedestrian image has abnormal behavior based on the target position information corresponding to the human body key points in the escalator pedestrian image.
[0070] Specifically, after obtaining the position information of each human key point by using the human key point detection model, it is possible to further determine whether the pedestrian in the escalator pedestrian image has abnormal behavior based on the target position information corresponding to the human key points in the escalator pedestrian image. Among them, abnormal behaviors such as pedestrians falling, pedestrians walking against the flow, pedestrians running fast, etc. can be determined in combination with preset abnormal behavior rules. The preset abnormal behavior rules are the relevant ranges of the position information of the human key points corresponding to various abnormal behaviors.
[0071] In the method provided in this embodiment, a first feature map is obtained by inputting an escalator pedestrian image into an input layer of a human key point detection model; then, a first convolution operation is performed on the first feature map using a fully connected convolution C2f layer of a backbone network layer to obtain a second feature map; a second convolution operation and a pooling operation are performed on the second feature map of at least two sampling rates using a dilated spatial convolutional pooling pyramid ASPP layer of the backbone network layer to obtain a third feature map; the third feature map is reconstructed according to a preset cardinality and a preset number of iterations using an attention module of the backbone network layer to obtain a reconstructed fourth feature map; The reconstructed fourth feature map is upsampled by the neck layer, and fully connected with the second feature map of the first convolutional layer corresponding to the output of each first convolutional layer, and fully connected with the downsampled feature map corresponding to each first convolutional layer, to obtain the target feature map corresponding to the output of each first convolutional layer; the prediction layer is used to detect the key points of the human body based on the target feature map corresponding to the output of each first convolutional layer, and the target position information corresponding to the key points of the human body in the escalator pedestrian image is obtained; then, based on the target position information corresponding to the key points of the human body in the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior. The attention module based on the backbone network layer in the present invention focuses the model's attention on the key parts, and the neck layer fuses the upsampled and downsampled feature maps to obtain the target feature map corresponding to the output of each first convolutional layer, and predicts the key points of the human body based on the target feature map, thereby improving the accuracy of the detection of key points of the human body.
[0072] Optionally, each first convolution layer uses a regional dynamic perception depth separable convolution to perform a first convolution operation on the input first feature map, and uses a fully connected convolution C2f layer of the backbone network layer to perform a first convolution operation on the first feature map to obtain a second feature map with different sampling rates, including:
[0073] For any first convolutional layer, using the first convolutional layer to generate a guiding feature of the first feature map in the first convolutional layer according to the first feature map;
[0074] Based on the guiding features of the first feature map, dividing the first feature map into a plurality of spatial regions using a first convolutional layer;
[0075] Performing a two-dimensional convolution on the first feature map of each spatial region to obtain a convolution image corresponding to each spatial region;
[0076] The convolution images corresponding to each spatial region are fused to obtain a second feature map of the sampling rate corresponding to the first convolution layer.
[0077] Specifically, the fully connected convolutional layer includes at least one first convolutional layer, and each first convolutional layer is a convolutional layer that uses regional dynamic perception depth separable convolution to extract features from the input first feature map. Correspondingly, step 102 can be implemented as follows:
[0078] For example, Figure 3 : is a schematic diagram of the structure of the regional dynamic perception depth separable convolutional layer provided by the present invention, such as Figure 3 As shown, for any first convolution layer, the first convolution layer (depth convolution and point convolution) is used to generate the guiding feature (k*k) of the first feature map in the first convolution layer according to the first feature map X; then, based on the guiding feature of the first feature map, the first convolution layer is used to divide the first feature map into multiple spatial regions, each of which can be a region represented by a different color or a region represented by a different symbol, such as Figure 3 W0, W1 and W2 in; further, performing two-dimensional convolution on the first feature map of each spatial region to obtain a convolution image corresponding to each spatial region; for example, using the first convolution layer to allocate multiple filters to each spatial region respectively, and multiple filters are used to perform two-dimensional convolution on the first feature map of the spatial region in each first convolution layer to obtain a convolution image corresponding to each spatial region; further, the convolution images corresponding to each spatial region are fused to obtain a second feature map Y of the sampling rate corresponding to the first convolution layer. It can be understood that the parameters that need to be optimized are mainly concentrated in the filter generator module, and the number of parameters is independent of the size of the feature space. In addition to significantly improving network performance, compared with local convolution, the regional dynamic perception depth separable convolution layer proposed in the present invention can significantly reduce the number of parameters and hardly increase the computational complexity compared with standard convolution.
[0079] In the method provided in this embodiment, the fully connected convolution layer includes at least one first convolution layer, and each first convolution layer is a convolution layer that uses regional dynamic perception deep separable convolution to extract features from the input first feature map. First, the first convolution layer is used to generate the guiding features of the first feature map in the first convolution layer according to the first feature map; then, based on the guiding features of the first feature map, the first convolution layer is used to divide the first feature map into multiple spatial regions, each of which is a region represented by a different color; then, the first feature map of each spatial region is subjected to two-dimensional convolution to obtain a convolution image corresponding to each spatial region; finally, the convolution images corresponding to each spatial region are fused to obtain a second feature map of the sampling rate corresponding to the first convolution layer. Compared with local convolution, the regional dynamic perception deep separable convolution of the present invention can significantly reduce the number of parameters, and compared with standard convolution, it hardly increases the computational complexity, and can improve the overall network performance.
[0080] Optionally, the atrous spatial convolution pooling pyramid layer includes parallel convolution layers and pooling layers for at least two sampling rates; performing a second convolution operation and a pooling operation on second feature maps with different sampling rates using the atrous spatial convolution pooling pyramid layer of the backbone network layer to obtain a third feature map, including:
[0081] Using parallel convolution layers, respectively perform second convolution operations on second feature maps with different sampling rates to obtain feature maps with different sampling rates;
[0082] Performing a pooling operation on the second feature maps with different sampling rates to obtain a pooling operation result, and performing a convolution and upsampling operation on the pooling operation result using a convolution kernel of a preset size to obtain an upsampling result;
[0083] The feature maps with different sampling rates and the upsampling results are fused to obtain the third feature map.
[0084] Specifically, in some embodiments, the atrous spatial convolution pooling pyramid layer includes parallel convolution layers and pooling layers for at least two sampling rates, and the atrous spatial convolution pooling pyramid layer constructs convolution kernels of different receptive fields through different atrous rates, so as to obtain multi-scale object information. Correspondingly, step 103 can be implemented as follows:
[0085] For example, Figure 4 : is a schematic diagram of the structure of the dilated spatial convolutional pooling pyramid layer provided by the present invention, such as Figure 4 As shown, firstly, three parallel convolutional layers are used to perform the second convolution operation on the second feature maps with different sampling rates to obtain feature maps with different sampling rates, wherein the expansion rates corresponding to the parallel convolutional layers are different, namely, 6, 12, and 18;
[0086] Further, a pooling operation is performed on the feature maps of different sampling rates. After the pooling operation, for example, a 1×1 convolution kernel is used to perform convolution and upsampling operations on the second feature maps of different sampling rates to obtain an upsampling result; further, the feature maps of different sampling rates and the upsampling results are spliced and fused to obtain a third feature map. Optionally, a 1×1 convolution kernel can be used to further convolve the fused image to obtain the third feature map.
[0087] In the method provided in this embodiment, since the atrous spatial convolution pooling pyramid layer includes parallel convolution layers and pooling layers for at least two sampling rates, the parallel convolution layers are first used to perform second convolution operations on second feature maps of different sampling rates to obtain feature maps of different sampling rates; then, pooling operations are performed on feature maps of different sampling rates to obtain pooling operation results, and convolution kernels of preset sizes are used to perform convolution and upsampling operations on the pooling operation results to obtain upsampling results; further, the feature maps of different sampling rates and the upsampling results are further fused to obtain a third feature map. This embodiment constructs convolution kernels of different receptive fields through different atrous rates, and can obtain multi-scale object information, thereby improving the accuracy of model detection.
[0088] Optionally, the attention module includes a responsibility estimation module, a likelihood maximization module and a data re-estimation module; using the attention module of the backbone network layer, the third feature map is reconstructed according to a preset cardinality and a preset number of iterations to obtain a reconstructed fourth feature map, including:
[0089] Step a: according to the third feature map and the initial value of the preset cardinality, a first latent variable corresponding to the third feature map is estimated by using a responsibility estimation module, where the first latent variable is used to characterize the responsibility value of each pixel in the third feature map;
[0090] Step b: updating the preset cardinality using a likelihood maximization module according to the first latent variable corresponding to the third feature map to obtain an updated value of the preset cardinality;
[0091] Step c, according to the third characteristic map and the updated value of the preset cardinality, the responsibility estimation module is used to estimate the second latent variable corresponding to the third characteristic map, and the second latent variable is determined as the new first latent variable, and the above steps a to c are repeated until the number of iterations reaches the preset number of iterations, and the updated value of the preset cardinality and the second latent variable corresponding to the third characteristic map at the end of the iteration are determined as the target value of the preset cardinality and the target latent variable corresponding to the third characteristic map;
[0092] According to the target value of the preset cardinality and the target latent variable corresponding to the third feature map, the third feature map is reconstructed using the data re-estimation module to obtain a reconstructed fourth feature map; the reconstructed fourth feature map is used to instruct the human body key point detection model to focus on the key parts.
[0093] Specifically, in some embodiments, the backbone network in the human key point detection model introduces an attention mechanism such as an incentive and modulation attention (EMA) mechanism. The EMA mechanism is an attention mechanism for improving the performance of neural network models. The core idea is to weight the input data or feature map so that the network focuses on the most important part of the current task. The incentive mechanism calculates the importance of each part of the input data to the current task. This is usually done by calculating the similarity between the features of the input data and specific parameters. The modulation mechanism adjusts the weights of each part according to the similarity matrix. A common way is to use a softmax function to normalize each row of the similarity matrix to obtain a weight vector. Exemplarily, Figure 5 is a schematic diagram of the structure of the attention module provided by the present invention, such as Figure 5 As shown, the attention module includes a responsibility estimation AE module, a likelihood maximization AM module and a data re-estimation AR module.
[0094] Correspondingly, step 104 can be implemented in the following manner:
[0095] Step a: According to the third feature map and the initial value of the preset cardinality, a responsibility estimation module is used to estimate a first latent variable corresponding to the third feature map, where the first latent variable is used to characterize the responsibility value of each pixel in the third feature map.
[0096] Specifically, the third feature map is the feature map input to the attention module. To simplify the notation, the input feature map X of size C×H×W is reshaped from a single sample to N×C, where N=H×W, xi□RC indexes the C-dimensional feature vector at pixel i; the initial cardinality is, for example, μ∈RK×C, and the first latent variable is represented as Z∈RN×K. The example process of calculating the first latent variable corresponding to the third feature map using the responsibility estimation AE module is as follows:
[0097] p(x n |μ k )=K(x n ,μ k )
[0098] Among them, p(x n |μ k ) represents the kth preset cardinality μ for x n The posterior probability of the responsibility is, where 1≤k≤K, 1≤n≤N. K represents a general kernel function. In the experiment, in the tth iteration, the operation of AE can be expressed as:
[0099] Z (t) =softmax(λX(μ (t-1) ) T )
[0100] Among them, Z (t) represents the first latent variable corresponding to the third feature map of the t-th iteration, λ is used as a hyperparameter to control the distribution of Z, and T represents the preset number of iterations.
[0101] Step b: According to the first latent variable corresponding to the third feature map, the preset cardinality is updated using the likelihood maximization module to obtain an updated value of the preset cardinality.
[0102] Specifically, likelihood maximization (AM) is used as the M step of the EM algorithm. Using the estimated Z (the first latent variable corresponding to the third feature map), AM updates the preset cardinality μ by maximizing the likelihood of the complete data. In order to keep the preset cardinality in the same embedding space as X, we use the weighted sum of X to update the cardinality μ. Therefore, using the likelihood maximization (AM) module, the process of updating the preset cardinality according to the first latent variable corresponding to the third feature map to obtain the updated value of the preset cardinality is as follows:
[0103]
[0104] in, represents the updated value of the kth preset cardinality at the tth iteration, It represents the responsibility of the kth cardinality of the tth iteration to the nth pixel, and N represents the maximum number of pixels in common.
[0105] Step c, according to the third characteristic map and the updated value of the preset cardinality, the responsibility estimation module is used to estimate the second latent variable corresponding to the third characteristic map, and the second latent variable is determined as the new first latent variable, and the above steps a to c are repeated until the number of iterations reaches the preset number of iterations T, and the updated value of the preset cardinality at the end of the iteration and the second latent variable corresponding to the third characteristic map are determined as the target value of the preset cardinality and the target latent variable corresponding to the third characteristic map;
[0106] Furthermore, according to the target value of the preset cardinality and the target latent variable corresponding to the third feature map, the third feature map is reconstructed using the data re-estimation module to obtain a reconstructed fourth feature map, wherein the reconstructed fourth feature map is used to instruct the human key point detection model to focus on the key parts.
[0107] Specifically, the above-mentioned responsibility estimation AE module and likelihood maximization (AM) are performed alternately for T steps. After that, the approximately converged u and Z can be used to re-estimate X to obtain:
[0108]
[0109] in, Represents the reconstructed fourth feature map, Z (T) represents the target latent variable corresponding to the third feature map of the tth iteration, μ (T) Indicates the target value of the preset cardinality for the tth iteration.
[0110] In the method provided in this embodiment, by adding the EMA attention mechanism to the backbone network of the human key point detection model, the advantage is that it can automatically learn the key parts in the input feature map and focus the attention of the human key point detection model on these parts, so that the model can capture the key features more accurately, and the accuracy of subsequent human key point detection is improved, thereby improving the model performance.
[0111] Optionally, determining whether a pedestrian in the escalator pedestrian image has abnormal behavior based on target position information corresponding to human body key points in the escalator pedestrian image includes:
[0112] Based on the target position information corresponding to the key points of the human body in the escalator pedestrian image and the preset abnormal behavior rules, determine whether the pedestrian in the escalator pedestrian image has abnormal behavior;
[0113] Among them, the preset abnormal behavior rules are used to characterize the key position information of the pedestrian's body corresponding to at least one abnormal behavior; the abnormal behavior includes at least one of the following: pedestrian falling, pedestrian walking in the opposite direction, pedestrian running and pedestrian squatting.
[0114] Specifically, in some embodiments, abnormal behaviors of pedestrians on escalators, such as pedestrians falling, pedestrians walking in the opposite direction, pedestrians running, and pedestrians squatting, may cause serious safety accidents.
[0115] Furthermore, the preset abnormal behavior rules are used to characterize the key position information of the pedestrian's body corresponding to at least one abnormal behavior. For example, the range of the position information of the key points of the human body when the pedestrian falls, such as the coordinate height, is compared with the range of the detected position information of the key points of the human body and the position information of the key points of the human body when the pedestrian falls, such as the coordinate height, to obtain whether the pedestrian's behavior is abnormal; for example, the position information of the key points of the human body at multiple moments corresponding to the trajectory direction of the pedestrian walking in the opposite direction, the position information of the key points of the human body at multiple moments detected is combined into a pedestrian trajectory to determine the direction of the pedestrian trajectory, and the pedestrian trajectory direction is compared with the running direction of the escalator to obtain whether the pedestrian's behavior is abnormal; for example, the range of the speed of change of the key point position information of the human body at each moment when the pedestrian is running, and the change rules of the key point position information of the human body when the pedestrian is squatting (such as the coordinate height of the key point of the elbow bone is lower than the preset height), etc.
[0116] It should be noted that the preset abnormal behavior rules can be set according to the range of abnormal behaviors of pedestrians in the escalator history, and this embodiment does not limit how to set the abnormal behavior rules.
[0117] Based on the target position information corresponding to the key points of the human body in the escalator pedestrian image and the preset abnormal behavior rules, it can be determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
[0118] In the method provided in this embodiment, abnormal behaviors include at least one of the following: pedestrians falling, pedestrians walking in the opposite direction, pedestrians running and pedestrians squatting. The preset abnormal behavior rules are used to characterize the key position information of the pedestrian's body corresponding to at least one abnormal behavior. After the position information of the key points of the human body is obtained by detecting the key points of the human body using the human body key point detection model, the detected position information of the key points of the human body is compared with the preset abnormal behavior rules to determine whether there is abnormal behavior of the escalator pedestrians. The performance of abnormal behavior detection in the present invention is better.
[0119] Optionally, the human key point detection model is obtained by training an initial human key point detection model according to the first sample image and the MPDIoU loss function, and the initial human key point detection model is a YOLOv8 model.
[0120] Specifically, in some embodiments, the human key point detection model used in the present method is obtained by training an initial human key point detection model according to the first sample image and the MPDIoU loss function, and the initial human key point detection model is a YOLOv8 model.
[0121] Among them, the YOLOv8 model is a target detection model. With the continuous development of deep learning technology, the YOLO model has become the main model for target detection and behavior recognition. It is the latest version of the YOLO series model. YOLOv8 adopts a detection method based on the anchor-free model. Compared with the traditional anchor-based detection method, it has higher detection accuracy and faster detection speed, and has become the most important model for video surveillance. The YOLOv8 model mainly includes the input layer, the backbone network layer, the neck layer and the prediction layer (head). The backbone network layer is C2f and SPPF (Spatial Pyramid Pooling-Fast), the neck layer is PANet (Path Aggregation Network), and the prediction layer uses a decoupled head. However, the initial human key point detection model YOLOv8 model has great limitations on the detection performance and timeliness of small targets, so it is limited in many scenarios, especially for elevator scenarios where the sample targets are small and the timeliness requirements are high.
[0122] Therefore, the human key point detection model in this embodiment first enhances the backbone network by introducing an attention mechanism. In addition, a small target detection layer is added to improve the accuracy of detecting small target key points. Finally, we replaced the conventional convolution conv with the dynamic region-aware deep separable convolution (Dynamic Region-Deep Point-Aware Convolution, DR-DP-Conv) and replaced SPPF with ASPP. In addition, the human key point detection model is trained using multiple sample images (historically collected escalator pedestrian images and human key points annotated in the images) and the target loss function. At the same time, the IOU loss function of the minimum point distance MPDIoU loss function replaces the original CIoU loss function.
[0123] Among them, the MPDIoU loss function example is as follows: It includes all relevant factors considered in the existing loss function, such as overlapping or non-overlapping areas, center point distance, width and height deviation, and simplifies the calculation process. The formula of MPDIoU is as follows:
[0124] Input: Two polygonal boxes: The length and width of the input image are: w, h
[0125] Output:MPDIou
[0126] 1. For A and B, (x1 A ,y1 A ) and (x2 A ,y2 A ) represent the coordinates of the upper left corner and lower right corner of A respectively; (x1 B ,y1 B ) and (x2 B ,y2 B ) represent the coordinates of the upper left corner and lower right corner of B respectively;
[0127] 2.d1 2 =(x1 B ,x1 A ) 2 +(y1 B ,y1 A ) 2 ;
[0128] 3.d2 2 =(x2 B ,x2 A ) 2 +(y2 B ,y2 A ) 2 ;
[0129]
[0130] In the method provided in this embodiment, the human key point detection model is obtained by training the initial human key point detection model according to the first sample image and the MPDIoU loss function. The initial human key point detection model is a YOLOv8 model. The trained human key point detection model is used to detect the human key points of pedestrians in the elevator scene with high accuracy.
[0131] The escalator pedestrian abnormal behavior recognition device provided by the present invention is described below. The escalator pedestrian abnormal behavior recognition device described below and the escalator pedestrian abnormal behavior recognition method described above can be referenced to each other.
[0132] Figure 6 Schematic diagram of the structure of the escalator pedestrian abnormal behavior recognition device provided by the present invention. Figure 6 As shown, the escalator pedestrian abnormal behavior recognition device 600 includes:
[0133] The key point detection module 610 is used to input the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer; the first convolution operation is performed on the first feature map by the fully connected convolution C2f layer of the backbone network layer to obtain a second feature map; the second convolution operation and pooling operation are performed on the second feature map of at least two sampling rates by the hollow space convolution pooling pyramid ASPP layer of the backbone network layer to obtain a third feature map; the attention module of the backbone network layer is used to perform the first convolution operation and the second pooling operation according to the preset The third feature map is reconstructed according to the cardinality and the preset number of iterations to obtain a reconstructed fourth feature map; the reconstructed fourth feature map is upsampled by using the neck layer, and is fully connected with the second feature map of the first convolutional layer corresponding to the output of each first convolutional layer, and is fully connected with the downsampled feature map corresponding to each first convolutional layer to obtain a target feature map corresponding to the output of each first convolutional layer; the human body key points are detected by using the prediction layer based on the target feature map corresponding to the output of each first convolutional layer, and the target position information corresponding to the human body key points of the escalator pedestrian image is obtained;
[0134] The abnormality determination module 620 is used to determine whether the pedestrian in the escalator pedestrian image has abnormal behavior based on the target position information corresponding to the human body key points in the escalator pedestrian image.
[0135] In the device provided by this embodiment, the key point detection module 610 is used to input the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; then, the first feature map is subjected to a first convolution operation using the fully connected convolution C2f layer of the backbone network layer to obtain a second feature map; the second feature map of at least two sampling rates is subjected to a second convolution operation and a pooling operation using the atrous spatial convolution pooling pyramid ASPP layer of the backbone network layer to obtain a third feature map; the third feature map is reconstructed using the attention module of the backbone network layer according to a preset cardinality and a preset number of iterations to obtain a reconstructed fourth feature map; The reconstructed fourth feature map is upsampled by using the neck layer, and fully connected with the second feature map of the first convolutional layer corresponding to the output of each first convolutional layer, and fully connected with the downsampled feature map corresponding to each first convolutional layer, to obtain the target feature map corresponding to the output of each first convolutional layer; the prediction layer is used to detect the key points of the human body based on the target feature map corresponding to the output of each first convolutional layer, and the target position information corresponding to the key points of the human body in the escalator pedestrian image is obtained; then, the abnormality judgment module 620 determines whether the pedestrian in the escalator pedestrian image has abnormal behavior based on the target position information corresponding to the key points of the human body in the escalator pedestrian image.
[0136] The attention module based on the backbone network layer in the present invention enables the model to focus on the key parts. The neck layer fuses the up-sampled and down-sampled feature maps to obtain the target feature maps corresponding to the outputs of each first convolutional layer. The key points of the human body are predicted based on the target feature maps, thereby improving the accuracy of human key point detection.
[0137] Optionally, the fully connected convolutional layer includes at least one first convolutional layer, and each of the first convolutional layers is a convolutional layer that uses regional dynamic-aware depth-separable convolution to extract features from the input first feature map;
[0138] Optionally, the key point detection module 610 is specifically used to:
[0139] For any of the first convolutional layers, using the first convolutional layer to generate a guiding feature of the first feature map in the first convolutional layer according to the first feature map;
[0140] Based on the guiding features of the first feature map, the first feature map is divided into a plurality of spatial regions using the first convolutional layer, each of the spatial regions being a region represented by a different color;
[0141] Using the first convolutional layer to assign a plurality of filters to each of the spatial regions, respectively, the plurality of filters are used to perform two-dimensional convolution on the first feature map of the spatial region in each of the first convolutional layers, so as to obtain a convolution image corresponding to each of the spatial regions in the first convolutional layer;
[0142] The convolution images corresponding to the spatial regions are fused using the first convolution layers to obtain the second feature maps corresponding to the first convolution layers.
[0143] Optionally, the atrous spatial convolutional pooling pyramid layer includes parallel convolutional layers and pooling layers for at least two sampling rates;
[0144] Optionally, the key point detection module 610 is specifically used to:
[0145] Using the parallel convolution layer to perform a second convolution operation on the second feature maps with different sampling rates, respectively, to obtain feature maps with different sampling rates;
[0146] Performing a pooling operation on the second escalator pedestrian image, and performing convolution and upsampling operations on the second escalator pedestrian image using a 1×1 convolution kernel to obtain the second escalator pedestrian image after the pooling operation;
[0147] The feature maps with different sampling rates and the second escalator pedestrian image after the pooling operation are fused to obtain the third feature map.
[0148] Optionally, the attention module includes a responsibility estimation module, a likelihood maximization module and a data re-estimation module;
[0149] Optionally, the key point detection module 610 is specifically used to:
[0150] Step a: according to the third feature map and the initial value of the preset cardinality, the responsibility estimation module is used to estimate a first latent variable corresponding to the third feature map, where the first latent variable is used to characterize the responsibility value of each pixel in the third feature map;
[0151] Step b: updating the preset cardinality using the likelihood maximization module according to the first latent variable corresponding to the third feature graph to obtain an updated value of the preset cardinality;
[0152] Step c: according to the third characteristic graph and the updated value of the preset cardinality, using the responsibility estimation module to estimate a second latent variable corresponding to the third characteristic graph;
[0153] Repeating the above steps a to c, when the iteration reaches the preset number of iterations, determining the updated value of the preset cardinality and the second latent variable corresponding to the third feature map when the iteration is terminated as the target value of the preset cardinality and the target latent variable corresponding to the third feature map;
[0154] According to the target value of the preset cardinality and the target latent variable corresponding to the third feature map, the third feature map is reconstructed using the data re-estimation module to obtain a reconstructed fourth feature map; the reconstructed fourth feature map is used to instruct the human key point detection model to focus on the key parts.
[0155] Optionally, the preset abnormal behavior rule is used to characterize key position information of the pedestrian's body corresponding to at least one abnormal behavior; the abnormal behavior includes at least one of the following: pedestrian falling, pedestrian walking in the opposite direction, pedestrian running and pedestrian squatting.
[0156] Optionally, the human key point detection model is obtained by training an initial human key point detection model according to the first sample image and the MPDIoU loss function, and the initial human key point detection model is a YOLOv8 model.
[0157] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the escalator pedestrian abnormal behavior recognition method, which includes:
[0158] Inputting the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer;
[0159] Using the fully connected convolutional layer of the backbone network layer to perform a first convolution operation on the first feature map to obtain a second feature map;
[0160] Using the atrous spatial convolution pooling pyramid layer of the backbone network layer, a second convolution operation and a pooling operation are performed on the second feature maps of at least two sampling rates to obtain a third feature map;
[0161] Reconstructing the third feature map according to a preset cardinality and a preset number of iterations using the attention module of the backbone network layer to obtain a reconstructed fourth feature map;
[0162] Using the neck layer, upsampling the reconstructed fourth feature map, fully connecting it with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer, to obtain the upsampled feature map corresponding to each of the first convolutional layers, and fully connecting it with the downsampled feature map corresponding to each of the first convolutional layers, to obtain the target feature map corresponding to the output of each of the first convolutional layers;
[0163] Using the prediction layer, based on the target feature map corresponding to the output of each of the first convolutional layers, human key points are detected to obtain target position information corresponding to the human key points of the escalator pedestrian image;
[0164] Based on the target position information corresponding to the human body key points of the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
[0165] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0166] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the escalator pedestrian abnormal behavior identification method provided by the above methods, the method comprising:
[0167] Inputting the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer;
[0168] Using the fully connected convolutional layer of the backbone network layer to perform a first convolution operation on the first feature map to obtain a second feature map;
[0169] Using the atrous spatial convolution pooling pyramid layer of the backbone network layer, a second convolution operation and a pooling operation are performed on the second feature maps of at least two sampling rates to obtain a third feature map;
[0170] Reconstructing the third feature map according to a preset cardinality and a preset number of iterations using the attention module of the backbone network layer to obtain a reconstructed fourth feature map;
[0171] Using the neck layer, upsampling the reconstructed fourth feature map, fully connecting it with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer, to obtain the upsampled feature map corresponding to each of the first convolutional layers, and fully connecting it with the downsampled feature map corresponding to each of the first convolutional layers, to obtain the target feature map corresponding to the output of each of the first convolutional layers;
[0172] Using the prediction layer, based on the target feature map corresponding to the output of each of the first convolutional layers, human key points are detected to obtain target position information corresponding to the human key points of the escalator pedestrian image;
[0173] Based on the target position information corresponding to the human body key points of the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
[0174] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the escalator pedestrian abnormal behavior identification method provided by the above methods, the method comprising:
[0175] Inputting the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; the human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer;
[0176] Using the fully connected convolutional layer of the backbone network layer to perform a first convolution operation on the first feature map to obtain a second feature map;
[0177] Using the atrous spatial convolution pooling pyramid layer of the backbone network layer, a second convolution operation and a pooling operation are performed on the second feature maps of at least two sampling rates to obtain a third feature map;
[0178] Reconstructing the third feature map according to a preset cardinality and a preset number of iterations using the attention module of the backbone network layer to obtain a reconstructed fourth feature map;
[0179] Using the neck layer, upsampling the reconstructed fourth feature map, fully connecting it with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer, to obtain the upsampled feature map corresponding to each of the first convolutional layers, and fully connecting it with the downsampled feature map corresponding to each of the first convolutional layers, to obtain the target feature map corresponding to the output of each of the first convolutional layers;
[0180] Using the prediction layer, based on the target feature map corresponding to the output of each of the first convolutional layers, human key points are detected to obtain target position information corresponding to the human key points of the escalator pedestrian image;
[0181] Based on the target position information corresponding to the human body key points of the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
[0182] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0183] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0184] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying abnormal behavior of pedestrians on escalators. It is characterized in that include: Input the escalator pedestrian image into the input layer of the human key point detection model to obtain the first feature map; The human body key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer; Using the fully connected convolutional layer of the backbone network layer to perform a first convolution operation on the first feature map to obtain a second feature map with different sampling rates; Using the atrous spatial convolution pooling pyramid layer of the backbone network layer, performing a second convolution operation and a pooling operation on the second feature maps with different sampling rates to obtain a third feature map; Reconstructing the third feature map according to a preset cardinality and a preset number of iterations using the attention module of the backbone network layer to obtain a reconstructed fourth feature map; Using the neck layer, upsampling the reconstructed fourth feature map, fully connecting it with the second feature map corresponding to the output of at least one first convolutional layer included in the fully connected convolutional layer, to obtain the upsampled feature map corresponding to each of the first convolutional layers, and fully connecting it with the downsampled feature map corresponding to each of the first convolutional layers, to obtain the target feature map corresponding to the output of each of the first convolutional layers; Using the prediction layer, based on the target feature map corresponding to the output of each of the first convolutional layers, human key points are detected to obtain target position information corresponding to the human key points of the escalator pedestrian image; Based on the target position information corresponding to the human body key points of the escalator pedestrian image, it is determined whether the pedestrian in the escalator pedestrian image has abnormal behavior.
2. The method for identifying abnormal behavior of escalator pedestrians according to claim 1, It is characterized in that Each of the first convolutional layers uses a regional dynamic perception depth separable convolution to perform the first convolution operation on the input first feature map, and the fully connected convolutional layer of the backbone network layer is used to perform the first convolution operation on the first feature map to obtain second feature maps with different sampling rates, including: For any of the first convolutional layers, using the first convolutional layer to generate a guiding feature of the first feature map in the first convolutional layer according to the first feature map; Based on the guiding features of the first feature map, dividing the first feature map into a plurality of spatial regions using the first convolutional layer; Performing a two-dimensional convolution on the first feature map of each of the spatial regions to obtain a convolution image corresponding to each of the spatial regions; The convolution images corresponding to the spatial regions are fused to obtain a second feature map of the sampling rate corresponding to the first convolution layer.
3. The method for identifying abnormal behavior of escalator pedestrians according to claim 1, It is characterized in that The atrous spatial convolution pooling pyramid layer includes a parallel convolution layer and a pooling layer; the atrous spatial convolution pooling pyramid layer of the backbone network layer is used to perform a second convolution operation and a pooling operation on the second feature maps with different sampling rates to obtain a third feature map, including: Using the parallel convolution layer to perform a second convolution operation on the second feature maps with different sampling rates, respectively, to obtain feature maps with different sampling rates; Performing a pooling operation on the second feature maps of different sampling rates to obtain a pooling operation result, and performing a convolution and upsampling operation on the pooling operation result using a convolution kernel of a preset size to obtain an upsampling result; The feature maps with different sampling rates and the upsampling results are fused to obtain the third feature map.
4. The method for identifying abnormal behavior of escalator pedestrians according to claim 1, It is characterized in that The attention module includes a responsibility estimation module, a likelihood maximization module and a data re-estimation module; The method of using the attention module of the backbone network layer to reconstruct the third feature map according to a preset cardinality and a preset number of iterations to obtain a reconstructed fourth feature map includes: Step a: according to the third feature map and the initial value of the preset cardinality, the responsibility estimation module is used to estimate a first latent variable corresponding to the third feature map, where the first latent variable is used to characterize the responsibility value of each pixel in the third feature map; Step b: updating the preset cardinality using the likelihood maximization module according to the first latent variable corresponding to the third feature graph to obtain an updated value of the preset cardinality; Step c, according to the third characteristic map and the updated value of the preset cardinality, using the responsibility estimation module to estimate the second latent variable corresponding to the third characteristic map, and determining the second latent variable as the new first latent variable, repeating the above steps a to c until the number of iterations reaches the preset number of iterations, and determining the updated value of the preset cardinality and the second latent variable corresponding to the third characteristic map at the end of the iteration as the target value of the preset cardinality and the target latent variable corresponding to the third characteristic map; According to the target value of the preset cardinality and the target latent variable corresponding to the third feature map, the third feature map is reconstructed using the data re-estimation module to obtain a reconstructed fourth feature map; the reconstructed fourth feature map is used to instruct the human key point detection model to focus on the key parts.
5. The method for identifying abnormal behavior of escalator pedestrians according to any one of claims 1 to 4, It is characterized in that The determining whether a pedestrian in the escalator pedestrian image has abnormal behavior based on target position information corresponding to human body key points in the escalator pedestrian image includes: Based on the target position information corresponding to the key points of the human body in the escalator pedestrian image and the preset abnormal behavior rules, determining whether the pedestrian in the escalator pedestrian image has abnormal behavior; Among them, the preset abnormal behavior rules are used to characterize the key position information of the pedestrian's body corresponding to at least one abnormal behavior; the abnormal behavior includes at least one of the following: pedestrian falling, pedestrian walking in the opposite direction, pedestrian running and pedestrian squatting.
6. The method for identifying abnormal behavior of pedestrians in an escalator according to any one of claims 1 to 4, It is characterized in that The human key point detection model is obtained by training an initial human key point detection model according to the first sample image and the MPDIoU loss function, and the initial human key point detection model is a YOLOv8 model.
7. An escalator pedestrian abnormal behavior recognition device, It is characterized in that include: A key point detection module, used for inputting the escalator pedestrian image into the input layer of the human key point detection model to obtain a first feature map; The human key point detection model includes the input layer, the backbone network layer, the neck layer and the prediction layer; the first convolution operation is performed on the first feature map by using the fully connected convolution layer of the backbone network layer to obtain the second feature map with different sampling rates; the second convolution operation and pooling operation are performed on the second feature map with different sampling rates by using the hollow space convolution pooling pyramid ASPP layer of the backbone network layer to obtain the third feature map; the third feature map is reconstructed according to the preset cardinality and the preset number of iterations by using the attention module of the backbone network layer to obtain the reconstructed fourth feature map; the reconstructed fourth feature map is upsampled by using the neck layer, and the second feature map corresponding to the output of at least one first convolution layer included in the fully connected convolution layer is fully connected to obtain the upsampled feature map corresponding to each first convolution layer, and the downsampled feature map corresponding to each first convolution layer is fully connected to obtain the target feature map corresponding to the output of each first convolution layer; the human key points are detected by using the prediction layer based on the target feature map corresponding to the output of each first convolution layer, and the target position information corresponding to the human key points of the escalator pedestrian image is obtained; The abnormality determination module is used to determine whether the pedestrian in the escalator pedestrian image has abnormal behavior based on the target position information corresponding to the human body key points in the escalator pedestrian image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method for identifying abnormal behavior of pedestrians in an escalator as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for identifying abnormal behavior of pedestrians in an escalator as described in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method for identifying abnormal behavior of pedestrians in an escalator as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Self-adaptive mask wearing detection method for small target optimization
CN117423144A
Coal mine filling mining effect evaluation method and system
CN118279081A
Teaching student network for end-to-end semi-supervised object detection
US20230281980A1
Cited By
Personnel abnormal behavior monitoring identification method and early warning system
CN119810753A
A method for monitoring and identifying abnormal behaviors of personnel and an early warning system
CN119810753B
Escalator passenger abnormal behavior detection method and system based on YOLOv8
CN119942648A
Method for detecting targets in car elevator based on improved YOLOv8 algorithm
CN120375278A
