Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a missing detection license plate prediction method, which can solve the problems that the license plate number cannot be identified and the license plate is missing;
the invention also provides a processing terminal which can solve the problems that the license plate number cannot be identified and the license plate is missed;
the invention also provides a method for determining the vehicle similarity function, which can solve the problem of determining the vehicle similarity function weight required by license plate number recognition and license plate missing detection.
The technical scheme for realizing one purpose of the invention is as follows: a missing vehicle license plate prediction method comprises the following steps of sequentially performing offline analysis processing and periodic analysis processing:
step 1: performing off-line analysis processing, namely taking the vehicle passing records containing the recognized license plates in a plurality of recent months as a training set A, generating a bayonet directed graph, presetting a limited number of weight combinations which are constants, calculating the corresponding similarity by adopting a vehicle similarity function through training for each weight combination, obtaining an average evaluation score by ranking the similarity according to a descending order evaluation strategy, and selecting the weight combination corresponding to the highest average evaluation score as the optimal weight combination of the vehicle similarity function, thereby determining the vehicle similarity function;
step 2: and periodically analyzing and processing, namely periodically traversing the missed vehicle license plate passing record within a period of time before a plurality of hours according to the period of m, predicting the vehicle license plate through the vehicle similarity function, calculating the similarity of the missed vehicle license plate, periodically executing off-line analysis processing according to the period of n, wherein the similarity with the highest value corresponds to the vehicle license plate in the passing record, the vehicle license plate is the missed vehicle license plate, the off-line analysis result is used for updating the weight in the checkpoint directed graph and the vehicle similarity function, and m and n are constants.
Further, the expression of the vehicle similarity function is formula (i):
in the formula, x is the color of the vehicle body in the vehicle passing record to be compared, y is the type of the vehicle in the vehicle passing record to be compared, z is the brand of the vehicle in the vehicle passing record to be compared, c is the bayonet number in the vehicle passing record to be compared, x, y, z and c are all assigned, and p
xTo identify the accuracy of the body colour, p
yTo identify the accuracy of the vehicle type, p
zTo identify the accuracy of the vehicle brand, p
cThe method comprises the following steps: in the training set A, if the current bayonet is the predecessor bayonet of the target bayonet, p
cThe ratio of the number of records from the current bayonet to the target bayonet to the total number of records entering the target bayonet, if the current bayonet is a successor of the target bayonet, p is
cThe ratio of the number of records from the target card slot to the current card slot to the total number of records from the target card slot,
and
are all a function I
u,vWhen u equals v, I
u,vValue 1, otherwise, I
u,vA value of 0, x
0Recording the value of body color, y, in the target passing
0Value of vehicle type, z, in the target pass record
0For the value of the vehicle brand in the target pass record, θ
1Is the weight of the body color x, θ
2Weight of vehicle type y, θ
3Weight of vehicle brand z, θ
4Is the weight of the bayonet, and θ
1+θ
2+θ
3+θ
4Weight (θ) 1
1,θ
2,θ
3,θ
4) A finite number of weight combinations are formed,
and
are all k
ωExpression of different meanings, k
ωThe confidence rate of the value omega of the vehicle characteristic recorded for the target passing vehicle in all the values of the characteristic is calculated by the formula II:
wherein n isωThe number of vehicle passing records with the value of omega of the vehicle feature in the training set A is shown, and N is the total number of vehicle passing records in the training set A.
Further, the determining the vehicle similarity function includes the following steps performed in sequence:
step 1-1: for each selected weight combination, performing the following steps 1-2 to 1-4 in sequence;
step 1-2: randomly selecting a certain proportion of vehicle passing records in a training set A as a set B, calculating the similarity between each vehicle passing record in the set B and each vehicle passing record of a front drive gate corresponding to a gate where the vehicle passing record is located, simultaneously calculating the similarity between each vehicle passing record and each vehicle passing record of a subsequent gate corresponding to the gate where the vehicle passing record is located, and sorting all the calculated similarities in a descending order to form a sorted list which is recorded as a sorted list U;
step 1-3: for each vehicle passing record in the set B, taking the reciprocal of the position, which is most ranked in the ranked list U, of the corresponding license plate as an evaluation score, calculating all vehicle passing records according to the evaluation score to obtain the evaluation scores of all vehicle passing records in the set B, and calculating the average value of all the evaluation scores, wherein the average value is taken as the evaluation score of the selected weight combination;
step 1-4: and selecting a group of weight combinations with the highest evaluation score as an optimal weight combination, and taking the optimal weight combination as the weight in the vehicle similarity function, thereby determining the vehicle similarity function.
Further, in the step 1-2, forming the ordered list U includes the following steps performed in sequence:
step 1-2-1: for each vehicle passing record S in the set B, acquiring a bayonet number of the passing bayonet and time T of the passing bayonet;
step 1-2-2: all the front drive bayonets and the subsequent bayonets of the current bayonets, and corresponding vehicle passing records and average driving time consumption delta T are obtained according to the bayonet digraph;
step 1-2-3: screening known license plate passing records corresponding to the predecessor bayonet and the successor bayonet and meeting the time range condition from the training set A to serve as a set C, wherein the time range is [ T-2 delta T, T ] for the predecessor bayonet and [ T, T +2 delta T ] for the successor bayonet;
step 1-2-4: calculating the similarity between each vehicle passing record S' in the set C and the vehicle passing record S by using a vehicle similarity function;
step 1-2-5: and (4) carrying out descending sorting on the similarity calculated in the step (1-2-4) according to the similarity value to form a sorted list, and recording the sorted list as a sorted list U.
Further, the weight (θ)1,θ2,θ3,θ4) And forming the finite weight combinations, and increasing the value of each weight in the weight combinations from 0.1 to 1 according to a fixed step length.
Further, the fixed step size is 0.1 or 0.01.
Further, the generating the bayonet directed graph includes the following steps executed in sequence:
step 1-1-1: screening vehicle passing records containing recognized license plates in a plurality of months recently from all the existing vehicle passing records to form a training set A, wherein the vehicle passing records in the training set A at least comprise license plate numbers, bayonet serial numbers, time passing through the bayonets, vehicle body colors, vehicle types and vehicle brands;
step 1-1-2: and for each license plate in the training set A, constructing a directed graph according to the bayonets through which vehicles corresponding to the license plate pass in time sequence, so as to obtain the bayonet directed graph, wherein directed edges in the bayonet directed graph represent that vehicles are driven from the bayonet a to the next bayonet b, the number of vehicle passing records from the bayonet a to the bayonet b and the average driving time delta T are recorded, and the directed edges of the bayonet directed graph all point to other bayonets relative to the current bayonet.
Further, the period m has a value of 30 minutes.
Further, the period n has a value of 30 days.
Further, the previous period of time has a value of 30 minutes.
The second technical scheme for realizing the aim of the invention is as follows: a processing terminal, comprising,
a memory for storing program instructions;
a processor for executing the program instructions to perform the steps of:
step 1: performing off-line analysis processing, namely taking the vehicle passing records containing the recognized license plates in a plurality of recent months as a training set A, generating a bayonet directed graph, presetting a limited number of weight combinations which are constants, calculating the corresponding similarity by adopting a vehicle similarity function through training for each weight combination, obtaining an average evaluation score by ranking the similarity according to a descending order evaluation strategy, and selecting the weight combination corresponding to the highest average evaluation score as the optimal weight combination of the vehicle similarity function, thereby determining the vehicle similarity function;
step 2: and periodically analyzing and processing, namely periodically traversing the missed vehicle license plate passing record within a period of time before a plurality of hours according to the period of m, predicting the vehicle license plate through the vehicle similarity function, calculating the similarity of the missed vehicle license plate, periodically executing off-line analysis processing according to the period of n, wherein the similarity with the highest value corresponds to the vehicle license plate in the passing record, the vehicle license plate is the missed vehicle license plate, the off-line analysis result is used for updating the weight in the checkpoint directed graph and the vehicle similarity function, and m and n are constants.
Further, the expression of the vehicle similarity function is formula (i):
wherein x is the color of the vehicle body in the record of the vehicle to be compared, and y is the color of the vehicle to be comparedThe vehicle types in the vehicle records, z is the vehicle brands in the vehicle records to be compared, c is the bayonet numbers in the vehicle records to be compared, x, y, z and c are assigned with values, and p
xTo identify the accuracy of the body colour, p
yTo identify the accuracy of the vehicle type, p
zTo identify the accuracy of the vehicle brand, p
cThe method comprises the following steps: in the training set A, if the current bayonet is the predecessor bayonet of the target bayonet, p
cThe ratio of the number of records from the current bayonet to the target bayonet to the total number of records entering the target bayonet, if the current bayonet is a successor of the target bayonet, p is
cThe ratio of the number of records from the target card slot to the current card slot to the total number of records from the target card slot,
and
are all a function I
u,vWhen u equals v, I
u,vValue 1, otherwise, I
u,vA value of 0, x
0Recording the value of body color, y, in the target passing
0Value of vehicle type, z, in the target pass record
0For the value of the vehicle brand in the target pass record, θ
1Is the weight of the body color x, θ
2Weight of vehicle type y, θ
3Weight of vehicle brand z, θ
4Is the weight of the bayonet, and θ
1+θ
2+θ
3+θ
4Weight (θ) 1
1,θ
2,θ
3,θ
4) A finite number of weight combinations are formed,
and
are all k
ωExpression of different meanings, k
ωThe confidence rate of the value omega of the vehicle characteristic recorded for the target passing vehicle in all the values of the characteristic is calculated by the formula II:
wherein n isωThe number of vehicle passing records with the value of omega of the vehicle feature in the training set A is shown, and N is the total number of vehicle passing records in the training set A.
Further, the determining the vehicle similarity function includes the following steps performed in sequence:
step 1-1: for each selected weight combination, performing the following steps 1-2 to 1-4 in sequence;
step 1-2: randomly selecting a certain proportion of vehicle passing records in a training set A as a set B, calculating the similarity between each vehicle passing record in the set B and each vehicle passing record of a front drive gate corresponding to a gate where the vehicle passing record is located, simultaneously calculating the similarity between each vehicle passing record and each vehicle passing record of a subsequent gate corresponding to the gate where the vehicle passing record is located, and sorting all the calculated similarities in a descending order to form a sorted list which is recorded as a sorted list U;
step 1-3: for each vehicle passing record in the set B, taking the reciprocal of the position, which is most ranked in the ranked list U, of the corresponding license plate as an evaluation score, calculating all vehicle passing records according to the evaluation score to obtain the evaluation scores of all vehicle passing records in the set A, and calculating the average value of all the evaluation scores, wherein the average value is taken as the evaluation score of the selected weight combination;
step 1-4: and selecting a group of weight combinations with the highest evaluation score as an optimal weight combination, and taking the optimal weight combination as the weight in the vehicle similarity function, thereby determining the vehicle similarity function.
Further, in the step 1-2, forming the ordered list U includes the following steps performed in sequence:
step 1-2-1: for each vehicle passing record S in the set B, acquiring a bayonet number of the passing bayonet and time T of the passing bayonet;
step 1-2-2: all the front drive bayonets and the subsequent bayonets of the current bayonets, and corresponding vehicle passing records and average driving time consumption delta T are obtained according to the bayonet digraph;
step 1-2-3: screening known license plate passing records corresponding to the predecessor bayonet and the successor bayonet and meeting the time range condition from the training set A to serve as a set C, wherein the time range is [ T-2 delta T, T ] for the predecessor bayonet and [ T, T +2 delta T ] for the successor bayonet;
step 1-2-4: calculating the similarity between each vehicle passing record S' in the set C and the vehicle passing record S by using a vehicle similarity function;
step 1-2-5: and (4) carrying out descending sorting on the similarity calculated in the step (1-2-4) according to the similarity value to form a sorted list, and recording the sorted list as a sorted list U.
Further, the weight (θ)1,θ2,θ3,θ4) And forming the finite weight combinations, and increasing the value of each weight in the weight combinations from 0.1 to 1 according to a fixed step length.
Further, the fixed step size is 0.1 or 0.01.
Further, the generating the bayonet directed graph includes the following steps executed in sequence:
step 1-1-1: screening vehicle passing records containing recognized license plates in a plurality of months recently from all the existing vehicle passing records to form a training set A, wherein the vehicle passing records in the training set A at least comprise license plate numbers, bayonet serial numbers, time passing through the bayonets, vehicle body colors, vehicle types and vehicle brands;
step 1-1-2: and for each license plate in the training set A, constructing a directed graph according to the bayonets through which vehicles corresponding to the license plate pass in time sequence, so as to obtain the bayonet directed graph, wherein directed edges in the bayonet directed graph represent that vehicles are driven from the bayonet a to the next bayonet b, the number of vehicle passing records from the bayonet a to the bayonet b and the average driving time delta T are recorded, and the directed edges of the bayonet directed graph all point to other bayonets relative to the current bayonet.
Further, the period m has a value of 30 minutes.
Further, the period n has a value of 30 days.
Further, the previous period of time has a value of 30 minutes.
The technical scheme for realizing the third aim of the invention is as follows: a method of determining a vehicle similarity function: the method comprises the following steps:
step 1: obtaining the passing records of the last months containing the identified license plates
Step 2: taking the passing records containing the recognized license plates in the last months as a training set A, and generating a bayonet directed graph;
and step 3: presetting a limited number of weight combinations which are constants, and calculating the corresponding similarity of each weight combination by adopting a vehicle similarity function through training;
and 4, step 4: and (3) sorting the similarity calculated in the step (3) according to a descending order evaluation strategy to obtain average evaluation scores, and selecting a weight combination corresponding to the highest average evaluation score as an optimal weight combination of the vehicle similarity function so as to determine the vehicle similarity function.
Further, the expression of the vehicle similarity function is formula (i):
in the formula, x is the color of the vehicle body in the vehicle passing record to be compared, y is the type of the vehicle in the vehicle passing record to be compared, z is the brand of the vehicle in the vehicle passing record to be compared, c is the bayonet number in the vehicle passing record to be compared, x, y, z and c are all assigned, and p
xTo identify the accuracy of the body colour, p
yTo identify the accuracy of the vehicle type, p
zTo identify the accuracy of the vehicle brand, p
cThe method comprises the following steps: in the training set A, if the current bayonet is the predecessor bayonet of the target bayonet, p
cThe ratio of the number of records from the current bayonet to the target bayonet to the total number of records entering the target bayonet, if the current bayonet is a successor of the target bayonet, p is
cThe ratio of the number of records from the target card slot to the current card slot to the total number of records from the target card slot,
and
are all a function I
u,vWhen u equals v, I
u,vValue 1, otherwise, I
u,vA value of 0, x
0Recording the value of body color, y, in the target passing
0Value of vehicle type, z, in the target pass record
0For the value of the vehicle brand in the target pass record, θ
1Is the weight of the body color x, θ
2Weight of vehicle type y, θ
3Weight of vehicle brand z, θ
4Is the weight of the bayonet, and θ
1+θ
2+θ
3+θ
4Weight (θ) 1
1,θ
2,θ
3,θ
4) A finite number of weight combinations are formed,
and
are all k
ωExpression of different meanings, k
ωThe confidence rate of the value omega of the vehicle characteristic recorded for the target passing vehicle in all the values of the characteristic is calculated by the formula II:
wherein n isωThe number of vehicle passing records with the value of omega of the vehicle feature in the training set A is shown, and N is the total number of vehicle passing records in the training set A.
Further, the determining the vehicle similarity function includes the following steps performed in sequence:
step 1-1: for each selected weight combination, performing the following steps 1-2 to 1-4 in sequence;
step 1-2: randomly selecting a certain proportion of vehicle passing records in a training set A as a set B, calculating the similarity between each vehicle passing record in the set B and each vehicle passing record of a front drive gate corresponding to a gate where the vehicle passing record is located, simultaneously calculating the similarity between each vehicle passing record and each vehicle passing record of a subsequent gate corresponding to the gate where the vehicle passing record is located, and sorting all the calculated similarities in a descending order to form a sorted list which is recorded as a sorted list U;
step 1-3: for each vehicle passing record in the set B, taking the reciprocal of the position, which is most ranked in the ranked list U, of the corresponding license plate as an evaluation score, calculating all vehicle passing records according to the evaluation score to obtain the evaluation scores of all vehicle passing records in the set B, and calculating the average value of all the evaluation scores, wherein the average value is taken as the evaluation score of the selected weight combination;
step 1-4: and selecting a group of weight combinations with the highest evaluation score as an optimal weight combination, and taking the optimal weight combination as the weight in the vehicle similarity function, thereby determining the vehicle similarity function.
Further, in the step 1-2, forming the ordered list U includes the following steps performed in sequence:
step 1-2-1: for each vehicle passing record S in the set B, acquiring a bayonet number of the passing bayonet and time T of the passing bayonet;
step 1-2-2: all the front drive bayonets and the subsequent bayonets of the current bayonets, and corresponding vehicle passing records and average driving time consumption delta T are obtained according to the bayonet digraph;
step 1-2-3: screening known license plate passing records corresponding to the predecessor bayonet and the successor bayonet and meeting the time range condition from the training set A to serve as a set C, wherein the time range is [ T-2 delta T, T ] for the predecessor bayonet and [ T, T +2 delta T ] for the successor bayonet;
step 1-2-4: calculating the similarity between each vehicle passing record S' in the set C and the vehicle passing record S by using a vehicle similarity function;
step 1-2-5: and (4) carrying out descending sorting on the similarity calculated in the step (1-2-4) according to the similarity value to form a sorted list, and recording the sorted list as a sorted list U.
Further onWeight (θ)1,θ2,θ3,θ4) And forming the finite weight combinations, and increasing the value of each weight in the weight combinations from 0.1 to 1 according to a fixed step length.
Further, the fixed step size is 0.1 or 0.01.
Further, the generating the bayonet directed graph includes the following steps executed in sequence:
step 1-1-1: screening vehicle passing records containing recognized license plates in a plurality of months recently from all the existing vehicle passing records to form a training set A, wherein the vehicle passing records in the training set A at least comprise license plate numbers, bayonet serial numbers, time passing through the bayonets, vehicle body colors, vehicle types and vehicle brands;
step 1-1-2: and for each license plate in the training set A, constructing a directed graph according to the bayonets through which vehicles corresponding to the license plate pass in time sequence, so as to obtain the bayonet directed graph, wherein directed edges in the bayonet directed graph represent that vehicles are driven from the bayonet a to the next bayonet b, the number of vehicle passing records from the bayonet a to the bayonet b and the average driving time delta T are recorded, and the directed edges of the bayonet directed graph all point to other bayonets relative to the current bayonet.
The invention has the beneficial effects that: on the basis of being capable of identifying the license plate and avoiding missing the license plate, the invention also has the following advantages:
1) convenient to realize, small in calculation amount and high in prediction efficiency
The method mainly consumes time as an offline analysis processing part, the offline analysis processing part only trains aiming at limited weight combinations, parallel analysis is easy to realize, the analysis interval period is long, the system bottleneck cannot be formed, and when the offline analysis processing is finished, a vehicle similarity function is also determined and a bayonet digraph is formed; and for the periodic processing part of the latest missed license plate record, the similarity is calculated only by aiming at the data in the short time range in the front drive checkpoint and the subsequent checkpoint, and the license plate with the highest similarity is used as a predicted value, so that the calculated amount is small, and the prediction efficiency is high.
2) Can adapt to the change of road network and image recognition algorithm
Because the track of the vehicle passing through the gate is very sensitive to the change of the road network, when the road network changes, vehicles may not pass through certain gates any more, and the method of the invention can periodically update the directed graph of the gate to adapt to the change of the road network to a certain extent; in addition, as the number of manufacturers of the image recognition algorithm is large, the recognition capability of the image recognition algorithm of each manufacturer for different vehicle characteristics is different, the algorithm of each manufacturer is continuously improved, and the recognition accuracy of the same algorithm for the vehicle characteristics is continuously changed.
Detailed Description
The invention will be further described with reference to the accompanying drawings and the detailed description below:
as shown in fig. 1 and 2, a missing vehicle license plate prediction method includes sequentially performing offline analysis processing and periodic analysis processing:
step 1: offline analysis processing, namely taking the vehicle passing records containing the recognized license plates in the last months as a training set A, generating a bayonet directed graph, selecting a limited number of preset weight combinations which are all constants, calculating the corresponding similarity of a preselected vehicle similarity function through training for each weight combination, sorting all the similarities into a list according to a descending order, wherein each similarity corresponds to one vehicle passing record containing the license plate, taking the reciprocal of the position in the sorted list as an evaluation score, carrying out averaging operation on all the evaluation scores to obtain an average evaluation score, and selecting the weight combination corresponding to the highest average evaluation score as the weight combination of the preselected vehicle similarity function so as to determine the vehicle similarity function;
step 2: and periodically analyzing and processing, namely periodically traversing the missed vehicle license plate passing record within a period of time several hours before, predicting the vehicle license plate through the vehicle similarity function, calculating the similarity of the missed vehicle license plate, wherein the similarity with the highest value corresponds to the vehicle license plate in the passing record as the missed vehicle license plate, periodically executing off-line analysis processing, and using the off-line analysis result to update the weights in the checkpoint directed graph and the vehicle similarity function.
More specifically, the offline analysis processing includes the following steps performed in sequence:
step 1-1: taking the vehicle passing records containing the recognized license plates in the latest months as a training set A, selecting the vehicle passing records in the latest month or two months or other months, and generating a bayonet directed graph through the training set A;
step 1-2: defining a vehicle similarity function simθ(x, y, z, c) selecting a finite number of weight combinations for the weight parameters, the vehicle similarity function simθThe expression of (x, y, z, c) is formula (1):
wherein x is the color of the vehicle body in the vehicle passing record to be compared, y is the type of the vehicle in the vehicle passing record to be compared, z is the brand of the vehicle in the vehicle passing record to be compared, c is the bayonet number in the vehicle passing record to be compared, x, y, z and c are all assigned, and pxTo identify the accuracy of the body colour, pyTo identify the accuracy of the vehicle type, pzTo identify the accuracy of the vehicle brand, pcThe method comprises the following steps: in the training set A, if the current bayonet is the predecessor bayonet of the target bayonet, pcThe ratio of the number of records from the current bayonet to the target bayonet to the total number of records entering the target bayonet, if the current bayonet is a successor of the target bayonet, p iscThe comparison result is that the ratio of the number of records from the target gate to the current gate to the total number of records leaving the target gate, the target gate is the gate containing the passing record of the missed-detection license plate, the current gate is the gate to which the passing record is to be compared, and the next gate of the front-drive gate is used as the next gateThere may be a plurality of vehicles which leave from the front driving bayonet and are dispersed to each subsequent bayonet, namely, a part of vehicles enters the bayonet G, when the traffic flow entering the bayonet G is larger, namely p iscThe larger the value is, the larger the probability that the target license plate to be predicted appears at the gate G is, and similarly, because a plurality of subsequent gates of the target gate are possible, the vehicles leaving from the target gate can be dispersed into each subsequent gate, and when the traffic flow of the target gate to the gate G is larger, namely p iscThe larger the value is, the larger the probability that the target license plate to be predicted appears at the gate G is considered to be, where the front gate refers to the last gate relative to the current gate, and the subsequent gate refers to the next gate relative to the current gate, but it should be noted that there may be a plurality of last gates relative to the current gate, and there may also be a plurality of next gates relative to the current gate;
and
are all a function I
u,vWhen u equals v, I
u,vValue 1, otherwise, I
u,vA value of 0, x
0The value of the color of the vehicle body in the target vehicle passing record is the vehicle passing record of which the license plate is not identified in the acquired vehicle passing record, y
0Value of vehicle type, z, in the target pass record
0For values of vehicle brand in the target pass record, e.g. value x of body colour when the target pass record
0Equal to the value x of the body colour in the pass record to be compared, i.e. x
0When x is equal, the color of the vehicle body of the vehicle to be predicted is the same as the color of the vehicle body in the vehicle record to be compared,
otherwise
And
is taken from
Similarly, θ
1Weight of body color x feature, θ
2Weight, θ, characteristic of vehicle type y
3Weight of the brand z feature of the vehicle, θ
4Is the weight of the bayonet number feature,
and
are all k
ωExpression of different meanings, k
ωThe value of the vehicle feature recorded for the target passing vehicle is a confidence rate of ω among all values of the vehicle feature, the confidence rate indicates the confidence level of the corresponding vehicle feature value, and the lower the confidence rate, the lower the confidence level, the more vehicles having the same vehicle feature, the lower the confidence level, the calculation formula (2):
wherein n is
ωFor the number of records with a value of ω for the vehicle feature in the training set A and N for the total number of records in the training set A, e.g. during calculation
Then, the value of the color feature of the car body in the training set A is obtained as x
0Number of records
And acquiring the total record number of the training set A as N, and calculating the value of the color characteristic of the vehicle body as x according to the formula (2)
0Corresponding confidence rate
The larger the confidence corresponding to the color of the vehicle body, the higher the others
And
the same is true for the calculations;
the sum of the four weights being 1, i.e. θ1+θ2+θ3+θ4Weight (θ) 11,θ2,θ3,θ4) Forming the limited weight combinations, wherein the weight combinations are preset constants which are determined as follows: each weight value in the weight combination is increased from 0.1 to 1 according to a fixed step length, if the step length is 0.1, the value of each weight has 10 possibilities, and the theta is satisfied1+θ2+θ3+θ4On the premise of 1, θ1、θ2、θ3And theta4The weight combination composed of four weights is 84 combinations in total, and if the step size is changed to 0.001, θ satisfies the same conditions as described above1、θ2、θ3And theta4The weight combinations of the four weights are 156849 combinations, that is, a finite number of weight combinations, it can be seen that the number of weight combinations is related to the value of the step size, and the finite number of weight combinations selected in step 1 is from θ1、θ2、θ3And theta4Selecting from the combination formed by the four weights to obtain an optimal weight combination;
step 1-3: for each selected weight combination, performing the following steps 1-4 and 1-5 in sequence;
step 1-4: randomly selecting a certain proportion of vehicle passing records in the training set A as a set B, preferably, the proportion is one thousandth in the embodiment, calculating the similarity between each vehicle passing record in the set B and each vehicle passing record of a front drive gate corresponding to a gate where the vehicle passing record is located, simultaneously calculating the similarity between each vehicle passing record and each vehicle passing record of a subsequent gate corresponding to the gate where the vehicle passing record is located, and sorting all the calculated similarities in a descending order to form a list;
step 1-5: for each vehicle passing record in the set B, taking the reciprocal of the position of the corresponding license plate in the sorted list as an evaluation score, calculating all vehicle passing records according to the evaluation score to obtain the evaluation scores of all vehicle passing records in the set B, calculating the average value of all the evaluation scores, and taking the average value as the evaluation score of the selected weight combination;
step 1-6: and selecting a group of weight combinations with the highest evaluation score as an optimal weight combination, and taking the optimal weight combination as the weight in the vehicle similarity function, thereby determining the vehicle similarity function.
The step 1-1 specifically includes the following steps that are sequentially executed:
step 1-1-1: screening vehicle-passing records containing license plates in the vehicle-passing records of a plurality of months in the past from all the existing vehicle-passing records, such as screening vehicle-passing records of one month or two months or other months in the past, if some vehicles in the vehicle-passing records do not identify the license plates, rejecting the vehicle-passing records to form a training set A, wherein the screened vehicle-passing records at least comprise structural information such as license plate numbers, bayonet numbers, time passing through the bayonet, vehicle body colors, vehicle types, vehicle brands and the like, and the specific structural information can be increased or decreased in actual use, such as increasing the year money, the vehicle sub-brands and the like;
step 1-1-2: for each license plate in the training set A, constructing a directed graph according to bayonets through which vehicles corresponding to the license plate pass in sequence, so as to obtain a bayonet directed graph, wherein a bayonet is a universal finger snapshot camera in the patent, the bayonet directed graph refers to that if a vehicle with a certain license plate is captured and tapped by the bayonet A at a certain moment and is captured and tapped by the bayonet B at the next moment, A- > B is one directed edge of the directed graph, a graph formed by directed edges among all the bayonets is called a bayonet directed graph, namely, the bayonet passed by a driving track of the vehicle corresponding to each license plate forms the bayonet directed graph, but the bayonet directed graph does not include directed edges directed to the bayonet directed graph, namely, the directed edges of the bayonet directed graph all point to other bayonets relative to the current bayonet;
step 1-1-3: the directed edge in the gate directed graph indicates that the number of passing records and the average travel time information from a to b are recorded from the gate a to the next gate b.
The steps 1 to 4 specifically include the following steps that are sequentially executed:
step 1-4-1: randomly selecting limited vehicle passing records from the training set A as a set B, preferably selecting one thousandth of the vehicle passing records of the training set A as the set B in the embodiment, and acquiring the gate number of each vehicle passing through the gate and the time T of the vehicle passing through the gate for each vehicle passing record S in the set B;
step 1-4-2: obtaining all front drive bayonets and subsequent bayonets of the current bayonets and corresponding vehicle passing records and average driving time consumption delta T according to the bayonet digraph, wherein the average driving time consumption delta T refers to the average driving time consumption of the current bayonets and the front drive bayonets or the average driving time consumption of the current bayonets and the subsequent bayonets;
step 1-4-3: screening known license plate vehicle passing records corresponding to a precursor bayonet and a subsequent bayonet and meeting the condition of a time range from the training set A to serve as a set C, wherein the time range is [ T-2 Delta T, T ] for the precursor bayonet, and [ T, T +2 Delta T ] for the subsequent bayonet, and setting 2 Delta T is based on research finding that a target vehicle can pass through a certain precursor bayonet or a subsequent bayonet with high probability within the time;
1-4-4: for each record S 'in the set C, calculating the similarity of each record S' and the vehicle passing record S by using a vehicle similarity function;
1-4-5: and (4) performing descending sorting on the similarity calculated in the steps 1-4-4 according to the similarity value to form a list, and marking the list as a sorted list U, wherein the position of the target license plate in the sorted list U is closer to the front, and the prediction effect is better.
The steps 1 to 5 specifically include the following steps that are sequentially executed:
step 1-5-1: taking the reciprocal of the position, closest to the front, of the license plate in each vehicle passing record S 'in the set C in the sorted list U as an evaluation score for predicting the license plate in the record S', wherein any one evaluation score corresponds to one record in the set C and also corresponds to one record in the set B;
step 1-5-2: and calculating the average value of the evaluation scores corresponding to all records in the set B, wherein the average value is used as the evaluation score of the selected weight combination.
More specifically, the periodic analysis process includes the following steps performed in sequence:
step 2-1: the method comprises the steps of periodically traversing vehicle passing records in a period of time several hours before, screening vehicle passing records containing missed vehicle license plates, predicting the vehicle license plates by using a vehicle similarity function, calculating the similarity of the missed vehicle license plates, wherein the vehicle license plate in the corresponding vehicle passing record with the highest similarity is a predicted vehicle license plate, namely the vehicle license plate is the missed vehicle license plate, so that the vehicle license plate number is recognized, and the missed vehicle license plate is avoided;
step 2-2: all steps of the off-line analysis processing are executed periodically, and the weight parameters in the bayonet directed graph and the vehicle similarity function are updated, in the embodiment, the period is preferably 30 days, the length of the period can be flexibly selected according to the actual situation, the purpose of the periodic updating is to adapt to the situation of road change, and the change of the pattern recognition algorithm to the accuracy of each feature recognition is adapted.
Therefore, the missing detection license plate prediction method provided by the invention has the following advantages:
1) convenient to realize, small in calculation amount and high in prediction efficiency
The method mainly consumes time as an offline analysis processing part, the offline analysis processing part only trains aiming at limited weight combinations, parallel analysis is easy to realize, the analysis interval period is long, the system bottleneck cannot be formed, and when the offline analysis processing is finished, a vehicle similarity function is also determined and a bayonet digraph is formed; and for the periodic processing part of the latest missed license plate record, the similarity is calculated only by aiming at the data in the short time range in the front drive checkpoint and the subsequent checkpoint, and the license plate with the highest similarity is used as a predicted value, so that the calculated amount is small, and the prediction efficiency is high.
2) The method and the idea of the invention have wide application range, are not limited and can predict the missing detection of the license plate
The method provided by the invention has the main ideas that: if vehicles appearing at the current time point also appear at nearby gates in the recent historical time period and the future time period, missing license plates at the current time point are predicted by comparing the vehicles appearing at the nearby gates. The method and the idea can be popularized and applied to other similar scenes, such as vehicle track prejudgment, WIFI perception track prediction and the like.
3) Can adapt to the change of road network and image recognition algorithm
Because the track of the vehicle passing through the gate is very sensitive to the change of the road network, when the road network changes, vehicles may not pass through certain gates any more, and the method of the invention can periodically update the directed graph of the gate to adapt to the change of the road network to a certain extent; in addition, as the number of manufacturers of the image recognition algorithm is large, the recognition capability of the image recognition algorithm of each manufacturer for different vehicle characteristics is different, the algorithm of each manufacturer is continuously improved, and the recognition accuracy of the same algorithm for the vehicle characteristics is continuously changed.
Therefore, the method can be effectively applied to vehicle identification systems of departments such as public security traffic police and the like for predicting the missing detection license plate, and can also effectively improve the accuracy of service scenes such as vehicle track research and judgment and the like based on the vehicle identification system.
As shown in fig. 3, the present invention also relates to a processing terminal 100 of a physical device implementing the above method, which comprises,
a memory 101 for storing program instructions;
the processor 102 is configured to run the program instructions to execute the steps of the missing-detected license plate prediction method, and the specific steps are the same as those of the missing-detected license plate prediction method described above, and are not described herein again.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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 flow or flows and/or block diagram block or blocks.
These computer program instructions may 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 instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may 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 flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.