A license plate recognition data quality online diagnosis method based on bayesian hypothesis testing
Patent Information
- Application Number
- CN202611198641.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-08
- Publication Date
- 2026-11-03
AI Technical Summary
现有技术在车牌识别数据监控方法无法自动区分异常异常检测异常检测异常,现有技术无法有效解决车牌匹配数据质量监控中设备级、边级和全局级异常的准确区分,依赖人工设定阈值,缺乏路网空间结构利用,诊断结果可解释性不足。
A Bayesian hypothesis testing-based approach is adopted. By analyzing the road network topology and the configuration of detection equipment, a dynamic matching network is constructed, various anomaly hypotheses are defined, and the posterior probability is calculated using Bayes' theorem to generate device-level and edge-level anomaly rankings, supporting online rolling detection.
It enables adaptive data quality monitoring for different road sections and time periods, reduces false alarms and missed alarms, accurately distinguishes equipment faults and matches service anomalies, has clear physical meaning, is easy for operation and maintenance personnel to understand, and supports online detection.
Smart Images

Figure CN123031121A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and specifically to an online diagnostic method for license plate recognition data quality based on Bayesian hypothesis testing. Background Technology
[0002] License plate recognition systems collect vehicle traffic records through roadside detection equipment and establish vehicle travel path relationships by matching license plates between upstream and downstream devices. The quality of the matching data directly affects the reliability of downstream applications such as traffic state estimation, signal optimization, and route analysis.
[0003] Currently, the quality monitoring of license plate matching data mainly relies on the following methods: (1) Fixed threshold-based method. This method sets empirical thresholds for indicators such as matching rate and number of records. When an indicator is below the threshold, it is judged as abnormal. This method is simple to implement and has low computational overhead, but it relies on manually set empirical thresholds. The data characteristics of different road sections and different time periods are significantly different. A uniform threshold is prone to false alarms or false negatives, and it cannot distinguish different types of abnormal sources such as equipment acquisition failure, matching service abnormality, and database write failure.
[0004] (2) Statistical process control-based method. This method uses statistical means such as control charts and moving averages to monitor the temporal drift of a single indicator. This method can capture the gradual drift of the indicator, but it only focuses on the temporal changes of a single indicator and lacks the utilization of the spatial topology of the road network, making it difficult to distinguish between local equipment failures and system-level failures that affect the whole system.
[0005] (3) Anomaly detection methods based on deep learning. This method uses models such as graph neural networks or autoencoders to learn normal patterns from historical data and identifies anomalies by reconstruction error or deviation scoring. This type of method has strong feature representation ability and nonlinear fitting ability, but it belongs to a black box model. The anomaly judgment results are difficult to interpret as specific physical causes, which is not conducive to the rapid location of faults by operation and maintenance personnel.
[0006] In summary, existing technologies generally suffer from the following shortcomings when dealing with license plate matching data quality issues: they cannot accurately distinguish between device-level, edge-level, and global-level anomalies; they rely on manually set empirical thresholds; they lack full utilization of the road network spatial structure; and the interpretability of diagnostic results is insufficient. Summary of the Invention
[0007] This invention provides an online diagnostic method for license plate recognition data quality based on Bayesian hypothesis testing, aiming to solve the technical problems of existing license plate matching data quality monitoring methods that cannot automatically distinguish the specific source of anomalies, rely on manually set detection thresholds, and have insufficient interpretability of diagnostic results.
[0008] To achieve the above objectives, this invention provides an online diagnostic method for license plate recognition data quality based on Bayesian hypothesis testing, comprising the following steps: S1, analyze the road network topology and detection equipment configuration, and establish the mapping relationship between each license plate recognition device and road network nodes and road segments; S2 uses a fixed time window as a unit to extract the number of vehicle records of each device in each time window from the vehicle matching database as a node observation, and the number of vehicle matching between each upstream and downstream device pair as an edge observation. A dynamic matching network is constructed with devices as nodes and the matching relationship between devices as directed edges. S3 uses the number of vehicle records and vehicle matching in the same historical time period to estimate the baseline parameters of the count distribution of each device and each directed edge in each time slot; S4. For each test time window, define the normal hypothesis and multiple abnormal hypotheses. The abnormal hypotheses include global abnormal hypotheses and local abnormal hypotheses. The global abnormal hypotheses include a first global abnormal hypothesis and a second global abnormal hypothesis. The first global abnormal hypothesis is that only the expected number of matches for all directed edges decays while the expected number of records for all devices remains unchanged. The second global abnormal hypothesis is that the expected number of records for all devices and the expected number of matches for all directed edges decay simultaneously. The local abnormal hypotheses include a first local abnormal hypothesis and a second local abnormal hypothesis. The first local abnormal hypothesis is that only the expected number of records for a single device and the expected number of matches for all directed edges associated with that device decay while the expected number of records for the remaining devices and directed edges remain unchanged. The second local abnormal hypothesis is that only the expected number of matches for a single directed edge decays while the expected number of records for all devices and the remaining directed edges remain unchanged. Calculate the joint likelihood of the node observations and the edge observations under each hypothesis, and marginalize the decay coefficients in each abnormal hypothesis to obtain the marginal likelihood of each hypothesis. S5. Based on the prior probability of each hypothesis and the marginal likelihood, calculate the posterior probability of each hypothesis using Bayes' theorem, and select the hypothesis with the largest posterior probability as the anomaly diagnosis result for the current time window. S6 summarizes the posterior probabilities of all test time windows, counts the number of windows whose posterior probabilities of anomalies exceed the preset threshold by device and by directed edge respectively, and generates device-level anomaly ranking and edge-level anomaly ranking.
[0009] In some embodiments, step S1 includes: mapping each license plate recognition device to the road network segments and lanes it covers, and obtaining the correspondence between device number, lane number, road segment number, start node and end node; for each pair of upstream and downstream devices, labeling their spatial relationship type according to the road network topology, wherein the spatial relationship type includes adjacent nodes, same road segment and indirect connection.
[0010] In some embodiments, in step S2, the continuous time is divided into discrete time windows of fixed length; for each time window, the number of vehicle records for each device is counted. As a nodal observation, the number of vehicle matches between each upstream and downstream device pair is counted. As an edge observation measurement, a dynamic matching network sequence with time window intervals is constructed, with devices as nodes and the matching relationships between devices as directed edges.
[0011] In some embodiments, in step S3, the counting distribution is a negative binomial distribution, and the nodal observations are... Follow the mean The dispersion parameter is The negative binomial distribution, lateral observations Follow the mean The dispersion parameter is The negative binomial distribution is used; the moment estimation method is employed to estimate the mean and the dispersion parameter using observations from multiple working days during the same historical period.
[0012] In some embodiments, in step S4: Normal assumption Assuming all devices and directed edges are in normal working order, and node observations are... Follow the mean The negative binomial distribution, lateral observations Follow the mean The negative binomial distribution; First global anomaly hypothesis Let: The expected number of matchings for all directed edges is given by Attenuation to The number of records across all devices is expected to remain constant. constant; Second global anomaly hypothesis For: The expected number of records for all devices is determined by Attenuation to And the expected number of matchings for all directed edges is determined by... Attenuation to ; First Local Anomaly Hypothesis For: target device only The expected number of records is determined by Attenuation to The expected number of matchings for all directed edges with this device as upstream or downstream is determined by... Attenuation to The expected number of records for the remaining devices and the expected number of matches for the remaining directed edges remain unchanged; Second Local Anomaly Hypothesis For: Only the target directed edge The expected number of matches is determined by Attenuation to The expected number of records for all devices and the expected number of matches for the remaining directed edges remain unchanged; in, This is the attenuation coefficient for the severity of the anomaly. .
[0013] In some embodiments, in step S4, the method for marginalizing the attenuation coefficients in each anomalous hypothesis is as follows: for each anomalous hypothesis k=1,2,3,4, in a discrete grid Calculate each given α separately m Log-likelihood for the value Assuming that α follows a uniform prior distribution at each grid point, according to Calculate the marginal likelihood of the anomalous hypothesis; normal hypothesis. The marginal likelihood is the log-likelihood when α=1.
[0014] In some embodiments, in step S4: Normal assumption The log-likelihood is the sum of the log probability mass of all node observations and the log probability mass of all edge observations; First global anomaly hypothesis The log-likelihood of the observations of all nodes is the log-probability mass of all directed edges, which decays to the expected parameter of . The sum of the logarithmic probability masses under given conditions; Second global anomaly hypothesis The log-likelihood of all nodal observations at the desired parameter decays to... The logarithmic probability mass under given conditions, and the decay of all directed edges with the expected parameter are... The sum of the logarithmic probability masses under given conditions; First Local Anomaly Hypothesis The log-likelihood of the target device The nodal observations decay to the desired parameter. The log probability quality under the given conditions, the log probability quality of all other node observations, and the expected parameter decay of all directed edges associated with the target device are given as follows: The log probability mass of the given condition is the sum of the log probability masses of all other directed edges; Second Local Anomaly Hypothesis The log-likelihood of the observations at all nodes is the log-probability mass, and the directed edge to the target decays to the expected parameter. The logarithmic probability mass of the given condition is the sum of the logarithmic probability masses of all other directed edges.
[0015] In some embodiments, in step S5, the prior probability of the normal hypothesis is higher than the prior probability of each anomalous hypothesis; the prior probability of the global anomalous hypothesis is lower than the prior probability of the normal hypothesis; the total prior probability of the first local anomalous hypothesis is evenly distributed among the candidate devices, and the total prior probability of the second local anomalous hypothesis is evenly distributed among the candidate directed edges; the non-normalized logarithmic posterior score of each hypothesis is calculated in the logarithmic space. ,pass Normalization yields the posterior probabilities of each hypothesis.
[0016] In some embodiments, in step S5, each first local anomaly hypothesis is... The total probability of equipment failure is obtained by summing the posterior probabilities. ; Each second local anomaly hypothesis Summing the posterior probabilities yields the total probability of directed edge anomalies. .
[0017] In some embodiments, step S6 includes: counting the number of windows in which the total probability of device anomalies for each device exceeds a first preset threshold and a second preset threshold across all test time windows, and generating a device-level anomaly ranking table; counting the number of windows in which the total probability of directed edge anomalies for each directed edge exceeds the first preset threshold and the second preset threshold across all test time windows, and generating an edge-level anomaly ranking table; and associating and outputting the device-level anomaly ranking table and the edge-level anomaly ranking table with road network topology annotation information.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: Compared with existing data quality detection methods based on fixed thresholds, this invention does not require manual setting of anomaly thresholds. The diagnostic criteria are derived from the posterior probability comparison of the Bayesian probability model, which can adapt to the traffic flow characteristics of different road segments and time periods, reducing false alarms and false negatives. Compared with existing single-indicator monitoring methods, this invention can distinguish four different sources—equipment failure, matching service anomaly, database write anomaly, and local path anomaly—by modeling five types of competing hypotheses. Furthermore, the distinction between global matching anomaly and global write anomaly depends on different observation modes—the former only affects the number of matches, while the latter affects both the number of records and the number of matches, and has a clear physical meaning. Compared with existing statistical process control-based methods, this invention utilizes the comparison mechanism of evidence from Bayesian models, which naturally possesses the Occam's razor effect: when a small number of objects are anomalous, the evidence for a single device or unilateral hypothesis is stronger; when a large number of objects are anomalous simultaneously, the evidence for a global hypothesis is stronger, and local anomalies and global anomalies can be automatically distinguished without additional rules. Compared with deep learning-based anomaly detection methods, each hypothesis in this invention has a clear physical meaning, and the posterior probability can be directly interpreted as the probability of an anomaly source, which is convenient for operation and maintenance personnel to understand and respond to, and there is no interpretability problem of black box models. This invention supports online rolling detection, and only one forward calculation is needed to obtain the diagnostic result for each time window. It has high computational efficiency and is suitable for practical deployment. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the overall technical process of an online diagnostic method for license plate recognition data quality based on Bayesian hypothesis testing, as described in this invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer and more complete, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention in any way. Example 1
[0021] In one specific embodiment, the method of the present invention is implemented by a system consisting of the following functional modules: a road network topology parsing module, used to parse the road network file and the detection device configuration file, and establish the mapping relationship between the device and the road network nodes and road segments; a data extraction and network construction module, used to extract node-level and edge-level observations from the vehicle matching database and construct a dynamic matching network; a baseline parameter estimation module, used to estimate the negative binomial distribution baseline parameters of each device and each matching edge using historical data from the same period; a Bayesian hypothesis testing module, used to define five types of competing anomaly hypotheses and calculate the marginal likelihood of each hypothesis; a posterior probability calculation module, used to combine the prior probability to calculate the posterior probability of each hypothesis and output the diagnostic results; and an anomaly ranking generation module, used to summarize the posterior probabilities of all test windows and generate anomaly rankings at the device level and edge level.
[0022] The aforementioned modules are deployed on industrial-grade servers or cloud computing platforms. These servers are equipped with multi-core processors and sufficient memory resources to support parallel computing across hundreds of devices and thousands of matching edges in a large-scale road network. The servers interact with license plate recognition devices deployed on the roadside and the central vehicle matching database via standardized network communication protocols.
[0023] The method includes the following steps: Step 1: Road network topology analysis and device mapping.
[0024] During the system initialization phase, the road network topology parsing module first reads the road network file. Taking the SUMO simulation road network file as an example, the road network file contains information such as the start and end node numbers, road segment length, and number of lanes for each road segment. The module parses the file, obtains the start and end node numbers for each road segment, and establishes a topology table of nodes and road segments.
[0025] The module then reads the detector configuration file. In this file, each license plate recognition device is mapped to the road network segments and lanes it covers, recording the correspondence between device number, lane number, road segment number, start node, and end node. The module iterates through all devices, establishing a complete mapping table between devices and road network nodes and segments.
[0026] Based on this, the module labels the spatial relationship type of each pair of upstream and downstream devices according to the road network topology. The specific judgment logic is as follows: if the termination node of the upstream device is the same as the starting node of the downstream device, it is labeled as "adjacent nodes," indicating that the two devices are located upstream and downstream of the same node, and vehicles can reach the downstream device from the upstream device without passing through an intermediate road segment; if the two devices cover the same road segment, it is labeled as "same road segment," indicating that the two devices collect vehicle information on the same road segment; otherwise, it is labeled as "indirectly connected" or "unmapped," indicating that there may be other road segments between the two devices where no detection devices are installed. This spatial relationship labeling information will be used to enhance the interpretability of subsequent anomaly localization results.
[0027] Step 2: Dynamic matching network construction.
[0028] The data extraction and network construction module extracts observation data from the vehicle matching database using fixed time windows. In this implementation, the default time window length is set to 15 minutes, with one day divided into 96 time slots. The window length can be adjusted according to the actual road network traffic characteristics: for urban core areas with high traffic volume, it can be shortened to 10 minutes to improve temporal resolution; for suburban road sections with low traffic volume, it can be extended to 30 minutes to ensure sufficient observation samples within each window.
[0029] For each time window t, the module performs the following statistical operations: (1) Node-level observation extraction: Traverse all devices and count the number of vehicle records Yᵢ for each device i within the time window. t The number of vehicle records refers to the total number of vehicle passage records collected by the device within this time window, including records where the license plate number was successfully identified and records where it was not successfully identified.
[0030] (2) Edge-level observation extraction: Traverse all upstream and downstream device pairs (i,j) and count the number of vehicle matches between each pair of devices within the time window. The number of vehicle matching records refers to the number of matching records formed after associating and matching the passage records of the same vehicle at upstream device i with the passage records of downstream device j according to the license plate number.
[0031] After completing the statistics, the module constructs a weighted directed graph with devices as nodes and the matching relationships between devices as directed edges. Where V is the set of device nodes, Let t be a set of directed edges containing matching relationships within a time window t, where the weight of each edge is the number of matches. This forms a dynamic matching network sequence with 15-minute intervals. .
[0032] Step 3: Baseline parameter estimation.
[0033] The baseline parameter estimation module estimates the negative binomial distribution baseline parameters of each device and each matching edge using data from the same historical period. In this embodiment, historical data from two consecutive weeks (including 10 working days) prior to the test period are selected as the training set.
[0034] For each device i and each time slot s ( (corresponding to the s-th 15-minute time slot of the day), the module collects the recorded observations of all weekdays in the training set for that time slot. , where n is the number of working days in the training set (n=10 in this example). The mean parameter of the negative binomial distribution is estimated using the method of moments. and dispersion parameter :
[0035] in, Let be the variance of the observations for device i across all time slots. When the value is greater than 0, the data exhibits excessive dispersion, and the negative binomial distribution is suitable; when... At that time, it degenerates into a Poisson distribution.
[0036] For each matching edge (i,j) and each time slot s, perform the same parameter estimation process to obtain the edge-level mean parameters. and dispersion parameter .
[0037] Step 4: Bayesian hypothesis testing and marginal likelihood calculation.
[0038] For each test time window t, the Bayesian hypothesis testing module first acquires the observation data for that window. And the baseline parameters of the corresponding time slot obtained from step three. , , ,}
[0039] The module then calculates the marginal likelihood of the five types of hypotheses.
[0040] Normal assumption The calculation involves summing the log probability mass of all node observations with the log probability mass of all edge observations. Specifically, for each device i, the calculation is based on its number of records. and baseline parameters Calculate the probability mass function value of the negative binomial distribution. And take the logarithm; for each matching edge (i,j), based on its matching quantity and baseline parameters Calculate the probability mass function value And take the logarithm. Sum all the logarithmic probabilities to get .
[0041] Global matching anomaly assumption The calculation: The module keeps the expected parameters of all devices unchanged (still the same). ), adjust the expected parameters of all matched edges to ,in Let be the attenuation coefficient. For each discrete value of α (0.15, 0.3, 0.5, 0.7), calculate the attenuation coefficient. Log-likelihood .because At each grid point, a uniform prior is followed, and the module will include all... The marginal likelihood is obtained by averaging the likelihood values for each value and then taking the logarithm. .
[0042] Global database write exception assumption The calculation: The module adjusts the desired parameters of all devices to At the same time, adjust the expected parameters of all matched edges to For each Calculate the log-likelihood for the discrete values, and then... To marginalize, obtain .
[0043] Single device anomaly assumption The calculation: The module constructs a sub-hypothesis for each candidate device i. In the sub-hypothesis... Below, the expected recording volume for device i is adjusted to And the expected value of all matching edges with i as the upstream or downstream is adjusted to The remaining devices and matching edges remain normal. For each The module calculates the log-likelihood under the sub-hypothesis for the discrete values of the given value, and then... To marginalize, obtain The module repeats this calculation for all candidate devices i*.
[0044] One-sided anomaly hypothesis The calculation: The module constructs sub-hypotheses for each candidate matching edge (i,j). In the sub-hypotheses... Below, the expected matching quantity for only this edge is adjusted to All other devices maintained normal record volumes and matching edges. For each The module calculates the log-likelihood under the sub-hypothesis for the discrete values of the given value, and then... To marginalize, obtain The module repeats this calculation for all candidate edges.
[0045] Through the above marginalization process, the module avoids the empirical assumption of fixed anomaly magnitude, enabling the model to adapt to different degrees of anomaly decay.
[0046] Step 5: Calculate the posterior probability and output the diagnostic results.
[0047] The posterior probability calculation module first sets prior probabilities for each hypothesis. In this embodiment, the prior probabilities are set as follows: normal hypothesis prior... Global matching anomaly prior Global write exception prior Any device malfunction always has a priori Any edge anomaly always has prior knowledge .
[0048] The module calculates the unnormalized logarithmic posterior score of each hypothesis in the log space, and normalizes it using the log-sum-exp technique to obtain the posterior probability of each hypothesis.
[0049] The module selects the hypothesis with the highest posterior probability as the best diagnostic result for the current time window and aggregates the posterior probabilities of similar hypotheses.
[0050] Step 5: Calculate the posterior probability and output the diagnostic results.
[0051] The posterior probability calculation module first sets prior probabilities for each hypothesis. In this embodiment, the prior probabilities are set as follows: normal hypothesis prior... Global matching anomaly prior Global write exception prior Any device malfunction always has a priori Any edge anomaly always has prior knowledge .in, Divide equally among N candidate devices , The average value between the E candidate edges is... .
[0052] The prior probability setting reflects the following prior engineering knowledge: under normal operating conditions, the data quality is normal for the vast majority of time windows (75% prior probability); various abnormal events are low-probability events. The total prior probability of device anomalies (10%) is higher than that of global matching anomalies (5%) and global write anomalies (5%), reflecting that in actual operation and maintenance, individual device failures are more common than global system failures. The prior probabilities of different hypotheses can be optimized using empirical Bayesian methods, that is, first setting a coarse or expert-based prior probability, and then iteratively updating the prior probability using the posterior calculation results of historical data.
[0053] The module computes the nonnormalized log-posterior score for each hypothesis in log space: To avoid numerical underflow, the module adopts... Normalize the techniques:
[0054] The module selects the hypothesis with the highest posterior probability as the best diagnostic result for the current time window and records the type of the hypothesis and its posterior probability value.
[0055] The module then aggregates the posterior probabilities of similar hypotheses: all single-device sub-hypotheses Summing the posterior probabilities yields the total probability p_node of any device malfunction; all one-sided sub-hypotheses are then summed. The summation of the posterior probabilities yields the total probability p_edge of any edge anomaly.
[0056] Step Six: Anomaly Ranking Generation and Output.
[0057] The anomaly ranking generation module summarizes and analyzes the posterior probabilities of all test windows. For each candidate device i, the module calculates the posterior probability of node anomalies for that device across all test windows. The number of windows exceeding 0.5 is defined as the number of suspicious windows, and the number of windows exceeding 0.9 is defined as the number of highly suspicious windows. The module sorts all devices in descending order of the number of highly suspicious windows and generates a device-level anomaly ranking table. For devices with the same number of highly suspicious windows, they are then sorted in descending order of the number of suspicious windows.
[0058] For each candidate edge (i,j), the module performs the same summary statistics to generate an edge-level anomaly ranking table.
[0059] The module associates and outputs the device ranking and edge ranking with the road network topology spatial relationship information marked in step one. Specifically, for each top-ranked abnormal device, it outputs its device number, the road segment it is located on, information on adjacent devices, and the spatial relationship type; for each top-ranked abnormal edge, it outputs its upstream and downstream device numbers and the spatial relationship type. This information helps maintenance personnel quickly locate the physical location and road network relationship of abnormal devices, improving the efficiency of fault diagnosis.
[0060] Specific application examples This application example uses urban road license plate recognition data from a specific region for feasibility verification. The data covers 20 license plate recognition devices and 50 traffic matching device pairs (upstream and downstream device pairs). The training set consists of the first week's working days (5 days), and the test set consists of the second week's working days (5 days). The time window length is 15 minutes, for a total of 480 test windows.
[0061] The prior probability is set as follows: , , , , ;in The average value among the 20 candidate devices is 0.10 / 20 = 0.005. The average value among the 50 candidate edges is 0.05 / 50 = 0.001. The values are 0.15, 0.3, 0.5, and 0.7 on the discrete grid.
[0062] The ranking results of device-level anomalies are shown in Table 1: Table 1: Ranking of Equipment-Level Anomalies
[0063] Table 1 presents the ranking results of device-level anomalies. The results show that device 1928526120249792 has a node anomaly posterior probability exceeding 0.5 in 33 out of 480 windows, with 26 windows exceeding 0.9, making it the most suspicious device. Device 1934257433758144 also exhibits persistent anomaly characteristics, with 24 windows exceeding 0.5 and 18 windows exceeding 0.9.
[0064] Table 2 shows the posterior probabilities of some typical time windows: Table 2: Posterior probability distribution of typical time windows
[0065] The above results demonstrate that the Bayesian hypothesis testing framework proposed in this invention can effectively distinguish between normal fluctuations and various types of abnormal events in license plate matching data. Devices 1928526120249792 and 1934257433758144 exhibited persistent abnormal patterns during the test week; it is recommended that maintenance personnel prioritize checking the data acquisition, identification, and uploading functions of these two devices. The detection of global matching anomalies (12-10 17:15) and global write anomalies (12-12 06:00) indicates that the method has the ability to identify system-level faults.
[0066] Analysis of the data in Tables 1 and 2 clearly demonstrates the significant advantages of the technical solution of this invention. Regarding anomaly detection accuracy, the highest posterior probability for equipment-level anomalies reaches over 0.9999999948, indicating that the model has extremely high confidence in judging specific equipment anomalies. The p_normal value for the normal window reaches over 0.9, indicating that the model has a low false alarm rate under normal conditions.
[0067] Regarding the ability to distinguish anomaly sources, the five hypothetical frameworks of this invention can simultaneously detect device-level anomalies (12-08 07:30, 12-08 09:15, 12-10 10:45), global matching anomalies (12-10 17:15), and global write anomalies (12-12 06:00). The distinction between global matching anomalies (p_match=0.595) and global write anomalies (p_write=0.838) is particularly noteworthy—the former only affects the number of matches without affecting the number of records, while the latter affects both the number of records and the number of matches. This invention achieves effective differentiation between these two types of system-level anomalies through joint likelihood calculation of node observations and edge observations. This ability to simultaneously detect multiple types of anomalies is not reported in existing methods.
[0068] In terms of computational efficiency, this invention supports online rolling detection. In an application example with 480 test windows (5 working days × 96 windows / day), the model can complete real-time diagnosis of all windows. Each time window only requires one forward computation to obtain a complete diagnostic result, indicating its computational feasibility for practical deployment.
[0069] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. An online diagnostic method for license plate recognition data quality based on Bayesian hypothesis testing, characterized in that, Includes the following steps: S1, analyze the road network topology and detection equipment configuration, and establish the mapping relationship between each license plate recognition device and road network nodes and road segments; S2 uses a fixed time window as a unit to extract the number of vehicle records of each device in each time window from the vehicle matching database as a node observation, and the number of vehicle matching between each upstream and downstream device pair as an edge observation. A dynamic matching network is constructed with devices as nodes and the matching relationship between devices as directed edges. S3 uses the number of vehicle records and vehicle matching in the same historical time period to estimate the baseline parameters of the count distribution of each device and each directed edge in each time slot; S4. For each test time window, define the normal hypothesis and multiple abnormal hypotheses. The abnormal hypotheses include global abnormal hypotheses and local abnormal hypotheses. The global abnormal hypotheses include a first global abnormal hypothesis and a second global abnormal hypothesis. The first global abnormal hypothesis is that only the expected number of matches for all directed edges decays while the expected number of records for all devices remains unchanged. The second global abnormal hypothesis is that the expected number of records for all devices and the expected number of matches for all directed edges decay simultaneously. The local abnormal hypotheses include a first local abnormal hypothesis and a second local abnormal hypothesis. The first local abnormal hypothesis is that only the expected number of records for a single device and the expected number of matches for all directed edges associated with that device decay while the expected number of records for the remaining devices and directed edges remain unchanged. The second local abnormal hypothesis is that only the expected number of matches for a single directed edge decays while the expected number of records for all devices and the remaining directed edges remain unchanged. Calculate the joint likelihood of the node observations and the edge observations under each hypothesis, and marginalize the decay coefficients in each abnormal hypothesis to obtain the marginal likelihood of each hypothesis. S5. Based on the prior probability of each hypothesis and the marginal likelihood, calculate the posterior probability of each hypothesis using Bayes' theorem, and select the hypothesis with the largest posterior probability as the anomaly diagnosis result for the current time window. S6 summarizes the posterior probabilities of all test time windows, counts the number of windows whose posterior probabilities of anomalies exceed the preset threshold by device and by directed edge respectively, and generates device-level anomaly ranking and edge-level anomaly ranking.
2. The method according to claim 1, characterized in that, Step S1 includes: mapping each license plate recognition device to the road network segments and lanes it covers, and obtaining the correspondence between device number, lane number, road segment number, start node and end node; for each pair of upstream and downstream devices, marking their spatial relationship type according to the road network topology, the spatial relationship type includes adjacent nodes, same road segment and indirect connection.
3. The method according to claim 1, characterized in that, In step S2, the continuous time is divided into discrete time windows of fixed length; for each time window, the number of vehicle records for each device is counted. As a nodal observation, the number of vehicle matches between each upstream and downstream device pair is counted. As an edge observation measurement, a dynamic matching network sequence with time window intervals is constructed, with devices as nodes and the matching relationships between devices as directed edges.
4. The method according to claim 1, characterized in that, In step S3, the counting distribution is a negative binomial distribution, and the nodal observations are... Follow the mean The dispersion parameter is The negative binomial distribution, lateral observations Follow the mean The dispersion parameter is The negative binomial distribution; The mean and the dispersion parameter are estimated using the method of moments, which utilizes observations from multiple working days during the same historical period.
5. The method according to claim 1, characterized in that, In step S4: Normal assumption Assuming all devices and directed edges are in normal working order, and node observations are... Follow the mean The negative binomial distribution, lateral observations Follow the mean The negative binomial distribution; First global anomaly hypothesis Let: The expected number of matchings for all directed edges is given by Attenuation to The number of records across all devices is expected to remain constant. constant; Second global anomaly hypothesis For: The expected number of records for all devices is determined by Attenuation to And the expected number of matchings for all directed edges is determined by... Attenuation to ; First Local Anomaly Hypothesis For: target device only The expected number of records is determined by Attenuation to The expected number of matchings for all directed edges with this device as upstream or downstream is determined by... Attenuation to The expected number of records for the remaining devices and the expected number of matches for the remaining directed edges remain unchanged; Second Local Anomaly Hypothesis For: Only the target directed edge The expected number of matches is determined by Attenuation to The expected number of records for all devices and the expected number of matches for the remaining directed edges remain unchanged; in, This is the attenuation coefficient for the severity of the anomaly. .
6. The method according to claim 5, characterized in that, In step S4, the method for marginalizing the attenuation coefficients in each anomaly hypothesis is as follows: for each anomaly hypothesis... k=1,2,3,4, in a discrete grid Calculate each given Log-likelihood for the value Assuming that α follows a uniform prior distribution at each grid point, according to Calculate the marginal likelihood of the anomalous hypothesis; normal hypothesis. The marginal likelihood is the log-likelihood when α=1.
7. The method according to claim 5, characterized in that, In step S4: Normal assumption The log-likelihood is the sum of the log probability mass of all node observations and the log probability mass of all edge observations; First global anomaly hypothesis The log-likelihood of the observations of all nodes is the log-probability mass of all directed edges, which decays to the expected parameter of . The sum of the logarithmic probability masses under given conditions; Second global anomaly hypothesis The log-likelihood of all nodal observations at the desired parameter decays to... The logarithmic probability mass under given conditions, and the decay of all directed edges with the expected parameter are... The sum of the logarithmic probability masses under given conditions; First Local Anomaly Hypothesis The log-likelihood of the target device The nodal observations decay to the desired parameter. The log probability quality under the given conditions, the log probability quality of all other node observations, and the expected parameter decay of all directed edges associated with the target device are given as follows: The log probability mass of the given condition is the sum of the log probability masses of all other directed edges; Second Local Anomaly Hypothesis The log-likelihood of the observations at all nodes is the log-probability mass, and the directed edge to the target decays to the expected parameter. The logarithmic probability mass of the given condition is the sum of the logarithmic probability masses of all other directed edges.
8. The method according to claim 1, characterized in that, In step S5, the prior probability of the normal hypothesis is higher than the prior probabilities of each anomalous hypothesis; the prior probability of the global anomalous hypothesis is lower than the prior probability of the normal hypothesis; the total prior probability of the first local anomalous hypothesis is evenly distributed among all candidate devices, and the total prior probability of the second local anomalous hypothesis is evenly distributed among all candidate directed edges; the non-normalized logarithmic posterior score of each hypothesis is calculated in log space. ,pass Normalization yields the posterior probabilities of each hypothesis.
9. The method according to claim 1, characterized in that, In step S5, each of the first local anomaly hypotheses is... The total probability of equipment failure is obtained by summing the posterior probabilities. ; Each second local anomaly hypothesis Summing the posterior probabilities yields the total probability of directed edge anomalies. .
10. The method according to claim 1, characterized in that, Step S6 includes: counting the number of windows in which the total probability of device anomalies for each device exceeds the first preset threshold and the second preset threshold across all test time windows, and generating a device-level anomaly ranking table; counting the number of windows in which the total probability of directed edge anomalies for each directed edge exceeds the first preset threshold and the second preset threshold across all test time windows, and generating an edge-level anomaly ranking table; and associating and outputting the device-level anomaly ranking table and the edge-level anomaly ranking table with the road network topology annotation information.
