A method for detecting vehicle position at a road checkpoint
Through the vehicle side camera and deep learning algorithm, combined with the vehicle position classification model, the problem of inaccurate vehicle position detection and misjudgment in the existing technology is solved, achieving more efficient verification task automation and fault tolerance, and improving the accuracy of road checkpoints. traffic efficiency.
Patent Information
- Application Number
- CN202011587925.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-12-29
AI Technical Summary
Existing vehicle detection methods at road junctions cannot accurately identify vehicle locations, leading to misjudgments. Relying on position sensors increases hardware costs and failure points, and vehicle capture machines miss the mark, affecting traffic efficiency.
The vehicle side camera is used to collect video, and the vehicle position is detected through the vehicle side recognition model and location classification model. Deep learning and machine learning algorithms are combined to optimize detection parameters and compensation algorithms, reduce the misrecognition rate, and realize vehicle entry, landing and departure. Accurate identification.
It improves the accuracy of vehicle location identification and the degree of automation of verification tasks, shortens the interval of verification tasks, enhances the fault tolerance and automation level of the system, and reduces manual intervention.
Smart Images

Figure CN112712012B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of security inspection, and in particular to a method for detecting the position of a vehicle at a road checkpoint. Background Art
[0002] In our company's patent "CN202010159007-A system and method for mixed verification of people and vehicles at an intelligent checkpoint", a system and method for mixed verification of people and vehicles at an intelligent checkpoint has been described, hereinafter referred to as the original verification method.
[0003] In this method, the landing sensor and relay signal are used to determine whether the vehicle has reached the appropriate position. However, this method has some limitations, as described below:
[0004] Q1: It can only detect whether the vehicle is in place and whether the vehicle has left. It cannot immediately detect when the vehicle begins to enter the verification area, nor can it accurately identify the vehicle's current location;
[0005] Q2: The position sensor uses infrared light and cannot distinguish between vehicles, people or other objects, so there is a certain amount of misjudgment;
[0006] Q3: The installation and debugging standards are high. If the camera installation angle is deviated, it cannot be guaranteed that the vehicle is in the right position when the landing signal is sent;
[0007] Q4: Relying on position sensors will increase additional hardware costs, implementation costs and failure points.
[0008] In addition, this method uses vehicle capture as the trigger source of the verification task, which has two problems, as described below:
[0009] Q5: Due to problems with the capture line drawing, lighting issues, etc., there is a small probability that the vehicle capture machine will miss a capture. At this time, the verification task cannot be triggered and a certain amount of manual intervention is required.
[0010] Q6: The best capture position of the vehicle camera is generally in the middle and front part of the verification area. Vehicles will be captured and the task will be triggered only when they drive here. Therefore, there is often a 7-10 second interval between two verification tasks, and the traffic efficiency will be affected to a certain extent. Summary of the invention
[0011] In response to the above technical problems, the present invention provides a method for detecting vehicle position at a road checkpoint, which optimizes the method described in the original verification method, so that vehicle position identification is more accurate and the degree of automation of the verification task is higher.
[0012] The technical solution includes the following steps:
[0013] S1. Collecting vehicle video through a camera located on the side of the vehicle;
[0014] S2, extract frames from the video collected by S1 to obtain a side image of the vehicle, and perform unified processing on the image;
[0015] S3, using the vehicle side recognition model to identify the vehicle position through the image obtained in S2;
[0016] S4. Classify the vehicle location status using a vehicle location classification model.
[0017] Preferably, the training method of the vehicle side recognition model in S3 is:
[0018] S31, collecting vehicle video through a camera located on the side of the vehicle,
[0019] S32, extracting frames from the video collected in S31 to obtain vehicle side image samples, and performing unified processing on the images;
[0020] S33, manually labeling the image samples obtained in S32 or using a pre-trained model for automatic pre-labeling;
[0021] S34, training a vehicle side recognition model using a deep learning-based target detection algorithm;
[0022] S35, evaluate model accuracy;
[0023] S36, repeating steps S31-S35 until an ideal model is obtained;
[0024] Preferably, the camera is a rear camera located on the driver's side;
[0025] Preferably, the unified processing of the image in S32 includes optimizing the input parameters of the vehicle side recognition model. The original algorithm model usually chooses to use larger-sized images such as 416*416 and 608*608 as input, which can have a better detection effect on small targets, but often identifies vehicles in distant lanes that are not in the lane, resulting in a large number of misidentifications. Considering that the vehicles in the verification area are very large targets, the parameters are optimized, the image is compressed to 144*144~192*192 pixels as input, the confidence threshold is adjusted to 0.30~0.5, and the NMS threshold is adjusted to 0.35~0.45. This can greatly improve the detection performance (5-10 times), and almost all vehicles in non-lanes can be filtered out, which greatly reduces the misidentification rate and has little effect on the detection effect of vehicles in the verification area.
[0026] Preferably, in S33, the image samples obtained in S32 are manually annotated or automatically pre-annotated using a pre-trained model. When annotating, a five-tuple representation (left, top, width, height, confidence) is selected, which are the left x-coordinate, top y-coordinate, width, height and confidence of the vehicle rectangular box in the picture. When manually annotating, the confidence of the fifth element defaults to 1.
[0027] Preferably, when the vehicle is in position, due to the camera's viewing angle, the vehicle will occupy most of the camera's field of view, which will cause the vehicle to be incompletely displayed in the picture, such as the wheels cannot be seen. At this time, the confidence of the algorithm recognition result will be relatively low, and there is a small probability that a missed detection problem will occur. To address this problem, the vehicle side recognition model also includes a missed detection compensation algorithm, that is, a linear interpolation algorithm is used to predict and compensate for the missed detection frames after the vehicle is in position. The algorithm formula is as follows:
[0028] If the previous frame is not missed and is the true value, then F n =(F n-1 -F n-2 )+F n-1 ;
[0029] If the previous frame has been missed and is a predicted value, then F n =F n-1 , this ensures that the error will not be amplified with multiple predictions;
[0030] where F n It is a five-tuple representation of the vehicle in the nth frame (left, top, width, height, confidence).
[0031] Preferably, the vehicle position classification model training method in S4 is to use a machine learning algorithm to train the vehicle position classification model, including:
[0032] S41, calculating the vehicle position quintuple (left, top, width, height, confidence), marking the current position of the vehicle as five status labels of “vehicle entering, vehicle landing, critical position, vehicle leaving, invalid vehicle”;
[0033] S41. Formulate a preliminary rule model based on experience to calculate the state label based on the five-tuple representation (left, top, width, height, confidence) of the vehicle;
[0034] S42, pre-labeling the sampled vehicle images using a rule model;
[0035] S43, drawing the calculated state label and vehicle quintuple to the sample image;
[0036] S44. Manually review and annotate the pre-annotated samples;
[0037] S45. Train using a 5-layer neural network classification model;
[0038] S46. Evaluate the model accuracy;
[0039] S47. Repeat steps S42 - S46 to finally obtain a relatively ideal vehicle position classification model.
[0040] Preferably, the rule model in S42 includes:
[0041] Invalid vehicle: includes conditions,
[0042] bottom < 0.7 (vehicles in other lanes);
[0043] or left > 0.9 and height < 0.2;
[0044] or 0.8 < left < 0.9 and height < 0.3;
[0045] or left < 0.8 and height < 0.4;
[0046] When any one of the above conditions is met, the vehicle is determined to be invalid; invalid vehicles include distant vehicles, or other misidentified objects, etc.;
[0047] Vehicle entry: When left > 0.3 and right > 0.9 are satisfied, it is determined that the vehicle has entered;
[0048] Vehicle departure: When left < 0.05 and width < 0.6 are satisfied, it is determined that the vehicle has left;
[0049] Vehicle parking: When left < 0.3 and right > 0.75 and width > 0.6 are satisfied, it is determined that the vehicle has parked;
[0050] Critical vehicle: When none of the above conditions are met, it is determined to be a critical vehicle;
[0051] Where bottom = top + height; right = left + width, and the above values are all relative proportions of the coordinates in the picture.
[0052] Preferably, the neural network classification model in S45 includes 5 layers: an input layer, a hidden layer, a semi-connected layer, a fully-connected layer, and an output layer:
[0053] The input layer is a five-tuple representation of the vehicle (left, top, width, height, confidence) vector;
[0054] The hidden layer uses 5*M neurons, and the output is activated using the ReLU function;
[0055] The semi-connected layer uses M*N neurons and DropOut 50% of the output to prevent overfitting;
[0056] The fully connected layer uses N*5 neurons and uses softmax cross entropy for classification;
[0057] The output layer is the classification result, which is a 1*5 vector corresponding to the probability of each position state.
[0058] When using the model prediction, the five-tuple parameters of the vehicle are input and the output vector can be calculated. As long as the position of the maximum value in the output vector is found in the vector, the position state of the vehicle can be obtained;
[0059] Since the input layer vector space is very small, using such a shallow neural network can achieve good results. M and N are adjusted according to the training situation.
[0060] A road checkpoint vehicle verification method, comprising:
[0061] A1. A camera is set at the side of the vehicle corresponding to the checkpoint verification area, and the vehicle position detection method described in claim 7 is used to determine the vehicle position;
[0062] A2. When the front of a moving vehicle just enters the verification area, it is determined that the vehicle has entered. At this time, the verification task of the road checkpoint's own verification system can be immediately started, and interactive prompts can be given to shorten the interval between two verification tasks by 2 to 3 seconds, thereby further improving the passing efficiency. Most road checkpoint verification systems have voice or text prompts as interactive prompts for drivers to help them cooperate in completing the verification task;
[0063] A3. When a moving vehicle completely enters the verification area and is completely within the camera range, it is determined that the vehicle has landed, and the next verification step of the road checkpoint's own verification system is carried out;
[0064] A4. When a vehicle completes verification and leaves, it is determined that the vehicle has left. At this time, the corresponding verification system saves the data and resets the verification environment to prepare for the verification of the next vehicle.
[0065] This solution can accurately detect vehicle departure in various scenarios and has better fault tolerance than the original method.
[0066] Through the vehicle position classification model, vehicles that are not in the current lane can be further identified, marked as invalid vehicles, and discarded, so that the system will not make misidentifications.
[0067] The technical solution provided by the embodiment of the present invention has the following beneficial effects: by combining the vehicle side recognition model and the vehicle position classification model, the solution can detect the vehicle position at the road checkpoint more accurately and the verification task has a higher degree of automation. In addition, in various scenarios, it can detect the vehicle leaving more accurately and has better fault tolerance. In combination with the existing vehicle verification area, a better trigger mechanism is provided for assigning verification tasks to it. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 This is a flow chart of vehicle side recognition model training in Example 1 of the present invention.
[0069] Figure 2 This is a flow chart of vehicle position classification model training in Example 1 of the present invention.
[0070] Figure 3 This is a network diagram of a vehicle location classification model according to Embodiment 1 of the present invention.
[0071] Figure 4 This is a flowchart of the capture machine missed capture compensation in embodiment 1 of the present invention.
[0072] Figure 5 This is a vehicle position detection flow chart of embodiment 1 of the present invention.
[0073] Figure 6 This is a schematic diagram of the installation and deployment of the vehicle lane in Example 2 of the present invention.
[0074] Among them, the figure markings are: 1. signal light; 2. gate machine; 3. vehicle capture camera; 4. face capture camera; 5. window lighting equipment; 6. landing detection sensor; 7. speaker; 8. speed bump. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.
[0076] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0077] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0078] In the description of the invention, it should be noted that, unless otherwise clearly specified and limited, the terms "install", "connect", "connect", and "set" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the invention can be understood according to specific circumstances.
[0079] Example 1
[0080] See also Figures 1 to 5 The present invention provides a method for detecting the position of a vehicle at a road checkpoint. The method uses a target detection algorithm based on deep learning to conduct targeted training on the side image of the vehicle to obtain a vehicle side recognition model. The method cooperates with a camera installed on the side of the verification area (generally the left rear camera) to accurately recognize the coordinate position of the vehicle in the picture in real time in the video. The five-tuple representation (left, top, width, height, confidence) is respectively the x-coordinate of the left side of the vehicle rectangular frame in the picture, the y-coordinate of the top side, the width, height and confidence. The training process of the vehicle side recognition model, such as Figure 1 The vehicle side recognition model training flow chart is as follows: first, obtain vehicle side image samples by extracting video frames; manually annotate the samples or use a pre-trained model for automatic pre-annotation; use a deep learning-based target detection algorithm to train the vehicle side detection model; evaluate the model accuracy; repeat the above steps of sampling, annotating, training, and evaluating until a more ideal model is obtained. Solve questions Q1 and Q2.
[0081] The input parameters of the vehicle side recognition model are optimized. The original algorithm model usually uses large-size images such as 416*416 and 608*608 as input, which can have a good detection effect on small targets, but often identifies vehicles in distant lanes that are not in the lane, resulting in a large number of misidentifications. Considering that the vehicles in the verification area are very large targets, the parameters are optimized, and the images are compressed to 144*144~192*192 pixels as input, and the confidence threshold is adjusted to 0.30~0.5, and the NMS threshold is adjusted to 0.35~0.45. This can greatly improve the detection performance (5-10 times), and almost all vehicles in non-lanes can be filtered out, which greatly reduces the misidentification rate, and has little effect on the detection effect of vehicles in the verification area.
[0082] When the vehicle is in place, due to the camera's viewing angle, the vehicle will occupy most of the camera's field of view, which will cause the vehicle to be incomplete in the picture, such as the wheels cannot be seen. At this time, the confidence of the algorithm recognition result will be lower, and there is a small probability of missed detection. To address this problem, the system enables the missed detection compensation algorithm, that is, for the missed detection frames after the vehicle is in place, the linear interpolation algorithm is used for prediction compensation. The algorithm formula is as follows:
[0083] If the previous frame is not missed and is the true value, then F n =(F n-1 -F n-2 )+F n-1
[0084] If the previous frame has been missed and is a predicted value, then F n =F n-1 , this ensures that the error will not be amplified with multiple predictions.
[0085] Where Fn is the five-tuple representation of the vehicle in the nth frame (left, top, width, height, confidence).
[0086] Use machine learning algorithms to train the vehicle position classification model, calculate the vehicle position quintuple (left, top, width, height, confidence), and mark the vehicle's current position as "vehicle entering, vehicle landing, critical position, vehicle leaving, invalid vehicle" and other five status labels. The training process of the position classification model, such as Figure 2The vehicle position classification model training flow chart is as follows: First, a rule model is formulated based on experience to calculate the status label according to the five - tuple representation of the vehicle (left, top, width, height, confidence); the rule model is used to pre - label the vehicle pictures; the calculated status label and the vehicle five - tuple are drawn on the sample pictures; the pre - labeled samples are manually reviewed and labeled; a 5 - layer neural network classification model is used for training, and the network model is as shown in Figure 3 the schematic diagram of the vehicle position classification model network; the accuracy of the model is evaluated; and the above processes of sampling, labeling, training, evaluation, etc. are repeated. Finally, an ideal vehicle position classification model is obtained. Problem Q1 is solved.
[0087] The rule model for vehicle position is:
[0088] Invalid vehicle: bottom < 0.7 (vehicles in other lanes) or left > 0.9 and height < 0.2 or 0.8 < left < 0.9 and height < 0.3 or left < 0.8 and height < 0.4 (distant vehicles, or other mis - identified objects)
[0089] Vehicle entering: left > 0.3 and right > 0.9
[0090] Vehicle leaving: left < 0.05 and width < 0.6
[0091] Vehicle parked: left < 0.3 and right > 0.75 and width > 0.6
[0092] Critical vehicle: a vehicle that does not meet any of the above conditions
[0093] Where bottom = top + height; right = left + width. The above values are all relative ratios of the coordinates in the picture.
[0094] The neural network classification model includes 5 layers: an input layer, a hidden layer, a semi - connected layer, a fully - connected layer, and an output layer, as shown in Figure 3The network diagram of the vehicle position classification model is shown as follows: the input layer is a five-tuple representation of the vehicle (left, top, width, height, confidence) vector; the hidden layer uses 5*M neurons, and the output is activated using the ReLU function; the semi-connected layer uses M*N neurons, and the output is DropOut 50% to prevent overfitting; the fully connected layer uses N*5 neurons and uses softmax cross entropy for classification; the output layer is the classification result, which is a 1*5 vector corresponding to the probability of each position state. When using the model for prediction, the five-tuple parameters of the vehicle are input to calculate the output vector. As long as the position of the maximum value in the output vector is found in the vector, the position state of the vehicle can be obtained. Since the input layer vector space is very small, using such a shallow neural network can achieve good results. M and N are adjusted according to the training situation.
[0095] When the front of a moving vehicle just enters the verification area, the system will recognize it as a vehicle entering. At this time, the verification task can be started immediately and an interactive prompt can be given to shorten the interval between the two verification tasks by 2 to 3 seconds, thereby further improving the passing efficiency. That is, the interval between the two verification tasks can be optimized from the original 7-10 seconds to 5-7 seconds, which solves problem Q6 to a certain extent.
[0096] When a moving vehicle completely enters the verification area and is completely within the camera range, the system can identify it as a vehicle in place, and then proceed to the next verification step described in the original verification method. Solve problem Q3.
[0097] When the vehicle has completed the verification and leaves, it can be recognized by the system as a vehicle leaving. At this time, the system can save the data and reset the verification environment to prepare for the verification of the next vehicle. In addition, in various scenarios, it can accurately detect the departure of the vehicle, which has better fault tolerance than the original method. Solve the problem Q1.
[0098] Through the vehicle position classification model, vehicles that are not in the current lane can be further identified, marked as invalid vehicles, and discarded, so that the system will not make misidentifications.
[0099] If the license plate capture machine misses a license plate due to problems with the capture line or light, then when the system detects that the vehicle has landed and fails to receive the license plate data from the license plate capture machine within a period of time (e.g. 5 seconds), it can actively call the capture machine SDK interface to capture the vehicle. This can effectively reduce missed captures, reduce manual intervention, and improve the automation and stability of the system. Figure 4 The capture machine missed capture compensation process is shown to solve problem Q5.
[0100] This solution can simultaneously support the position recognition and classification of multiple vehicles in the camera image, and intelligently extract up to two valid vehicles, which can be recorded as the front vehicle and the rear vehicle respectively. Since the verification area can only accommodate one vehicle passing through, there are only the following multi-vehicle scenarios in reality: the front vehicle leaves and the rear vehicle enters; the front vehicle settles and the rear vehicle enters; the front vehicle leaves and the rear vehicle settles. If there are more than two vehicles in the video image, the other vehicles must be invalid vehicles in the distance.
[0101] use Figure 5 The vehicle position detection flow chart shows the process: read the video stream; extract frames; use the vehicle side recognition model to accurately identify the vehicle position; use the vehicle position classification model to classify the vehicle position status; perform corresponding subsequent processing according to the vehicle position status, including: when the vehicle enters, start the verification task; when the vehicle leaves, initialize the verification environment; after the vehicle is in place, enter the missed capture compensation process; critical vehicles and invalid vehicles are discarded. In this way, the system completely gets rid of the physical dependence on sensor equipment and can solve problem Q4. And the intelligence and automation levels of the system can be greatly improved.
[0102] Example 2
[0103] See also Figure 6 , taking the implementation of car lanes as an example:
[0104] Step 1: If Figure 6 As shown in the installation and deployment diagram of the car lane, install the front-end equipment:
[0105] The lane range and verification waiting area are planned according to the standard lane width. A vehicle capture camera 3 is installed in front of the lane. A set of boxes are installed on both sides of the lane waiting area. Four face capture cameras 4 are installed in the boxes respectively. According to the relative position with the vehicle, they are the left front, left rear, right front, and right rear cameras. The functions of each device are as follows:
[0106] 1) Vehicle capture camera 3: captures vehicle photos and analyzes license plates. In this method, a capture camera that supports the active capture SDK interface is used.
[0107] 2) 4 face capture cameras 4: synchronously collect videos of the driver and passengers in the vehicle. In this method, the left rear camera is selected as the data source for vehicle position detection.
[0108] 3) Position detection sensor 6: In the original verification method, it is used to determine whether the vehicle has entered the appropriate position in the waiting area; in this method, this device is removed.
[0109] 4) The installation and functions of other equipment are consistent with the original verification method and remain unchanged.
[0110] Step 2: Use a smart industrial box or server with a GPU card to deploy the vehicle position detection system. The vehicle position detection system includes: vehicle side recognition model, vehicle position classification model, and the parameters of each model are as follows:
[0111] 1) Vehicle side recognition model: Since the vehicle will occupy most of the camera's field of view when it is in the verification area, a small-size image of 160*160 is selected as input, the confidence threshold is set to 0.35, and the NMS threshold is set to 0.4, which can effectively reduce the missed detection rate and the false detection rate. In addition, the model can make predictions about 60 times per second under NVIDIA GeForce GTX 1650. The actual frame rate of the video is only 25 frames. The frame extraction ratio of 1 / 5 can be selected, that is, one detection every 0.2 seconds. In this way, a GTX1650 GPU can support the simultaneous detection of about 10 lanes.
[0112] 2) Vehicle location classification model: Since the model input vector has only 5 parameters, the model neurons should not be too many, such as Figure 3 As shown in the network diagram of the vehicle position classification model, M is 128 and N is 256 to achieve a relatively ideal effect. In addition, the input of the model depends on the output of the vehicle side recognition model, and the prediction speed is much faster than that of the vehicle side recognition model, so the detection can be performed synchronously after the prediction of the vehicle side recognition model, that is, once every 0.2 seconds.
[0113] Step 3: Optimize the verification process for mixed human and vehicle verification system applications, such as Figure 5 As shown in the vehicle position detection flow chart, the optimization points include:
[0114] 1) When a vehicle is detected entering: the verification task is directly started and voice prompts begin.
[0115] 2) When the vehicle is detected in place: Figure 4 As shown in the capture machine missed capture compensation flow chart, the capture machine missed capture compensation process is started. If the capture is not taken within 5 seconds after landing, the capture interface is actively called to capture. If the capture is taken, the vehicle information is updated.
[0116] 3) When a vehicle is detected leaving: initialize the verification environment and wait for the next vehicle to enter.
[0117] 4) When an invalid vehicle is detected: discard and do not process.
[0118] 5) When a critical vehicle is detected: A critical vehicle is generally in the middle position between vehicle entry and vehicle landing or vehicle landing and vehicle departure, and no processing is required.
[0119] After the above steps are implemented, the optimized verification process is described as follows: When the vehicle enters the verification area, the system detects the entry of the vehicle and can immediately start the verification task, and start the voice and text prompt "Please drive forward into the inspection area"; the vehicle follows the prompt and continues to move forward until it reaches the appropriate position. At this time, the system detects that the vehicle is in position and starts the voice and text prompt "Please lower the window"; during the positioning process, if the license plate capture machine automatically completes the capture, the vehicle information will be updated. If the capture fails to be completed for some reason, the interface will be called to actively capture the image 5 seconds after the positioning, and then the vehicle information will be updated; after the vehicle completes the inspection and leaves, the system detects that the vehicle has left and can reset the verification environment, such as clearing the data cache, turning on the red traffic light, restoring the relay switch, refreshing the LED display, etc., to facilitate the verification of the next vehicle.
[0120] This solution solves some problems existing in the original verification method:
[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting vehicle position at a road checkpoint, characterized in that: S1. Collect vehicle videos through a camera located on the side of the vehicle; S2. Extract frames from the videos collected in S1 to obtain vehicle side pictures, and perform uniform processing on the pictures; S3. Use the vehicle side recognition model to recognize the vehicle position through the pictures obtained in S2; S4. Use the vehicle position classification model to classify the vehicle position status; Among them, the training method of the vehicle position classification model in S4 is as follows: S41. Calculate the vehicle position quintuple, and label the current vehicle position with 5 status labels: "vehicle entering, vehicle parked, critical position, vehicle leaving, invalid vehicle"; the quintuple represents (left, top, width, height, confidence), which are the x coordinate on the left, the y coordinate on the top, the width, the height, and the confidence of the vehicle rectangle in the picture respectively; S42. Formulate a preliminary rule model based on experience for calculating the status label according to the vehicle quintuple; S43. Use the rule model to pre-label the sampled vehicle pictures; S44. Draw the calculated status label and the vehicle quintuple on the sample pictures; S45. Conduct manual review and annotation on the pre-labeled samples; S46. Use a 5-layer neural network classification model for training; S47. Evaluate the model accuracy; S48. Repeat steps S43 - S47 until an ideal vehicle position classification model is obtained; Among them, the rule model in S42 includes: Invalid vehicle: includes conditions bottom < 0.7; or left > 0.9 and height < 0.2; or 0.8 < left < 0.9 and height < 0.3; or left < 0.8 and height < 0.4; When any one of the above conditions is met, it is determined that the vehicle is invalid; Vehicle entering: When left > 0.3 and right > 0.9, it is determined that the vehicle is entering; Vehicle leaving: When left < 0.05 and width < 0.6, it is determined that the vehicle is leaving; Vehicle parked: When left < 0.3 and right > 0.75 and width > 0.6, it is determined that the vehicle is parked; Critical vehicle: When none of the above conditions are met, it is determined that the vehicle is a critical vehicle; Among them, bottom = top + height; right = left + width, and the above values are all relative proportions of the coordinates in the picture.
2. The method for detecting vehicle position at a road checkpoint according to claim 1, characterized in that: The training method of the vehicle side recognition model in S3 is as follows: S31. Collect vehicle videos through a camera located on the side of the vehicle, S32. Extract frames from the videos collected in S31 to obtain vehicle side picture samples, and perform uniform processing on the pictures; S33. Conduct manual annotation on the picture samples obtained in S32 or use a pre-trained model for automated pre-annotation; S34. Use a deep learning-based object detection algorithm to train the vehicle side recognition model; S35. Evaluate the model accuracy; S36. Repeat steps S31 - S35 until an ideal model is obtained.
3. The method for detecting vehicle position at a road checkpoint according to claim 1, characterized in that: The unified processing of the image in S32 includes compressing the image to 144*144-192*192 pixels as input, adjusting the confidence threshold to 0.30-0.5, and adjusting the NMS threshold to 0.35-0.
45.
4. The method for detecting vehicle position at a road checkpoint according to claim 2, characterized in that: S33, manually annotating the image samples obtained in S32 or using a pre-trained model for automatic pre-annotation, selecting the five-tuple representation (left, top, width, height, confidence) for annotation, and the confidence of the fifth element is 1 by default during manual annotation.
5. The method for detecting vehicle position at a road checkpoint according to claim 3, characterized in that: The vehicle side recognition model also includes a missed detection compensation algorithm, which uses a linear interpolation algorithm for prediction compensation. The algorithm formula is as follows: If the previous frame is not missed and is the true value, then F n =(F n-1 -F n-2 )+F n-1 ; If the previous frame has been missed and is a predicted value, then F n =F n-1 ; Among them, F n It is a five-tuple representation of the vehicle in the nth frame (left, top, width, height, confidence).
6. The method for detecting vehicle position at a road checkpoint according to any one of claims 1 to 5, characterized in that: The neural network classification model in S46 includes 5 layers, namely, input layer, hidden layer, semi-connected layer, fully connected layer and output layer: The input layer is a five-tuple representation of the vehicle (left, top, width, height, confidence) vector; The hidden layer uses 5*M neurons, and the output is activated using the ReLU function; The semi-connected layer uses M*N neurons and DropOut 50% of the output to prevent overfitting; The fully connected layer uses N*5 neurons and uses softmax cross entropy for classification; The output layer is the classification result, which is a 1*5 vector corresponding to the probability of each position state.
7. A road checkpoint vehicle verification method, characterized in that: include, A1. A camera is set at the side of the vehicle corresponding to the checkpoint verification area, and the vehicle position detection method described in claim 1 is used to determine the vehicle position; A2. When the front of a moving vehicle just enters the verification area, it is determined that the vehicle has entered, and the verification task of the road checkpoint's own verification system is initiated; A3. When a moving vehicle completely enters the verification area and is completely within the camera range, it is determined that the vehicle is in position, and the next verification step of the road checkpoint's own verification system is carried out; A4. When a vehicle completes verification and leaves, it is determined that the vehicle has left. At this time, the corresponding verification system saves the data and resets the verification environment to prepare for the verification of the next vehicle.
