Intelligent traffic target detection method and device, electronic equipment and storage medium
By using the gradient threshold and adaptive threshold methods to filter the target detection results in intelligent transportation target detection, and combining the actual scene characteristics with the screening, the problem of low target detection accuracy in the existing technology is solved, and higher detection accuracy is achieved. accuracy.
Patent Information
- Application Number
- CN202310244274.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-06
AI Technical Summary
Among existing intelligent transportation target detection methods, threshold screening uses a fixed threshold method without targeted adjustments based on actual scenarios, resulting in low target detection accuracy.
The method of gradient threshold and adaptive threshold is used to filter the target detection results. The gradient threshold is obtained by secondary fitting of the confidence threshold, and adaptive adjustment is performed based on the height and area of the target object for secondary screening.
It effectively improves the accuracy of intelligent transportation target detection, eliminates false detection results, and improves detection accuracy.
Smart Images

Figure CN118609037A
Abstract
Description
Technical Field
[0001] The present application relates to the field of target detection technology. Specifically, the present application relates to an intelligent traffic target detection method, device, electronic device and storage medium. Background Art
[0002] In recent years, with the rapid development of my country's economy, a large amount of funds have been invested in the construction of transportation infrastructure. The development speed has been accelerating and the scale has been expanding. As a result, traffic safety accidents have gradually increased. Congestion, traffic accidents caused by vehicle damage, and even accidents caused by pedestrians intruding are common.
[0003] In order to reduce the incidence of traffic accidents, it is necessary to detect traffic scenes in real time to determine whether there are any abnormalities in the traffic scenes. The existing anomaly detection methods in the field of intelligent transportation can be roughly divided into traditional computer vision methods and artificial intelligence deep learning methods. The latter are becoming more and more common in practical applications due to their stronger feature extraction capabilities and relatively better generalization. In general, supervised artificial intelligence learning methods can be divided into two parts: detectors and prior algorithms. The detector provides target detection results. Since the detector results cannot be guaranteed to be completely accurate, they need to be screened by thresholds and then input into the prior algorithm for comprehensive analysis.
[0004] However, in the prior art, a fixed threshold method is usually adopted when performing threshold screening, and no targeted adjustment is made in combination with the actual scenario, which makes the screening result unreasonable and leads to low target detection accuracy.
[0005] It can be seen that the existing technology still has the defect of low accuracy of intelligent traffic target detection. Summary of the invention
[0006] The embodiments of the present application provide a method, device, electronic device and storage medium for intelligent traffic target detection, which can solve the problem of low target detection accuracy in intelligent traffic scenarios in related technologies. The technical solution is as follows:
[0007] According to one aspect of an embodiment of the present application, a method for intelligent traffic target detection includes: acquiring an image to be detected, preprocessing the image to be detected to obtain a preprocessed image; the image to be detected is a traffic scene image containing a target object; performing target detection on the preprocessed image to obtain a target detection result; the target detection result includes the position height of the detection area containing the target object in the preprocessed image and its confidence score; using a quadratic function to fit the confidence threshold in the preprocessed image to obtain a gradient threshold, and using the gradient threshold to filter the target detection result to obtain a filtering result.
[0008] According to one aspect of an embodiment of the present application, an intelligent traffic target detection device includes: an image acquisition device, which is used to acquire an image to be detected, and preprocess the image to be detected to obtain a preprocessed image; the image to be detected is a traffic scene image containing a target object; a target detection module is used to perform target detection on the preprocessed image to obtain a target detection result; the target detection result includes a detection area containing the target object in the preprocessed image and its confidence score; a screening module is used to perform gradient threshold screening on the target detection result to obtain a screening result;
[0009] In an exemplary embodiment, the device further includes: a result output module, which is used to perform adaptive threshold screening on the screening results to obtain output results.
[0010] According to one aspect of an embodiment of the present application, an electronic device includes: at least one processor, at least one memory, and at least one communication bus, wherein a computer program is stored in the memory, and the processor reads the computer program in the memory through the communication bus; when the computer program is executed by the processor, the intelligent traffic target detection method as described above is implemented.
[0011] According to one aspect of an embodiment of the present application, a storage medium stores a computer program thereon, and when the computer program is executed by a processor, the intelligent traffic target detection method as described above is implemented.
[0012] According to one aspect of an embodiment of the present application, a computer program product includes a computer program, the computer program is stored in a storage medium, a processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, so that the computer device implements the intelligent traffic target detection method as described above when executing.
[0013] The beneficial effects of the technical solution provided by this application are:
[0014] In the above technical scheme, the acquired image to be detected is preprocessed to obtain a preprocessed image. After target detection is performed on the preprocessed image to obtain the target detection result, the target detection result is screened once using a gradient threshold to eliminate the possibility of false detection, and the area of all similar target areas at the same height position is combined to comprehensively calculate the adaptive threshold for secondary screening, thereby effectively improving the accuracy of intelligent traffic target detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0016] Figure 1is a flow chart of an intelligent traffic target detection method according to an exemplary embodiment;
[0017] Figure 2 is a flowchart of a YOLOv5 network training process according to an exemplary embodiment;
[0018] Figure 3 According to an exemplary embodiment, Figure 1 Flowchart of step 350;
[0019] Figure 4 is a flow chart of another intelligent traffic target detection method according to an exemplary embodiment;
[0020] Figure 5 According to an exemplary embodiment, Figure 4 Flowchart of step 370;
[0021] Figure 6 is a structural block diagram of an intelligent traffic target detection device according to an exemplary embodiment;
[0022] Figure 7 is a hardware structure diagram of an electronic device according to an exemplary embodiment;
[0023] Figure 8 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0024] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0025] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0026] As mentioned earlier, in order to reduce the incidence of traffic accidents, real-time detection of traffic scenes is required. When the current supervised artificial intelligence learning method provides target detection results through the detector, it cannot guarantee that the detector results are completely accurate. Therefore, it is necessary to go through threshold screening and then input the detection results into the prior algorithm for comprehensive analysis.
[0027] However, in the prior art, a fixed threshold method is usually adopted when performing threshold screening, and no targeted adjustment is made in combination with the actual scenario, which makes the screening result unreasonable and leads to low target detection accuracy.
[0028] It can be seen that the relevant technology still has the problem of low accuracy of intelligent traffic target detection.
[0029] To this end, the intelligent traffic target detection method provided by the present application combines the characteristics of the data in the target detection image that the near data is large and the far data is small, and screens the target detection results output by the target detector by setting the gradient threshold + adaptive threshold method, thereby effectively improving the accuracy of intelligent traffic target detection. Accordingly, the intelligent traffic target detection method is suitable for an intelligent traffic target detection device, which can be deployed in an electronic device, for example, the electronic device can be a smart camera, and the electronic device can also be a computer device that deploys the von Neumann architecture, for example, the computer device can be a desktop computer, a laptop computer, a server, etc.
[0030] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0031] See also Figure 1 An embodiment of the present application provides an intelligent traffic target detection method, which is applicable to an electronic device, which may be a smart camera or other electronic device with image acquisition function.
[0032] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this is not intended to be limiting.
[0033] like Figure 1 As shown, the method may include the following steps:
[0034] Step 310: Acquire the image to be detected, and preprocess the image to be detected to obtain a preprocessed image.
[0035] The image to be detected is a traffic scene image containing a target object, and the target object may include one or more of pedestrians and vehicles.
[0036] The embodiments of the present application can be applied to electronic devices, which can be smart cameras or other electronic devices with image acquisition functions. By using the electronic device to shoot a set area, an image to be detected can be obtained. For example, the electronic device is a road monitoring camera, and the road monitoring camera shoots a road surface area to obtain an image to be detected.
[0037] The image to be detected can be a photo collected independently by the electronic device, offline picture data, or one of multiple video frames in a video continuously collected by the electronic device, or one of multiple video frames in a local video or online video stream. In other words, the image to be detected obtained by the embodiment of the present application can come from a photo or a video, which is not limited here.
[0038] In a possible implementation, after acquiring the image to be detected, the present application preprocesses the image to be detected to obtain a preprocessed image.
[0039] Optionally, the preprocessing of the image to be detected includes an image pyramid operation. Different from the feature pyramid that performs multi-scale fusion on the image inside the network, the image pyramid can perform multi-scale fusion on the image at the input end, forcibly amplify the relatively small-scale target in the input image, make the target feature more obvious, and thus obtain more obvious features of the target object in the image to be detected.
[0040] Optionally, the preprocessing of the image to be detected includes background modeling operations. In combination with actual road scenes, as long as pedestrians appear, it can be considered as an abnormality, and when congestion or traffic accidents cause the vehicle to stop, it is considered that the vehicle is abnormal. Based on this prior knowledge, the average background algorithm is used to calculate the average value of the corresponding pixels of multiple background images, and the corresponding pixels of the image to be detected are compared with the average pixel points. If it exceeds a certain threshold, it is considered to be a foreground pixel point, and if it is between a certain threshold, it is considered to be a background point, thereby eliminating the interference caused by the background in the image to be detected.
[0041] Step 330: Perform target detection on the preprocessed image to obtain a target detection result.
[0042] In a possible implementation, the target detection on the preprocessed image is implemented based on a target detection model. The target detection model is a deep learning model that has been trained to detect the preprocessed image containing the target object and output the detection area of the target object and its confidence score. The deep learning model can be an SSD network (SingleShot MultiBox Detector, single-stage target detection algorithm), an R-CNN network, a Fast R-CNN network, a Faster R-CNN network, and a YOLO series network.
[0043] In an exemplary embodiment, the YOLOv5 network is used as an example for explanation, but this is not intended to be limiting. Figure 2 As shown, the training process of the YOLOv5 network includes the following steps:
[0044] Step 410, obtaining a number of real images containing the target object from the data set, and dividing the real images into a training set and a test set according to a certain ratio.
[0045] Step 430, performing data enhancement on the acquired multiple real images containing the target object; wherein the data enhancement includes one or more of mosaic enhancement, affine transformation, color transformation and random noise.
[0046] Step 450, using the real image after data enhancement to train the YOLOv5 network model, to obtain a target detection model that performs target detection on the preprocessed image containing the target object and outputs the detection area of the target object and its confidence score.
[0047] Among them, the YOLOv5 network consists of four parts: input end, Backbone layer, Neck layer and Prediction layer, using the standard YOLOv5 structure.
[0048] Among them, the Backbone layer uses FOCUS+CSP Darknet+SiLU activation function; the Neck layer uses CSPBlock, SPP, FPN+PAN structure; the Prediction layer uses CIOU_Loss combined with DIOU_NMS operation.
[0049] The loss function of YOLOv5 mainly consists of three parts:
[0050] Classes loss: Classification loss, using BCE loss, only calculates the classification loss of positive samples.
[0051] Objectness loss: obj loss, still using BCE loss, obj refers to the CIoU between the target bounding box predicted by the network and the GT Box, and the obj loss of all samples is calculated.
[0052] Location loss, positioning loss, uses CIoU loss, which only calculates the positioning loss of positive samples.
[0053] Loss=λ1Lcls+λ2Lobj+λ3Lloc.
[0054] Among them, λ1, λ2, λ3 are balance coefficients.
[0055] Through the above process, the target detection model based on YOLOv5 is used to detect possible abnormalities in the preprocessed image, and the areas where abnormalities may exist in the preprocessed image and the confidence scores of the abnormality types are output as the target detection results to complete the preliminary detection of the preprocessed image.
[0056] Step 350, using a quadratic function to fit the confidence threshold in the preprocessed image to obtain a gradient threshold, and using the gradient threshold to filter the target detection result to obtain a filtering result.
[0057] In an exemplary embodiment, in order to eliminate false detection results in the target detection model, the present application proposes a screening method.
[0058] like Figure 3 As shown, the method may include the following steps:
[0059] Step 351, calculate the height gradient threshold t1 of the current position according to the position height of the target object indicated by the target detection result in the preprocessed image.
[0060] Specifically, considering the overall characteristics of the data modality in the road scene, which is large near and small far away, that is, at the top of the image, the target is smaller at a distance from the electronic device, while at the bottom of the image, the target is larger at a distance from the electronic device. Therefore, in the detection algorithm, the confidence score of large targets is significantly higher than that of small targets. Based on this prior knowledge, this application uses a gradient threshold instead of a fixed threshold when setting the device threshold. The threshold is set as follows:
[0061] t1=2*conf_thres*y / h-conf_thres*y^2 / h^2+0.05
[0062] Among them, y is the distance between the detection area of the target object and the upper limit of the preprocessed image, h is the height of the preprocessed image, and conf_thres is the threshold, which defaults to 0.4.
[0063] Based on this, the gradient threshold t1 at the distance y between the detection area of different target objects in the preprocessed image and the upper boundary of the preprocessed image is determined, so as to screen the target detection results.
[0064] Step 353: If the confidence score of the target object is greater than the height gradient threshold t1 of the current location, the screening result indicates that the current target detection result is retained.
[0065] Step 355: If the confidence score of the target object is less than the height gradient threshold t1 of the current location, the screening result indicates that the current target detection result is deleted.
[0066] Through the above process, the data modality in the road scene is generally large near and small far away. The confidence threshold at different heights y in the preprocessed image is calculated by gradient calculation to obtain the gradient threshold. The target detection results obtained by the detector are preliminarily screened using the gradient threshold to eliminate the possibility of false detection and preliminarily improve the accuracy of intelligent traffic target detection.
[0067] In an exemplary embodiment, if Figure 4 As shown, after step 350, the above method may further include the following steps:
[0068] Step 370, obtain an adaptive threshold value by comprehensive calculation according to the area size of the target object, and perform secondary screening on the screening result using the adaptive threshold value to obtain an output result.
[0069] The inventors realize that for several target objects of the same category, their area sizes at the distance y between the same detection area and the upper boundary of the preprocessed image may be different, but the corresponding gradient thresholds are the same, which will lead to an unreasonable screening process.
[0070] Alternatively, if Figure 5 As shown, the above steps include the following steps:
[0071] Step 371, based on the position height of the target object indicated by the target detection result in the preprocessed image, calculate the average area of all target object detection regions of the same category at the current position height.
[0072] In a possible implementation, for the distance y between the detection region of the same target object and the upper boundary of the preprocessed image, there may be several target object detection regions of the same category, and the average area s of the several target object detection regions is calculated.
[0073] Step 373: The average area of the target area at the current location obtained by experimental statistics is used as a priori area threshold.
[0074] Step 375: Adaptively adjust the height gradient threshold of the current location according to the average area and the prior area threshold to obtain the current location height adaptive threshold t1'
[0075] t1'=k(s-t2)+t1
[0076] Among them, k is the weight parameter corresponding to the current scene obtained by the experiment, s is the average area of all detection areas of the same category of target objects at the current location height, and t2 is the prior area threshold of the current location height.
[0077] Based on this, combined with the detection area of the target object, the gradient threshold t1' at the distance y between the detection area of the target object of the same category in the preprocessed image and the upper boundary of the preprocessed image is adaptively adjusted, so as to perform secondary screening on the screening results.
[0078] Step 377, according to the confidence score of the target object being greater than the current position height adaptive threshold t1', retain the current screening result as the output result;
[0079] Step 379: according to the confidence score of the target object being less than the current position height adaptive threshold t1', the current screening result is deleted as the output result.
[0080] Through the above process, the gradient threshold is weightedly adjusted for the results after preliminary screening, combined with the detection area area of all similar target objects under the distance y between the same detection area and the upper limit of the preprocessed image, to obtain the adaptive threshold t1'. The results after preliminary screening are secondary screened through t1' to further improve the accuracy of traffic scene target detection.
[0081] Table 1 Object detection accuracy under different thresholds
[0082] Way FPS mAP (mean average precision) Fixed threshold 0.5 32 45.13 Fixed threshold 0.1 32 51.33 Gradient Threshold 32 54.51 Gradient threshold + adaptive threshold 31 55.15
[0083] As shown in Table 1, this application provides the target detection accuracy under different thresholds as a comparison result. It can be seen that the effect of the fixed threshold of 0.1 is better than that of the fixed threshold of 0.5, indicating that there are fewer false detections in the target detection model, but there is still a certain degree of missed detection. Using the gradient threshold and the gradient threshold + adaptive threshold method to replace the fixed threshold in the existing method effectively improves the target detection accuracy.
[0084] The following is an embodiment of the device of the present application, which can be used to execute the intelligent traffic target detection method involved in the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the method embodiment of the intelligent traffic target detection method involved in the present application.
[0085] See also Figure 6 , an embodiment of the present application provides an intelligent traffic target detection device 500 , including but not limited to: an image acquisition module 510 , a target detection module 520 , and a screening module 530 .
[0086] The image acquisition module 510 is used to acquire the image to be detected and preprocess the image to be detected to obtain a preprocessed image; the image to be detected is a traffic scene image containing a target object.
[0087] The target detection module 520 is used to perform target detection on the preprocessed image to obtain a target detection result; the target detection result includes a detection area containing the target object in the preprocessed image and its confidence score.
[0088] The screening module 530 is used to perform gradient threshold screening on the target detection result to obtain a screening result.
[0089] In an exemplary embodiment, the intelligent traffic target detection device 500 further includes: a result output module, which is used to perform adaptive threshold screening on the screening results to obtain output results.
[0090] It is worth mentioning that the device embodiment provided in this application is only an exemplary embodiment. The intelligent traffic target detection method provided in this application can be installed on various platforms such as image acquisition equipment, chips, software and cloud services, and it cannot be regarded as a limitation of this application.
[0091] It should be noted that the intelligent traffic target detection device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing abnormality detection. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the intelligent traffic target detection device will be divided into different functional modules to complete all or part of the functions described above.
[0092] In addition, the intelligent traffic target detection device provided in the above embodiment and the embodiment of the intelligent traffic target detection device belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0093] Figure 7 A schematic structural diagram of an electronic device is shown according to an exemplary embodiment.
[0094] It should be noted that the electronic device is only an example adapted to the present application and cannot be considered to provide any limitation on the scope of use of the present application. The electronic device cannot be interpreted as requiring dependence on or having Figure 7 One or more components of exemplary electronic device 2000 are shown.
[0095] The hardware structure of the electronic device 2000 may vary greatly due to differences in configuration or performance, such as Figure 7 As shown, the electronic device 2000 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .
[0096] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000 .
[0097] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices.
[0098] Of course, in other examples adapted by the present application, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Figure 7 As shown, this is not intended to be a specific limitation.
[0099] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.
[0100] Among them, the operating system 251 is used to manage and control various hardware devices and application programs 253 on the electronic device 2000 to enable the central processor 270 to calculate and process the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0101] The application program 253 is a computer program that performs at least one specific task based on the operating system 251, and may include at least one module ( Figure 7 (not shown), each module may respectively include a computer program for the electronic device 2000. For example, the intelligent traffic target detection device may be regarded as an application 253 deployed on the electronic device 2000.
[0102] The data 255 may be photos, images, etc. stored on a disk, stored in the memory 250 .
[0103] The central processor 270 may include one or more processors and is configured to communicate with the memory 250 through at least one communication bus to read the computer program stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the intelligent traffic target detection method is completed in the form of the central processor 270 reading a series of computer programs stored in the memory 250.
[0104] In addition, the present application can also be implemented through hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present application is not limited to any specific hardware circuits, software, or a combination of the two.
[0105] See also Figure 8An embodiment of the present application provides an electronic device 4000, which can be a desktop computer, a laptop computer, a server, etc.
[0106] exist Figure 8 In the embodiment, the electronic device 4000 includes at least one processor 4001, at least one communication bus 4002 and at least one memory 4003.
[0107] The processor 4001 and the memory 4003 are connected, such as through a communication bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0108] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0109] The communication bus 4002 may include a path to transmit information between the above components. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0110] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0111] The memory 4003 stores a computer program, and the processor 4001 reads the computer program stored in the memory 4003 through the communication bus 4002 .
[0112] When the computer program is executed by the processor 4001, the intelligent traffic target detection method in the above-mentioned embodiments is implemented.
[0113] In addition, a storage medium is provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the intelligent traffic target detection method in the above embodiments is implemented.
[0114] In an embodiment of the present application, a computer program product is provided, the computer program product includes a computer program, the computer program is stored in a storage medium. A processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, so that the computer device executes the intelligent traffic target detection method in each of the above embodiments.
[0115] Compared with the related art, on the one hand, the present application takes into account the overall characteristics of the data modality in the road scene that objects are larger when near and smaller when far away, and sets a gradient threshold screening method to replace the original fixed threshold screening method, so as to perform preliminary screening on the detection results obtained by the target detection model, eliminate the possibility of false detection, and preliminarily improve the detection accuracy; on the other hand, for the results of the preliminary screening, the gradient threshold is adaptively adjusted in combination with the detection area of all target objects at the same height, and the adaptive threshold is obtained to perform secondary screening on the results of the preliminary screening, so as to eliminate the irrationality of having the same gradient threshold for different detection area areas at the same height, and further improve the accuracy of intelligent traffic target detection.
[0116] Moreover, for all situations where target detection is required, the gradient threshold screening method provided by the present application is definitely better than the fixed threshold. Therefore, the present application can be applied to tasks in most intelligent traffic scenarios and has good versatility. Moreover, the present application does not involve model training, and improves the target detection accuracy without taking up additional resource consumption and speed. At the same time, it can also be combined with different target detection models, and the gradient threshold setting and adaptive threshold calculation method can be flexibly adjusted for different scenarios, which has good flexibility.
[0117] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0118] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An intelligent traffic target detection method, characterized in that: The method comprises: Acquire an image to be detected, and preprocess the image to be detected to obtain a preprocessed image; the image to be detected is a traffic scene image containing a target object; Performing target detection on the preprocessed image to obtain a target detection result; the target detection result includes a detection area position height and a confidence score of the detection area containing the target object in the preprocessed image; A quadratic function is used to fit the confidence threshold in the preprocessed image to obtain a gradient threshold, and the target detection result is screened using the gradient threshold to obtain a screening result.
2. The method according to claim 1, characterized in that After obtaining the screening results, the method further comprises: An adaptive threshold is obtained by comprehensive calculation according to the area size of the target object, and the screening result is secondary screened using the adaptive threshold to obtain an output result.
3. The method according to claim 1, characterized in that The confidence threshold in the preprocessed image is fitted using a quadratic function to obtain a gradient threshold, and the target detection result is screened using the gradient threshold to obtain a screening result, including: Calculate the gradient threshold t1 of the height of the current position according to the position height of the target object indicated by the target detection result in the preprocessed image; If the confidence score of the target object is greater than the gradient threshold t1 of the current position height, the screening result indicates that the current target detection result is retained; If the confidence score of the target object is less than the gradient threshold t1 of the current position height, the screening result indicates that the current target detection result is deleted.
4. The method according to claim 2, characterized in that The adaptive threshold is obtained by comprehensive calculation based on the confidence score of the target object, and the screening result is secondary screened by using the adaptive threshold to obtain an output result, including: According to the position height of the target object indicated by the target detection result in the preprocessed image, the average area of all target object detection areas of the same category at the current position height is calculated; The average area of the target area at the current location obtained by experimental statistics is used as the prior area threshold; Adaptively adjust the height gradient threshold of the current location according to the average area and the prior area threshold to obtain the height adaptive threshold t1' of the current location; According to the confidence score of the target object being greater than the current position height adaptive threshold t1', retaining the current target detection result as the output result; According to the confidence score of the target object being less than the current position height adaptive threshold t1', the current target detection result is deleted as the output result.
5. The method according to claim 4, characterized in that The method of adaptively adjusting the height gradient threshold of the current location according to the average area and the prior area threshold to obtain the height adaptive threshold t1' of the current location includes: t1'=k(s-t2)+t1 Among them, k is the weight parameter corresponding to the current scene obtained by the experiment, s is the average area of all detection areas of the same category of target objects at the current location height, and t2 is the prior area threshold of the current location height.
6. The method according to claim 1, characterized in that The preprocessing of the image to be detected to obtain a preprocessed image includes image pyramid operation and background modeling operation; The image pyramid operation is used to relatively enlarge the scale of small target objects in the image to be detected, so that the features of the target objects are more obvious; The background modeling operation is used to compare the pixel points corresponding to the target area in the image to be detected with the average pixel points to distinguish the foreground and background of the image to be detected.
7. The method according to claim 1, characterized in that The target detection result is obtained by calling a target detection model based on the Yolov5 algorithm; the target detection model is a deep learning model that has been trained to detect preprocessed images containing target objects and output the detection area of the target object and its confidence score; The training process of the target detection model includes: Obtain a number of real images containing target objects from the data set, and divide the real images into a training set and a test set according to a certain ratio; Performing data enhancement on the acquired plurality of real images containing the target object; the data enhancement includes one or more of mosaic enhancement, affine transformation, color transformation and random noise; The Yolov5 network model is trained using the real image after the data enhancement to obtain a target detection model that performs target detection on the preprocessed image containing the target object and outputs the detection area of the target object and its confidence score.
8. An intelligent traffic target detection device, characterized in that: The device comprises: An image acquisition module is used to acquire an image to be detected and preprocess the image to be detected to obtain a preprocessed image; the image to be detected is a traffic scene image containing a target object; The target detection module is used to perform target detection on the preprocessed image to obtain a target detection result; the target detection result includes a detection area containing the target object in the preprocessed image and its confidence score; The screening module is used to perform gradient threshold screening on the target detection results to obtain screening results.
9. An electronic device, characterized in that: include: at least one processor, at least one memory, and at least one communication bus, wherein: The memory stores a computer program, and the processor reads the computer program in the memory through the communication bus; When the computer program is executed by the processor, the intelligent traffic target detection method according to any one of claims 1 to 7 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the intelligent traffic target detection method according to any one of claims 1 to 7 is implemented.
