Multi-level pedestrian detection method, device and storage medium

Through the multi-level pedestrian detection method, combined with the variance filter and pedestrian classifier, the problem of false triggering of pedestrian detection in the existing technology is solved, the detection precision and accuracy are improved, and false reporting is reduced.

CN114863472BActive Publication Date: 2024-09-27SHENZHEN OCEANWING SMART INNOVATIONS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210315117.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2024-09-27
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Existing pedestrian detection technology is prone to false triggers due to complex scenes, resulting in false reports, which reduces detection accuracy.

Method used

A multi-level pedestrian detection method is adopted. The pedestrian detector outputs the initial detection results, the variance filter is used to filter the background false detection frames, and the pedestrian classifier is further filtered to improve detection accuracy.

Benefits of technology

It effectively reduces false triggers, improves the accuracy and precision of pedestrian detection, and reduces the work intensity of patrol personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114863472B
    Figure CN114863472B
Patent Text Reader

Abstract

A multi-stage pedestrian detection method, device and storage medium, the method comprising: obtaining an image to be detected, performing pedestrian detection on the image to be detected by a pedestrian detector, and outputting an initial pedestrian detection result; when the initial pedestrian detection result includes a pedestrian region image in the image to be detected, a variance filter calculates the variance of the pixel values ​​of the pedestrian region image; when the variance is greater than a variance threshold, a pedestrian classifier performs pedestrian classification on the pedestrian region image to obtain a final pedestrian detection result of the image to be detected. The method and device implement pedestrian detection in a multi-module cascade manner. After obtaining the image to be detected, the pedestrian detector is first used to output the initial pedestrian detection result, and then the pedestrian region image initially determined to include a pedestrian target in the initial pedestrian detection result is filtered by a variance filter to filter out background false detection frames, and finally filtered again by a pedestrian classifier, which can improve the accuracy of pedestrian detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of pedestrian detection, and more specifically to a multi-level pedestrian detection method, device and storage medium. Background Art

[0002] Security is the foundation for the steady development of today's society. With the rapid development of artificial intelligence technology, more and more companies are beginning to use artificial intelligence technology to strengthen modern security protection. The most basic artificial intelligence technology in the security field is pedestrian detection. When a pedestrian walks into the monitoring area of ​​the camera, the camera detects the pedestrian through a visual algorithm and triggers the recording function. At the same time, it analyzes the person's behavior. Once there is an intrusion, robbery or other criminal activities, the security technology prevention system can detect and alarm in time, which can greatly reduce the workload of patrol officers on duty. Detection technology is the most basic and important link. Due to the complexity and changeability of real scenes, it is very easy to cause false triggering of pedestrian detection, resulting in a series of erroneous reports. Summary of the invention

[0003] The present application is proposed to solve the above problems. According to one aspect of the present application, a multi-stage pedestrian detection method is provided, the method comprising: obtaining an image to be detected, performing pedestrian detection on the image to be detected by a pedestrian detector, and outputting an initial pedestrian detection result; when the initial pedestrian detection result includes a pedestrian area image in the image to be detected, calculating the variance of the pixel values ​​of the pedestrian area image by a variance filter; when the variance is greater than a variance threshold, performing pedestrian classification on the pedestrian area image by a pedestrian classifier, and obtaining a final pedestrian detection result of the image to be detected.

[0004] In one embodiment of the present application, the pedestrian detector uses a first threshold and a second threshold to perform the pedestrian detection, the first threshold is less than the second threshold, and the initial pedestrian detection result includes outputting a pedestrian detection frame with a score; when the score of the pedestrian detection frame is between the first threshold and the second threshold, the pedestrian detector outputs the coordinates of the pedestrian detection frame to crop out the pedestrian area image and input it into the variance filter.

[0005] In one embodiment of the present application, when the score of the pedestrian detection frame is less than the first threshold, it is determined that the pedestrian detection frame does not include a pedestrian target; when the score of the pedestrian detection frame is greater than the second threshold, it is determined that the pedestrian detection frame includes a pedestrian target, and the coordinates of the pedestrian detection frame are output as the final pedestrian detection result of the image to be detected.

[0006] In one embodiment of the present application, the first threshold is set based on an average false negative rate of the pedestrian detector on a false detection test set.

[0007] In one embodiment of the present application, the second threshold is set based on the recall rate and precision rate of the pedestrian detector on the positive detection test set.

[0008] In one embodiment of the present application, the variance filter calculates the variance of the pixel values ​​of the pedestrian area image, including: converting the pedestrian area image into a target grayscale image; and calculating the variance of the pixel grayscale values ​​of the target grayscale image.

[0009] In one embodiment of the present application, the variance threshold is calculated based on the following process: converting the image to be detected into a grayscale image to be detected; evenly dividing the grayscale image to be detected into a plurality of rectangular image blocks; calculating the grayscale value variance of each image block; sorting all the image blocks in order of grayscale value variance from small to large; taking the mean of the grayscale value variances of the image blocks sorted in the first N positions as the variance threshold, and the value of N is set according to demand.

[0010] In one embodiment of the present application, when the variance of the pixel values ​​of the pedestrian area image is less than or equal to the variance threshold, it is determined that the pedestrian area image does not include a pedestrian target.

[0011] In one embodiment of the present application, the method further includes: before the pedestrian classifier classifies the pedestrian area image as a pedestrian, scaling the pedestrian area image, and maintaining the original aspect ratio of the pedestrian area image after image scaling.

[0012] In one embodiment of the present application, the classification threshold of the pedestrian classifier is set based on the F1 score, and the final pedestrian detection result includes the score of the pedestrian area image. When the score of the pedestrian area image is greater than the classification threshold, it is determined that the pedestrian area image includes a pedestrian target.

[0013] According to another aspect of the present application, a multi-level pedestrian detection device is provided, the device comprising a memory and a processor, the memory storing a computer program executed by the processor, and when the computer program is executed by the processor, the processor executes the above-mentioned multi-level pedestrian detection method.

[0014] According to another aspect of the present application, a storage medium is provided, on which a computer program executed by a processor is stored. When the computer program is executed by the processor, the processor executes the above-mentioned multi-stage pedestrian detection method.

[0015] According to the multi-level pedestrian detection method and device of the embodiment of the present application, pedestrian detection is realized in a multi-module cascade manner. After acquiring the image to be detected, the pedestrian detector is first used to output the initial pedestrian detection result. Then, the pedestrian area image initially determined to include pedestrian targets in the initial pedestrian detection result is filtered through a variance filter to filter out the background false detection frame. Finally, it is filtered again through a pedestrian classifier, which can improve the pedestrian detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0017] Figure 1 A schematic block diagram of an example electronic device for implementing a multi-stage pedestrian detection method and apparatus according to an embodiment of the present invention is shown.

[0018] Figure 2 A schematic flow chart of a multi-stage pedestrian detection method according to an embodiment of the present application is shown.

[0019] Figure 3 A schematic diagram showing pedestrian detection using a dual-threshold pedestrian detector used in a multi-stage pedestrian detection method according to an embodiment of the present application.

[0020] Figure 4 A schematic diagram showing a variance filter used in a multi-stage pedestrian detection method according to an embodiment of the present application to evenly divide an image into blocks.

[0021] Figure 5 A comparison diagram is shown before and after using letterbox (scaling while maintaining the aspect ratio of the original image) in the multi-level pedestrian detection method according to an embodiment of the present application.

[0022] Figure 6 A schematic diagram showing pedestrian classification by a pedestrian classifier used in a multi-stage pedestrian detection method according to an embodiment of the present application.

[0023] Figure 7 A detailed block flow chart of a multi-stage pedestrian detection method according to an embodiment of the present application is shown.

[0024] Figure 8 A schematic block diagram of a multi-stage pedestrian detection device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solutions and advantages of the present application more obvious, the example embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described herein. Based on the embodiments of the present application described in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.

[0026] First, refer to Figure 1 An example electronic device 100 for implementing the multi-stage pedestrian detection, the facial key point detection model training method and the face detection method according to the embodiments of the present invention is described.

[0027] like Figure 1 As shown, the electronic device 100 includes one or more processors 102, one or more storage devices 104, an input device 106, and an output device 108, and these components are interconnected through a bus system 110 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 1 The components and structures of the electronic device 100 shown are merely exemplary and non-limiting. The electronic device may also have other components and structures as required.

[0028] The processor 102 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.

[0029] The storage device 104 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 102 may run the program instructions to implement the client functions (implemented by the processor) and / or other desired functions in the embodiments of the present invention described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.

[0030] The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, etc. In addition, the input device 106 may also be any interface for receiving information.

[0031] The output device 108 can output various information (such as images or sounds) to the outside (such as a user), and can include one or more of a display, a speaker, etc. In addition, the output device 108 can also be any other device with an output function.

[0032] Exemplarily, an example electronic device for implementing the multi-stage pedestrian detection method, the facial key point detection model training method, and the face detection method according to the embodiments of the present invention can be implemented in terminals such as smart phones, tablet computers, etc.

[0033] Next, we will refer to Figure 2 The multi-stage pedestrian detection method 200 according to an embodiment of the present application is described. Figure 2 As shown, the multi-stage pedestrian detection method 200 may include the following steps:

[0034] In step S210, an image to be detected is acquired, and a pedestrian detector performs pedestrian detection on the image to be detected, and outputs an initial pedestrian detection result.

[0035] In step S220, when the initial pedestrian detection result includes a pedestrian region image in the image to be detected, a variance filter is used to calculate the variance of the pixel values ​​of the pedestrian region image.

[0036] In step S230, when the variance is greater than the variance threshold, the pedestrian classifier performs pedestrian classification on the pedestrian region image to obtain a final pedestrian detection result of the image to be detected.

[0037] In an embodiment of the present application, a multi-module cascade method is used to implement pedestrian detection. After acquiring the image to be detected, the pedestrian detector is first used to output the initial pedestrian detection result. In order to improve the detection accuracy, the pedestrian area image that is initially determined to include pedestrian targets in the initial pedestrian detection result can be filtered by a variance filter. Since the texture of the background area is single, the variance is reduced. Therefore, the background false detection frame can be filtered out by the variance filter. Finally, it is filtered again by the pedestrian classifier to further improve the pedestrian detection accuracy.

[0038] In one embodiment of the present application, the pedestrian detector used in step S210 may be a single-threshold pedestrian detector. In this embodiment, pedestrian detection frames with confidence scores greater than the threshold are screened out, and the corresponding pedestrian image regions are cropped and input into the variance filter, and the variance filter filters out the background false detection frames that may contain no pedestrians (pedestrian detection frames with confidence scores less than or equal to the threshold are directly identified as not including pedestrian targets). In this embodiment, the threshold is relatively not set too high, because if the threshold is set too high, the possibility of missed detection will be greater, and the possibility of false detection will be smaller. The subsequent variance filter mainly deals with the false detection problem, so the threshold is set relatively low.

[0039] In another embodiment of the present application, the pedestrian detector used in step S210 may be a dual-threshold pedestrian detector. In this embodiment, the pedestrian detector uses a first threshold value V1 and a second threshold value V2 to perform pedestrian detection, the first threshold value V1 is less than the second threshold value V2, and the initial pedestrian detection result includes outputting a pedestrian detection frame with a score. When the score of the pedestrian detection frame is between the first threshold value V1 and the second threshold value V2, the pedestrian detector outputs the coordinates of the pedestrian detection frame to crop the pedestrian area image and input it into the variance filter. When the score of the pedestrian detection frame is less than the first threshold value V1, it is determined that the pedestrian detection frame does not include pedestrian targets; when the score of the pedestrian detection frame is greater than the second threshold value V2, it is determined that the pedestrian detection frame includes pedestrian targets, and the coordinates of the pedestrian detection frame are output as the final pedestrian detection result of the image to be detected. The following is combined with Figure 3 to describe.

[0040] Figure 3 FIG. 1 is a schematic diagram showing a dual-threshold pedestrian detector used in a multi-stage pedestrian detection method according to an embodiment of the present application for pedestrian detection. Figure 3 As shown, the image to be detected can be resized to match the size of the pedestrian detector input. Figure 3 In the example shown, the size of the image to be detected is adjusted to 416×416 and then input into the pedestrian detection model (i.e., pedestrian detector); since it is a dual-threshold pedestrian detector, the thresholds include V1 and V2, where 0 is less than V1, V1 is less than V2, and V2 is less than 1; therefore, the detection frame with a score between 0 and V1 is considered to be the background, the detection frame with a score between V2 and 1 is considered to be a pedestrian, and the detection frame with a score between V1 and V2 is considered to be to be judged. For these detection frames, the pedestrian detector will output their corresponding area coordinates, such as Figure 3 The coordinates (x1, y1, x2, y2) shown in the figure, the corresponding pedestrian area image will be cropped out and input into the variance filter for further judgment.

[0041] In an embodiment of the present application, the above-mentioned first threshold V1 can be set based on the average false positive reduction rate (False Positive Per Image, FPPI) of the pedestrian detector on the false detection test set (for each image). There are no human-shaped targets in each image of the false detection test set. Therefore, each target detected by the detection model (i.e., the pedestrian detector) under this false detection test set is a false detection target, and the scores of all false detection targets are saved. The scores of most false detection targets are relatively low, generally below 0.5. Therefore, V1 can be adjusted downward starting from 0.5. By adjusting different V1 values, different FPPI values can be obtained, and the calculation is as follows:

[0042]

[0043] In the above formula, FP is the number of false detection targets, and N represents the number of samples in the false detection test set. Generally, FP <<< N. Therefore, FPPI is much less than 1, and there will be no situation where it is greater than 1. From the calculation formula of FPPI, the lower the value of V1, the greater FP, the greater FPPI, and the worse the false detection performance. By continuously reducing the value of V1 until the maximum acceptable value of FPPI is reached.

[0044] In an embodiment of the present application, the above-mentioned second threshold V2 can be set based on the recall rate and precision rate of the pedestrian detector on the positive detection test set. There are human-shaped targets in each image of the positive detection test set. By combining the ground truth (abbreviated as GT), the precision and recall of the detection model (i.e., the pedestrian detector) on the test set can be calculated as follows:

[0045]

[0046] In the above formula, TP (true positive) indicates the number of boxes predicted by the model and correct, which is the number of positive detections; FP (false positive) indicates the number of boxes predicted by the model but wrongly predicted, which is the number of false detections; FN (false negative) indicates the number of real targets that are not predicted by the model (i.e., there are targets in the image but they are mistaken for background), which is the number of missed detections. The sum of TP and FN is equal to GT, which is the number of manually labeled boxes. Save the scores of all detected human targets. In general, the scores of human targets are relatively high, usually above 0.5, so V2 can be adjusted from 0.5 upwards. By adjusting different V2, different Precision and Recall values ​​can be obtained. According to the calculation formula of Precision, the higher the V2 value, the smaller the FP, the larger the Precision, and the fewer false detection boxes. By continuously increasing the V2 value until Precision is close to 1, there is basically no false detection of detection boxes greater than V2.

[0047] In an embodiment of the present application, the variance filter in step S220 calculates the variance of the pixel values ​​of the pedestrian area image, which may include: converting the pedestrian area image into a target grayscale image; calculating the variance of the pixel grayscale values ​​of the target grayscale image. Variance is generally used to describe the degree of fluctuation of a signal. The larger the variance, the greater the fluctuation of the signal. For the background area in the image, its texture is relatively simple, so the variance is small. The texture of the area where the pedestrians are located is relatively rich, so the variance value is relatively large. Since the variance calculation is simple and has little effect on the time consumption, a part of the background false detection frame can be quickly filtered out by judging the variance value. In an embodiment of the present application, the area where the detection frame with a score (score) between [V1, V2] in the pedestrian detector is located can be intercepted, and the image block can be converted from a color to a single-channel grayscale image to calculate the variance of the pixel grayscale value of the grayscale image.

[0048] In addition, in an embodiment of the present application, the variance threshold can be calculated based on the current image to be detected. Since the pedestrian area image is captured from the image to be detected, the variance threshold is calculated based on the image to be detected, and compared with the pixel value variance of the pedestrian area image obtained in step S210, so that it can be more targeted to determine whether the pedestrian area image is a background or a pedestrian. Specifically, the variance threshold is calculated based on the following process: converting the image to be detected into a grayscale image to be detected; evenly dividing the grayscale image to be detected into multiple rectangular image blocks; calculating the grayscale value variance of each image block; sorting all image blocks in order of grayscale value variance from small to large; taking the mean of the grayscale value variances of the image blocks ranked in the first N positions as the variance threshold, and the value of N is set according to demand. Refer to the following Figure 4This is described with a specific example.

[0049] Figure 4 A schematic diagram showing a variance filter used in a multi-stage pedestrian detection method according to an embodiment of the present application to evenly divide an image into blocks. Figure 4 The example shown is a home scene example. In the monitoring area based on the home scene, there are generally not too many pedestrian targets. The variance value of the background area can be obtained by comparison. Figure 4 As shown, first, the image to be detected is converted into a grayscale image, and then it is evenly divided into 9 rectangular image blocks. Then, the variance of each image block is calculated. The variance value of each image block can reflect the pixel uniformity of the image block. The variance value of the image block is to calculate its grayscale value variance. The grayscale value variance of a certain image block Pi is:

[0050] D(P i )=E(P i 2 )-E 2 (P i )

[0051] In the above formula, E(P i ) is the image block P i The grayscale mean, E(p i 2 ) represents the image block P i The mean of the grayscale value after square. After that, sort the variances of the 9 image blocks from small to large; take the mean of the smallest 3 image blocks (or other numbers of image blocks, such as 2, 4, etc.) as the threshold D of the variance filter p , expressed as:

[0052]

[0053] After calculating the above variance threshold, calculate the variance value D of the target grayscale image of the target area, that is, the pedestrian image area mentioned above. If D is less than or equal to D p , the area is considered to be the background area, excluding pedestrian targets, and is excluded.

[0054] In an embodiment of the present application, method 200 may further include (not shown in Figure 2 As shown in FIG. 1 ): Before the pedestrian classifier classifies the pedestrian region image, the pedestrian region image is scaled, and the original aspect ratio of the pedestrian region image is maintained after the image is scaled, that is, a letterbox operation is performed on the pedestrian region image. Figure 5 to describe.

[0055] Figure 5The figure shows the comparison before and after using the letterbox in the multi-level pedestrian detection method according to the embodiment of the present application. In the target detection task of deep learning, it is usually necessary to crop the objects detected by the detection box, scale them to the same size, and send them to the classifier for secondary judgment. If the target area is directly cut and resized to a certain size, the aspect ratio of the target in the image will be destroyed, thereby destroying the original scale characteristics of the target, such as Figure 5 When letterbox is used to resize an image, the image is resized while maintaining the aspect ratio, thus preserving the original features of the image. Figure 5 As shown in the figure on the right.

[0056] In an embodiment of the present application, the process of resizing the pedestrian area image using letterbox may include the following steps: scaling the pedestrian area image according to the aspect ratio, with the longer side being exactly equal to the target size length (required by the pedestrian classifier), and the other side that is less than or equal to the target size being scaled proportionally; copying the scaled data to the center of the canvas of the target size; filling the blank part with gray, i.e. (128, 128, 128), so that the image size meets the input requirements.

[0057] In the embodiment of the present application, the classification threshold of the pedestrian classifier in step S230 is set based on the F1 score, and the final pedestrian detection result includes the score of the pedestrian area image. When the score of the pedestrian area image is greater than the classification threshold, it is determined that the pedestrian area image includes a pedestrian target. Figure 6 to describe.

[0058] Figure 6 A schematic diagram showing a pedestrian classification performed by a pedestrian classifier used in a multi-stage pedestrian detection method according to an embodiment of the present application. Figure 6 In the example shown, the pedestrian classification module (i.e., pedestrian classifier) ​​can use a convolutional neural network classification model. In the training stage, the training data of the classification model used can all be processed using letterbox to prevent distortion of human features. In the testing stage, the input image can also be resized to 128x128 using the letterbox method, and then convolved through the classification network, and finally the output score socre is used to determine whether the image block contains a human target. Assuming that the classification threshold, i.e., the human confidence, is Vc, if score>Vc, it is considered to be a pedestrian target, where the setting of Vc can be determined by the F1-score method.

[0059] F1 score is a measure of classification problems. It is the harmonic mean of precision and recall, and its value is between 0 and 1. Generally speaking, if you want to get a high recall rate, you will reduce the accuracy rate. Therefore, we usually do not directly use accuracy and recall rate to evaluate the algorithm, but use F1 scores to judge the labeling. The calculation formula of F1 score is as follows:

[0060]

[0061] As can be seen from the above formula, when F1 is the highest, both Precision and recall are at their maximum. The threshold of the classifier can be determined based on the idea of ​​F1-score.

[0062] Assume that the number of positive samples correctly classified by the classifier is TP, the number of negative samples classified as positive samples is FP, and the number of positive samples classified as negative samples is FN. According to the calculation method of Precision and Recall, the final calculation formula of F1-score becomes:

[0063]

[0064] Through the above formula, different recall and precision rates can be obtained by setting different thresholds for the classification model. Then, through the F1 formula, the threshold Vc of the classification model corresponding to the highest F1 is found, and the threshold is used as the basis for the classification model to judge positive and negative samples. When the classification score is greater than Vc, the sample is considered to be a positive human sample, otherwise it is considered to be a false negative sample. Due to the different distributions of different data sets, the specific threshold setting method is modified according to the usage requirements of the business scenario.

[0065] Based on the above description, the multi-stage pedestrian detection method according to the embodiment of the present application uses a multi-module cascade method to realize pedestrian detection. After obtaining the image to be detected, the pedestrian detector is first used to output the initial pedestrian detection result, and then the pedestrian area image that is initially determined to include pedestrian targets in the initial pedestrian detection result is filtered by a variance filter to filter out the background false detection frame, and finally filtered again by a pedestrian classifier, which can improve the pedestrian detection accuracy. Generally, the detection rate and the false detection rate are two contradictory indicators. The improvement of one indicator generally leads to the reduction of the other indicator. Through the cascade detection method of the method of the present application, the detection accuracy of the detection model can be improved while ensuring that the detection rate is not affected. In addition, the multi-stage pedestrian detection method according to the embodiment of the present application can filter the setting of the pedestrian detector through a dual threshold. In simple scenarios, the subsequent judgment of the post-variance filter is not required, thereby ensuring the real-time nature of the detection. In addition, through the variance filter, the interfering background area can be quickly excluded without affecting the time consumption. Furthermore, the multi-level pedestrian detection method according to the embodiment of the present application can adjust the size of the image through letterbox, which greatly ensures the invariance of the image features after the size change, and further improves the accuracy of the pedestrian classifier. Figure 7 To understand the detailed process of the multi-stage pedestrian detection method according to the embodiments of the present application, they are a combination of several embodiments described above and will not be repeated here.

[0066] The above exemplary describes the multi-stage pedestrian detection method provided according to one aspect of the present application. Figure 8 A multi-stage pedestrian detection device is described according to another aspect of the present application. Figure 8 FIG. 8 is a schematic block diagram of a multi-stage pedestrian detection device 800 according to an embodiment of the present application. Figure 8 As shown, the multi-stage pedestrian detection device 800 according to the embodiment of the present application may include a memory 810 and a processor 820, and the memory 810 stores a computer program executed by the processor 820. When the computer program is executed by the processor 820, the processor 820 executes the multi-stage pedestrian detection method according to the embodiment of the present application described above. Those skilled in the art can understand the specific operation of the multi-stage pedestrian detection device 800 according to the embodiment of the present application in combination with the above content, and for the sake of brevity, the specific details are not repeated here.

[0067] In addition, according to an embodiment of the present application, a storage medium is also provided, on which program instructions are stored, and when the program instructions are executed by a computer or a processor, the corresponding steps of the multi-level pedestrian detection method of the embodiment of the present application are executed. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.

[0068] Based on the above description, the multi-stage pedestrian detection method and device according to the embodiment of the present application adopts a multi-module cascade method to realize pedestrian detection. After obtaining the image to be detected, the pedestrian detector is first used to output the initial pedestrian detection result, and then the pedestrian area image that is initially determined to include pedestrian targets in the initial pedestrian detection result is filtered by a variance filter to filter out the background false detection frame, and finally filtered again by a pedestrian classifier, which can improve the pedestrian detection accuracy. Generally, the detection rate and the false detection rate are two contradictory indicators. The improvement of one indicator generally leads to the reduction of the other indicator. Through the cascade detection method of the present application, the detection accuracy of the detection model can be improved while ensuring that the detection rate is not affected. In addition, the multi-stage pedestrian detection method and device according to the embodiment of the present application can filter the setting of the pedestrian detector through a dual threshold. In simple scenarios, the subsequent judgment of the variance filter is not required, thereby ensuring the real-time nature of the detection. In addition, through the variance filter, the interfering background area can be quickly excluded without affecting the time consumption. Furthermore, according to the multi-level pedestrian detection method and device of the embodiment of the present application, the size of the image can be adjusted through letterbox, which greatly ensures the invariance of the image features after the size changes, and further improves the accuracy of the pedestrian classifier.

[0069] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present application to this. A person of ordinary skill in the art may make various changes and modifications therein without departing from the scope and spirit of the present application. All these changes and modifications are intended to be included within the scope of the present application as required by the appended claims.

[0070] Those of ordinary skill in the art will appreciate that the units and algorithm 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 this application.

[0071] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the 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 device, or some features can be ignored or not executed.

[0072] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0073] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present application should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with features less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0074] It will be understood by those skilled in the art that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0075] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0076] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some modules according to the embodiments of the present application. The application can also be implemented as a device program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0077] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

[0078] The above is only a specific implementation or description of a specific implementation of the present application, and the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A multi-stage pedestrian detection method, characterized in that: The method comprises: Acquire an image to be detected, perform pedestrian detection on the image to be detected by a pedestrian detector, and output an initial pedestrian detection result; When the initial pedestrian detection result includes a pedestrian region image in the image to be detected, a variance filter is used to calculate the variance of pixel values ​​of the pedestrian region image; When the variance is greater than the variance threshold, a pedestrian classifier performs pedestrian classification on the pedestrian area image to obtain a final pedestrian detection result of the image to be detected; The pedestrian detector uses a first threshold and a second threshold to perform the pedestrian detection, the first threshold is less than the second threshold, and the initial pedestrian detection result includes outputting a pedestrian detection frame with a score; When the score of the pedestrian detection frame is less than the first threshold, it is determined that the pedestrian detection frame does not include a pedestrian target; when the score of the pedestrian detection frame is greater than the second threshold, it is determined that the pedestrian detection frame includes a pedestrian target; When the score of the pedestrian detection frame is between the first threshold and the second threshold, the pedestrian detector outputs the coordinates of the pedestrian detection frame to crop the pedestrian area image and input it into the variance filter.

2. The method according to claim 1, characterized in that When the score of the pedestrian detection frame is greater than the second threshold, the coordinates of the pedestrian detection frame are output as the final pedestrian detection result of the image to be detected.

3. The method according to claim 1, characterized in that The first threshold is set based on an average false negative rate of the pedestrian detector on a false detection test set; The second threshold is set based on the recall rate and precision rate of the pedestrian detector on the positive detection test set.

4. The method according to any one of claims 1 to 3, characterized in that: The variance filter calculates the variance of the pixel values ​​of the pedestrian area image, including: Converting the pedestrian area image into a target grayscale image; Calculate the variance of the pixel grayscale values ​​of the target grayscale image.

5. The method according to claim 4, characterized in that The variance threshold is calculated based on the following process: Converting the image to be detected into a grayscale image to be detected; Evenly dividing the grayscale image to be detected into a plurality of rectangular image blocks; Calculating the grayscale value variance of each of the image blocks; Sorting all the image blocks in ascending order of gray value variance; The mean value of the grayscale value variance of the image blocks ranked in the first N positions is used as the variance threshold, and the value of N is set according to requirements.

6. The method according to claim 1 or 5, characterized in that: When the variance of the pixel values ​​of the pedestrian area image is less than or equal to the variance threshold, it is determined that the pedestrian area image does not include a pedestrian target.

7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Before the pedestrian classifier performs pedestrian classification on the pedestrian region image, the pedestrian region image is scaled, and the original aspect ratio of the pedestrian region image is maintained after the image scaling.

8. The method according to any one of claims 1 to 3, characterized in that: The classification threshold of the pedestrian classifier is set based on the F1 score, and the final pedestrian detection result includes the score of the pedestrian area image. When the score of the pedestrian area image is greater than the classification threshold, it is determined that the pedestrian area image includes a pedestrian target.

9. A multi-stage pedestrian detection device, characterized in that: The device includes a memory and a processor, wherein the memory stores a computer program executed by the processor, and when the computer program is executed by the processor, the processor executes the multi-stage pedestrian detection method according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium stores a computer program executed by a processor, and when the computer program is executed by the processor, the processor executes the multi-stage pedestrian detection method according to any one of claims 1 to 8.