A vehicle identification and statistics method, system, device and storage medium

By training a vehicle model using the YOLOV8+EfficientNetV2 model and combining a matching method with historical and backup dictionaries, the problems of low accuracy and high cost in vehicle recognition and traffic flow statistics were solved, achieving efficient and accurate traffic flow statistics.

CN117789490BActive Publication Date: 2026-02-06CHANGAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311816837.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2026-02-06
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

Existing vehicle identification and traffic flow statistics methods suffer from low accuracy and high cost, especially in complex traffic situations and at night when accuracy is difficult to guarantee.

Method used

A vehicle recognition model was trained using the YOLOV8+EfficientNetV2 model. By analyzing road traffic flow video data, the number of vehicle target boxes in consecutive adjacent frames was compared using the target box coordinates and category information to calculate traffic flow. The model was then matched using historical and backup dictionaries to improve statistical accuracy.

Benefits of technology

It enables fast, simple, and accurate traffic flow statistics, reduces detection costs, improves detection accuracy, reduces the risk of counting errors caused by model omissions, and improves the accuracy of traffic flow statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117789490B_ABST
    Figure CN117789490B_ABST
Patent Text Reader

Abstract

The application discloses a vehicle identification and statistics method, system, device and storage medium, target frame coordinates and category information of a vehicle in a certain period of time are obtained by using a trained vehicle model identification model, the target frame coordinates and category information of the vehicle obtained are used to compare the number change of the vehicle target frame in continuous adjacent frames, and the target frame coordinates and category information of the vehicle in the continuous adjacent frames are matched, and vehicle flow is calculated, compared with the existing vehicle flow statistics by installing contactable or non-contactable sensors on a road, the vehicle flow statistics can be quickly, simply and accurately realized, and the detection cost is low, and the detection precision is higher.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of transportation, and particularly relates to a vehicle identification and statistical method, system, device and storage medium. BACKGROUND

[0002] The vehicle intelligent identification method has important significance in the aspect of counting the traffic flow of various vehicle types on the highway. The existing method is mainly based on image processing and machine learning technology, and the vehicle quantity is counted or directly counted manually by analyzing the vehicle image captured by the traffic camera. However, the current identification method still has certain defects: the accuracy of vehicle counting is low in some complex traffic situations, and the cost of manual 24-hour traffic counting is high, and because there is no perfect auditing and checking mechanism, the accuracy of manual counting is low, and the accuracy of manual counting is more difficult to guarantee for night counting.

[0003] The road is installed with contactable or non-contactable sensors to count the traffic flow. The contactable sensor is generally laid under the road, and when the vehicle passes, the voltage, magnetic field or pressure inside the sensor changes, thereby counting the vehicle. The installation and maintenance cost of this kind of sensor is high, and now it is no longer laid in large quantities. Non-contact sensors include ultrasonic, infrared, radar sensors, etc. Non-contact sensors do not need physical installation and maintenance, reducing the risk of equipment damage and maintenance, and have high accuracy and good real-time performance, but such sensors are easily affected by bad weather, resulting in reduced detection accuracy. SUMMARY

[0004] The purpose of the present application is to provide a vehicle identification and statistical method, system, device and storage medium to solve the technical problems of low accuracy and high cost of existing vehicle identification and traffic flow counting.

[0005] To achieve the above purpose, the technical scheme adopted by the present application is as follows:

[0006] A vehicle identification and statistical method, comprising the following steps:

[0007] Obtaining the target frame coordinates and category information of the vehicle by using the trained vehicle type identification model;

[0008] Based on the obtained target frame coordinates and category information of the vehicle, comparing the number of vehicle target frames in the continuous adjacent frames, and matching the target frame coordinates and category information of the vehicle in the continuous adjacent frames, and calculating the traffic flow;

[0009] The vehicle type identification model adopts YOLOV8+EfficientNetV2 model.

[0010] Further, the training process of the trained vehicle type identification model is:

[0011] Collecting road traffic flow video data;

[0012] Processing the collected road traffic flow video data to obtain road traffic images of each frame of the video as an original image set;

[0013] Taking the original image set as input and the target box coordinates and category information of the vehicle as output, a YOLOV8+EfficientNetV2 target detection algorithm is applied to train a vehicle model recognition model.

[0014] Further, the YOLOV8+EfficientNetV2 model introduces a reference convolutional network EfficientNetV2 in the YOLOV8 model and introduces an incremental learning method of the convolutional network EfficientNetV2.

[0015] Further, the specific steps of the vehicle flow calculation are:

[0016] Setting a history dictionary, a backup dictionary 1, a backup dictionary 2, and a backup dictionary 3 to count vehicle target box information, the vehicle target box information including vehicle target box coordinates, categories, and confidence;

[0017] Setting an identifier Matched=False, and when the number of consecutive frames identified by the trained vehicle model recognition model reaches a certain number, comparing the number of vehicle target box identifications of the previous and subsequent frames;

[0018] Respectively matching when the number of vehicle target box identifications decreases, remains unchanged, and increases, and counting the vehicle categories that decrease, the sum of all categories of vehicles in a time period being the vehicle flow of the time period.

[0019] Further, the number of vehicle target box identifications decreases, that is, the number of vehicle target box identifications of the current frame is less than that of the previous frame:

[0020] If the backup dictionary 1 is empty or the frame difference when the target box decreases compared with the last time exceeds 2 frames, the target box information of the previous frame before the number of target box identifications decreases is counted into the backup dictionary 1, and the target box information of the current frame is updated into the history dictionary;

[0021] If the backup dictionary 1 is not empty and the frame difference when the target box decreases compared with the last time is 2 frames, the backup dictionary 1 and the history dictionary (the target box information of the previous frame at the current frame position) are matched, if the matching is successful, the target box confidence in the history dictionary (the current frame) is updated, the vehicle model with the highest confidence is selected as the final category of the target box, if the target box matching fails, the target boxes that fail to match in the backup dictionary 1 are counted and the backup dictionary 1 is emptied, and finally the target box information of the current frame is used to update the history dictionary.

[0022] Furthermore, when the number of vehicle target boxes identified remains unchanged, that is, when the number of vehicle target boxes identified in the current frame is equal to the number of vehicle target boxes identified in the previous frame:

[0023] The target bounding boxes from the historical dictionary are entered into the backup dictionary 2. The target bounding box information of the current frame is updated and entered into the historical dictionary. The target bounding boxes in the backup dictionary 2 and the historical dictionary are then matched. If all target bounding boxes match successfully, the confidence of the target bounding boxes in the historical dictionary is updated, and the vehicle type with the highest confidence is selected as the final category of the target bounding box. If the target bounding box fails to match, the target bounding boxes in the backup dictionary 1 and the historical dictionary are matched again. The vehicles in the target bounding boxes in the backup dictionary 1 that failed to match are counted. Then the backup dictionary 1 is cleared and the identifier Matched = True is set.

[0024] Furthermore, when the number of vehicle target boxes identified increases, i.e., the number of vehicle target boxes identified in the current frame is greater than the number of vehicle target boxes identified in the previous frame:

[0025] If the identifier Matched = True, then the target box information of the historical dictionary is counted and added to the backup dictionary 3. Then, the target box information of the current frame is updated and added to the historical dictionary. Subsequently, the target boxes of the backup dictionary 3 and the historical dictionary are matched. If all target boxes in the backup dictionary 3 are successfully matched, the confidence of the target boxes in the historical dictionary is updated, and the vehicle type with the highest confidence is selected as the final category of the target box. Then, the identifier Matched = False is set. If the target box fails to match, the vehicles in the corresponding target boxes in the backup dictionary 3 are counted, and then the identifier Matched = False is set.

[0026] If the identifier Matched = False, the target box information of the current frame is updated into the historical dictionary, and the target boxes of the backup dictionary 1 are matched with those of the historical dictionary. If the target box fails to match, the vehicles in the failed target boxes are counted. If the match is successful, the confidence of the target box in the historical dictionary is updated, the vehicle type with the highest confidence is selected as the final category of the target box, and the backup dictionary 1 is cleared.

[0027] A vehicle identification and statistics system includes a vehicle information acquisition module and a traffic flow output module, wherein:

[0028] Vehicle information acquisition module: used to obtain the target box coordinates and category information of vehicles using a trained vehicle model;

[0029] The traffic flow output module is used to compare the changes in the number of vehicle target boxes in consecutive adjacent frames based on the obtained target box coordinates and category information of the vehicles, and to match the target box coordinates and category information of the vehicles in consecutive adjacent frames to calculate the traffic flow.

[0030] The vehicle model recognition model uses the YOLOV8+EfficientNetV2 model.

[0031] A terminal device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.

[0032] A computer-readable storage medium stores a computer program, and the computer program implements the steps of the above method when executed by a processor.

[0033] Compared with the prior art, the present application has the following beneficial technical effects:

[0034] The vehicle recognition and statistical method of the present application obtains the target frame coordinates and category information of the vehicle in a certain period of time by using the trained vehicle model recognition model, compares the number of vehicle target frames in the continuous adjacent frames based on the obtained target frame coordinates and category information of the vehicle, matches the target frame coordinates and category information of the vehicle in the continuous adjacent frames, and calculates the vehicle flow. Compared with the existing method of installing contactable or non-contactable sensors on the road to count the vehicle flow, the present application can quickly, simply and accurately realize the counting of the vehicle flow, has low detection cost and higher detection accuracy.

[0035] Preferably, the present application provides a vehicle category recognition method, which uses the target detection algorithm YOLOV8+EfficientNetV2 to train the vehicle recognition model with training samples. Compared with the traditional method, the present application has higher accuracy and faster recognition speed. The vehicle recognition model is trained with actual measured traffic conditions, which can better meet the traffic conditions of domestic highways and effectively overcome the shortcomings of long time consumption, high cost and low accuracy of existing road traffic volume investigation.

[0036] Preferably, according to the vehicle flow statistical method of the present application, when the number of vehicles decreases, the first time does not perform statistical counting, the information when the number of vehicles decreases is stored by using the backup dictionary 1, and is matched with the vehicles after two frames, so as to greatly reduce the risk of counting caused by model misrecognition, and by using the matching method, the disadvantage that the system does not count due to the entry of new vehicles while the vehicles leave is eliminated, thereby effectively improving the accuracy of vehicle flow statistical counting. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 The flowchart of the vehicle recognition and statistical method in the embodiment of the present application.

[0038] Figure 2 The model performance index diagram of the vehicle recognition and statistical method in the embodiment of the present application.

[0039] Figure 3 The vehicle flow statistical logic diagram of the vehicle recognition and statistical method in the embodiment of the present application.

[0040] Figure 4 The specific steps of the vehicle identification and statistical method in the embodiment of the present application are shown in the figure. DETAILED DESCRIPTION

[0041] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should be within the scope of protection of the present application.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0043] The present application will be described in further detail below with reference to the drawings:

[0044] As shown in Figure 1 A vehicle identification and statistical method includes the following steps:

[0045] S1, obtaining the target box coordinates and category information of the vehicle by using the trained vehicle model identification model;

[0046] S2, comparing the number of vehicle target boxes in the consecutive adjacent frames based on the obtained target box coordinates and category information of the vehicle, and matching the target box coordinates and category information of the vehicle in the consecutive adjacent frames to calculate the vehicle flow;

[0047] The vehicle model identification model uses a YOLOV8+EfficientNetV2 model.

[0048] Specifically, in S1, the training process of the trained vehicle model identification model is as follows:

[0049] Collecting road traffic flow video data;

[0050] The collected road traffic flow video data is processed to obtain road traffic images of each frame of the video as an original image set;

[0051] The original image set is taken as input, and the target box coordinates and category information of the vehicle are taken as output, and a YOLOV8+EfficientNetV2 target detection algorithm is applied to train a vehicle model recognition model.

[0052] The specific steps of the road traffic flow video data collection are as follows:

[0053] Step 1, according to the needs of the present application, select hardware devices and purchase, including solar all-in-one machine, camera and various auxiliary materials and other equipment, the selected equipment is as follows: the solar all-in-one machine includes 670mm*535mm A-level monocrystalline silicon panel and maximum output 40Ah lithium battery, the camera contains 256G memory, the highest resolution can reach 2560*1920, the auxiliary materials include hoop, support and the like;

[0054] Step 2, using solar all-in-one machine, camera and other equipment, install to a specific angle, such as 45 degrees angle on the right side of the road or portal angle directly above the road, collect road traffic video data;

[0055] The camera angle can be changed within a certain angle, such as 45 degree angle and 50 degree, 40 degree angle, the road traffic video data collected can be used for the same model for vehicle intelligent recognition and statistics, but the road traffic video data collected by 45 degree angle and portal angle cannot be used for the same model, and the model needs to be trained respectively.

[0056] As shown in Figure 4 The specific steps of processing the collected road traffic video data are as follows:

[0057] Step 1, processing the collected road traffic video data, obtaining road traffic images of each frame of the video as an original image set;

[0058] Step 2, using software labelimg, setting the required vehicle model category in advance, opening the original image set in the software labelimg, directly selecting and assigning the corresponding category in the pre-set vehicle model category for the vehicle in the image, thereby completing the production of training samples.

[0059] In the process of making training samples, open the original image in software labelimg, directly frame the vehicles in the picture, pay attention to making special angle training samples, and as much as possible supplement various vehicle postures in the training sample set, which is beneficial to improve the model quality, improve the target recognition accuracy, and reduce the statistical error. The target frame information of the training sample is saved in a txt file, including the upper left corner, lower right corner, target frame center coordinates and target frame category. Finally, the txt file is used to train the model with the corresponding original image set.

[0060] The training samples are divided into a training set and a validation set, and a YOLOV8+EfficientNetV2 target detection algorithm is used to train a vehicle model. Specifically,

[0061] Randomly divide the samples, select 80% of the samples as the training set, and 20% of the samples as the validation set;

[0062] The reference convolutional network EfficientNetV2 is introduced into the YOLOV8 model, mainly in the yaml file of YOLOV8, the main network of YOLOV8 is changed by referring to the convolutional network EfficientNetV2, so as to introduce the progressive learning method of convolutional network EfficientNetV2;

[0063] The model indicators verified by the validation set are as follows Figure 2 The model indicator instance diagram is shown, wherein the indicator Box is the bounding box loss of YOLOV5 using GIOU Loss, the Box estimation is the mean value of the GIoU loss function, the smaller the value, the more accurate the frame, the indicator Objectness is the mean value of the target detection loss, the smaller the value, the more accurate the target detection, the indicator Classification is the mean value of the classification loss, the smaller the value, the more accurate the classification, the indicator Precision is the model precision, the larger the value, the higher the probability that the positive class classified by the classifier is a positive class, the indicator Recall is the recall rate, the larger the value, the higher the ability to find all positive classes, the indicator mAP@0.5 represents the average precision when the IOU threshold for judging positive and negative samples is 0.5, the higher the value, the higher the model prediction accuracy, and the indicator mAP@0.5:0.95 represents the mean value of mAP with 0.05 as the step and IOU threshold from 0.5 to 0.95.

[0064] The specific steps of vehicle flow calculation are as follows:

[0065] Set up a history dictionary, a backup dictionary 1, a backup dictionary 2, and a backup dictionary 3 to count vehicle target frame information, including vehicle target frame coordinates, categories, and confidence.

[0066] Set identifier Matched = False, and the number of frames identified by the trained vehicle model recognition model is compared with the number of vehicle target frame recognition before and after the frame;

[0067] The matching is performed for the vehicle target frame recognition number reduction, no change and increase, respectively, and the vehicle class of the reduced vehicle is counted. The sum of all classes of vehicles in the time period is the traffic flow in the time period.

[0068] Specifically, when the vehicle target frame recognition number decreases, i.e., the current frame vehicle target frame recognition number is less than the previous frame vehicle target frame recognition number:

[0069] If the standby dictionary 1 is empty or the frame difference is more than 2 frames compared with the last target frame reduction, the target frame information of the previous frame before the target frame recognition number is reduced is counted into the standby dictionary 1, and the current frame target frame information is updated into the history dictionary;

[0070] If the standby dictionary 1 is not empty and the frame difference is 2 frames compared with the last target frame reduction, match the standby dictionary 1 with the history dictionary (the previous frame target frame information of the current frame position), if the matching is successful, update the target frame confidence in the history dictionary (current frame), select the highest confidence vehicle type as the final class of the target frame; if the target frame matching fails, count the matching failed target frame in the standby dictionary 1 and empty the standby dictionary 1, and finally update the history dictionary with the current frame target frame information.

[0071] When the vehicle target frame recognition number is unchanged, i.e., the current frame vehicle target frame recognition number is equal to the previous frame vehicle target frame recognition number:

[0072] Count the history dictionary target frame into the standby dictionary 2, update the current frame target frame information into the history dictionary, then match the standby dictionary 2 with the history dictionary target frame, if all target frames are successfully matched, update the target frame confidence in the history dictionary, select the highest confidence vehicle type as the final class of the target frame; if the target frame matching fails, continue to match the standby dictionary 1 with the history dictionary target frame, count the target frame vehicle in the standby dictionary 1 which fails to match, and then empty the standby dictionary 1 and set the identifier Matched = True;

[0073] When the vehicle target frame recognition number increases, i.e., the current frame vehicle target frame recognition number is greater than the previous frame vehicle target frame recognition number:

[0074] If the identifier Matched = True, the target box information of the history dictionary is counted into the standby dictionary 3, and the current frame target box information is updated into the history dictionary. Then, the target box of the standby dictionary 3 and the history dictionary is matched. If all the target boxes of the standby dictionary 3 are successfully matched, the target box confidence of the history dictionary is updated, the vehicle model with the highest confidence is selected as the final category of the target box, and the identifier Matched = False is set. If the target box matching fails, the corresponding target box vehicle in the standby dictionary 3 is counted, and the identifier Matched = False is set.

[0075] If the identifier Matched = False, the current frame target box information is updated into the history dictionary, the standby dictionary 1 and the target box of the history dictionary are matched, and if the target box matching fails, the vehicle of the target box matching failure is counted. If the matching is successful, the target box confidence of the history dictionary is updated, the vehicle model with the highest confidence is selected as the final category of the target box, and the standby dictionary 1 is emptied.

[0076] The detailed logic diagram is shown in Figure 3 The detailed logic diagram is shown in

[0077] The YOLOV8+EfficientNetV2 target detection algorithm is applied to detect the vehicle information in the camera picture. The history dictionary, the standby dictionary 1, the standby dictionary 2, and the standby dictionary 3 are set to count the target box information of the vehicle in the picture, including the vehicle target box coordinates, the category, and the confidence.

[0078] The identifier Matched = False is set, the YOLOV8+EfficientNetV2 target detection algorithm is used to continuously identify the video frame number, and the number of target boxes identified before and after the frame number is compared.

[0079] When the number of target boxes identified in the current frame is less than that in the last frame, it is judged whether the standby dictionary 1 is empty. If it is empty, the frame number information when the current frame is reduced is recorded, the target box information of the history dictionary is counted into the standby dictionary 1, and the target box information of the current frame is updated into the history dictionary. If it is not empty, the difference between the frame number when the last target box is reduced and the current frame is judged. If it is less than or equal to 2, the standby dictionary 1 and the history dictionary IOU are matched. If the matching is successful, the target box information of the history dictionary is updated according to the standby dictionary 1. If the matching is not successful, the target box in the standby dictionary 1 is counted. Finally, the history dictionary is updated with the target box information of the current frame. If it is greater than 2, the frame number information when the current frame is reduced is recorded, the target box information of the history dictionary is counted into the standby dictionary 1, and the target box information of the current frame is updated into the history dictionary.

[0080] If the number of target frame recognition is equal to the last frame, the target frame information of the history dictionary is counted into the backup dictionary 2, and it is judged whether the backup dictionary 1 is empty. If it is empty, the history dictionary is updated with the target frame information of the current frame, and then the IOU of the backup dictionary 2 and the history dictionary is matched. If the matching is successful, the history dictionary is updated according to the target frame information of the backup dictionary 2, and if the matching is unsuccessful, the corresponding target frame in the backup dictionary 2 is counted. If it is not empty, the difference between the current frame number and the frame number when the last target frame is reduced is judged. If it is less than 2, the history dictionary is updated with the target frame information of the current frame, and then the IOU of the backup dictionary 2 and the history dictionary is matched. If the matching is successful, the target frame information in the backup dictionary 2 is deleted, and if the matching is unsuccessful, it is retained. Then it is judged whether the backup dictionary 2 is empty. If it is empty, the history dictionary is updated with the target frame information of the current frame, and if it is not empty, the IOU of the backup dictionary 1 and the history dictionary is matched. If the matching is successful, the history dictionary is updated according to the target frame information of the backup dictionary 1, and if the matching is unsuccessful, the corresponding target frame in the backup dictionary 1 is counted. Then the backup dictionary 1 is emptied and the identifier Matched is set to True.

[0081] If the difference between the current frame number and the frame number when the last target frame is reduced is equal to 2, the identifier Matched is judged. If Matched = False, the IOU of the backup dictionary 1 and the history dictionary is matched. If the matching is successful, the corresponding target frame information in the backup dictionary 1 is deleted, and if the matching is unsuccessful, the corresponding target frame in the backup dictionary 1 is counted. Then the backup dictionary 1 is emptied, the history dictionary is updated with the target frame information of the current frame, and the dictionary 2 and the history dictionary are matched. If the matching is successful, the target frame information in the backup dictionary 2 is deleted, and if the matching is unsuccessful, the corresponding target frame in the backup dictionary 2 is counted. If Matched = True, Matched is first set to False, the history dictionary is updated with the target frame information of the current frame, and then the IOU of the backup dictionary 2 and the history dictionary is matched. If the matching is successful, the history dictionary is updated according to the target frame information of the backup dictionary 2, and if the matching is unsuccessful, the corresponding target frame in the backup dictionary 2 is counted.

[0082] If the difference between the current frame number and the frame number when the last target frame is reduced is greater than 2, the history dictionary is updated with the target frame information of the current frame, and then the IOU of the backup dictionary 2 and the history dictionary is matched. If the matching is successful, the history dictionary is updated according to the target frame information of the backup dictionary 2, and if the matching is unsuccessful, the corresponding target frame in the backup dictionary 2 is counted.

[0083] If the number of target frame recognition is greater than the last frame, it is judged whether the backup dictionary 1 is empty. If it is empty, the target frame information of the history dictionary is counted into the backup dictionary 3, the IOU of the backup dictionary 3 and the history dictionary is matched, and if the matching is successful, the corresponding target frame information in the backup dictionary 3 is deleted. If the matching is unsuccessful, the corresponding target frame information in the backup dictionary 3 is counted.

[0084] If the backup dictionary 1 is not empty, the difference between the current frame number and the frame number when the target frame is reduced last time is judged, if greater than 2, the historical dictionary target frame information is counted into the backup dictionary 3, the backup dictionary 3 and the historical dictionary IOU are matched, if successfully matched, the corresponding target frame information in the backup dictionary 3 is deleted, if unable to match, the corresponding target frame information in the backup dictionary 3 is counted, if the frame number difference is less than or equal to 2, the identifier Matched is judged, if Matched=True, the historical dictionary target frame information is counted into the backup dictionary 3, the backup dictionary 3 and the historical dictionary IOU are matched, if successfully matched, the corresponding target frame information in the backup dictionary 3 is deleted, if unable to match, the corresponding target frame information in the backup dictionary 3 is counted, if Matched=False, the current frame target frame information is used to update the historical dictionary, then the backup dictionary 1 and the historical dictionary IOU are matched, if matched successfully, the corresponding target frame information in the backup dictionary 1 is deleted, if unable to match, the corresponding target frame information in the backup dictionary 1 is counted, then the backup dictionary 1 is emptied.

[0085] Finally, the example test 12h road traffic video data, artificially counted, the test used 12h road traffic flow video data includes 3331 vehicles in total, according to the technical solution adopted in this example, the test used 12h road traffic video data includes 3350 vehicles in total, and the total time consumed is less than 4h, so it is known that the target test precision and test speed of the new vehicle intelligent identification and statistical method provided by the present application have been greatly improved compared with the traditional method.

[0086] The application also provides a vehicle identification and statistical system, comprising a vehicle information acquisition module and a vehicle flow output module, wherein:

[0087] The vehicle information acquisition module is used to obtain the target frame coordinates and category information of the vehicle by using the trained vehicle model identification model;

[0088] The vehicle flow output module is used to compare the change of the number of vehicle target frames in the continuous adjacent frame numbers based on the obtained target frame coordinates and category information of the vehicle, match the target frame coordinates and category information of the vehicle in the continuous adjacent frame numbers, and calculate the vehicle flow.

[0089] The vehicle model identification model adopts a YOLOV8+EfficientNetV2 model.

[0090] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.

[0091] The present application is described in reference to the flowchart and / or block diagrams of the method, apparatus (system) and computer program product according to embodiments of the application. It will be understood that each block of the flowchart and / or block diagrams, and combinations of blocks in the flowchart and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0092] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0094] Finally, it should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application, but not to limit the scope of protection of the present application. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that: after reading the present application, the skilled in the art can make various changes, modifications or equivalent replacements to the specific embodiments of the present application, and these changes, modifications or equivalent replacements are all within the scope of protection of the claims of the present application.

Claims

1. A vehicle identification and statistics method, characterized by, The method comprises the following steps: obtaining the target frame coordinates and category information of the vehicle by using the trained vehicle model recognition model; comparing the number of vehicle target frames in the continuous adjacent frames based on the obtained target frame coordinates and category information of the vehicle, and matching the target frame coordinates and category information of the vehicle in the continuous adjacent frames to calculate the vehicle flow; the vehicle model recognition model adopts a YOLOV8+EfficientNetV2 model; the specific steps of calculating the vehicle flow are as follows: setting a history dictionary, a backup dictionary 1, a backup dictionary 2, and a backup dictionary 3 to count the vehicle target frame information, which includes the vehicle target frame coordinates, category, and confidence; setting an identifier Matched=False, and comparing the number of vehicle target frame recognitions in the previous and subsequent frames when the number of frames recognized by the trained vehicle model recognition model is continuous; matching when the number of vehicle target frame recognitions is reduced, unchanged, and increased, respectively, and counting the vehicle categories that are reduced, and the sum of all categories of vehicles in a time period is the vehicle flow in the time period; when the number of vehicle target frame recognitions is reduced, i.e., the number of vehicle target frame recognitions in the current frame is less than that in the previous frame: if the backup dictionary 1 is empty or the frame difference when the target frame is reduced compared with the last time is more than 2 frames, the target frame information of the frame before the number of target frame recognitions is reduced is counted into the backup dictionary 1, and the target frame information of the current frame is updated into the history dictionary; if the backup dictionary 1 is not empty and the frame difference when the target frame is reduced compared with the last time is 2 frames, the backup dictionary 1 and the history dictionary are matched, if the matching is successful, the target frame confidence in the history dictionary is updated, and the vehicle type with the highest confidence is selected as the final category of the target frame; if the target frame matching fails, the matching failed target frames in the backup dictionary 1 are counted and the backup dictionary 1 is emptied, and finally the history dictionary is updated with the target frame information of the current frame.

2. The vehicle identification and statistics method of claim 1, wherein the training process of the trained vehicle model recognition model is as follows: collecting road traffic flow video data; processing the collected road traffic flow video data to obtain the road traffic images of each frame of the video as an original image set; using the original image set as the input and the target frame coordinates and category information of the vehicle as the output, a YOLOV8+EfficientNetV2 target detection algorithm is applied to train the vehicle model recognition model.

3. The vehicle identification and statistics method according to claim 1 or 2, characterized in that, the YOLOV8+EfficientNetV2 model adopts a reference convolutional network EfficientNetV2 introduced in the YOLOV8 model, and an incremental learning method of the convolutional network EfficientNetV2 is introduced.

4. The vehicle identification and statistics method of claim 1, wherein when the number of vehicle target frame recognitions is unchanged, i.e., the number of vehicle target frame recognitions in the current frame is equal to that in the previous frame: counting the target frames in the history dictionary into the backup dictionary 2, updating the target frame information of the current frame into the history dictionary, matching the target frames in the backup dictionary 2 and the history dictionary, if all the target frames are successfully matched, updating the target frame confidence in the history dictionary, and selecting the vehicle type with the highest confidence as the final category of the target frame; If the target frame fails to match, the target frame vehicle in the backup dictionary 1 that fails to match is counted, and then the backup dictionary 1 is emptied and the identifier Matched is set to True.

5. The vehicle identification and statistics method of claim 1, wherein If the number of identified vehicle target frames increases, that is, the number of identified vehicle target frames in the current frame is greater than the number of identified vehicle target frames in the previous frame, the following steps are performed: If the identifier Matched is True, the target frame information in the history dictionary is counted into the backup dictionary 3, and the target frame information in the current frame is updated into the history dictionary, and then the target frames in the backup dictionary 3 and the history dictionary are matched. If the target frame fails to match, the corresponding target frame vehicle in the backup dictionary 3 is counted, and the identifier Matched is set to False. If the identifier Matched is False, the target frame information in the current frame is updated into the history dictionary, the target frames in the backup dictionary 1 and the history dictionary are matched, and if the target frame fails to match, the target frame vehicle that fails to match is counted. If the target frame successfully matches, the confidence of the target frame in the history dictionary is updated, the vehicle type with the highest confidence is selected as the final category of the target frame, and the backup dictionary 1 is emptied.

6. A vehicle identification and statistics system characterized by, The vehicle information acquisition module is configured to obtain target frame coordinates and category information of a vehicle by using a trained vehicle type identification model. The vehicle flow output module is configured to compare changes in the number of vehicle target frames in a plurality of consecutive adjacent frames based on the obtained target frame coordinates and category information of the vehicle, match the target frame coordinates and category information of the vehicle in the plurality of consecutive adjacent frames, and calculate vehicle flow. The vehicle type identification model uses a YOLOV8+EfficientNetV2 model. The specific steps of calculating the vehicle flow are as follows: A history dictionary, a backup dictionary 1, a backup dictionary 2, and a backup dictionary 3 are set to count vehicle target frame information, which includes vehicle target frame coordinates, categories, and confidence. An identifier Matched is set to False, and the number of vehicle target frames identified in a plurality of consecutive frames is compared. When the number of identified vehicle target frames decreases, remains unchanged, or increases, matching is performed, and the number of vehicles in the category that decreases is counted. When the number of identified vehicle target frames decreases, that is, the number of identified vehicle target frames in the current frame is less than the number of identified vehicle target frames in the previous frame, the following steps are performed: If the backup dictionary 1 is empty or the difference between the number of frames in which the number of target frames decreases and the previous number of target frames decreases is more than 2 frames, the target frame information of the frame before the number of target frames decreases is counted into the backup dictionary 1, and the target frame information of the current frame is updated into the history dictionary. ​ If the backup dictionary 1 is not empty and the frame number difference between the current target frame and the last target frame is 2, the backup dictionary 1 is matched with the history dictionary, if the matching is successful, the target frame confidence in the history dictionary is updated, the vehicle type with the highest confidence is selected as the final category of the target frame; if the matching fails, the target frames in the backup dictionary 1 that fail to match are counted and the backup dictionary 1 is emptied, and finally the history dictionary is updated with the target frame information of the current frame.

7. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The computer program, when executed by the processor, implements the steps of the method according to any one of claims 1-5.

8. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 7. The computer program, when executed by the processor, implements the steps of the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Vehicle multi-target detection and trajectory tracking method based on re-identification

    CN111914664A

  • Vehicle trajectory detection method and system based on target tracking

    CN117011341A