Traffic flow detection method and system based on artificial intelligence

By integrating sensors and image acquisition devices in the vehicle flow detection system and using artificial intelligence models to fuse data, the problem of low accuracy of existing vehicle flow detection methods under harsh conditions is solved, and higher detection accuracy is achieved.

CN119942787AInactive Publication Date: 2025-05-06JIANGXI HUASHI TECH SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510039771.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing vehicle flow detection methods have low accuracy in high-density traffic and severe weather conditions.

Method used

Using an artificial intelligence-based vehicle flow detection method, a vehicle monitoring sensor and image acquisition device are arranged on preset road sections, combined with sensor data and image data, a pre-trained vehicle flow data determination model is used to fusion, and the final vehicle flow data is determined.

Benefits of technology

It improves the accuracy of traffic flow detection and reduces the error caused by a single detection method, especially in high-density traffic and severe weather conditions, which can more accurately detect traffic flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942787A_ABST
    Figure CN119942787A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow detection method and system based on artificial intelligence, and the method comprises the steps: obtaining the current environment information of a preset road section when a traffic flow detection request is received; when the current environment information meets the sensor monitoring condition, sensor information collected by a vehicle monitoring sensor is obtained, and traffic flow information on a preset road section is determined according to the sensor information; when the current environment information meets the image acquisition monitoring condition, acquiring image information acquired by an image acquisition device, and determining traffic flow information on a preset road section according to the image information; and when the current environment information meets the fusion monitoring condition, sensor traffic flow data and image traffic flow data obtained by information acquired by the vehicle monitoring sensor and the image acquisition device are acquired respectively, and final traffic flow data are determined according to the sensor traffic flow data and the image traffic flow data. According to the invention, the problem of low accuracy of a traffic flow detection mode in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle flow detection, and in particular to a vehicle flow detection method and system based on artificial intelligence. Background Art

[0002] At present, vehicle flow detection mainly includes two categories: sensor monitoring and image monitoring. Among them, sensor monitoring mainly relies on induction coils, microwaves, lidar and other equipment to monitor vehicle passing information, and monitors vehicle flow based on the monitored sensor information. Image monitoring mainly uses frequency analysis technology to detect vehicle flow, and performs image analysis on the video based on the collected monitoring video, and then uses recognition algorithms or models to identify vehicle flow information.

[0003] However, sensor monitoring methods are prone to misjudgment in the face of high-density traffic, while image monitoring methods are easily affected by weather (rain, snow) and lighting conditions (night), affecting data accuracy. For example, video surveillance may not be able to clearly capture traffic in low light conditions, resulting in low accuracy of recognition results. Therefore, the current traffic flow detection method has the problem of low accuracy. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a vehicle flow detection method and system based on artificial intelligence, aiming to solve the problem of low accuracy of vehicle flow detection methods in the prior art.

[0005] The present invention is achieved in that:

[0006] A vehicle flow detection method based on artificial intelligence is used to detect the vehicle flow on a preset road section, where a vehicle monitoring sensor and an image acquisition device are respectively arranged on the preset road section. The method comprises:

[0007] When a traffic flow detection request is received, current environment information on a preset road section is obtained;

[0008] When the current environmental information meets the sensor monitoring conditions, the sensor information collected by the vehicle monitoring sensor is obtained, and the vehicle flow information on the preset road section is determined according to the sensor information;

[0009] When the current environmental information meets the image acquisition monitoring conditions, the image information acquired by the image acquisition device is acquired, and the traffic flow information on the preset road section is determined according to the image information;

[0010] When the current environmental information meets the fusion monitoring conditions, the sensor vehicle flow data and the image vehicle flow data obtained by the information collected by the vehicle monitoring sensor and the image acquisition device are respectively obtained, and the final vehicle flow data is determined based on the sensor vehicle flow data and the image vehicle flow data.

[0011] Furthermore, in the above-mentioned vehicle flow detection method based on artificial intelligence, the step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data includes:

[0012] Inputting the sensor vehicle flow data and the image vehicle flow data into a pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data;

[0013] The training process of the vehicle flow data determination model is as follows:

[0014] Collecting historical sensor traffic flow data and image traffic flow data and corresponding actual traffic flow data as a training data set, and inputting the training data set into a preset neural network for training to obtain the traffic flow data determination model;

[0015] The preset neural network is constructed based on the Bayesian probability formula, and the optimal relationship between the sensor vehicle flow data, the image vehicle flow data and the final vehicle flow data is adjusted through multiple trainings.

[0016] Furthermore, in the above-mentioned vehicle flow detection method based on artificial intelligence, the expression of the Bayesian probability formula is:

[0017]

[0018] Among them, P(A|B1, B2) represents the probability of event A occurring under the condition that events B1 and B2 occur, P(B1|A) represents the probability of event B1 occurring under the condition that event A occurs, P(B2|A) represents the probability of event B2 occurring under the condition that event A occurs, P(A) is the prior distribution of the independent occurrence of event A, P(B1, B2) is a normalization constant, event A = {actual traffic flow}, event B1 = {sensor traffic flow data}, event B2 = {image traffic flow data}.

[0019] Furthermore, in the above-mentioned vehicle flow detection method based on artificial intelligence, the training process of the vehicle flow data determination model further includes:

[0020] Determine the target environment that meets the fusion monitoring conditions and obtain the historical traffic flow information of the preset road section under the target environment;

[0021] Divide the target environment into multiple sub-environments according to time periods, dates, and weather conditions, and determine the traffic flow information corresponding to the sub-environments respectively, wherein each sub-environment includes a combination of a time period, a date, and a weather condition;

[0022] The traffic flow information corresponding to each sub-environment is counted to obtain traffic flow statistics information of the preset road section in each sub-environment, and the prior distribution type of the traffic flow in each sub-environment is determined according to the traffic flow statistics information;

[0023] Create a lookup table in the model that stores the corresponding prior distribution types for different sub-environments, and add time period, date, and weather conditions as auxiliary features to the training dataset;

[0024] When training the model, the corresponding prior distribution type and the corresponding prior distribution are retrieved from the lookup table according to the input sub-environment for training. After the training is completed, the sub-environment will be added as part of the input data. Based on the input sub-environment, the model will dynamically select the corresponding prior distribution and give the final traffic flow data.

[0025] Furthermore, in the above-mentioned vehicle flow detection method based on artificial intelligence, the step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data includes:

[0026] Determining whether the sensor vehicle flow data and the image vehicle flow data are consistent;

[0027] When the sensor vehicle flow data and the image vehicle flow data are consistent, selecting any one of them as the final vehicle flow data;

[0028] When the sensor vehicle flow data and the image vehicle flow data are inconsistent, the step of inputting the sensor vehicle flow data and the image vehicle flow data into the pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data is executed.

[0029] Furthermore, in the above-mentioned vehicle flow detection method based on artificial intelligence, wherein the monitoring sensor is a geomagnetic sensor, a ground induction coil or an infrared sensor, the step of determining the vehicle flow information on a preset road section according to the sensor data includes:

[0030] A geomagnetic sensor monitors the change in geomagnetic field caused by vehicles to detect vehicle flow information; or

[0031] Ground induction coils detect vehicle flow by sensing changes in electromagnetic signals generated when vehicles pass by; or

[0032] Infrared sensors detect traffic flow information through changes in reflected signals.

[0033] Furthermore, in the above-mentioned vehicle flow detection method based on artificial intelligence, the step of determining the vehicle flow information on a preset road section according to the image information comprises:

[0034] Collect traffic flow videos of various scenes, skip frames from the traffic flow video stream, select a preset number of images, and annotate them to obtain a training data set;

[0035] Construct a YOLOv5s neural network and input the training data set into the YOLOv5s neural network for deep learning training to obtain the corresponding traffic flow calculation model;

[0036] The image information is input into a vehicle flow calculation model to obtain corresponding vehicle flow information.

[0037] Another object of the present invention is to provide a vehicle flow detection system based on artificial intelligence, which is used to detect the vehicle flow on a preset road section, wherein a vehicle monitoring sensor and an image acquisition device are respectively arranged on the preset road section, and the system comprises:

[0038] An acquisition module, used to acquire current environment information on a preset road section when receiving a traffic flow detection request;

[0039] A first vehicle flow detection module, used to obtain sensor information collected by a vehicle monitoring sensor when the current environmental information meets the sensor monitoring conditions, and determine the vehicle flow information on a preset road section according to the sensor information;

[0040] A second vehicle flow detection module is used to obtain image information collected by the image acquisition device when the current environmental information meets the image acquisition monitoring conditions, and determine the vehicle flow information on the preset road section according to the image information;

[0041] The third vehicle flow detection module is used to obtain sensor vehicle flow data and image vehicle flow data obtained from information collected by the vehicle monitoring sensor and the image acquisition device respectively when the current environmental information meets the fusion monitoring conditions, and determine the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data.

[0042] Another object of the present invention is to provide a readable storage medium having a computer program stored thereon, wherein the program implements the steps of the above method when executed by a processor.

[0043] Another object of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0044] The present invention obtains the current environment information on the preset road section when receiving a vehicle flow detection request; obtains the sensor information collected by the vehicle monitoring sensor when the current environment information meets the sensor monitoring condition, and determines the vehicle flow information on the preset road section according to the sensor information; obtains the image information collected by the image acquisition device when the current environment information meets the image acquisition monitoring condition, and determines the vehicle flow information on the preset road section according to the image information; obtains the sensor vehicle flow data and the image vehicle flow data obtained by the information collected by the vehicle monitoring sensor and the image acquisition device when the current environment information meets the fusion monitoring condition, and determines the final vehicle flow data according to the sensor vehicle flow data and the image vehicle flow data. By arranging sensors and image acquisition devices respectively, in the environment where each monitors accurately, the collected data are used to perform vehicle flow detection respectively, and under the condition that both may have errors, the collected data are used. Both detection methods have their unique advantages and limitations. They may react differently to different situations, so by combining multiple detection methods, the errors that may be caused by a single method are reduced to a certain extent. The problem of low accuracy of the vehicle flow detection method in the prior art is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flow chart of the vehicle flow detection method based on artificial intelligence in the first embodiment of the present invention;

[0046] Figure 2 It is a structural block diagram of a vehicle flow detection system based on artificial intelligence in the third embodiment of the present invention.

[0047] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0048] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0049] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed types.

[0051] Embodiment 1

[0052] See also Figure 1 , shown is an artificial intelligence-based vehicle flow detection method in the first embodiment of the present invention, which is used to detect the vehicle flow on a preset road section, where vehicle monitoring sensors and image acquisition devices are respectively arranged on the preset road sections, and the method includes steps S10 to S13.

[0053] Step S10, when a traffic flow detection request is received, current environment information on a preset road section is obtained.

[0054] Among them, monitoring sensors and image acquisition devices are respectively arranged on the road sections where vehicle flow detection is required. Specifically, the monitoring sensor can be a geomagnetic sensor, a ground induction coil or an infrared sensor, and the image acquisition device is a surveillance camera, so that monitoring data that can obtain vehicle flow information of the road section collected by different methods can be obtained. More specifically, environmental information on the road section can be obtained to determine which method to use for vehicle flow detection, wherein the environmental information includes current lighting conditions, weather conditions, vehicle density, etc. In specific implementation, the vehicle flow detection request can be actively issued, or it can be initiated automatically at a set time interval or a set time period.

[0055] Step S11, when the current environmental information meets the sensor monitoring conditions, the sensor information collected by the vehicle monitoring sensor is obtained, and the vehicle flow information on the preset road section is determined according to the sensor information.

[0056] Among them, the sensor monitoring conditions are set for a separate sensor to monitor the vehicle flow, that is, under the current conditions, the information on the vehicle flow can be accurately detected through the data monitored by the sensor. Specifically, the sensor monitoring condition is that the vehicle density is lower than a preset threshold, wherein the current vehicle density can be determined by the data collected by the image, and then it can be determined whether the vehicle density is lower than the preset threshold.

[0057] Specifically, in some optional embodiments of the present invention, the step of determining the traffic flow information on a preset road section according to the sensor data includes:

[0058] A geomagnetic sensor monitors the change in geomagnetic field caused by vehicles to detect vehicle flow information; or

[0059] Ground induction coils detect vehicle flow by sensing changes in electromagnetic signals generated when vehicles pass by; or

[0060] Infrared sensors detect traffic flow information through changes in reflected signals.

[0061] Among them, geomagnetic sensors are buried under the road surface to monitor the changes in the geomagnetic field caused by passing vehicles to detect the number of vehicles, induction coils are buried in the road surface to detect the traffic flow by sensing the changes in electromagnetic signals generated when vehicles pass by, and infrared sensors are set up to detect traffic flow information by changes in reflected signals.

[0062] Step S12, when the current environmental information meets the image acquisition monitoring conditions, the image information acquired by the image acquisition device is acquired, and the traffic flow information on the preset road section is determined according to the image information.

[0063] Among them, image acquisition monitoring conditions are set for separate image monitoring of vehicle flow, that is, under the current conditions, the data collected by the image acquisition device can accurately detect the information of vehicle flow. Specifically, the image acquisition monitoring conditions are that separate image acquisition monitoring is carried out when the current lighting conditions are sufficient, the current weather conditions are sunny, and the visibility is good, that is, separate image acquisition monitoring is carried out when the light is dim and the visibility is blurred on rainy days. In the specific implementation, when the image acquisition monitoring can accurately obtain the vehicle flow information, the monitoring sensor can also be turned off or on standby to reduce energy consumption.

[0064] Specifically, in some optional embodiments of the present invention, the step of determining the traffic flow information on a preset road section according to the image information includes:

[0065] Collect traffic flow videos of various scenes, skip frames from the traffic flow video stream, select a preset number of images, and annotate them to obtain a training data set;

[0066] Construct a YOLOv5s neural network and input the training data set into the YOLOv5s neural network for deep learning training to obtain the corresponding traffic flow calculation model;

[0067] The image information is input into a vehicle flow calculation model to obtain corresponding vehicle flow information.

[0068] Among them, a training data set is obtained by annotating the collected historical data, and a traffic flow calculation model is obtained by deep learning training, so as to obtain corresponding traffic flow information according to the traffic flow calculation model. Among them, how to analyze the image to obtain the corresponding traffic flow data is understandable to those skilled in the art and will not be elaborated here.

[0069] Step S13, when the current environmental information meets the fusion monitoring conditions, the sensor vehicle flow data and the image vehicle flow data obtained by the information collected by the vehicle monitoring sensor and the image acquisition device are respectively obtained, and the final vehicle flow data is determined based on the sensor vehicle flow data and the image vehicle flow data.

[0070] Each observation method (such as sensors, image recognition) usually has its own unique advantages and limitations. They may respond differently to different situations, so by combining multiple observation methods, the errors that may be caused by a single method can be reduced to a certain extent. For example, sensor data may be interfered by high vehicle density, and image recognition may not perform well in low light or occlusion conditions. Since the errors of different observation methods may be independent of each other, or the error patterns are not exactly the same. Combining these data through appropriate fusion strategies can help eliminate the bias or noise of a single observation method.

[0071] Specifically, when the current environmental information meets the fusion monitoring conditions, the final traffic flow data is obtained based on the data monitored by the two. The fusion monitoring conditions can be that the current light is dim, the field of vision is poor, and the vehicle density is high, such as rainy days, foggy days, etc. For example, it can be set to night time, vehicle density is higher than a threshold, or rainy days, vehicle density is higher than a threshold, or night time, rainy days, and vehicle density is higher than a threshold.

[0072] More specifically, the sensor vehicle flow data and the image vehicle flow data are input into a pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data;

[0073] The training process of the vehicle flow data determination model is as follows:

[0074] Collecting historical sensor traffic flow data and image traffic flow data and corresponding actual traffic flow data as a training data set, and inputting the training data set into a preset neural network for training to obtain the traffic flow data determination model;

[0075] The preset neural network is constructed based on the Bayesian probability formula, and the optimal relationship between the sensor vehicle flow data, the image vehicle flow data and the final vehicle flow data is adjusted through multiple trainings.

[0076] Among them, a neural network is established using the Bayesian probability formula, and a large amount of historical sensor traffic flow data and image traffic flow data as well as the corresponding accurate actual traffic flow data are collected to form a training data set. The neural network is trained using the training data set to obtain a traffic flow data determination model that can accurately output traffic flow data. After obtaining the primary sensor traffic flow data and image traffic flow data, they are input into the model to output the final accurate traffic flow data.

[0077] Exemplarily, the expression of the Bayesian probability formula is:

[0078]

[0079] Among them, P(A|B1, B2) represents the probability of event A occurring under the condition that events B1 and B2 occur, P(B1|A) represents the probability of event B1 occurring under the condition that event A occurs, P(B2|A) represents the probability of event B2 occurring under the condition that event A occurs, P(A) is the prior distribution of event A occurring independently, P(B1, B2) is a normalization constant, event A = {actual traffic volume}, event B1 = {sensor traffic volume data}, event B2 = {image traffic volume data}, among which, based on historical data or expert experience, it can be determined that the traffic volume of the road section obeys a certain prior distribution. For example, normal distribution, uniform distribution, etc., according to the prior distribution of event A occurring independently, P(B1|A) and P(B2|A) can be determined.

[0080] In addition, in some optional embodiments of the present invention, the step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data includes:

[0081] Determining whether the sensor vehicle flow data and the image vehicle flow data are consistent;

[0082] When the sensor vehicle flow data and the image vehicle flow data are consistent, selecting any one of them as the final vehicle flow data;

[0083] When the sensor vehicle flow data and the image vehicle flow data are inconsistent, the step of inputting the sensor vehicle flow data and the image vehicle flow data into the pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data is executed.

[0084] Among them, when the two data are consistent, it can be determined that the detected data are accurate, and any one of the data can be selected as the final traffic flow data. When the two data are inconsistent, they are input into the traffic flow data determination model for re-detection and judgment.

[0085] In summary, the vehicle flow detection method based on artificial intelligence in the above embodiment of the present invention obtains the current environmental information on the preset road section when receiving the vehicle flow detection request; when the current environmental information meets the sensor monitoring condition, obtains the sensor information collected by the vehicle monitoring sensor, and determines the vehicle flow information on the preset road section according to the sensor information; when the current environmental information meets the image acquisition monitoring condition, obtains the image information collected by the image acquisition device, and determines the vehicle flow information on the preset road section according to the image information; when the current environmental information meets the fusion monitoring condition, obtains the sensor vehicle flow data and the image vehicle flow data obtained by the information collected by the vehicle monitoring sensor and the image acquisition device, respectively, and determines the final vehicle flow data according to the sensor vehicle flow data and the image vehicle flow data. By arranging sensors and image acquisition devices respectively, in the environment where each monitors accurately, the collected data are used to detect the vehicle flow respectively, and under the condition that both may have errors, the collected data are used. Both detection methods have their unique advantages and limitations. They may react differently to different situations, so by combining multiple detection methods, the errors that may be caused by a single method are reduced to a certain extent. The problem of low accuracy of the vehicle flow detection method in the prior art is solved.

[0086] Embodiment 2

[0087] This embodiment also proposes a vehicle flow detection method based on artificial intelligence. The difference between the vehicle flow detection method based on artificial intelligence proposed in this embodiment and the vehicle flow detection method based on artificial intelligence proposed in the first embodiment is that:

[0088] The method further comprises:

[0089] Determine the target environment that meets the fusion monitoring conditions and obtain the historical traffic flow information of the preset road section under the target environment;

[0090] Divide the target environment into multiple sub-environments according to time periods, dates, and weather conditions, and determine the traffic flow information corresponding to the sub-environments respectively, wherein each sub-environment includes a combination of a time period, a date, and a weather condition;

[0091] The traffic flow information corresponding to each sub-environment is counted to obtain traffic flow statistics information of the preset road section in each sub-environment, and the prior distribution type of the traffic flow in each sub-environment is determined according to the traffic flow statistics information;

[0092] Create a lookup table in the model that stores the corresponding prior distribution types for different sub-environments, and add time period, date, and weather conditions as auxiliary features to the training dataset;

[0093] When training the model, the corresponding prior distribution type and the corresponding prior distribution are retrieved from the lookup table according to the input sub-environment for training. After the training is completed, the sub-environment will be added as part of the input data. Based on the input sub-environment, the model will dynamically select the corresponding prior distribution and give the final traffic flow data.

[0094] Among them, a core advantage of Bayesian inference is to predict traffic flow through prior information. In the embodiment of the present invention, more prior knowledge is introduced to help the model converge better. Considering that changes in traffic flow have a strong timeliness, the prior distribution can be adjusted according to historical data to dynamically adapt to traffic characteristics in different time periods or events. This helps to improve prediction accuracy, especially in special circumstances such as holidays.

[0095] Specifically, the historical traffic flow information of the preset road section under the target environment of the integrated monitoring conditions is obtained, and the target environment is divided into multiple different sub-environments according to time period, date and weather, each sub-environment is composed of a time period, date and weather, wherein the date is weekdays, weekends and holidays, and the weather conditions are rainy days and foggy days, for example, weekdays, 17:00-19:00, and rainy days are a sub-environment, and the traffic flow information corresponding to the sub-environment is determined respectively, and the prior distribution type and prior distribution of the traffic flow under the corresponding sub-environment are determined according to the traffic flow information corresponding to a large number of sub-environments, that is, the traffic flow data under the sub-environment is statistically analyzed separately, and the prior distribution of the traffic flow under the sub-environment is considered in model training. The impact of different sub-environments. Specifically, a lookup table is created in the model, which stores the corresponding prior distribution types under different sub-environments. Time periods, dates, and weather conditions are added to the training data set as auxiliary features. These features will be used as inputs to the model to indicate the current environmental conditions. The extracted features are encoded so that the model can process them. When training the model, the corresponding prior distribution type is retrieved from the lookup table according to the input sub-environment, and training is performed according to the corresponding prior distribution. After the training is completed, the sub-environment is added as part of the input data. According to the input sub-environment, the model will dynamically select the corresponding prior distribution and provide the final traffic flow data. In addition, in some optional embodiments of the present invention, after determining the prior distribution types corresponding to different sub-environments, the same prior distribution types can also be merged to reduce the amount of data processing.

[0096] In summary, the vehicle flow detection method based on artificial intelligence in the above embodiment of the present invention obtains the current environmental information on the preset road section when receiving the vehicle flow detection request; when the current environmental information meets the sensor monitoring condition, obtains the sensor information collected by the vehicle monitoring sensor, and determines the vehicle flow information on the preset road section according to the sensor information; when the current environmental information meets the image acquisition monitoring condition, obtains the image information collected by the image acquisition device, and determines the vehicle flow information on the preset road section according to the image information; when the current environmental information meets the fusion monitoring condition, obtains the sensor vehicle flow data and the image vehicle flow data obtained by the information collected by the vehicle monitoring sensor and the image acquisition device, respectively, and determines the final vehicle flow data according to the sensor vehicle flow data and the image vehicle flow data. By arranging sensors and image acquisition devices respectively, in the environment where each monitors accurately, the collected data are used to detect the vehicle flow respectively, and under the condition that both may have errors, the collected data are used. Both detection methods have their unique advantages and limitations. They may react differently to different situations, so by combining multiple detection methods, the errors that may be caused by a single method are reduced to a certain extent. The problem of low accuracy of the vehicle flow detection method in the prior art is solved.

[0097] Embodiment 3

[0098] See also Figure 2 , shown is a vehicle flow detection system based on artificial intelligence proposed in the third embodiment of the present invention, which is used to detect the vehicle flow on a preset road section, where a vehicle monitoring sensor and an image acquisition device are respectively arranged on the preset road section, and the system includes:

[0099] The acquisition module 100 is used to acquire current environment information on a preset road section when receiving a vehicle flow detection request;

[0100] The first vehicle flow detection module 200 is used to obtain sensor information collected by the vehicle monitoring sensor when the current environmental information meets the sensor monitoring condition, and determine the vehicle flow information on the preset road section according to the sensor information;

[0101] The second vehicle flow detection module 300 is used to obtain image information collected by the image acquisition device when the current environmental information meets the image acquisition monitoring conditions, and determine the vehicle flow information on the preset road section according to the image information;

[0102] The third vehicle flow detection module 400 is used to obtain sensor vehicle flow data and image vehicle flow data obtained from information collected by the vehicle monitoring sensor and the image acquisition device respectively when the current environmental information meets the fusion monitoring conditions, and determine the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data.

[0103] Furthermore, in the above-mentioned vehicle flow detection system based on artificial intelligence, the step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data comprises:

[0104] Inputting the sensor vehicle flow data and the image vehicle flow data into a pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data;

[0105] The training process of the vehicle flow data determination model is as follows:

[0106] Collecting historical sensor traffic flow data and image traffic flow data and corresponding actual traffic flow data as a training data set, and inputting the training data set into a preset neural network for training to obtain the traffic flow data determination model;

[0107] The preset neural network is constructed based on the Bayesian probability formula, and the optimal relationship between the sensor vehicle flow data, the image vehicle flow data and the final vehicle flow data is adjusted through multiple trainings.

[0108] Furthermore, in the above-mentioned vehicle flow detection system based on artificial intelligence, the expression of the Bayesian probability formula is:

[0109]

[0110] Among them, P(A|B1, B2) represents the probability of event A occurring under the condition that events B1 and B2 occur, P(B1|A) represents the probability of event B1 occurring under the condition that event A occurs, P(B2|A) represents the probability of event B2 occurring under the condition that event A occurs, P(A) is the prior distribution of the independent occurrence of event A, P(B1, B2) is a normalization constant, event A = {actual traffic flow}, event B1 = {sensor traffic flow data}, event B2 = {image traffic flow data}.

[0111] Furthermore, in the above-mentioned vehicle flow detection system based on artificial intelligence, the training process of the vehicle flow data determination model further includes:

[0112] Determine the target environment that meets the fusion monitoring conditions and obtain the historical traffic flow information of the preset road section under the target environment;

[0113] Divide the target environment into multiple sub-environments according to time periods, dates, and weather conditions, and determine the traffic flow information corresponding to the sub-environments respectively, wherein each sub-environment includes a combination of a time period, a date, and a weather condition;

[0114] The traffic flow information corresponding to each sub-environment is counted to obtain traffic flow statistics information of the preset road section in each sub-environment, and the prior distribution type of the traffic flow in each sub-environment is determined according to the traffic flow statistics information;

[0115] Create a lookup table in the model that stores the corresponding prior distribution types for different sub-environments, and add time period, date, and weather conditions as auxiliary features to the training dataset;

[0116] When training the model, the corresponding prior distribution type and the corresponding prior distribution are retrieved from the lookup table according to the input sub-environment for training. After the training is completed, the sub-environment will be added as part of the input data. Based on the input sub-environment, the model will dynamically select the corresponding prior distribution and give the final traffic flow data.

[0117] Furthermore, in the above-mentioned vehicle flow detection system based on artificial intelligence, the step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data comprises:

[0118] Determining whether the sensor vehicle flow data and the image vehicle flow data are consistent;

[0119] When the sensor vehicle flow data and the image vehicle flow data are consistent, selecting any one of them as the final vehicle flow data;

[0120] When the sensor vehicle flow data and the image vehicle flow data are inconsistent, the step of inputting the sensor vehicle flow data and the image vehicle flow data into the pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data is executed.

[0121] Furthermore, in the above-mentioned vehicle flow detection system based on artificial intelligence, wherein the monitoring sensor is a geomagnetic sensor, a ground induction coil or an infrared sensor, the step of determining the vehicle flow information on a preset road section according to the sensor data includes:

[0122] A geomagnetic sensor monitors the change in geomagnetic field caused by vehicles to detect vehicle flow information; or

[0123] Ground induction coils detect vehicle flow by sensing changes in electromagnetic signals generated when vehicles pass by; or

[0124] Infrared sensors detect traffic flow information through changes in reflected signals.

[0125] Furthermore, in the above-mentioned artificial intelligence-based vehicle flow detection system, the step of determining the vehicle flow information on a preset road section according to the image information comprises:

[0126] Collect traffic flow videos of various scenes, skip frames from the traffic flow video stream, select a preset number of images, and annotate them to obtain a training data set;

[0127] Construct a YOLOv5s neural network and input the training data set into the YOLOv5s neural network for deep learning training to obtain the corresponding traffic flow calculation model;

[0128] The image information is input into a vehicle flow calculation model to obtain corresponding vehicle flow information.

[0129] The functions or operation steps implemented when the above modules are executed are substantially the same as those in the above method embodiments, and will not be repeated here.

[0130] Embodiment 4

[0131] Another aspect of the present invention further provides a readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of the method described in any one of the above embodiments 1 to 2 are implemented.

[0132] Embodiment 5

[0133] Another aspect of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the above-mentioned embodiments one to two when executing the program.

[0134] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0135] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0136] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0137] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0138] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0139] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A vehicle flow detection method based on artificial intelligence, characterized in that: Used to detect the traffic flow on a preset road section, where a vehicle monitoring sensor and an image acquisition device are respectively arranged on the preset road section, the method comprises: When a traffic flow detection request is received, current environment information on a preset road section is obtained; When the current environmental information meets the sensor monitoring conditions, the sensor information collected by the vehicle monitoring sensor is obtained, and the vehicle flow information on the preset road section is determined according to the sensor information; When the current environmental information meets the image acquisition monitoring conditions, the image information acquired by the image acquisition device is acquired, and the traffic flow information on the preset road section is determined according to the image information; When the current environmental information meets the fusion monitoring conditions, the sensor vehicle flow data and the image vehicle flow data obtained by the information collected by the vehicle monitoring sensor and the image acquisition device are respectively obtained, and the final vehicle flow data is determined based on the sensor vehicle flow data and the image vehicle flow data.

2. The vehicle flow detection method based on artificial intelligence according to claim 1 is characterized in that: The step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data comprises: Inputting the sensor vehicle flow data and the image vehicle flow data into a pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data; The training process of the vehicle flow data determination model is as follows: Collecting historical sensor traffic flow data and image traffic flow data and corresponding actual traffic flow data as a training data set, and inputting the training data set into a preset neural network for training to obtain the traffic flow data determination model; The preset neural network is constructed based on the Bayesian probability formula, and the optimal relationship between the sensor vehicle flow data, the image vehicle flow data and the final vehicle flow data is adjusted through multiple trainings.

3. The vehicle flow detection method based on artificial intelligence according to claim 2 is characterized in that: The expression of the Bayesian probability formula is: Among them, P(A|B1, B2) represents the probability of event A occurring under the condition that events B1 and B2 occur, P(B1|A) represents the probability of event B1 occurring under the condition that event A occurs, P(B2|A) represents the probability of event B2 occurring under the condition that event A occurs, P(A) is the prior distribution of the independent occurrence of event A, P(B1, B2) is a normalization constant, event A = {actual traffic flow}, event B1 = {sensor traffic flow data}, event B2 = {image traffic flow data}.

4. The vehicle flow detection method based on artificial intelligence according to claim 2 is characterized in that: The training process of the vehicle flow data determination model also includes: Determine the target environment that meets the fusion monitoring conditions and obtain the historical traffic flow information of the preset road section under the target environment; Divide the target environment into multiple sub-environments according to time periods, dates, and weather conditions, and determine the traffic flow information corresponding to the sub-environments respectively, wherein each sub-environment includes a combination of a time period, a date, and a weather condition; The traffic flow information corresponding to each sub-environment is counted to obtain traffic flow statistics information of the preset road section in each sub-environment, and the prior distribution type of the traffic flow in each sub-environment is determined according to the traffic flow statistics information; Create a lookup table in the model that stores the corresponding prior distribution types for different sub-environments, and add time period, date, and weather conditions as auxiliary features to the training dataset; When training the model, the corresponding prior distribution type and the corresponding prior distribution are retrieved from the lookup table according to the input sub-environment for training. After the training is completed, the sub-environment will be added as part of the input data. Based on the input sub-environment, the model will dynamically select the corresponding prior distribution and give the final traffic flow data.

5. The vehicle flow detection method based on artificial intelligence according to claim 1 is characterized in that: The step of determining the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data comprises: Determining whether the sensor vehicle flow data and the image vehicle flow data are consistent; When the sensor vehicle flow data and the image vehicle flow data are consistent, selecting any one of them as the final vehicle flow data; When the sensor vehicle flow data and the image vehicle flow data are inconsistent, the step of inputting the sensor vehicle flow data and the image vehicle flow data into the pre-trained vehicle flow data determination model to obtain the corresponding final vehicle flow data is executed.

6. The vehicle flow detection method based on artificial intelligence according to claim 1, wherein the monitoring sensor is a geomagnetic sensor, a ground induction coil or an infrared sensor, characterized in that: The step of determining the traffic flow information on the preset road section according to the sensor data comprises: A geomagnetic sensor monitors the change in geomagnetic field caused by vehicles to detect vehicle flow information; or Ground induction coils detect vehicle flow by sensing changes in electromagnetic signals generated when vehicles pass by; or Infrared sensors detect traffic flow information through changes in reflected signals.

7. The vehicle flow detection method based on artificial intelligence according to claim 1 is characterized in that: The step of determining the traffic flow information on the preset road section according to the image information comprises: Collect traffic flow videos of various scenes, skip frames from the traffic flow video stream, select a preset number of images, and annotate them to obtain a training data set; Construct a YOLOv5s neural network and input the training data set into the YOLOv5s neural network for deep learning training to obtain the corresponding traffic flow calculation model; The image information is input into a vehicle flow calculation model to obtain corresponding vehicle flow information.

8. A vehicle flow detection system based on artificial intelligence, characterized in that: Used to detect the traffic flow on a preset road section, where a vehicle monitoring sensor and an image acquisition device are respectively arranged on the preset road section, the system comprises: An acquisition module, used to acquire current environment information on a preset road section when receiving a traffic flow detection request; A first vehicle flow detection module, used to obtain sensor information collected by a vehicle monitoring sensor when the current environmental information meets the sensor monitoring conditions, and determine the vehicle flow information on a preset road section according to the sensor information; A second vehicle flow detection module is used to obtain image information collected by the image acquisition device when the current environmental information meets the image acquisition monitoring conditions, and determine the vehicle flow information on the preset road section according to the image information; The third vehicle flow detection module is used to obtain sensor vehicle flow data and image vehicle flow data obtained from information collected by the vehicle monitoring sensor and the image acquisition device respectively when the current environmental information meets the fusion monitoring conditions, and determine the final vehicle flow data based on the sensor vehicle flow data and the image vehicle flow data.

9. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.