A security inspection system and method based on SLAM and crowd abnormal behavior recognition
By introducing a security inspection system based on SLAM and ST-GCN into the community, it solves the problem of timely warning and rapid response in identifying abnormal crowd behaviors, achieving high-precision abnormal behavior detection and improving community safety supervision capabilities.
Patent Information
- Application Number
- CN202311682251.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-12-08
AI Technical Summary
When people in the community behave abnormally, existing technology cannot provide timely warning and rapid response, resulting in safety supervision problems such as high labor costs, insufficient emergency response capabilities, and low identification accuracy.
A security inspection system based on SLAM and crowd abnormal behavior recognition is adopted, combined with laser mapping, autonomous navigation and RGB-D depth cameras, using the ST-GCN algorithm to detect crowd abnormal behavior, and connecting the upper and lower systems through serial communication to realize the robot Inspection and voice warning.
It achieves accurate identification and timely warning of abnormal crowd behavior, improves the response capability and identification accuracy of community safety supervision, reduces labor costs, and expands the scope and accuracy of inspections.
Smart Images

Figure CN117746524B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automated security patrol, and in particular relates to a security patrol system and method based on SLAM and recognition of abnormal crowd behavior. Background Art
[0002] With the further development of smart communities, inefficient supervision, delayed emergency response and high-cost artificial community safety supervision systems have led to the inability to timely warn and deal with abnormal crowd behavior in the community. These behaviors may cause great losses to residents, so it is very important to timely warn of abnormal crowd behavior and quickly respond to unexpected situations in the community. As a method of intelligent production inspection, abnormal crowd behavior warning is a hot research topic in the field of video understanding and computer vision, which has attracted the attention of scholars at home and abroad and has been widely used in many fields such as intelligent monitoring and human-computer interaction.
[0003] At present, the warning of abnormal crowd behavior in community activities and living places is usually carried out by fixed cameras combined with manual inspections. However, manual inspections have problems such as high labor costs, insufficient emergency response capabilities, and emotional personnel. Moreover, when abnormal crowd behavior occurs, community supervision is often unable to respond in the first time, and can only retrieve surveillance or visit investigations afterwards, and cannot warn of danger in time. In addition, the common camera-based crowd abnormal behavior recognition scheme is limited by the location of the camera, and can only analyze the behavior of a small part of the crowd in a small part of the community. Moreover, due to the clarity of the camera, the camera-based crowd abnormal behavior recognition scheme often cannot accurately judge the behavior of the crowd, and can only make rough judgments. For abnormal crowd behavior with high environmental relevance, it is also impossible to correctly and effectively identify and warn accordingly. Summary of the invention
[0004] When abnormal crowd behavior occurs, community supervision is often unable to respond in the first time and can only retrieve surveillance or conduct field investigations afterwards, and is unable to issue timely warnings of dangers. The present invention provides a security inspection system and method based on SLAM and recognition of abnormal crowd behavior.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A security inspection system based on SLAM and recognition of abnormal crowd behavior, comprising an upper system and a lower system; the upper system is configured with a laser mapping unit, an autonomous navigation unit and a crowd abnormal behavior detection unit; the laser mapping unit uses a single-line laser radar as a hardware basis and a Gmapping algorithm as a software basis to complete the mapping function; the autonomous navigation unit uses an A* and DWA fusion algorithm to complete the autonomous navigation function; the crowd abnormal behavior detection unit uses an RGB-D depth camera as a hardware basis and an ST-GCN algorithm as a deep learning algorithm model to complete the crowd abnormal behavior detection;
[0007] The lower system is equipped with a body control unit and a communication warning unit; the body control unit completes robot control based on a six-axis acceleration sensor, tracks, power supply and motor; the communication warning unit uses a six-microphone voice array and a cloud server to complete voice recognition and communication warning;
[0008] The upper system and the lower system are connected via serial communication. The upper system controls the lower system and expands the computing resources of the lower system.
[0009] Furthermore, the upper control system uses NVIDIA Jetson nano as the core, is installed with ROS system, and uses Python3.8, Pytorch 1.13.0 and mmcv 2.1 as the operating environment for deep learning algorithms;
[0010] The laser mapping unit relies on the ROS system and the improved Gmapping algorithm, takes the 2D single-line laser radar as the hardware basis, uses the RBPF algorithm to complete the 2D grid map construction, and uses the particle filter algorithm to accurately estimate the robot's posture;
[0011] The autonomous navigation unit uses the A* algorithm to search for the shortest path between the robot's current position and the target point in the two-dimensional grid map network. At the same time, the DWA algorithm is used according to the current position state and speed state of the mobile robot, and then the trajectory of the robot moving within a certain period of time under these speed conditions is calculated, so as to effectively avoid obstacles.
[0012] The crowd abnormal behavior detection unit uses the improved YOLOv7 algorithm to collect and capture the video captured by the RGB-D depth camera, uses the improved SimCC to extract the key points of pedestrians in the video, combines the ST-GCN algorithm to judge the behavior of the target person, and determines whether the person falls or fights based on the spatial information.
[0013] Furthermore, the lower control system uses STM32F407 as the main control chip, and uses serial communication to control the body control unit and the communication warning unit. The body includes the front, body and chassis. The front is equipped with an RGB-D depth camera and a single-line laser radar, and the body is equipped with a communication module and upper and lower control circuit boards. The chassis is equipped with a power module, a motor drive board, a decoder and a track.
[0014] A patrol method for a security patrol system based on SLAM and recognition of abnormal crowd behavior, the working steps are as follows:
[0015] Step 1: Place the security inspection robot on the ground in the working area, turn on the main power of the power module installed on the chassis, turn on the Jetson nano circuit board switch on the body, and enter the security inspection robot operation mode;
[0016] Step 2: Select the autonomous map modeling mode in the ROS system and set the moving speed of the security inspection robot. The robot starts to move, and determines whether there are obstacles around it through the point cloud data of the surrounding environment returned by the laser radar, and gradually improves the map information. After the motion distortion is removed, the 2D grid map obtained by the laser radar scan is extracted and saved in the map path.
[0017] Further, the specific method of step 2 is:
[0018] Step 2.1: After the security inspection robot starts running, it uses a single-line laser radar to scan the surrounding environment 360 degrees. When the laser radar works at the set scanning frequency of 20Hz, the laser radar completes a 360-degree scan of the environment every 50ms of a scanning cycle, and uses the scanned 360-degree environmental data as a complete frame of data;
[0019] Step 2-2, during the period when the laser radar obtains a complete frame of scanning data, due to the movement of the robot, the received laser radar scanning data is obtained when the laser radar is at different positions. Therefore, it is necessary to obtain the corresponding position of the robot at each laser scanning point during the scanning cycle of 50ms; the improved Gmapping algorithm is used to process the scanning data obtained by the laser radar received at the current moment, thereby obtaining a complete frame of scanning data of the laser radar scanning a 360-degree environment at the same timestamp moment and at the same position; the improved Gmapping algorithm process includes:
[0020] Step 2.2.1: Input the particle swarm at the most recent time t, sample the subset and initialize the particle swarm, traverse the particles in the particle swarm at the previous time, and obtain the position, weight and map carried by the particles;
[0021] Step 2.2.2: Update the pose through the odometer and use maximum likelihood estimation to find the local extremum; if the local extremum is not found, use the observation model to update the particle pose weight state; if the local extremum is found, take k poses near the local extremum and calculate the mean, weight and variance of the k poses; then use the multivariate normal distribution to approximate the new pose and calculate the new pose particle weight.
[0022] Step 2.2.3: Update the map, update the particle swarm, and loop through all particles at the previous moment; calculate the discreteness of all particle weights, and determine whether the particle weights meet the requirements based on the threshold; if it is less than the threshold, it means that the particle differences are too large and resampling is required; if it is greater than the threshold, the process ends.
[0023] Step 2.3: According to the optimized complete frame scan data, perform pose transformation and splicing frame by frame, and then use the adjacent frame edge constraint method to align and match landmarks based on the key candidate frames associated with the current frame to correct the pose cumulative error. The selection conditions of the key candidate frames and the added constraints are expressed as:
[0024] ||x i px j p|| <Th dist (1)
[0025] ‖path(x i ,x j )‖ <Th path (2)
[0026] Score(x i ,x j ) <Th score (3)
[0027] Where: x i is the estimated pose of the i-th key frame; p is the key frame weight; path is the minimum distance of the key frame; Score is the score of the matching result; Th dist is the set threshold; Th path is the set distance threshold; Th score is the set score threshold; ||...|| means taking the absolute value. Finally, the global static 2D grid map is obtained and saved in the path of "map".
[0028] Step 3: The inspection area and target point are marked in the 2D grid map. The robot uses the A* algorithm to search for the shortest path between the robot's current position and the target point in the 2D grid map network. At the same time, the DWA algorithm is used for local path planning based on the obstacle information captured by the lidar to avoid temporary obstacles.
[0029] Further, the specific method of step 3 is:
[0030] Step 3.1: Based on the 2D grid map network generated in step 2, mark the robot's cruising area and cruising target position;
[0031] Step 3.2: Use the A* algorithm to perform global path planning for robot cruising and generate an initial path; the A* algorithm process is as follows:
[0032] Step 3.2.1: Starting from the robot's starting point A, check its adjacent grids and add them to the Openlist consisting of grids;
[0033] Step 3.2.2: Check the squares adjacent to starting point A, ignore the squares occupied by inaccessible obstacles, and add the walkable or reachable squares to the Openlist;
[0034] Step 3.2.3: Traverse the Openlist and calculate the valuation function F(n), where the calculation formula of F(n) is:
[0035] F(n)=G(n)+H(n) (4)
[0036] Where G(n) is the cost of moving from the starting point A to the specified square, G(n) is the G value of the current position, H(n) is the number of squares passed through to reach the target from the current square horizontally or vertically, ignoring diagonal movement, and the total number is multiplied by 10; select the square node with the smallest F value from the Openlist, set it as the starting point A, and execute step 3.2.2 again; when the adjacent square with the smallest F(n) already exists in the Openlist, determine whether the G value of the square with the smallest F(n) is less than G(n), that is, determine whether the G value is the G value of the next position, check whether this path is better, and use the G(n) value as a reference; a smaller G value indicates that this is a better path, but if not, then fall back to the upper starting point, and recalculate its G and F values after eliminating this square, and then reselect the path;
[0037] Step 3.2.4: When the end point B is added to the Openlist, the path is saved;
[0038] Step 3.3: The security cruise robot performs the cruise task according to the global planning path of the A* algorithm, and uses the laser radar to detect whether there are dynamic obstacles in the surrounding environment. When an obstacle is found, the DWA algorithm is called on the basis of the global path to perform local path planning to avoid dynamic obstacles; the DWA algorithm process includes:
[0039] Step 3.3.1: Based on the current state of the car (v, ω), solve the predicted state of the robot at different speeds and angular velocities, and simulate the motion trajectory of these speeds within a certain period of time;
[0040] Step 3.3.2: Use the evaluation function to evaluate the value of the evaluation function under different prediction states; the evaluation function G(v,ω) is expressed as:
[0041] G(v,ω)=σ(α*heading(v,ω)+β*dist(v,ω)+γ*vel(v,ω)) (5)
[0042] Among them, heading(v,ω) is the azimuth evaluation function: it evaluates the angle difference between the robot's end point and the target point at the current set speed; dist(v,ω) represents the distance between the robot and the nearest obstacle on the map when the robot is at the predicted end point of the trajectory. It penalizes the sampling points close to dynamic obstacles to ensure the robot's obstacle avoidance ability and reduce the probability of collision between the robot and obstacles; vel(v,ω) is the current linear speed of the robot, which ensures that the robot reaches the target quickly; α, β, γ, σ are weights;
[0043] Step 3.3.3: Normalize the evaluation function, and use Softmax to select the linear velocity and angular velocity of the predicted state corresponding to the appropriate evaluation function as the linear velocity and angular velocity of the next original state;
[0044] Step 3.4: Update the robot status, use the A* algorithm to re-plan the global path for the robot, and continue to perform the cruising mission.
[0045] Step 4: While the robot is performing the inspection task, the machine learning vision module integrated on the NVIDIA Jetson nano circuit board performs image detection and information extraction through the RGB-D depth camera; the improved YOLOv7 algorithm is used to detect pedestrians and objects, and the improved SimCC algorithm is used to extract the key points of the human body collected by the camera. Then, the ST-GCN algorithm is used to fuse multi-frame image information and combine spatiotemporal convolution to determine the human posture;
[0046] Further, the specific method of step 4 is:
[0047] Step 4.1: Read the video stream information obtained by the RGB-D depth camera as system input;
[0048] Step 4.2: Use the improved YOLOv7 to extract pedestrian targets and target objects related to dangerous behaviors in the video stream;
[0049] The improved YOLOv7 algorithm is specifically as follows: in terms of network structure, partial convolution is used on the YOLOv7 framework to compress the number of channels of the convolution kernel and reduce the number of parameters of the model; a CA attention module is rebuilt so that the network can capture the position information and direction information of the image while obtaining cross-channel information; in terms of loss function, the Wise-IoU loss function is used to replace the CIoU in the original algorithm, and a non-monotonic dynamic focusing mechanism is introduced to improve the feature extraction ability of the algorithm;
[0050] Step 4.3: Using the extracted target person area as the input of human posture detection, the improved SimCC is used to extract the key point representation of the pedestrian in the video stream;
[0051] The improved SimCC algorithm is specifically as follows: in terms of network structure, by combining the self-attention mechanism with a novel spatial convolution, LiteFNet enables the feature map to obtain a more informative global feature representation in the underlying network; the improved SimCC algorithm adds large-kernel convolution and self-attention mechanism to enhance SimCC's ability to process spatial information and obtain effective key point feature representation.
[0052] The step 4.3: using the extracted target person area as the input of human posture detection, using the improved SimCC to extract the human key point representation of the pedestrian in the video stream, using YOLOv7 as the human detection algorithm of SimCC, and flipping and cropping the detected pedestrians, there are 17 key points predicted in total, including: nose, left eye, right eye, left ear, right ear, left shoulder, right shoulder, left elbow, right elbow, left wrist, right wrist, left hip, right hip, left knee, right knee, left ankle, and right ankle.
[0053] Step 4.4: Use ST-GCN to analyze and judge the behavior of the target person, and combine the spatial information to determine whether the person has abnormal behavior;
[0054] The specific steps of step 4.4: using ST-GCN to analyze and judge the behavior of the target person and combining spatial information to determine whether the person has abnormal behavior and detect falls are:
[0055] First, detect whether there are pedestrians. If there are pedestrians, flip and crop the collected pedestrians, detect the key point representation of each pedestrian, and use the ST-GCN network combined with temporal convolution to judge the crowd behavior. If the crowd behavior is classified as falling and the fall score exceeds the threshold, the threshold is shown in Table 1, and it is considered that the pedestrian has fallen. If the pedestrian falls for 8 consecutive seconds, the pedestrian will approach the falling target for voice help and send a help message to the host computer.
[0056] Table 1 Crowd abnormal behavior detection indicators
[0057]
[0058] The specific steps of detecting a fight in step 4.4: using ST-GCN to analyze and judge the behavior of the target person and combining spatial information to determine whether the person has abnormal behavior are as follows:
[0059] First, dangerous objects and crowds are detected at the same time. If there are dangerous objects, an early warning will be immediately issued to the host computer. If there are no dangerous objects, the crowd behavior will be classified according to ST-GCN. When it is classified as fighting and the score exceeds the threshold, the crowd will be marked as fighting. When the fighting state lasts for 5 seconds, it is considered that the crowd is in dangerous behavior of fighting, and a voice warning will be issued and information will be sent to the host computer.
[0060] Step 4.5: The identified dangerous behavior information is transmitted to the front end for display and warning, and the car is controlled to approach abnormal people for warning or rescue.
[0061] Step 5: When abnormal crowd behavior is detected within the image range, the upper system will pass the behavior information data to the underlying control system. At this time, the security patrol robot will move to the vicinity of the target pedestrian or crowd, reminding the crowd that rescue is needed or warning the crowd not to conflict, and return the event information to the community management department through the communication module.
[0062] Compared with the prior art, the present invention has the following advantages:
[0063] 1. This invention innovatively combines laser SLAM, ST-GCN video understanding algorithm and ROS robot effectively. Compared with the current common unmanned cruise vehicles, it introduces video stream analysis, which overcomes the problems of small effect, small application scope and high cost of the current unmanned cruise vehicles;
[0064] 2. The present invention designs an adjacent frame edge constraint algorithm to optimize the cumulative error of the pose of SLAM mapping in complex environments. Compared with the current SLAM mapping algorithm that only uses a closed-loop detection algorithm, the adjacent frame edge constraint algorithm can better optimize the cumulative error of the point cloud map and can also achieve better results for continuously changing scenes;
[0065] 3. This paper improves the YOLOv7 algorithm, first redesigns the ELAN module, and effectively reduces the number of parameters and operations by using partial convolution; then adds the CA attention mechanism to obtain channel information and position information, helping the algorithm to efficiently locate and identify targets to improve the accuracy of identifying small objects. After testing and verification, the accuracy of the improved algorithm is increased by 2.3%, and the number of parameters is reduced by 12.3%, achieving lightweight while avoiding the reduction of detection accuracy, as shown in Table 2.
[0066] Table 2 Comparative experimental results
[0067]
[0068] 4. The present invention improves the SimCC human posture estimation and recognition algorithm, effectively combines the self-attention mechanism with a novel spatial convolution, and obtains a more informative global feature representation in the underlying network. In addition, the improved SimCC algorithm also enhances SimCC's ability to process spatial information by adding large-kernel convolution and self-attention mechanisms, and obtains more effective key point feature representations. After testing and verification, compared with the ResNet-based SimCC algorithm, the improved SimCC algorithm reduced GFlops by 46.0% while achieving an improvement of 2.0PCK. Compared with other algorithms based on heat maps or regression, the improved SimCC algorithm also achieves the best balance between GFlops and accuracy, as shown in Table 3.
[0069] Table 3 Comparison of results of different algorithms in MPII dataset.
[0070]
[0071] 5. This design uses a crowd abnormal behavior detection algorithm with optimized structure to achieve improved accuracy on multiple detection data sets, as shown in Table 4. Compared with similar video understanding algorithms, our algorithm can more effectively identify human key points and abnormal behaviors within 15m of the crowd.
[0072] Table 4 Comparison of abnormal behavior detection accuracy of crowds
[0073] BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0075] Figure 2 Schematic diagram of partial convolution used in improved YOLOv7;
[0076] Figure 3 Schematic diagram of CA attention used in the improved YOLOv7;
[0077] Figure 4 This is a schematic diagram of the key points extracted in SimCC;
[0078] Figure 5 A schematic diagram of the overall design technology route for the intelligent inspection robot;
[0079] Figure 6 This is the flow chart of the improved Gmapping algorithm;
[0080] Figure 7 This is the flow chart of A* fusion DWA algorithm;
[0081] Figure 8 This is the flow chart of the algorithm for detecting abnormal behavior of crowds;
[0082] Fig. 9 This is the flow chart of the abnormal behavior detection algorithm;
[0083] Fig.10 This is the network diagram of the DFC attention mechanism. DETAILED DESCRIPTION
[0084] like Figure 1 As shown, a security inspection system based on SLAM and abnormal crowd behavior recognition includes an upper system and a lower system. The upper system is equipped with a laser mapping unit, an autonomous navigation unit and an abnormal crowd behavior detection unit. The laser mapping unit uses a single-line laser radar as the hardware basis and the Gmapping algorithm as the software basis to complete the mapping function; the autonomous navigation unit uses the A* and DWA fusion algorithm to complete the autonomous navigation function; the abnormal human behavior detection unit uses an RGB-D depth camera as the hardware basis and the ST-GCN algorithm as the deep learning algorithm model to complete the abnormal human behavior detection;
[0085] The lower system is equipped with a body control unit and a communication warning unit. The body control unit completes robot control based on a six-axis acceleration sensor, tracks, power supply and motor; the communication warning unit uses a six-microphone voice array and a cloud server to complete voice recognition and communication warning; the upper system and the lower system are connected through serial communication, and the upper system controls the lower system and expands the computing resources of the lower system.
[0086] A patrol method for a security patrol system based on SLAM and recognition of abnormal crowd behavior, the specific implementation method mainly includes the following steps:
[0087] Step 1: Place the security inspection robot on the ground in the working area, turn on the main power of the power module installed on the chassis, turn on the Jetson nano circuit board switch on the body, and enter the security inspection robot operation mode;
[0088] Step 2: Select the autonomous map modeling mode in the ROS system and set the moving speed of the security inspection robot. The robot starts to move, and determines whether there are obstacles around it through the point cloud data of the surrounding environment returned by the laser radar, and gradually improves the map information. After the motion distortion is removed, the 2D grid map obtained by the laser radar scan is extracted and saved in the map path.
[0089] Step 3: The inspection area and target point are marked in the 2D grid map. The robot uses the A* algorithm to search for the shortest path between the robot's current position and the target point in the 2D grid map network. At the same time, the DWA algorithm is used for local path planning based on the obstacle information captured by the lidar to avoid temporary obstacles.
[0090] Step 4: While the robot is performing the inspection task, the machine learning vision module integrated on the NVIDIA Jetson nano circuit board performs image detection and information extraction through the RGB-D depth camera; the improved YOLOv7 algorithm is used to detect pedestrians and objects, and the improved SimCC algorithm is used to extract the key points of the human body collected by the camera. Then, the ST-GCN algorithm is used to fuse multi-frame image information and combine spatiotemporal convolution to determine the human posture;
[0091] Step 5: When abnormal crowd behavior is detected within the image range, the upper system will pass the behavior information data to the underlying control system. At this time, the security patrol robot will move to the vicinity of the target pedestrian or crowd, reminding the crowd that rescue is needed or warning the crowd not to conflict, and return the event information to the community management department through the communication module.
[0092] Furthermore, the crowd abnormal behavior detection algorithm mainly includes the following steps:
[0093] 1) Read the RGB-D depth camera carried by the inspection robot as the video stream information input of the system;
[0094] 2) Using the improved YOLOv7, pedestrian targets and target objects related to dangerous behaviors in the input video stream are extracted;
[0095] 3) Using the extracted target person area as the input of human posture detection, the improved SimCC is used to extract the key point representation of pedestrians in the video stream;
[0096] 4) Combining the key point representation of the human body extracted by SimCC and the position information of the small target object extracted by YOLOv7, ST-GCN is used to judge the target person, and combined with the spatial information to determine whether the person has fallen or dangerous behavior;
[0097] 5) Feedback the classified dangerous behavior categories to the inspection robot;
[0098] Among them, the method steps for extracting pedestrian targets and dangerous behavior-related target objects by the improved YOLOv7 mentioned in step 2) are as follows:
[0099] 1) Collect the behavior videos of the community population, split the obtained videos into frames to get the pictures of the community population behavior; then preprocess the obtained images, use the LableImage image annotation tool to annotate the community pedestrians and the objects they carry, and divide them into a training set and a test set, so as to obtain the community pedestrian and small object dataset;
[0100] 2) Build a crowd and small target detection network based on the improved YOLOv7. By combining partial convolution and ordinary convolution, the ELAN module of the YOLOv7 algorithm is reconstructed to reduce the algorithm's parameter quantity; then introduce the CA attention mechanism in the Neck module of YOLOv7 to enhance the algorithm's feature extraction ability; at the same time, add a small target detection layer to the prediction head part to improve the positioning accuracy of small targets; introduce WIOU as the loss function of the network to strengthen the network's positioning ability and improve the generalization ability of the model;
[0101] The PConv structure in the reconstructed ELAN module is as Figure 2 shown. The network applies ordinary convolution on c p (c p <c) channels for spatial feature extraction, keeping the number of channels of the feature map unchanged. And keep the remaining c - c p channels, so that the subsequent convolutional layers can utilize the feature information among them. The complexity of the algorithm is often measured by FLOPs (floating point operation count). The FLOPs calculation formula of partial convolution is shown in Equation (1):
[0102]
[0103] Among them, h and w are the length and width of the feature map respectively; k is the length and width of the partial convolution. Take the compression ratio Then the FLOPs of partial convolution is only 1 / 16 of that of ordinary convolution. Therefore, compared with the original network, the complexity of the improved YOLOv7 algorithm is greatly reduced. Further, in order to efficiently use the feature information of all channels, the improved YOLOv7 algorithm adds a layer of 1×1 ordinary convolution after partial convolution, and uses batch normalization (BatchNorm) and SiLU activation function.
[0104] The CA attention mechanism is as Figure 3 shown. In the CA module, first perform global average pooling on the input feature map x in two directions of width (W) and height (H), and the pooling kernel sizes are H×1 and 1×W respectively, so as to perform encoding operations on each channel in the horizontal and vertical coordinates. Therefore, the calculation formula (2) of the channel c output at h is as follows:
[0105]
[0106] Similarly, the output of channel c at w can be obtained as follows (3):
[0107]
[0108] Among them, x c (h,i) and x c (j,w) represents the i-th pixel and j-th pixel in W and H respectively; thus, the sizes of the feature perception maps in the horizontal and vertical directions are C×H×1 and C×1×W respectively. Then the two feature perception maps are concatenated and a 1×1 convolutional layer with shared weights and a nonlinear activation function are used to generate a transition feature map. Where r is the downsampling ratio. Then the transition feature map is divided into two independent tensors according to the spatial dimension and Using two 1×1 convolutional layers F h and F w f h and f w The number of channels is transformed to the same as the number of channels of input X, that is, formula (4) and (5):
[0109] g h =σ(F h (f h )) (4)
[0110] g w =σ(F w (f w )) (5)
[0111] Where σ is a nonlinear activation function, and finally g h and g w Expand them respectively and use them as attention weights to get the final output of the CA attention module as shown in formula (6):
[0112]
[0113] The Wise-IoU loss function introduces a non-monotonic dynamic focusing mechanism to improve the feature extraction capability of the algorithm. The Wise-IoU calculation formula is as follows:
[0114] L1=R×L IoU ,L IoU ∈[0,1] (10)
[0115]
[0116]
[0117]
[0118] Where L IoU is the loss function used by the YOLOv7 algorithm, and R is used to enlarge the L of the common anchor box. IoU ; * represents the separation of gradient calculation graph operations to prevent R from generating gradients that hinder convergence; x and y are network prediction values, x gt and gt is the true value of the prediction box; W g and H g is the size of the corresponding true value input image; α is the balance coefficient; δ is the scale coefficient; β is the outlier degree, which is used to describe the quality of the anchor box; r is the gradient gain. The high-quality anchor box has a lower outlier degree, which makes the gradient gain smaller, and the loss function can focus on the relatively low-quality anchor box; assigning a smaller gradient gain to the anchor box with a higher outlier degree can effectively prevent harmful gradients from low-quality examples. In addition, due to It is dynamic, which makes the quality division of the anchor box dynamic as well. This enables Wise-IoU to generate the gradient gain that best suits the current situation at any time, thereby improving detection accuracy.
[0119] 3) Use the image data in the dataset to train the improved YOLOv7 algorithm and obtain the trained pedestrian and small target object detection model weights;
[0120] 4) Download the trained model and prediction samples to Jetson, then configure the file and perform the prediction;
[0121] The steps of the improved SimCC method for extracting key points of the human body mentioned in step 3) are as follows:
[0122] 1) Collect pedestrian images segmented by YOLOv7, then pre-process the acquired images, and use the LabelImage image annotation tool to annotate the key points of the pedestrians in the community, using the annotation standard reference Figure 4 Then, the dataset is fused with public datasets such as COCO and UAV-Human to obtain the key point detection dataset.
[0123] 2) Build a human key point detection model based on the improved SimCC. In terms of network structure, by combining the self-attention mechanism with a novel spatial convolution, the convolution layer in SimCC is replaced, and LiteFNet is used to make the feature map obtain more informative global feature representation in the underlying network; at the same time, the improved SimCC algorithm adds large kernel convolution and self-attention mechanism to enhance SimCC's ability to process spatial information and obtain effective key point feature representation.
[0124] Furthermore, LiteFNet uses global information to extract stronger DFC Attention to adjust the weight of feature representation. The DFC attention mechanism network diagram is as follows: Fig.10 As shown. At the same time, FlipConv is used to replace the ordinary convolution in SimCC to generalize the performance of the model. In order to increase the perception of the coordinate separation method on the information between coordinates, we introduced large kernel convolution and GAU attention mechanism, which effectively improved the performance of the network.
[0125] 3) Use the image data in the dataset to train the improved SimCC algorithm and obtain the trained pedestrian key point detection model weights;
[0126] 4) Download the trained model and prediction samples to Jetson, then configure the file and perform pedestrian key point prediction on the output file of the YOLOv7 model; then use the spatial transformation network to correct the preliminary pedestrian key point area to obtain a higher quality pedestrian key point prediction result, and then send it to the ST-GCN network for target state classification to obtain the target state encoding of the pedestrian. At the same time, the target state behavior results are processed by the parameterized non-maximum suppression method to avoid redundant results.
[0127] Furthermore, for the deep network models used in this system, including YOLOv7, SimCC, and ST-GCN models, the TensorRT framework is used to accelerate deep learning reasoning. In the TensorRT deployment environment, this example uses the cuda11.0+cudann8.2.0+TensorRT8.0.0.3 version. The reasoning speed of the model is improved through methods such as tensor fusion and model pruning.
[0128] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.
Claims
1. A patrol method for a security patrol system based on SLAM and recognition of abnormal crowd behavior, characterized in that: The security inspection system includes an upper system and a lower system; the upper system includes a laser mapping unit, an autonomous navigation unit and a crowd abnormal behavior detection unit; the laser mapping unit uses a single-line laser radar as the hardware basis and the Gmapping algorithm as the software basis to complete the mapping function; the autonomous navigation unit uses the A* and DWA fusion algorithm to complete the autonomous navigation function; the crowd abnormal behavior detection unit uses an RGB-D depth camera as the hardware basis and the ST-GCN algorithm as the deep learning algorithm model to complete the crowd abnormal behavior detection; The lower system includes a body control unit and a communication warning unit; the body control unit completes robot control based on a six-axis acceleration sensor, tracks, power supply and motor; The communication warning unit uses a six-microphone voice array and cloud server to complete voice recognition and communication warning; The upper system and the lower system are connected via serial communication, the upper system controls the lower system and expands the computing resources of the lower system; the upper control system uses NVIDIA Jetson nano as the core, is installed with ROS system, and uses Python3.8, Pytorch 1.13.0 and mmcv 2.1 as the deep learning algorithm operating environment; The laser mapping unit relies on the ROS system and the improved Gmapping algorithm, takes the 2D single-line laser radar as the hardware basis, uses the RBPF algorithm to complete the 2D grid map construction, and uses the particle filter algorithm to accurately estimate the robot's posture; The autonomous navigation unit uses the A* algorithm to search for the shortest path between the robot's current position and the target point in the two-dimensional grid map network. At the same time, the DWA algorithm is used to calculate the trajectory of the robot moving at this speed for a certain period of time according to the current position and speed of the mobile robot, so as to effectively avoid obstacles. The abnormal crowd behavior detection unit uses the improved YOLOv7 algorithm to collect and capture the video captured by the RGB-D depth camera, uses the improved SimCC to extract the key points of pedestrians in the video, combines the ST-GCN algorithm to judge the behavior of the target person, and determines whether the person falls or fights based on the spatial information; The lower control system uses STM32F407 as the main control chip, and uses serial communication to control the body control unit and the communication warning unit; the body includes the front, the body and the chassis; the front is equipped with an RGB-D depth camera and a single-line laser radar, the body is equipped with a communication module and upper and lower control circuit boards; the chassis is internally equipped with a power module, a motor drive board, a decoder and a crawler; The inspection method comprises the following working steps: Step 1: Place the security inspection robot on the ground in the working area, turn on the main power of the power module installed on the chassis, turn on the Jetson nano circuit board switch on the body, and enter the security inspection robot operation mode; Step 2: Select the autonomous map modeling mode in the ROS system and set the moving speed of the security inspection robot. The robot starts to move, and determines whether there are obstacles around it through the point cloud data of the surrounding environment returned by the laser radar, and gradually improves the map information. After the motion distortion is removed, the 2D grid map obtained by the laser radar scan is extracted and saved in the "map" path. Step 3: The inspection area and target point are marked in the 2D grid map. The robot uses the A* algorithm to search for the shortest path between the robot's current position and the target point in the 2D grid map network. At the same time, the DWA algorithm is used for local path planning based on the obstacle information captured by the lidar to avoid temporary obstacles. Step 4: While the robot is performing the inspection task, the machine learning vision module integrated on the NVIDIA Jetson nano circuit board performs image detection and information extraction through the RGB-D depth camera; the improved YOLOv7 algorithm is used to detect pedestrians and objects, and the improved SimCC algorithm is used to extract the key points of the human body collected by the camera. Then, the ST-GCN algorithm is used to fuse multi-frame image information and combine spatiotemporal convolution to determine the human posture; Step 5: When abnormal crowd behavior is detected within the image range, the upper system will transmit the behavior information data to the lower control system. At this time, the security patrol robot will move to the vicinity of the target pedestrian or crowd, reminding the crowd that they need help or warning the crowd not to have a conflict, and return the event information to the community management department through the communication module; The specific process of step 2 is as follows: Step 2.1: After the security inspection robot starts running, it uses a single-line laser radar to scan the surrounding environment 360 degrees. When the laser radar works at the set scanning frequency, the laser radar completes a 360-degree scan of the environment every other scanning cycle, and uses the scanned 360-degree environmental data as a complete frame of data; Step 2.2: When the laser radar obtains a complete frame of scanning data, the improved Gmapping algorithm is used to process the scanning data obtained by the laser radar at the current moment, and the scanning data of a complete frame of the laser radar scanning the 360-degree environment at the same moment and at the same position is obtained; The improved Gmapping algorithm process includes: Step 2.2.1: Input the particle swarm at the most recent time t, sample the subset and initialize the particle swarm, traverse the particles in the particle swarm at the previous time, and obtain the position, weight and map carried by the particles; Step 2.2.2: Update the pose through the odometer and use maximum likelihood estimation to find the local extreme value; Step 2.2.3: Update the map, update the particle swarm, and loop through all particles at the previous moment; calculate the discrete degree of all particle weights, and determine whether the particle weights meet the requirements based on the threshold; Step 2.3: According to the optimized complete frame scan data, perform pose transformation and splicing frame by frame, and then use the adjacent frame edge constraint method to align and match landmarks based on the key candidate frames associated with the current frame to correct the pose cumulative error. The selection conditions of the key candidate frames and the added constraints are expressed as: ||x i p-x j p||<Th dist (1) ‖path(x i ,x j )‖<Th path (2) Score(x i ,x j )<Th score (3) Where: x i is the estimated pose of the i-th key frame; p represents the key frame weight; path is the minimum distance of the key frame; Score is the score of the matching result; Th dist is the set threshold; Th path is the set distance threshold; Th score is the set score threshold; ||...|| means taking the absolute value; finally, the global static 2D grid map is obtained and saved in the "map" path; The specific process of step 3 is as follows: Step 3.1: Based on the 2D grid map network generated in step 2, mark the robot's cruising area and cruising target position; Step 3.2: Use the A* algorithm to perform global path planning for robot cruising and generate an initial path; the A* algorithm process is as follows: Step 3.2.1: Starting from the robot's starting point A, check its adjacent grids and add them to the Openlist consisting of grids; Step 3.2.2: Check the squares adjacent to starting point A, ignore the squares occupied by inaccessible obstacles, and add the walkable or reachable squares to the Openlist; Step 3.2.3: Traverse the Openlist and calculate the valuation function F(n), where the calculation formula of F(n) is: F(n)=G(n)+H(n) (4) Where G(n) is the cost of moving from the starting point A to the specified square, G(n) is the G value of the current position, H(n) is the number of squares passed by the current square to reach the target horizontally or vertically, ignoring diagonal movement, and the total number is multiplied by 10; select the square node with the smallest F value from the Openlist, set it as the starting point A, and execute step 3.2.2 again; when the adjacent square with the smallest F(n) already exists in the Openlist, determine whether the G value of the square with the smallest F(n) is less than G(n), that is, determine whether the G value is the G value of the next position; Step 3.2.4: When the end point B is added to the Openlist, the path is saved; Step 3.3: The security cruise robot performs the cruise task according to the global planning path of the A* algorithm, and uses the laser radar to detect whether there are dynamic obstacles in the surrounding environment. When an obstacle is found, the DWA algorithm is called on the basis of the global path to perform local path planning to avoid dynamic obstacles; the DWA algorithm process includes: Step 3.3.1: Based on the current state of the car (v, ω), solve the predicted state of the robot at different speeds and angular velocities, and simulate the motion trajectory of these speeds within a certain period of time; Step 3.3.2: Use the evaluation function to evaluate the value of the evaluation function under different prediction states; the evaluation function G(v,ω) is expressed as: G(v,ω)=σ(α*heading(v,ω)+β*dist(v,ω)+γ*vel(v,ω)) (5) Among them, heading(v,ω) is the azimuth evaluation function: it evaluates the angle difference between the robot's end point and the target point at the current set speed; dist(v,ω) represents the distance between the robot and the nearest obstacle on the map when the robot is at the predicted end point of the trajectory. It penalizes the sampling points close to dynamic obstacles to ensure the robot's obstacle avoidance ability and reduce the probability of collision between the robot and obstacles; vel(v,ω) is the current linear speed of the robot, which ensures that the robot reaches the target quickly; α, β, γ, σ are weights; Step 3.3.3: Normalize the evaluation function, and use Softmax to select the linear velocity and angular velocity of the predicted state corresponding to the appropriate evaluation function as the linear velocity and angular velocity of the next original state; Step 3.4: Update the robot status, use the A* algorithm to re-plan the global path for the robot, and continue to perform the cruise mission; The specific process of step 4 is as follows: Step 4.1: Read the video stream information obtained by the RGB-D depth camera as system input; Step 4.2: Use the improved YOLOv7 to extract pedestrian targets and target objects related to dangerous behaviors in the video stream; The improved YOLOv7 algorithm is specifically as follows: in terms of network structure, partial convolution is used on the YOLOv7 framework to compress the number of channels of the convolution kernel and reduce the number of parameters of the model; a CA attention module is rebuilt so that the network can capture the position information and direction information of the image while obtaining cross-channel information; in terms of loss function, the Wise-IoU loss function is used to replace the CIoU in the original algorithm, and a non-monotonic dynamic focusing mechanism is introduced to improve the feature extraction ability of the algorithm; Step 4.3: Using the extracted target person area as the input of human posture detection, the improved SimCC is used to extract the key point representation of the pedestrian in the video stream; The improved SimCC algorithm is specifically as follows: in terms of network structure, by combining the self-attention mechanism with a novel spatial convolution, LiteFNet enables the feature map to obtain a more informative global feature representation in the underlying network; the improved SimCC algorithm adds large kernel convolution and self-attention mechanism to enhance SimCC's ability to process spatial information and obtain effective key point feature representation; Step 4.4: Use ST-GCN to analyze and judge the behavior of the target person, and combine the spatial information to determine whether the person has abnormal behavior; Step 4.5: The identified dangerous behavior information is transmitted to the front end for display and warning, and the car is controlled to approach abnormal people for warning or rescue.
2. According to claim 1, the inspection method of a security inspection system based on SLAM and crowd abnormal behavior recognition is characterized in that: The step 4.3: using the extracted target person area as the input of human posture detection, using the improved SimCC to extract the human key point representation of the pedestrian in the video stream, using YOLOv7 as the human detection algorithm of SimCC, and flipping and cropping the detected pedestrians, there are 17 key points predicted in total, including: nose, left eye, right eye, left ear, right ear, left shoulder, right shoulder, left elbow, right elbow, left wrist, right wrist, left hip, right hip, left knee, right knee, left ankle, and right ankle.
3. The inspection method of a security inspection system based on SLAM and crowd abnormal behavior recognition according to claim 2 is characterized in that: The specific steps of detecting falls are as follows: first, detect whether there are pedestrians. If there are pedestrians, flip and crop the collected pedestrians, detect the key point representation of each pedestrian, use the ST-GCN network combined with time convolution to judge the crowd behavior, and when the crowd behavior is classified as a fall and the fall score exceeds the threshold, it is considered that the pedestrian has fallen; when the pedestrian falls are detected for 8 consecutive seconds, approach the fall target to make voice help and send help information to the host computer; The specific steps for detecting fights are as follows: first, detect dangerous objects and crowds at the same time. When there are dangerous objects, an early warning is immediately issued to the host computer. When there are no dangerous objects, the crowd behavior is classified according to ST-GCN. When it is classified as a fight and the score exceeds the threshold, the crowd is marked as Fighting. When the Fighting state lasts for 5 seconds, it is considered that the crowd has dangerous behavior of fighting, and a voice warning is issued and information is sent to the host computer.
Citation Information
Patent Citations
Inspection robot path planning method based on improved A-satellite fusion DWA optimization algorithm
CN115079705A
Robot positioning and mapping system and method based on particle filtering and graph optimization
CN115407352A
Method and patrol robot for examination room or classroom discipline patrol
CN116259101A
Pedestrian crossing intention prediction method, model and device based on two channels
CN116824541A
