Training model-based road congestion prediction method and device
Through the road congestion prediction method based on the training model, using road information and pre-trained models for prediction, the problem in the prior art is solved that it is difficult to predict road congestion at high traffic intersections caused by non-fixed time periods and accidental accidents, and the vehicle traffic efficiency is improved.
Patent Information
- Application Number
- CN202411678025.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The prior art is difficult to predict road congestion at high traffic intersections caused by non-fixed time periods or accidents, resulting in inefficient vehicle traffic.
The road congestion prediction method based on the training model is adopted, and road congestion results are obtained by obtaining road information (including road images, road event information, time information and weather condition information) and using a pre-trained congestion prediction model for prediction processing.
The road congestion prediction of high-traffic intersections caused by non-fixed time periods and accidents has been achieved, and the vehicle traffic efficiency of urban roads has been improved.
Smart Images

Figure CN119625977A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and more specifically, to a road congestion prediction method and device based on a training model. Background Art
[0002] With the rapid growth of urban population and economy, the number of urban vehicles is also increasing, resulting in frequent traffic congestion and low traffic efficiency on urban roads. Therefore, how to improve traffic efficiency is an urgent problem that needs to be solved.
[0003] In the related art, traffic lights are usually adjusted and / or traffic control is performed by traffic controllers at high traffic intersections during peak hours in the morning and evening to limit traffic flow and ensure the rapid passage of vehicles on the road. However, this method is only applicable to intersections with high traffic flow at fixed time periods in historical records. At intersections with high traffic flow at non-fixed time periods or intersections where accidents cause vehicle congestion, the traffic control center usually performs traffic diversion operations only after congestion occurs, resulting in low traffic efficiency. That is, many urban intersections cannot achieve road congestion prediction, resulting in low vehicle traffic efficiency. Summary of the invention
[0004] In view of the defects existing in the related technologies, the embodiments of the present application provide a road congestion prediction method and device based on a training model, which aims to solve the problem of vehicle congestion caused by intersections with high traffic volume at non-fixed time periods or accidental accidents.
[0005] In a first aspect, the present application provides a road congestion prediction method based on a training model, comprising:
[0006] Obtain road information of the area to be predicted;
[0007] Based on the road information, the congestion prediction model trained in advance is used to perform prediction processing to obtain the road congestion result;
[0008] The road information includes at least one of the following: a road image within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0009] In some embodiments, the congestion prediction model is trained based on the following steps:
[0010] Obtain road information samples with road congestion labels and an initial congestion prediction model;
[0011] Based on the road information samples and the initial congestion prediction model, iterative training is performed to obtain a trained congestion prediction model.
[0012] In some embodiments, iterative training is performed based on the road information sample and the initial congestion prediction model to obtain a trained congestion prediction model, including:
[0013] Based on the road information samples with road congestion labels, determine the influence weights of different road event information, different time information and different weather condition information on road congestion;
[0014] Based on the influence weights of different road event information, different time information and different weather condition information on road congestion, and road information samples with road congestion labels, the congestion prediction model is trained at least once until the error between the prediction result obtained in the last training process and the road congestion label is less than the error threshold, and the congestion prediction model used in the last training process is used as the trained congestion prediction model;
[0015] Among them, the congestion prediction model used in each training process except the first training process in at least one training process is: based on the error between the prediction result of the previous training process and the road congestion label, the congestion prediction model used in the previous training process is updated after the parameters are updated.
[0016] In some embodiments, any one of the at least one training process includes:
[0017] The channel attention module in the congestion prediction model performs feature extraction, pooling, and dimension lifting and lowering operations on road information samples with road congestion labels to obtain channel features. Then, the spatial attention module in the congestion prediction model performs channel compression operations on the channel features to obtain target key features.
[0018] Generate target detection results corresponding to target key features, and perform prediction processing on the target detection results to obtain prediction results obtained in the training process.
[0019] In some embodiments, feature extraction is implemented by one or more of a non-maximum suppression algorithm NMS module, a channel attention module CAM, and a spatial attention module SAM in the congestion prediction model.
[0020] In some embodiments, based on the road information sample with the road congestion label, determining the influence weights of different time information on the road congestion respectively includes:
[0021] Based on the road image, time information and weather condition information in the road information sample, the influence weights of different light intensities corresponding to the road information sample on road congestion are determined, and the influence weights of different light intensities on road congestion are used as the influence weights of different time information on road congestion.
[0022] In a second aspect, the present application provides a road congestion prediction device based on a training model, comprising:
[0023] An acquisition module is used to obtain road information of the area to be predicted;
[0024] A prediction module is used to perform prediction processing based on road information through a pre-trained congestion prediction model to obtain road congestion results;
[0025] The road information includes at least one of the following: a road image within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0026] In a third aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0027] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0028] In a fifth aspect, the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0029] The training model-based road congestion prediction method and device provided in the embodiments of the present application predict and calculate the road information in a region through a pre-trained congestion prediction model, and obtain the road congestion results of whether the roads in the current region will be congested within a period of time. This enables the command center to realize congestion prediction at intersections with high traffic volume in non-fixed time periods or intersections where accidents cause vehicle congestion, thereby improving the vehicle traffic efficiency of urban roads in various regions. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0031] Figure 1 It is a flowchart of a road congestion prediction method based on a training model provided in an embodiment of the present application;
[0032] Figure 2 It is a structural schematic diagram of the feature extraction part of the congestion prediction model provided in an embodiment of the present application;
[0033] Figure 3 It is a road congestion prediction device based on a training model provided in an embodiment of the present application;
[0034] Figure 4 It is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0036] First, the technical terms involved in the embodiments of the present application are introduced.
[0037] (1) Channel Attention Module (CAM);
[0038] The core idea of the channel attention module is to enable the network to adaptively assign weights to each channel, thereby highlighting important channels and suppressing less important channels. This is usually achieved through an additional neural network that learns the importance of each channel of the feature map and assigns a weight value to each channel accordingly.
[0039] When implementing the channel attention module, global average pooling and global maximum pooling can be used to compress the spatial dimension and generate two channel descriptors. These two descriptors are then fed into a shared multi-layer perceptron (MLP) to learn the attention weights for each channel. Finally, the weights are normalized to the [0,1] interval through the sigmoid function and multiplied with the original feature map to achieve feature recalibration in the channel dimension.
[0040] Specifically, the implementation steps of the channel attention module can be summarized as follows:
[0041] Global average pooling and global maximum pooling: Perform global average pooling and global maximum pooling operations on the input feature map to compress the features of each channel into a real number.
[0042] Feature transformation: The compressed features are nonlinearly transformed through a shared multi-layer perceptron (MLP) to learn the attention weights of each channel.
[0043] Weight normalization: The learned weights are normalized to the [0,1] interval through the sigmoid function.
[0044] Feature recalibration: Multiply the normalized weights with the original feature map to achieve feature recalibration in the channel dimension.
[0045] (2)Spatial Attention Module (SAM);
[0046] The spatial attention module can focus on specific areas when processing image or video data to improve the performance and efficiency of the model. The spatial attention module focuses on the correlation between different positions in the data. By calculating the similarity or correlation between each position in the input data and other positions, SAM can derive attention weights, so that the network pays more attention to information related to the current task and extracts more meaningful features.
[0047] When implementing the spatial attention module, the following key steps are involved:
[0048] Input feature map: Assume that the size of the input feature map is C×H×W, where C is the number of channels, H and W are the height and width respectively.
[0049] Feature Mapping: Map each position in the feature map to an attention score space. This process is usually implemented using a small convolution kernel or a fully connected layer to generate a corresponding attention weight for each spatial position.
[0050] Weight calculation: Calculate the attention weights for each position and normalize these attention scores into a probability distribution using an activation function (such as softmax) to ensure that the sum of the attention weights at each position is 1.
[0051] Weighted feature fusion: Apply the calculated weights to the original feature map to obtain a weighted feature map. In this way, the network can pay more attention to areas with high attention weights and suppress areas with low attention weights.
[0052] (3) Non-maximum suppression algorithm;
[0053] The principle of the non-maximum suppression (NMS) algorithm is to simplify data and reduce redundancy by suppressing non-maximum elements and retaining local maxima.
[0054] The implementation steps include the following stages:
[0055] Calculate scores: For object detection tasks, we first calculate the score of each candidate bounding box, which is usually based on the output of a classifier.
[0056] Sorting: Sort the candidate bounding boxes according to their scores, and usually choose the bounding box with the highest score as the reference.
[0057] Suppress overlap: Calculate the degree of overlap between the reference bounding box and other bounding boxes (usually using the intersection over union (IoU)). If the overlap exceeds a preset threshold, suppress (i.e., delete) the bounding box with the lower score.
[0058] Repeat: Select the bounding box with the highest score from the unprocessed bounding boxes and repeat the suppression of overlap step until all bounding boxes have been processed.
[0059] Next, the technical solutions provided in the embodiments of the present application are introduced.
[0060] Figure 1 is a flow chart of a road congestion prediction method based on a training model provided in an embodiment of the present application, such as Figure 1 As shown, the method at least includes the following steps:
[0061] S101, obtaining road information of the area to be predicted;
[0062] The road information includes at least one of the following: a road image within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0063] Specifically, the application scenario of the road congestion prediction method is regional roads where road shooting cameras are distributed. The regional roads can be intersections with high traffic flow during fixed time periods (i.e., intersections with high traffic flow during peak hours in the morning and evening), intersections with high traffic flow during non-fixed time periods, and intersections where accidental accidents cause vehicle congestion, or any area that the user wishes to set, and the embodiments of the present application are not limited to this.
[0064] Optionally, the road image may refer to a road image taken by a road camera or a road image collected by a road image acquisition device or vehicle; the road image includes road vehicles, buildings, obstacles, and road scenes, etc.
[0065] Optionally, the time information may refer to the current time, such as the time determined based on the universal time standard (UTC), or a specific time point or time period, such as an hour of a day, a day of a week, or a season of a year, which is not limited in the embodiments of the present application.
[0066] Optionally, weather condition information may refer to weather conditions in the current regional road range, including rainy days, sunny days, cloudy days, foggy days and snowy days. Weather parameters corresponding to the weather conditions may also be collected as weather condition information, such as rainfall corresponding to rainy days, visibility corresponding to foggy days and snowfall corresponding to snowy days.
[0067] Optionally, the road event information may refer to relevant information of events occurring within the current road area, including road construction, road accidents, abnormal crowd gathering and other events that may cause traffic congestion.
[0068] S102: Based on the road information, a pre-trained congestion prediction model is used to perform prediction processing to obtain a road congestion result.
[0069] Specifically, the road congestion result refers to the result of the congestion prediction of the roads within the predicted area in the future or in a time period corresponding to a preset time length. For example, the preset time length can be 30 minutes or 1 hour, which can be adjusted according to demand.
[0070] Optionally, the congestion prediction results can be graded according to the congestion situation. No congestion can be level 0, slight congestion can be level 1, moderate congestion can be level 2, and severe congestion can be level 3. The classification of the congestion situation can be set according to needs, and the embodiments of the present application can provide different congestion situations and / or congestion intensities for users to implement different road control plans.
[0071] Specifically, the embodiment of the present application performs predictive analysis on the road conditions within the prediction area to obtain the predicted congestion situation of the current road in the future. For example, when there is heavy rain on the monitored road A and a large number of vehicles are traveling on the road A, it can be analyzed based on the average vehicle speed and heavy rain data that the accident will cause a congestion prediction result of level 2 congestion in the rear traffic flow. The congestion prediction result and the corresponding control plan can be sent to the traffic command center to achieve early command and unblocking of road traffic before traffic congestion occurs, so as to improve traffic efficiency.
[0072] It should be noted that different control schemes corresponding to different congestion prediction results may be pre-stored in the road congestion prediction device or flexibly set by the user.
[0073] The training model-based road congestion prediction method provided in the embodiment of the present application uses the pre-trained congestion prediction model to obtain the road congestion results of whether the roads in the current area will be congested within a period of time based on the road information in the area. This allows the command center to achieve congestion prediction at intersections with high traffic volume in non-fixed time periods or intersections where accidents cause vehicle congestion, thereby improving the vehicle traffic efficiency of urban roads in various regions.
[0074] In some embodiments, the congestion prediction model is trained based on the following steps:
[0075] Obtain road information samples with road congestion labels and an initial congestion prediction model;
[0076] Based on the road information samples and the initial congestion prediction model, iterative training is performed to obtain a trained congestion prediction model.
[0077] Specifically, the road information sample includes multi-dimensional data information about the current area to be predicted or a similar area (the similar area can be determined by the user), namely, road images, road event information, time information and weather condition information, as well as the road congestion label corresponding to each sample, as relevant data samples for model training.
[0078] Optionally, the area to be predicted or a similar area may preferably be a road intersection, and the road information sample may preferably be a historical data sample containing road congestion conditions collected by a data acquisition sensor (such as a camera) installed at the road intersection; the road congestion label of the road information sample may be manually marked.
[0079] The congestion prediction model is obtained by deep learning training of neural networks based on road information samples and road congestion labels of the samples. Through deep learning training of neural networks, it is possible to make accurate predictions on the current road congestion based on road information samples, so as to implement congestion control operation management plans in advance before traffic congestion occurs, thereby further alleviating traffic congestion and improving traffic efficiency.
[0080] In some embodiments, iterative training is performed based on the road information sample and the initial congestion prediction model to obtain a trained congestion prediction model, including:
[0081] Based on the road information samples with road congestion labels, determine the influence weights of different road event information, different time information and different weather condition information on road congestion;
[0082] Based on the influence weights of different road event information, different time information and different weather condition information on road congestion, and road information samples with road congestion labels, the congestion prediction model is trained at least once until the error between the prediction result obtained in the last training process and the road congestion label is less than the error threshold, and the congestion prediction model used in the last training process is used as the trained congestion prediction model;
[0083] Among them, the congestion prediction model used in each training process except the first training process in at least one training process is: based on the error between the prediction result of the previous training process and the road congestion label, the congestion prediction model used in the previous training process is updated after the parameters are updated.
[0084] Specifically, during iterative training, the following steps (1) to (5) may be included:
[0085] Step a, determining the influence weights of different road event information, different time information and different weather condition information on road congestion; wherein, the influence weights of different road event information, different time information and different weather condition information on road congestion can be understood as a mapping between different values of each information determined based on a large number of samples and weights.
[0086] a-1. Impact weight corresponding to time information: the degree of impact that road usage may be affected in different time periods. For example, roads during peak hours in the morning and evening may be busier than late at night, so the impact weight corresponding to peak hours in the morning and evening is higher, and the impact weight corresponding to late night time is lower.
[0087] a-2. Impact weight corresponding to weather condition information: the degree of impact that road usage may be subject to under different weather conditions. For example, rainy and snowy weather may cause slippery roads and increase the risk of accidents, so the weather condition weight is higher. The impact weight corresponding to weather condition information can be determined based on the weather conditions and the weather parameters corresponding to the weather conditions. The larger the weather condition weight, the better the weather conditions and the lower the probability of congestion. That is, the larger the weather condition weight, the lower the probability of road congestion.
[0088] a-3. Impact weight corresponding to road event information: the degree of impact of a specific road event on road usage. For example, a major traffic accident may cause long-term congestion, so the impact weight corresponding to the road event information is higher. The relevant information of the event can be monitored. If there are no vehicle failures, traffic accidents, road construction and other events, then the road event information has no events, and the corresponding impact weight is 0; if any one or more events such as vehicle failures, traffic accidents, road construction and the like occur, the device will assign different impact weights according to the relevant information of different events, where the impact weight corresponding to the road event information can be the weight on the event processing time, and the event processing time refers to the time from the occurrence of the event to the completion of the event processing. Event information includes the type and / or nature of the event, the location of the event, the start time, etc. The event processing time is usually given by technicians in this field based on different event information and experiments in a specified event scenario, and the corresponding impact weights are different for different event information. Taking into account that traffic congestion is often caused by incidents on the road, event information and corresponding impact weights are added when training the road congestion prediction model. The lighter the incident, the shorter the event processing time, and the smaller the impact weight, the congestion prediction result is more inclined to mild congestion; the more serious the incident, the longer the event processing time, and the larger the impact weight, the congestion prediction result is more inclined to severe congestion.
[0089] Step b: Based on the influence weights of different road event information, different time information and different weather condition information on road congestion, as well as road information samples with road congestion labels, a prediction analysis calculation is performed on the congestion prediction model to obtain a predicted congestion result.
[0090] Step c: Calculate the difference between the predicted congestion result and the road congestion label of the road information sample to obtain an error result.
[0091] Step d: Based on the error result, determine whether the error result meets the error standard indicated by a preset error threshold.
[0092] Step e: If the error result does not meet the error standard indicated by the preset error threshold, based on the error between the prediction result of the previous training process and the road congestion label, update the parameters of the congestion prediction model used in the previous training process, and return to step b. Iterate the training until the error result meets the error standard indicated by the preset error threshold, and obtain the trained congestion prediction model.
[0093] In the embodiment of the present application, the influence weights corresponding to different information are introduced. By understanding the weights under different conditions, traffic flow can be better planned, congestion can be reduced, and traffic flow can be optimized. By identifying high-risk time periods and weather conditions, preventive measures can be taken, such as increasing police patrols or issuing weather warnings, to improve road safety.
[0094] Based on the weight information, traffic management and emergency response resources can be allocated more reasonably and resource allocation can be optimized.
[0095] In some embodiments, any one of the at least one training process includes:
[0096] The channel attention module in the congestion prediction model performs feature extraction, pooling, and dimension lifting and lowering operations on road information samples with road congestion labels to obtain channel features. Then, the spatial attention module in the congestion prediction model performs channel compression operations on the channel features to obtain target key features.
[0097] Generate target detection results corresponding to target key features, and perform prediction processing on the target detection results to obtain prediction results obtained in the training process.
[0098] In some embodiments, feature extraction is implemented by one or more of a non-maximum suppression algorithm NMS module, a channel attention module CAM, and a spatial attention module SAM in the congestion prediction model.
[0099] Figure 2 is a schematic diagram of the structure of the feature extraction part of the congestion prediction model provided in the embodiment of the present application, such as Figure 2As shown in the figure, a channel attention module CAM (Channel Attention Module) and a spatial attention module SAM (Spatial Attention Module) are proposed in the structure of the target detection function of the congestion prediction model. The feature map in the middle of the network is reconstructed through the two modules, and important features are highlighted and general features are suppressed to improve the final detection effect. Among them, CAM determines the importance of pixels by considering the relationship between channels in the feature map. The input feature map uses global maximum pooling and average pooling on each channel, and then enters the multi-layer perceptron for dimensionality reduction and dimensionality increase operations, and then performs summation operations and Sigmoid activation, and finally obtains the channel attention MC (F).
[0100] Optionally, in order to adapt to various complex weather conditions encountered in target detection in actual application scenarios and enhance the feature expression capability of the detected target, the channel attention module CAM and the spatial attention module SAM are introduced in the feature extraction part, which enables the network to effectively extract key features, thereby further improving the accuracy of target detection.
[0101] Optionally, a non-maximum suppression algorithm is used to obtain a large number of candidate boxes (which may refer to the bounding boxes generated by the congestion prediction model for the target objects that may exist in the road image in the preliminary stage of identifying the road image; these boxes need to be processed later, such as non-maximum suppression (NMS), to remove redundancy and improve detection accuracy.); finally, the one with the highest probability is output in the picture, that is, similar bounding boxes of the same target are merged, which greatly reduces the number of false positives and can effectively improve the accuracy of the target detection algorithm. In the non-maximum suppression algorithm, first, the device sorts all the candidate detection boxes in the initial list according to their confidence (referring to the degree of confidence of the congestion prediction model for the target object contained in the candidate detection box); secondly, the device moves the detection box with the highest score into the final list, and the remaining boxes are assigned unique identifiers respectively; finally, when the overlapping area with the detection box with the highest score is greater than the confidence threshold after the penalty, it is removed, otherwise it is retained, and this process is iterated once for all the remaining detection boxes until the initial list is empty.
[0102] Specifically, all candidate detection frames can be first sorted from high to low according to their confidence. Then, select the detection frame with the highest confidence, add it to the final detection result list, and retain the identification of this detection frame. Next, calculate the overlapping area between the remaining detection frames and the selected detection frame (usually using the intersection-over-union ratio IOU). If the overlapping area is greater than the preset threshold, it is considered that the two frames detect the same target. According to the principle of lower confidence, the detection frame with lower confidence is removed. Repeat the above process until all candidate detection frames have been processed. Finally, the resulting detection frame set is the result after NMS processing. Usually only one optimal detection frame is retained for each target, thereby improving the accuracy of target detection and reducing the number of false alarms.
[0103] In order to avoid the situation in which the non-maximum suppression algorithm may cause missed detection in some crowded sections and time periods, or when some large vehicles are in front, the non-maximum suppression algorithm may cause missed detection in such a scenario. Based on the non-maximum suppression algorithm, the embodiment of the present application uses a penalty function to reduce the score of the target detection frame instead of directly setting it to 0. That is, the score of the prediction frame with a large degree of overlap with the target detection frame is greatly reduced, while the impact on the prediction frame with a small degree of overlap is small, thereby reducing the missed detection rate and further improving the accuracy of the algorithm.
[0104] In some embodiments, based on the road information sample with the road congestion label, determining the influence weights of different time information on the road congestion respectively includes:
[0105] Based on the road image, time information and weather condition information in the road information sample, the influence weights of different light intensities corresponding to the road information sample on road congestion are determined, and the influence weights of different light intensities on road congestion are used as the influence weights of different time information on road congestion.
[0106] Specifically, the influence weights of different time information on road congestion can be determined according to the road image, time information and weather condition information, and the light intensity at the current road moment is determined, and then the influence weight corresponding to the light intensity is used as the weight corresponding to the time information. When the light intensity (or the weight corresponding to the time information) is greater, it means that the road visibility is high, the corresponding traffic speed is fast, and the probability of congestion is lower, that is, the greater the light intensity (or the weight corresponding to the time information), the smaller the probability of road congestion;
[0107] The embodiment of the present application uses a pre-trained congestion prediction model to analyze the road information in the area to obtain the road congestion results of whether the roads in the current area will be congested within a period of time, so that the command center can also realize congestion prediction at intersections with high traffic volume in non-fixed time periods or intersections where accidental accidents cause vehicle congestion, thereby improving the vehicle traffic efficiency of urban roads in various regions.
[0108] Figure 3 The road congestion prediction device based on the training model provided in the embodiment of the present application is as follows: Figure 3 As shown, the device comprises:
[0109] An acquisition module 301 is used to acquire road information of a region to be predicted;
[0110] The prediction module 302 is used to perform prediction processing based on road information through a pre-trained congestion prediction model to obtain a road congestion result;
[0111] The road information includes at least one of the following: a road image within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0112] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0113] In some embodiments, the road congestion prediction device further includes a training module for:
[0114] Obtain road information samples with road congestion labels and an initial congestion prediction model;
[0115] Based on the road information samples and the initial congestion prediction model, iterative training is performed to obtain a trained congestion prediction model.
[0116] In some embodiments, the training module includes:
[0117] A weight determination submodule, for determining the influence weights of different road event information, different time information and different weather condition information on road congestion based on road information samples with road congestion labels;
[0118] an iterative training submodule, for performing at least one training process on the congestion prediction model based on the influence weights of different road event information, different time information and different weather condition information on road congestion, and road information samples with road congestion labels, until the error between the prediction result obtained in the last training process and the road congestion label is less than an error threshold, and the congestion prediction model used in the last training process is used as the trained congestion prediction model;
[0119] Among them, the congestion prediction model used in each training process except the first training process in at least one training process is: based on the error between the prediction result of the previous training process and the road congestion label, the congestion prediction model used in the previous training process is updated after the parameters are updated.
[0120] In some embodiments, the iterative training submodule includes:
[0121] A feature extraction unit is used to perform feature extraction, pooling operations, and dimension lifting and lowering operations on road information samples with road congestion labels through a channel attention module in the congestion prediction model to obtain channel features, and then perform channel compression operations on the channel features based on the spatial attention module in the congestion prediction model to obtain target key features;
[0122] The prediction processing unit is used to generate target detection results corresponding to the target key features, and perform prediction processing on the target detection results to obtain the prediction results obtained in the training process.
[0123] In some embodiments, feature extraction is implemented by one or more of a non-maximum suppression algorithm NMS module, a channel attention module CAM, and a spatial attention module SAM in the congestion prediction model.
[0124] In some embodiments, the weight determination submodule includes:
[0125] The influence weight determination unit is used to determine the influence weights of different light intensities corresponding to the road information samples on road congestion based on the road image, time information and weather condition information in the road information samples, and use the influence weights of different light intensities on road congestion as the influence weights of different time information on road congestion.
[0126] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0127] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0128] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The device may include: at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment.
[0129] Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4As shown, the electronic device may include: a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 communicate with each other through the communication bus 404. The processor 401 may call the software instructions in the memory 403 to execute the method described in the above embodiment.
[0130] In addition, the logic instructions in the above-mentioned memory 403 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0131] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0132] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0133] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0134] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0135] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0136] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0137] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A road congestion prediction method based on a training model, characterized in that: The method comprises: Obtain road information of the area to be predicted; Based on the road information, a pre-trained congestion prediction model is used to perform prediction processing to obtain a road congestion result; The road information includes at least one of the following: a road image within the prediction area, road event information within the prediction area, time information, and weather condition information.
2. The road congestion prediction method according to claim 1, characterized in that: The congestion prediction model is trained based on the following steps: Obtain road information samples with road congestion labels and an initial congestion prediction model; Based on the road information samples and the initial congestion prediction model, iterative training is performed to obtain a trained congestion prediction model.
3. The road congestion prediction method according to claim 2, characterized in that: The iterative training is performed based on the road information sample and the initial congestion prediction model to obtain a trained congestion prediction model, including: Based on the road information samples with road congestion labels, determining the influence weights of different road event information, different time information and different weather condition information on road congestion respectively; Based on the influence weights of the different road event information, different time information and different weather condition information on road congestion, and the road information samples with road congestion labels, the congestion prediction model is trained at least once, until the error between the prediction result obtained in the last training process and the road congestion label is less than an error threshold, and the congestion prediction model used in the last training process is used as the trained congestion prediction model; Among them, the congestion prediction model used in each training process except the first training process in the at least one training process is: based on the error between the prediction result of the previous training process and the road congestion label, the congestion prediction model used in the previous training process is updated after the parameters are updated.
4. The road congestion prediction method according to claim 3, characterized in that: Any one of the at least one training process comprises: The channel attention module in the congestion prediction model performs feature extraction, pooling operation and dimension lifting and lowering operation on the road information sample with the road congestion label to obtain channel features, and then performs channel compression operation on the channel features based on the spatial attention module in the congestion prediction model to obtain target key features; Generate target detection results corresponding to target key features, and perform prediction processing on the target detection results to obtain prediction results obtained in the training process.
5. The road congestion prediction method according to claim 4, characterized in that: The feature extraction is implemented by one or more of the non-maximum suppression algorithm NMS module, the channel attention module CAM and the spatial attention module SAM in the congestion prediction model.
6. The road congestion prediction method based on training model according to claim 3 is characterized in that: Based on the road information sample with the road congestion label, determining the influence weights of different time information on the road congestion respectively, including: Based on the road image, time information and weather condition information in the road information sample, the influence weights of different light intensities corresponding to the road information sample on road congestion are determined, and the influence weights of different light intensities on road congestion are used as the influence weights of different time information on road congestion.
7. A road congestion prediction device based on a training model, characterized in that: include: An acquisition module is used to obtain road information of the area to be predicted; A prediction module, configured to perform prediction processing based on the road information through a pre-trained congestion prediction model to obtain a road congestion result; The road information includes at least one of the following: a road image within the prediction area, road event information within the prediction area, time information, and weather condition information.
8. An electronic device / image signal generator / network device / transmitter / terminal / base station / industrial computer, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that When the computer program product runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Highway condition detection method and system
CN110033619A
Highway congestion identification model construction method and device and identification method
CN112101117A
Traffic road condition prediction method and device, electronic equipment and storage medium
CN112382099A
Method and system for predicting road congestion state
CN115457766A
Road traffic jam prediction method and device, electronic equipment and storage medium
CN116189422A
Cited By
Traffic control protection method, device and equipment based on congestion prediction
CN120279715A