A dense pedestrian detection method, medium, terminal and device
Through the detection method of Faster-RCNN and ROI Pooling or RoI Align layer, combined with the non-maximum suppression method, it solves the problem of pedestrian detection accuracy in dense crowds and occlusion scenes, improves the recall rate and average precision, and achieves pedestrian detection accurate identification.
Patent Information
- Application Number
- CN202010705325.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-21
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-07-21
AI Technical Summary
Existing technology is difficult to accurately identify pedestrians in dense crowds and occlusion scenarios, resulting in missed detections and false detections, and cannot meet the precise navigation needs of robots and unmanned vehicles.
Use the Faster-RCNN method to detect pedestrians on the target image, generate multiple detection frames, and cover the frames with scores higher than the preset threshold. Use the ROI Pooling or RoI Align layer again for detection to generate a frame for identifying blocked pedestrians. Detection frame, combined with non-maximum suppression method for screening.
It effectively eliminates the interference of unobstructed people in the crowd on detection and recognition, greatly improves the recall rate and average accuracy of pedestrian detection in dense crowds, and accurately identifies the location and number of pedestrians.
Smart Images

Figure CN111832515B
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of image recognition technology, and in particular to a dense pedestrian detection method, medium, terminal and device. [Background technology]
[0002] When robots or unmanned vehicles are moving, they often need to use visual perception methods to analyze and understand the surrounding environment images taken by the camera, so as to realize the perception of surrounding objects, especially pedestrians, and guide the path planning and motion strategies of robots and unmanned vehicles during navigation, such as obstacle avoidance. The existing technology usually adopts the regional target detection method of neural networks such as Faster-RCNN. This method directly processes the results of Faster-RCNN, such as using non-maximum suppression (NMS) to filter neighboring boxes. At this time, the NMS threshold is generally 0.5, which will result in that if the IoU (Intersection over Union) between two target boxes in the picture is greater than 0.5, one of the boxes will definitely not be detected after passing NMS. Indoor robots or unmanned vehicles often face scenes with dense and overlapping crowds around them. In this scene, due to the occlusion of dense crowds or other obstacles, not only will the visual feature information of the occluded objects be small and inaccurate, but also a large number of occluded targets will be actually identified by the existing Faster-RCNN regional target detection method, but will be suppressed by NMS, resulting in missed detection or false detection, which is difficult to meet the needs of accurate detection of robots. [Summary of the invention]
[0003] The present invention provides a dense pedestrian detection method, medium, terminal and device, which solve the above-mentioned technical problems.
[0004] The technical solution of the present invention to solve the above technical problem is as follows: a dense pedestrian detection method, comprising the following steps:
[0005] S1, using the Faster-RCNN method to perform pedestrian detection on the target image to generate multiple first pedestrian detection frames, and covering the first pedestrian detection frames with scores higher than a preset threshold;
[0006] S2, using the Faster-RCNN method based on the ROI Pooling layer or the RoI Align layer to perform pedestrian detection again on the masked target image, and generate a second pedestrian detection frame for identifying the blocked pedestrian;
[0007] S3, using a non-maximum suppression method to filter the first pedestrian detection frame and the second pedestrian detection frame, and displaying the filtering result in the target image;
[0008] The method of using the Faster-RCNN method to perform pedestrian detection on the target image to generate multiple first pedestrian detection frames, and covering the first pedestrian detection frames with scores higher than a preset threshold, comprises the following steps:
[0009] S101, using the trained first Faster-RCNN model to perform pedestrian detection on the target image, generating multiple first pedestrian detection frames and a score for each first pedestrian detection frame;
[0010] S102, sorting the first pedestrian detection frames according to scores, and selecting primary target frames having scores greater than a preset threshold from the first pedestrian detection frames;
[0011] S103, covering the primary target frame with a mask on the first convolution feature map of the target image to generate a second convolution feature map of the target image; the activation value of the white part of the mask corresponding to the first convolution feature map area is set to 0.
[0012] In a preferred embodiment, the first Faster-RCNN model includes a first RPN layer, a first RoI Pooling layer, and a first fully connected layer connected in sequence, and training the first Faster-RCNN model specifically includes the following steps:
[0013] S1001, collecting a large number of training images containing pedestrians, and marking the pedestrian parts in the training images with a first box to form a training set containing pedestrians;
[0014] S1002, constructing a VGG-16 convolutional neural network and inputting the training set, extracting pedestrian features in the training image, and outputting a first convolutional feature map of the training image;
[0015] S1003, inputting the first convolutional feature map into a first RPN layer, and generating first region of interest proposals through the first RPN layer;
[0016] S1004, inputting the first convolutional feature map and the first region of interest proposals into the first RoI Pooling layer, and outputting a first RoI feature map of a fixed size through the first RoI Pooling layer;
[0017] S1005, combining the first convolutional feature map and the first RoI feature map, calculating the probability vector of each first region of interest proposal belonging to a pedestrian through the first fully connected layer and the softmax function, and performing bounding box regression with a smoothing function to obtain the position offset of each first region of interest proposal to regress the precise position of the object, thereby completing the training of the first Faster-RCNN model.
[0018] In a preferred embodiment, the method of performing pedestrian detection again on the masked target image using the Faster-RCNN method based on the ROI Pooling layer to generate a second pedestrian detection frame for identifying the masked pedestrian specifically comprises the following steps:
[0019] S201, using the first trained Faster-RCNN model to perform pedestrian detection on the training images in the training set, and covering the primary target frame with a mask on the first convolution feature map of the training image to generate a second convolution feature map of the training image;
[0020] S202, constructing a second Faster-RCNN model including a second RPN layer, a second RoI Pooling layer, and a second fully connected layer connected in sequence, inputting a second convolutional feature map of the training image into the second RPN layer, taking undetected occluded pedestrians as detection targets, and generating second region of interest proposals through the second RPN layer;
[0021] S203, inputting the second convolutional feature map and the second region of interest proposals into a second RoIPooling layer, and outputting a second RoI feature map of a fixed size through the second RoI Pooling layer;
[0022] S204, combining the second convolutional feature map and the second RoI feature map, calculating the probability vector of each second region of interest proposal belonging to the pedestrian through the second fully connected layer and the softmax function, and performing bounding box regression with a smoothing function to obtain the position offset of each second region of interest proposal to regress the precise position of the object, and completing the training of the second Faster-RCNN model;
[0023] S205: Input the second convolutional feature map of the target image into the trained second Faster-RCNN model to generate a second pedestrian detection frame for identifying the obscured pedestrian.
[0024] In a preferred embodiment, the preset threshold for screening the primary target box is set to 0.6; when the second RPN layer is used to generate the second region of interest proposals, 0.7 is used as the positive and negative sample threshold.
[0025] In a preferred embodiment, the non-maximum suppression method is used to screen the first pedestrian detection frame and the second pedestrian detection frame as follows: the first pedestrian detection frame and the second pedestrian detection frame are arranged in order of pedestrian probability from large to small, and the first detection frame and the second detection frame whose overlap rate with the detection frame with the largest pedestrian probability is greater than 70% are deleted, and then the first detection frame and the second detection frame whose overlap rate with the detection frame with the second largest pedestrian probability is greater than 70%, and so on. The detection frames left at the end are the detection frames screened by the non-maximum suppression method.
[0026] A second aspect of an embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the dense pedestrian detection method described above is implemented.
[0027] A third aspect of an embodiment of the present invention provides a dense pedestrian detection terminal, comprising the computer-readable storage medium and a processor, wherein the processor implements the steps of the dense pedestrian detection method described above when executing the computer program on the computer-readable storage medium.
[0028] A fourth aspect of an embodiment of the present invention provides a dense pedestrian detection device, including a first detection module, a second detection module and a screening module.
[0029] The first detection module is used to detect pedestrians in the target image using the Faster-RCNN method, and to cover the first pedestrian detection frame in the detection result whose score is higher than a preset threshold;
[0030] The second detection module is used to perform pedestrian detection again on the covered target image using a Faster-RCNN method based on a ROI Pooling layer or a RoI Align layer to generate a second pedestrian detection frame for identifying the covered pedestrian;
[0031] The screening module is used to screen the first pedestrian detection frame and the second pedestrian detection frame by using a non-maximum suppression method, and display the screening result in a target image;
[0032] The first detection module specifically includes:
[0033] A first detection unit, configured to perform pedestrian detection on a target image using a trained first Faster-RCNN model, and generate a plurality of first pedestrian detection frames and a score for each first pedestrian detection frame;
[0034] a screening unit, configured to sort the first pedestrian detection frames according to their scores, and screen out primary target frames having scores greater than a preset threshold from the first pedestrian detection frames;
[0035] A masking unit is used to cover the primary target frame with a mask on the first convolution feature map of the target image to generate a second convolution feature map of the target image; the activation value of the white part of the mask corresponding to the first convolution feature map area is set to 0.
[0036] In a preferred embodiment, the dense pedestrian detection device further includes a first training module, and the first training module specifically includes:
[0037] A collection unit, used for collecting a large number of training images containing pedestrians, and marking the pedestrian parts in the training images with a first frame to form a training set containing pedestrians;
[0038] A feature extraction unit, used to construct a VGG-16 convolutional neural network and input the training set, extract pedestrian features in the training image, and output a first convolution feature map of the training image;
[0039] The first training unit is used to input the first convolutional feature map into the first RPN layer, generate first region of interest proposals through the first RPN layer, input the first convolutional feature map and the first region of interest proposals into the first RoI Pooling layer, and output a first RoI feature map of a fixed size through the first RoI Pooling layer; and integrate the first convolutional feature map and the first RoI feature map, calculate the probability vector that each first region of interest proposal belongs to a pedestrian through the first fully connected layer and the softmax function, and perform border regression with a smoothing function to obtain a position offset of each first region of interest proposal, so as to regress the precise position of the object and complete the training of the first Faster-RCNN model.
[0040] In a preferred embodiment, the second detection module specifically includes:
[0041] A second detection unit is used to perform pedestrian detection on the training images in the training set by using the first trained Faster-RCNN model, and to cover the primary target frame with a mask on the first convolution feature map of the training image to generate a second convolution feature map of the training image;
[0042] A second training unit is used to construct a second Faster-RCNN model including a second RPN layer, a second RoI Pooling layer and a second fully connected layer connected in sequence, input the second convolutional feature map of the training image into the second RPN layer, take the undetected blocked pedestrian as the detection target and generate second region of interest proposals through the second RPN layer; and input the second convolutional feature map and the second region of interest proposals into the second RoIPooling layer, output a second RoI feature map of a fixed size through the second RoI Pooling layer, and combine the second convolutional feature map and the second RoI feature map, calculate the probability vector of each second region of interest proposal belonging to the pedestrian through the second fully connected layer and the softmax function, and perform border regression with a smoothing function to obtain the position offset of each second region of interest proposal, so as to regress the precise position of the object and complete the training of the second Faster-RCNN model;
[0043] The third detection unit is used to input the second convolution feature map of the target image into the trained second Faster-RCNN model to generate a second pedestrian detection frame for identifying the obscured pedestrian.
[0044] In a preferred embodiment, the screening module is specifically used to arrange the first pedestrian detection frame and the second pedestrian detection frame in order of pedestrian probability from large to small, delete the first detection frame and the second detection frame whose overlap rate with the detection frame with the highest pedestrian probability is greater than 70%, and then delete the first detection frame and the second detection frame whose overlap rate with the detection frame with the second highest pedestrian probability is greater than 70%, and so on. The detection frame that remains at the end is the detection frame obtained by screening using the non-maximum suppression method.
[0045] The present invention designs a dense pedestrian detection method, medium, device and terminal for scenes with highly overlapping pedestrians. Through the detection-covering-redetection method, the interference of unobstructed people in the crowd on the detection and recognition of obscured people is effectively eliminated, and the recall rate (Recall) and average precision (Average Precision) of pedestrian detection in dense crowds are greatly improved, so as to accurately identify the position and number of pedestrians within the field of vision. The method can be widely used in intelligent carriers such as self-driving cars and robots.
[0046] In order to make the above-mentioned objects, features and advantages of the invention more obvious and easy to understand, the preferred embodiments of the present invention are specifically cited below and described in detail with reference to the attached drawings.
Brief Description of the Drawings
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 is a flowchart of a dense pedestrian detection method provided in Example 1;
[0049] Figure 2 is a schematic diagram of a mask in the dense pedestrian detection method provided in Example 1;
[0050] Figure 3 is a detection framework diagram of the dense pedestrian detection method provided in Example 1;
[0051] Figure 4 is a schematic diagram of the structure of a dense pedestrian detection device provided in Example 2;
[0052] Figure 5 It is a structural diagram of a dense pedestrian detection terminal provided in Example 3. [Specific implementation method]
[0053] In order to make the purpose, technical solution and beneficial technical effect of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be understood that the specific implementation methods described in this specification are only for explaining the present invention, not for limiting the present invention.
[0054] Figure 1 is a flow chart of a dense pedestrian detection method provided by Embodiment 1 of the present invention, such as Figure 1 As shown, the following steps are included:
[0055] S1, use the Faster-RCNN method to detect pedestrians in the target image to generate multiple first pedestrian detection frames, and cover the first pedestrian detection frames with scores higher than the preset threshold. The Faster-RCNN method is a detection method proposed by Ross Girshick in 2015. It replaces the traditional selective search (Selective Search) method of extracting targets with a method based on the RPN network (Region Proposal Networks) to generate candidate regions, which greatly improves the detection and classification speed of the entire process. Specifically, we must first train and generate the first Faster-RCNN model. The first Faster-RCNN model includes the first RPN layer, the first RoI Pooling layer and the first fully connected layer connected in sequence. The specific training method includes the following steps:
[0056] S1001, a large number of training images containing pedestrians are collected by a driving recorder or other equipment during the driving of the car, and the pedestrian parts in the training images are marked with a first frame to form a training set containing pedestrians.
[0057] S1002, construct a VGG-16 convolutional neural network and input the training set, extract pedestrian features in the training image through a series of convolution and pooling steps, and output the first convolution feature map of the training image. In other embodiments, other common structures such as ResNet and Inception (only the part before the fully connected layer is used) can also be used to extract pedestrian features, which will not be described in detail.
[0058] S1003, input the first convolutional feature map to the first RPN layer, and generate the first region of interest proposals through the first RPN layer. Specifically, each pixel of the first convolutional feature map generates 9 anchor points. The first RPN layer is divided into two routes: classification layer and regression layer. The outputs of the classification layer and regression layer are connected to the Proposal layer. In the classification layer, the anchor is classified by the softmax function to obtain the detection target foreground and image background background, that is, whether it is an object or not. In the regression layer, the candidate box position is obtained by regressing the anchor. Finally, the Proposal layer comprehensively detects the target foreground and the candidate box position to generate the first region of interest proposals, i.e., ROI.
[0059] S1004, input the first convolutional feature map and the first region of interest proposals to the first RoI Pooling layer, "cut out" the first region of interest proposals from the first convolutional feature map through the first RoI Pooling layer, and pool the "cut out" first region of interest proposals into a fixed length output, that is, output a first RoI feature map of fixed size. This is because the size of the proposals extracted by the RPN network will change, and the input of the fully connected layer for classification must be of a fixed length, so there must be a process of transforming from a variable size to a fixed size input. In the earlier R-CNN and FastR-CNN structures, the proposals are warped or cropped to a fixed size. The side effect of warping and cropping is that the original input is deformed or the amount of information is lost, resulting in inaccurate classification. ROI Pooling completely avoids this problem. The proposals can be completely pooled into a fully connected input without deformation and with a fixed length.
[0060] S1005, combining the first convolutional feature map and the first RoI feature map, calculating the probability vector of each first region of interest proposal belonging to a pedestrian through the first fully connected layer and the softmax function, and using the smoothing function to perform bounding box regression to obtain the position offset of each first region of interest proposal to regress the precise position of the object and complete the training of the first Faster-RCNN model. The specific training process is described in detail in Ross Girshick's paper and will not be described in detail here.
[0061] Then, the trained first Faster-RCNN model can be used to perform pedestrian detection on the target image to generate multiple first pedestrian detection frames, and the first pedestrian detection frames with scores higher than a preset threshold are covered, specifically including the following steps:
[0062] S101, using the trained first Faster-RCNN model to perform pedestrian detection on the target image, generating multiple first pedestrian detection frames and a score for each first pedestrian detection frame.
[0063] S102, sorting the first pedestrian detection frames according to the scores, and selecting primary target frames whose scores are greater than a preset threshold from the first pedestrian detection frames.
[0064] S103, covering the primary target frame with a mask on the first convolution feature map of the target image to generate a second convolution feature map of the target image; the activation value of the white part of the mask corresponding to the first convolution feature map area is set to 0.
[0065] In the standard Faster-RCNN method, the output of the RCNN in stage one is the final result of the algorithm. In the present invention, the result of the RCNN in stage one is only to detect clear and primary pedestrian targets, so 0.6 can be selected as the preset threshold corresponding to the primary target frame. That is, assuming that the RCNN in stage one outputs n first pedestrian detection frames, and m of the first pedestrian detection frames have scores greater than 0.6, then these m first pedestrian detection frames are retained as the primary target frames detected in the first stage. Then, for each detected primary target frame, a human mask is covered on the first convolution feature map. The specific operation is: the activation value in the first convolution feature map area corresponding to the white color inside the mask is set to 0, that is, the detected primary target frame is covered. The white human mask is as follows: Figure 2 As shown in Figure 1, m regions on the first convolutional feature map are masked / erased and will not be detected repeatedly in the second stage. Phase 1 is completed.
[0066] Then, S2 is executed to detect pedestrians again on the masked target image using the Faster-RCNN method based on the ROI Pooling layer or the RoI Align layer, and a second pedestrian detection frame is generated for identifying the blocked pedestrians. In one embodiment, the steps include:
[0067] S201, use the trained first Faster-RCNN model to perform pedestrian detection on the training images in the training set, and cover the primary target box with the above mask on the first convolution feature map of the training image to generate a second convolution feature map of the training image.
[0068] S202, construct a second Faster-RCNN model including a second RPN layer, a second RoI Pooling layer and a second fully connected layer connected in sequence, input the second convolutional feature map of the training image into the second RPN layer, take the undetected occluded pedestrians as detection targets and generate second region of interest proposals through the second RPN layer.
[0069] S203, input the second convolutional feature map and the second region of interest proposals into the second RoI Pooling layer, and output a second RoI feature map of a fixed size through the second RoI Pooling layer.
[0070] S204, combining the second convolutional feature map and the second RoI feature map, calculating the probability vector of each second region of interest proposal belonging to the pedestrian through the second fully connected layer and the softmax function, and using the smoothing function to perform bounding box regression to obtain the position offset of each second region of interest proposal to regress the precise position of the object and complete the training of the second Faster-RCNN model.
[0071] S205: Input the second convolutional feature map of the target image into the trained second Faster-RCNN model to generate a second pedestrian detection frame for identifying the obscured pedestrian.
[0072] After stage 1, the primary target frame detected has been completely erased by the mask on the convolutional feature map, which is equivalent to starting from stage 2. The target detected in stage 1 has completely disappeared from the feature map and will not be detected repeatedly. In this way, stage 2 can focus on detecting the targets missed in stage 1. Figure 3As shown in the figure, after the targets that are easier to detect in the convolutional feature map are erased, the targets that were originally highly obscured will be exposed and become the primary targets of the second stage. In the second stage training stage, the undetected pedestrians are first marked with the second box and used as the targets to be detected in the second stage. The first region of interest proposals in the first stage are reassigned (Assign) and sampled (Sample) to screen out the second region of interest proposals in the second stage. In the assign step, the threshold of the second stage is changed to 0.7, which is different from the traditional practice of using 0.5 as the positive and negative sample threshold, so that a sparser prediction result can be obtained when only part of the target is exposed. Then, the features of the second region of interest proposals are extracted through the roi align layer or the roi pooling layer. It should be noted here that when using the FPN network, feature extraction should be performed on the layer with the largest feature map to obtain a clear target activation pattern. The training of the second Faster-RCNN model can be completed through a specific training process, and then the second convolutional feature map of the target image is directly sent to the second Faster-RCNN model to obtain the output result. Because of the consistency between the training phase and the testing phase, the two-stage RCNN network is very sensitive to human targets that only partially reveal their area (i.e., highly occluded targets), and can give a more accurate regression frame.
[0073] Then execute S3, use the non-maximum suppression method to filter the first pedestrian detection frame and the second pedestrian detection frame, and set the NMS threshold to 0.7, so that the screening results are displayed in the target image. Specifically, the first pedestrian detection frame and the second pedestrian detection frame are arranged in order from large to small according to the pedestrian probability, and the first detection frame and the second detection frame whose overlap rate with the detection frame with the highest pedestrian probability is greater than 70% are deleted, and then the first detection frame and the second detection frame whose overlap rate with the detection frame with the second highest pedestrian probability is greater than 70% are deleted, and so on. The detection frame left at the end is the detection frame obtained by filtering using the non-maximum suppression method. Experiments have shown that the method of the present invention can retrieve most of the targets whose IoU (Intersection over Union) with other targets is between 0.5-0.7, and such targets will be suppressed by NMS in the standard Faster-RCNN network, resulting in failure to detect.
[0074] The present invention is mainly based on the target detection structure of the Faster-RCNN deep neural network. First, the detection frame with a confidence higher than a preset threshold is taken as the first-stage "high confidence" target frame for the output result of the original Faster-RCNN. Then, the pixel-level position of the target in the "high confidence" target frame is segmented by a human mask, and these "high confidence" targets are erased / covered on the feature map with a human mask, and then sent to a specially trained second-stage RCNN network for identification and positioning. Finally, the detection results of the first and second stages are integrated to obtain the final human detection result. In this way, the main and easily identifiable targets are first ensured to be identified in the first stage, and then these identified targets are covered in the second stage to prevent repeated identification. At the same time, the recognition rate of other pedestrians who are severely blocked by pedestrians in the first-stage target frame is improved through a specially trained RCNN module. Finally, the recognition results of the first and second stages are fused, effectively avoiding the situation where the high overlapping target pedestrians caused by NMS are suppressed and missed detection occurs, and the accuracy of pedestrian detection technology in overlapping scenes is improved.
[0075] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0076] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above dense pedestrian detection method is implemented.
[0077] Figure 4 is a schematic diagram of the structure of a dense pedestrian detection device provided by Embodiment 2 of the present invention, such as Figure 4 As shown, it includes a first detection module 100, a second detection module 200 and a screening module 300,
[0078] The first detection module 100 is used to perform pedestrian detection on the target image using the Faster-RCNN method, and to cover the first pedestrian detection frame in the detection result whose score is higher than a preset threshold;
[0079] The second detection module 200 is used to perform pedestrian detection again on the masked target image using the Faster-RCNN method based on the ROI Pooling layer or the RoI Align layer to generate a second pedestrian detection frame for identifying the masked pedestrian;
[0080] The screening module 300 is used to screen the first pedestrian detection frame and the second pedestrian detection frame by using a non-maximum suppression method, and display the screening result in the target image.
[0081] In a preferred embodiment, the first detection module 100 specifically includes:
[0082] A first detection unit 101 is used to perform pedestrian detection on a target image using a trained first Faster-RCNN model, and generate a plurality of first pedestrian detection frames and a score for each first pedestrian detection frame;
[0083] A screening unit 102 is used to sort the first pedestrian detection frames according to the scores, and screen out primary target frames whose scores are greater than a preset threshold from the first pedestrian detection frames;
[0084] The masking unit 103 is used to cover the primary target frame with a mask on the first convolution feature map of the target image to generate a second convolution feature map of the target image; the activation value of the white part of the mask corresponding to the first convolution feature map area is set to 0.
[0085] In a preferred embodiment, the dense pedestrian detection device further includes a first training module 400, and the first training module 400 specifically includes:
[0086] The collecting unit 401 is used to collect a large number of training images containing pedestrians, and mark the pedestrian parts in the training images with a first frame to form a training set containing pedestrians;
[0087] A feature extraction unit 402 is used to construct a VGG-16 convolutional neural network and input a training set, extract pedestrian features in the training image, and output a first convolution feature map of the training image;
[0088] The first training unit 403 is used to input the first convolutional feature map into the first RPN layer, generate first region of interest proposals through the first RPN layer, input the first convolutional feature map and the first region of interest proposals into the first RoI Pooling layer, and output the first RoI feature map of a fixed size through the first RoI Pooling layer; and integrate the first convolutional feature map and the first RoI feature map, calculate the probability vector that each first region of interest proposal belongs to the pedestrian through the first fully connected layer and the softmax function, and perform border regression with a smoothing function to obtain the position offset of each first region of interest proposal, so as to regress the precise position of the object and complete the training of the first Faster-RCNN model.
[0089] In a preferred embodiment, the second detection module 200 specifically includes:
[0090] The second detection unit 201 is used to perform pedestrian detection on the training image in the training set by using the trained first Faster-RCNN model, and to cover the primary target frame with a mask on the first convolution feature map of the training image to generate a second convolution feature map of the training image;
[0091] The second training unit 202 is used to construct a second Faster-RCNN model including a second RPN layer, a second RoI Pooling layer and a second fully connected layer connected in sequence, input the second convolution feature map of the training image into the second RPN layer, take the undetected blocked pedestrian as the detection target and generate second region of interest proposals through the second RPN layer; and input the second convolution feature map and the second region of interest proposals into the second RoI Pooling layer, output a second RoI feature map of a fixed size through the second RoI Pooling layer, and combine the second convolution feature map and the second RoI feature map, calculate the probability vector of each second region of interest proposal belonging to the pedestrian through the second fully connected layer and the softmax function, and perform border regression with a smoothing function to obtain the position offset of each second region of interest proposal, so as to regress the precise position of the object and complete the training of the second Faster-RCNN model;
[0092] The third detection unit 203 is used to input the second convolution feature map of the target image into the trained second Faster-RCNN model to generate a second pedestrian detection frame for identifying the obscured pedestrian.
[0093] In a preferred embodiment, the screening module 300 is specifically used to arrange the first pedestrian detection frame and the second pedestrian detection frame in order of pedestrian probability from large to small, delete the first detection frame and the second detection frame whose overlap rate with the detection frame with the largest pedestrian probability is greater than 70%, and then delete the first detection frame and the second detection frame whose overlap rate with the detection frame with the second largest pedestrian probability is greater than 70%, and so on. The detection frames left at the end are the detection frames obtained by screening using the non-maximum suppression method.
[0094] An embodiment of the present invention further provides a dense pedestrian detection terminal, comprising a computer-readable storage medium and a processor, wherein the processor implements the steps of the above dense pedestrian detection method when executing a computer program on the computer-readable storage medium. Figure 5 is a schematic diagram of the structure of a dense pedestrian detection terminal provided in Embodiment 3 of the present invention. Figure 5 As shown, the dense pedestrian detection terminal 8 of this embodiment includes: a processor 80, a readable storage medium 81, and a computer program 82 stored in the readable storage medium 81 and executable on the processor 80. When the processor 80 executes the computer program 82, the steps in the above-mentioned various method embodiments are implemented, such as Figure 1 Alternatively, when the processor 80 executes the computer program 82, the functions of each module in the above-mentioned device embodiments are implemented, for example Figure 4 The functions of the modules 100 to 300 are shown.
[0095] Exemplarily, the computer program 82 may be divided into one or more modules, one or more modules are stored in the readable storage medium 81, and are executed by the processor 80 to complete the present invention. One or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 82 in the dense pedestrian detection terminal 8.
[0096] The dense pedestrian detection terminal 8 may include, but is not limited to, a processor 80 and a readable storage medium 81. Those skilled in the art will appreciate that Figure 5 It is only an example of the dense pedestrian detection terminal 8 and does not constitute a limitation of the dense pedestrian detection terminal 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the dense pedestrian detection terminal may also include a power management module, an operation processing module, input and output devices, a network access device, a bus, etc.
[0097] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0098] The readable storage medium 81 may be an internal storage unit of the dense pedestrian detection terminal 8, such as a hard disk or memory of the dense pedestrian detection terminal 8. The readable storage medium 81 may also be an external storage device of the dense pedestrian detection terminal 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the dense pedestrian detection terminal 8. Further, the readable storage medium 81 may also include both an internal storage unit and an external storage device of the dense pedestrian detection terminal 8. The readable storage medium 81 is used to store computer programs and other programs and data required by the dense pedestrian detection terminal. The readable storage medium 81 may also be used to temporarily store data that has been output or is to be output.
[0099] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0100] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0102] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0105] The present invention is not limited to what is described in the specification and implementation modes, and therefore additional advantages and modifications can be easily realized by those skilled in the art. Therefore, without departing from the spirit and scope of the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details, representative devices, and illustrative examples shown and described herein.
Claims
1. A dense pedestrian detection method, It is characterized in that The following steps are involved: S1, using the Faster-RCNN method to perform pedestrian detection on the target image to generate multiple first pedestrian detection frames, and covering the first pedestrian detection frames with scores higher than a preset threshold; S2, using the Faster-RCNN method based on the ROIPooling layer or the RoI Align layer to perform pedestrian detection again on the masked target image, and generate a second pedestrian detection frame for identifying the blocked pedestrian; S3, using a non-maximum suppression method to filter the first pedestrian detection frame and the second pedestrian detection frame, and displaying the filtering result in the target image; The method of using the Faster-RCNN method to perform pedestrian detection on the target image to generate multiple first pedestrian detection frames, and covering the first pedestrian detection frames with scores higher than a preset threshold, comprises the following steps: S101, using the trained first Faster-RCNN model to perform pedestrian detection on the target image, generating multiple first pedestrian detection frames and a score for each first pedestrian detection frame; S102, sorting the first pedestrian detection frames according to scores, and selecting primary target frames having scores greater than a preset threshold from the first pedestrian detection frames; S103, covering the primary target frame with a mask on the first convolution feature map of the target image to generate a second convolution feature map of the target image; the activation value of the white part of the mask corresponding to the first convolution feature map area is set to 0.
2. According to the dense pedestrian detection method of claim 1, It is characterized in that The first Faster-RCNN model includes a first RPN layer, a first RoIPooling layer, and a first fully connected layer connected in sequence, and training the first Faster-RCNN model specifically includes the following steps: S1001, collecting a large number of training images containing pedestrians, and marking the pedestrian parts in the training images with a first box to form a training set containing pedestrians; S1002, constructing a VGG-16 convolutional neural network and inputting the training set, extracting pedestrian features in the training image, and outputting a first convolutional feature map of the training image; S1003, inputting the first convolutional feature map into a first RPN layer, and generating first region of interest proposals through the first RPN layer; S1004, inputting the first convolutional feature map and the first region of interest proposals into the first RoIPooling layer, and outputting a first RoI feature map of a fixed size through the first RoIPooling layer; S1005, combining the first convolutional feature map and the first RoI feature map, calculating the probability vector of each first region of interest proposal belonging to a pedestrian through the first fully connected layer and the softmax function, and performing bounding box regression with a smoothing function to obtain the position offset of each first region of interest proposal to regress the precise position of the object, thereby completing the training of the first Faster-RCNN model.
3. According to the dense pedestrian detection method of claim 2, It is characterized in that The method of using the Faster-RCNN method based on the ROI Pooling layer to perform pedestrian detection again on the covered target image to generate a second pedestrian detection frame for identifying the covered pedestrian specifically includes the following steps: S201, using the first trained Faster-RCNN model to perform pedestrian detection on the training images in the training set, and covering the primary target frame with a mask on the first convolution feature map of the training image to generate a second convolution feature map of the training image; S202, constructing a second Faster-RCNN model including a second RPN layer, a second RoIPooling layer, and a second fully connected layer connected in sequence, inputting a second convolutional feature map of the training image into the second RPN layer, taking undetected occluded pedestrians as detection targets, and generating second region of interest proposals through the second RPN layer; S203, inputting the second convolutional feature map and the second region of interest proposals into a second RoIPooling layer, and outputting a second RoI feature map of a fixed size through the second RoIPooling layer; S204, combining the second convolutional feature map and the second RoI feature map, calculating the probability vector of each second region of interest proposal belonging to the pedestrian through the second fully connected layer and the softmax function, and performing bounding box regression with a smoothing function to obtain the position offset of each second region of interest proposal to regress the precise position of the object, and completing the training of the second Faster-RCNN model; S205: Input the second convolutional feature map of the target image into the trained second Faster-RCNN model to generate a second pedestrian detection frame for identifying the obscured pedestrian.
4. According to the dense pedestrian detection method of claim 3, It is characterized in that The preset threshold for screening the primary target box is set to 0.6; when the second RPN layer is used to generate the second region of interest proposals, 0.7 is used as the positive and negative sample threshold.
5. The dense pedestrian detection method according to any one of claims 1 to 4, It is characterized in that The non-maximum suppression method is used to screen the first pedestrian detection frame and the second pedestrian detection frame specifically as follows: the first pedestrian detection frame and the second pedestrian detection frame are arranged in order of pedestrian probability from large to small, and the first detection frame and the second detection frame whose overlap rate with the detection frame with the largest pedestrian probability is greater than 70% are deleted, and then the first detection frame and the second detection frame whose overlap rate with the detection frame with the second largest pedestrian probability is greater than 70%, and so on. The detection frame that remains at the end is the detection frame screened by the non-maximum suppression method.
6. A computer-readable storage medium, It is characterized in that A computer program is stored, and when the computer program is executed by a processor, the dense pedestrian detection method according to any one of claims 1 to 5 is implemented.
7. A dense pedestrian detection terminal, It is characterized in that The method comprises the computer-readable storage medium and a processor as described in claim 6, wherein when the processor executes the computer program on the computer-readable storage medium, the steps of the dense pedestrian detection method as described in any one of claims 1 to 5 are implemented.
8. A dense pedestrian detection device, It is characterized in that It includes a first detection module, a second detection module and a screening module, The first detection module is used to perform pedestrian detection on the target image using the Faster-RCNN method to generate multiple first pedestrian detection frames, and to cover the first pedestrian detection frames whose scores are higher than a preset threshold; The second detection module is used to perform pedestrian detection again on the covered target image using the Faster-RCNN method based on the ROIPooling layer or the RoI Align layer to generate a second pedestrian detection frame for identifying the covered pedestrian; The screening module is used to screen the first pedestrian detection frame and the second pedestrian detection frame by using a non-maximum suppression method, and display the screening result in a target image; The first detection module specifically includes: A first detection unit, configured to perform pedestrian detection on a target image using a trained first Faster-RCNN model, and generate a plurality of first pedestrian detection frames and a score for each first pedestrian detection frame; a screening unit, configured to sort the first pedestrian detection frames according to their scores, and screen out primary target frames having scores greater than a preset threshold from the first pedestrian detection frames; A masking unit is used to cover the primary target frame with a mask on the first convolution feature map of the target image to generate a second convolution feature map of the target image; the activation value of the white part of the mask corresponding to the first convolution feature map area is set to 0.
Citation Information
Patent Citations
Pedestrian detection method and system based on block occlusion perception
CN108898047A
A deep pedestrian detection method for dense crowds
CN109766796A
Method and system for partial occlusion handling in vehicle tracking using deformable parts model
US20150310624A1
