Road congestion prediction method and device based on training model
By training a model that combines road images, event information, and weather conditions to predict road congestion, this technology solves the problem of congestion caused by non-fixed time periods and accidental events, thus improving vehicle traffic efficiency.
Patent Information
- Application Number
- CN202411678025.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing technologies cannot effectively predict road congestion caused by non-fixed time periods and accidental events, resulting in low vehicle traffic efficiency.
By training a model, road congestion is predicted using road images, road event information, time information, and weather conditions. The model employs a channel attention module, a spatial attention module, and a nonmaximum suppression algorithm for feature extraction and prediction, generating road congestion results.
It enables the prediction of road congestion at intersections during non-fixed time periods and due to occasional accidents, thereby improving the efficiency of vehicle traffic on urban roads.
Smart Images

Figure CN119625977B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and more specifically, relates to a method and apparatus for predicting road congestion based on a trained model. Background Technology
[0002] With the rapid growth of urban population and economy, the number of urban vehicles is also constantly increasing, leading to frequent traffic congestion and low traffic efficiency on urban roads. Therefore, how to improve traffic efficiency is an urgent problem to be solved.
[0003] In related technologies, traffic light timing adjustments and / or traffic control by traffic controllers are typically implemented at high-traffic intersections during morning and evening rush hours to limit traffic flow and ensure rapid vehicle passage. However, this method only applies to intersections with high traffic volume during fixed historical time periods. At intersections with high traffic volume outside of fixed time periods or where traffic congestion is caused by accidents, traffic control centers usually only take measures to alleviate congestion after it occurs, resulting in low traffic efficiency. In other words, many urban intersections cannot predict road congestion, leading to low vehicle throughput. Summary of the Invention
[0004] To address the shortcomings of related technologies, this application provides a road congestion prediction method and apparatus based on a trained model, aiming to solve the problem of traffic congestion caused by high traffic volume at intersections during non-fixed time periods or by accidental incidents.
[0005] Firstly, this application provides a road congestion prediction method based on a trained model, including:
[0006] Obtain road information for the area to be predicted;
[0007] Based on road information, a pre-trained congestion prediction model is used to predict and process road congestion results.
[0008] The road information includes at least one of the following: road images 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 labeled with road congestion and an initial congestion prediction model;
[0011] Based on road information samples and an initial congestion prediction model, iterative training is performed to obtain a fully trained congestion prediction model.
[0012] In some embodiments, based on road information samples and an initial congestion prediction model, iterative training is performed to obtain a trained congestion prediction model, including:
[0013] Based on road information samples labeled with road congestion, the influence weights of different road event information, different time information, and different weather condition information on road congestion were determined.
[0014] Based on the influence weights of different road event information, different time information and different weather conditions 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. The congestion prediction model used in the last training process is taken as the completed congestion prediction model.
[0015] Among them, the congestion prediction model used in at least one training process other than the first training process is obtained by updating the parameters of the congestion prediction model used in the previous training process based on the error between the prediction result of the previous training process and the road congestion label.
[0016] In some embodiments, any one training process in at least one training session includes:
[0017] The channel attention module in the congestion prediction model performs feature extraction, pooling, and dimensionality adjustment operations on road information samples labeled with road congestion to obtain channel features. Then, based on the spatial attention module in the congestion prediction model, channel compression is performed on the channel features to obtain the target key features.
[0018] Generate target detection results corresponding to key target features, and perform prediction processing on the target detection results to obtain the prediction results obtained during the training process.
[0019] In some embodiments, feature extraction is implemented through one or more of the Nonmaximum Suppression Algorithm (NMS) module, the Channel Attention Module (CAM) module, and the Spatial Attention Module (SAM) module in the congestion prediction model.
[0020] In some embodiments, based on road information samples labeled with road congestion, the influence weights of different time information on road congestion are determined, including:
[0021] Based on road images, time information, and weather conditions in the road information samples, the influence weights of different light intensities 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] Secondly, this application provides a road congestion prediction device based on a trained model, comprising:
[0023] The acquisition module is used to acquire road information for the area to be predicted.
[0024] The prediction module is used to perform prediction processing based on road information using a pre-trained congestion prediction model to obtain road congestion results;
[0025] The road information includes at least one of the following: road images within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0026] Thirdly, this application provides an electronic device, comprising: at least one memory for storing a program; and at least one processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the method described in the first aspect or any possible implementation thereof.
[0027] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to perform the method described in the first aspect or any possible implementation thereof.
[0028] Fifthly, this application provides a computer program product that, when run on a processor, causes the processor to perform the method described in the first aspect or any possible implementation thereof.
[0029] The road congestion prediction method and apparatus based on the training model provided in this application use a pre-trained congestion prediction model to predict and calculate road information within a region, and obtain the road congestion result of whether the roads in the region will be congested within a certain period of time. This enables the command center to predict congestion at intersections with high traffic volume at non-fixed time periods or at intersections where accidents occasionally cause traffic congestion, thereby improving the vehicle traffic efficiency of urban roads in various regions. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a schematic flowchart of the road congestion prediction method based on a trained model provided in an embodiment of this application;
[0032] Figure 2 This is a schematic diagram of the feature extraction part of the congestion prediction model provided in the embodiments of this application;
[0033] Figure 3 This application provides a road congestion prediction device based on a trained model.
[0034] Figure 4 This is a schematic diagram of the physical structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] First, the technical terms involved in the embodiments of this application will be introduced.
[0037] (1) Channel Attention Module (CAM);
[0038] The core idea of a channel attention module is to enable the network to adaptively assign weights to each channel, thereby highlighting important channels and suppressing less important ones. This is typically achieved through an additional neural network that learns the importance of each channel in the feature map and assigns a weight value to each channel accordingly.
[0039] When implementing the channel attention module, global average pooling and global max pooling can be used to compress the spatial dimension, generating two channel descriptors. These two descriptors are then fed into a shared multilayer perceptron (MLP) to learn the attention weights for each channel. Finally, the weights are normalized to the [0,1] interval using 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 max pooling: Perform global average pooling and global max pooling operations on the input feature map to compress the feature of each channel into a real number.
[0042] Feature Transformation: The compressed features are nonlinearly transformed using a shared multilayer perceptron (MLP) to learn the attention weights for each channel.
[0043] Weight normalization: The learned weights are normalized to the [0,1] interval using the sigmoid function.
[0044] Feature recalibration: The normalized weights are multiplied by the original feature map to achieve feature recalibration along the channel dimension.
[0045] (2) Spatial Attention Module (SAM);
[0046] Spatial attention modules (SAMs) can focus on specific regions when processing image or video data, improving model performance and efficiency. SAMs focus on the correlations between different locations in the data. By calculating the similarity or correlation between each location in the input data and other locations, SAMs derive attention weights, enabling the network to pay more attention to information relevant to the current task and extract more meaningful features.
[0047] The implementation of the spatial attention module involves the following key steps:
[0048] Input feature map: Assume the size of the input feature map is C×H×W, where C is the number of channels, and H and W are the height and width, respectively.
[0049] Feature mapping: Mapping each location in the feature map to an attention score space. This process is typically implemented using a small convolutional kernel or a fully connected layer, with the goal of generating a corresponding attention weight for each spatial location.
[0050] Weight Calculation: Calculate the attention weight 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 for each position is 1.
[0051] Feature weighted fusion: The calculated weights are applied 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) Nonmaximum suppression algorithm;
[0053] The principle of the Non-Maximum Suppression (NMS) algorithm is to suppress non-maximum elements and retain local maxima, thereby simplifying data and reducing redundancy.
[0054] The implementation steps include the following stages:
[0055] Calculate the score: For object detection tasks, the score for each candidate bounding box is first calculated, which is usually based on the output of the classifier.
[0056] Sorting: Candidate bounding boxes are sorted according to their scores, and the bounding box with the highest score is usually selected as the reference.
[0057] Suppress overlap: Calculate the degree of overlap between the reference bounding box and other bounding boxes (usually using the intersection-union ratio, IoU). If the degree of overlap exceeds a preset threshold, then suppress (i.e. delete) the bounding box with the lower score.
[0058] Repeat: Select the highest-scoring bounding box from the unprocessed bounding boxes and repeat the suppress overlap step until all bounding boxes have been processed.
[0059] Next, the technical solutions provided in the embodiments of this application will be described.
[0060] Figure 1 This is a flowchart illustrating the road congestion prediction method based on a trained model provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes at least the following steps:
[0061] S101. Obtain road information for the area to be predicted;
[0062] The road information includes at least one of the following: road images within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0063] Specifically, the application scenario for the road congestion prediction method is a road area with distributed road cameras. This road area can be an intersection with high traffic volume during fixed time periods (i.e., a high traffic volume intersection during morning and evening rush hours), an intersection with high traffic volume during non-fixed time periods, an intersection where traffic congestion is caused by an accident, or any area that the user wishes to set. This application embodiment does not limit this.
[0064] Optionally, road images can refer to road images captured by road cameras or road image acquisition devices or vehicles; road images include 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 globally unified time standard (UTC), or a specific point in time or time period, such as a certain hour of a day, a certain day of a week, or a certain season of a year. This application embodiment does not limit this.
[0066] Optionally, weather condition information can refer to the weather conditions within the current road area, including rainy, sunny, cloudy, foggy, and snowy days. It can also collect weather parameters corresponding to the weather conditions, such as rainfall for rainy days, visibility for foggy days, and snowfall for snowy days, as weather condition information.
[0067] Optionally, road event information may refer to information related to events occurring within the current road area, including road construction, traffic accidents, and abnormal gatherings of people that may cause traffic congestion.
[0068] S102. Based on road information, the traffic congestion prediction model, which has been pre-trained, is used to perform prediction processing to obtain the road congestion results.
[0069] Specifically, the road congestion result refers to the predicted congestion of roads within the area to be predicted in the future or within a time period corresponding to a preset duration. For example, the preset duration can be 30 minutes or 1 hour, which can be adjusted according to needs.
[0070] Optionally, the congestion prediction results can be classified according to the congestion situation. Level 0 indicates no congestion, Level 1 indicates slight congestion, Level 2 indicates moderate congestion, and Level 3 indicates severe congestion. The classification of congestion situation can be set by the user as needed. Furthermore, the embodiments of this application can provide different congestion situations and / or congestion intensities for users to implement different road control schemes.
[0071] Specifically, this application embodiment performs predictive analysis on road conditions within the predicted area to obtain the predicted congestion situation of the current road in the future. For example, if there is heavy rain on monitored road A and a large number of vehicles are traveling on road A, the system can analyze data such as average vehicle speed and heavy rain to predict that the accident will cause congestion of traffic behind the road, resulting in a level 2 congestion prediction. The system can then send the congestion prediction result and the corresponding control plan to the traffic command center to enable early traffic control and smooth traffic flow before traffic congestion occurs, thereby improving traffic efficiency.
[0072] It should be noted that the road congestion prediction device can pre-store or be flexibly set by the user to different control schemes corresponding to different congestion prediction results.
[0073] The road congestion prediction method based on a training model provided in this application uses a pre-trained congestion prediction model to obtain road congestion results for the region, indicating whether congestion will occur in the region within a certain period of time. This enables the command center to predict congestion at intersections with high traffic volume during non-fixed time periods or at intersections where accidents occasionally cause traffic congestion, thereby improving the 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 labeled with road congestion and an initial congestion prediction model;
[0076] Based on road information samples and an initial congestion prediction model, iterative training is performed to obtain a fully trained congestion prediction model.
[0077] Specifically, the road information samples include multi-dimensional data information about the current area to be predicted or similar areas (which can be determined by the user), namely road images, road event information, time information and weather conditions, as well as the road congestion label corresponding to each sample, which serve as relevant data samples for model training.
[0078] Optionally, the area to be predicted or a similar area can preferably be a road intersection, and the road information sample can preferably be a historical data sample containing road congestion information collected by data acquisition sensors (e.g., cameras) set at the road intersection; the road congestion label of the road information sample can be manually labeled.
[0079] The congestion prediction model is trained using deep learning neural networks based on road information samples and road congestion labels. Through deep learning training, it can accurately predict the current road congestion situation based on road information samples, so as to implement congestion control operation and management plans in advance before traffic congestion occurs, thereby further alleviating traffic congestion and improving traffic efficiency.
[0080] In some embodiments, based on road information samples and an initial congestion prediction model, iterative training is performed to obtain a trained congestion prediction model, including:
[0081] Based on road information samples labeled with road congestion, the influence weights of different road event information, different time information, and different weather condition information on road congestion were determined.
[0082] Based on the influence weights of different road event information, different time information and different weather conditions 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. The congestion prediction model used in the last training process is taken as the completed congestion prediction model.
[0083] Among them, the congestion prediction model used in at least one training process other than the first training process is obtained by updating the parameters of the congestion prediction model used in the previous training process based on the error between the prediction result of the previous training process and the road congestion label.
[0084] Specifically, during iterative training, the following steps (1) to (5) may be included:
[0085] Step a: Determine the impact weights of different road event information, different time information, and different weather condition information on road congestion; whereby the impact weights of different road event information, different time information, and different weather condition information on road congestion can be understood as the mapping between different values of each piece of information and their weights, determined based on a large number of samples.
[0086] a-1. Impact weighting of time information: The degree to which road usage may be affected at different times. For example, roads may be busier during morning and evening rush hours than at night, so the impact weighting for morning and evening rush hours is higher, while the impact weighting for nighttime hours is lower.
[0087] a-2. Impact Weighting of Weather Condition Information: The degree to which road usage may be affected under different weather conditions. For example, rain and snow may cause slippery roads, increasing the risk of accidents, so weather conditions have a higher weighting. The impact weighting of weather condition information can be determined based on the weather conditions and the corresponding weather parameters. The higher the weather condition weighting, the better the weather conditions and the lower the probability of congestion; in other words, the higher the weather condition weighting, the lower the probability of road congestion.
[0088] a-3. Impact Weight of Road Event Information: The degree of impact of a specific road event on road usage. For example, a major traffic accident may lead to prolonged congestion, therefore the impact weight of road event information is higher. The device can monitor relevant information about the occurrence of an event. If there are no events such as vehicle malfunctions, traffic accidents, or road construction, then the road event information is considered "no event," and the corresponding impact weight is 0. If any one or more events such as vehicle malfunctions, traffic accidents, or road construction occur, the device will assign different impact weights based on the relevant information of different events. The impact weight of road event information can be a weight related to the event processing time, which refers to the duration from the occurrence of the event until its completion. 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 determined by those skilled in the art based on experiments in a specified event scenario according to different event information, and the corresponding impact weight is different for different event information. Considering that traffic congestion is often caused by events on the road, event information and corresponding impact weights are incorporated into the training of the road congestion prediction model. The less severe the event, the shorter the event processing time, and the smaller the impact weight, the more the congestion prediction result will be biased towards mild congestion. Conversely, the more severe the event, the longer the event processing time, and the larger the impact weight, the more the congestion prediction result will be biased towards severe congestion.
[0089] Step b: Based on the influence weights of different road event information, different time information, and different weather conditions on road congestion, and using road information samples labeled with road congestion, perform predictive analysis calculations on the congestion prediction model to obtain the predicted congestion results.
[0090] Step c: Calculate the difference between the predicted congestion results and the road congestion labels of the road information samples to obtain the error results.
[0091] Step d: Based on the error results, determine whether the error results meet the error standard indicated by the 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 in this way until the error result meets the error standard indicated by the preset error threshold, and obtain the congestion prediction model that has been trained.
[0093] This application introduces influence weights corresponding to different information in its embodiments. By understanding the weights under different conditions, traffic flow can be better planned, congestion reduced, and traffic flow optimized. By identifying high-risk time periods and weather conditions, preventative measures can be taken, such as increasing police patrols or issuing weather warnings, to improve road safety.
[0094] Based on the weighting information, traffic management and emergency response resources can be allocated more rationally, thus optimizing resource allocation.
[0095] In some embodiments, any one training process in at least one training session includes:
[0096] The channel attention module in the congestion prediction model performs feature extraction, pooling, and dimensionality adjustment operations on road information samples labeled with road congestion to obtain channel features. Then, based on the spatial attention module in the congestion prediction model, channel compression is performed on the channel features to obtain the target key features.
[0097] Generate target detection results corresponding to key target features, and perform prediction processing on the target detection results to obtain the prediction results obtained during the training process.
[0098] In some embodiments, feature extraction is implemented through one or more of the Nonmaximum Suppression Algorithm (NMS) module, the Channel Attention Module (CAM) module, and the Spatial Attention Module (SAM) module in the congestion prediction model.
[0099] Figure 2 This is a schematic diagram of the feature extraction part of the congestion prediction model provided in the embodiments of this application, as shown below. Figure 2As shown, this paper proposes a Channel Attention Module (CAM) and a Spatial Attention Module (SAM) to reconstruct the feature map in the congestion prediction model for object detection. These two modules reconstruct the feature map in the middle of the network, highlighting important features and suppressing general features to improve the final detection performance. CAM determines the importance of pixels by considering the relationships between feature map channels. The input feature map is subjected to global max pooling and average pooling in each channel, then enters a multilayer perceptron for dimensionality reduction and expansion, followed by summation and sigmoid activation, finally yielding the channel attention module MC(F).
[0100] Optionally, in order to adapt to the various complex weather conditions encountered in target detection in real-world application scenarios and enhance the feature representation capability of the detected targets, a channel attention module (CAM) and a spatial attention module (SAM) are introduced in the feature extraction part. This 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 numerous candidate boxes (which can refer to the bounding boxes generated by the congestion prediction model for possible target objects in the road image during the initial stage of road image recognition; these boxes need to undergo subsequent processing, such as non-maximum suppression (NMS), to remove redundancy and improve detection accuracy). Finally, the bounding box with the highest probability in the image is output, merging similar bounding boxes of the same target. This significantly reduces the number of false alarms and effectively improves the accuracy of the target detection algorithm. In the non-maximum suppression algorithm, firstly, the device sorts all candidate detection boxes in the initial list according to their confidence level (referring to the degree of confidence of the congestion prediction model that the candidate detection box contains a target object); secondly, the device moves the detection box with the highest score into the final list, while assigning a unique identifier to each of the remaining boxes; finally, if the overlap area with the highest-scoring detection box is greater than the penalized confidence threshold, it is removed; otherwise, it is retained. This process is iterated once for all other detection boxes until the initial list is empty.
[0102] Specifically, all candidate detection boxes can first be sorted from highest to lowest confidence level. Then, the detection box with the highest confidence level is selected and added to the final detection result list, retaining its identifier. Next, the overlap area between the remaining detection boxes and the selected detection boxes is calculated (usually using the Intersection over Union (IOU)). If the overlap area is greater than a preset threshold, the two boxes are considered to detect the same target, and the detection boxes with lower confidence levels are removed. This process is repeated until all candidate detection boxes have been processed. Finally, the resulting set of detection boxes is the result after NMS processing. Typically, only one optimal detection box is retained for each target, thus improving the accuracy of target detection and reducing the number of false positives.
[0103] To avoid occlusion of vehicles behind during object detection in congested areas or at certain times, or when large vehicles are ahead, which could lead to missed detections by the non-maximum suppression algorithm, this application's embodiment uses a penalty function to reduce the score of the object detection box instead of setting it to 0. This significantly reduces the score of predicted boxes with a high degree of overlap with the object detection box, while having a smaller impact on those with less overlap, thus lowering the missed detection rate and further improving the algorithm's accuracy.
[0104] In some embodiments, based on road information samples labeled with road congestion, the influence weights of different time information on road congestion are determined, including:
[0105] Based on road images, time information, and weather conditions in the road information samples, the influence weights of different light intensities 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 weight of different time information on road congestion can be determined by analyzing road images, time information, and weather conditions to determine the current road light intensity. Then, the influence weight corresponding to the light intensity is used as the weight corresponding to the time information. The greater the light intensity (or the weight corresponding to the time information), the higher the road visibility, the faster the traffic flow, and the lower the probability of congestion. In other words, the greater the light intensity (or the weight corresponding to the time information), the lower the probability of road congestion.
[0107] This application embodiment uses a pre-trained congestion prediction model to obtain road congestion results from road information within a region, indicating whether congestion will occur in the region within a certain period of time. This enables the command center to predict congestion at intersections with high traffic volume at non-fixed time periods or at intersections where accidents occasionally cause traffic congestion, thereby improving the vehicle traffic efficiency of urban roads in various regions.
[0108] Figure 3 This application provides a road congestion prediction device based on a trained model, such as... Figure 3 As shown, the device includes:
[0109] The acquisition module 301 is used to acquire road information of the area to be predicted;
[0110] The prediction module 302 is used to perform prediction processing based on road information using a pre-trained congestion prediction model to obtain road congestion results;
[0111] The road information includes at least one of the following: road images within the prediction area, road event information within the prediction area, time information, and weather condition information.
[0112] It is understood that the detailed functional implementation of each of the above units / modules can be found in the description in the aforementioned method embodiments, 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 labeled with road congestion and an initial congestion prediction model;
[0115] Based on road information samples and an initial congestion prediction model, iterative training is performed to obtain a fully trained congestion prediction model.
[0116] In some embodiments, the training module includes:
[0117] The weight determination submodule is used to determine the 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] The iterative training submodule is used to perform 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 conditions, as well as 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 the error threshold. The congestion prediction model used in the last training process is taken as the completed congestion prediction model.
[0119] Among them, the congestion prediction model used in at least one training process other than the first training process is obtained by updating the parameters of the congestion prediction model used in the previous training process based on the error between the prediction result of the previous training process and the road congestion label.
[0120] In some embodiments, the iterative training submodule includes:
[0121] The feature extraction unit is used to extract features, perform pooling operations and dimensionality increase / decrease operations on road information samples with road congestion labels through the channel attention module in the congestion prediction model to obtain channel features. Then, based on the spatial attention module in the congestion prediction model, channel compression operations are performed on the channel features to obtain target key features.
[0122] The prediction processing unit is used to generate target detection results corresponding to key target features, and to perform prediction processing on the target detection results to obtain the prediction results obtained during the training process.
[0123] In some embodiments, feature extraction is implemented through one or more of the Nonmaximum Suppression Algorithm (NMS) module, the Channel Attention Module (CAM) module, and the Spatial Attention Module (SAM) module 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 weight of different light intensities on road congestion based on road images, time information and weather conditions in the road information samples, and to use the influence weight of different light intensities on road congestion as the influence weight of different time information on road congestion.
[0126] It is understood that the detailed functional implementation of each of the above units / modules can be found in the description in the aforementioned method embodiments, and will not be repeated here.
[0127] It should be understood that the above-described device is used to execute the methods in the above embodiments. The implementation principle and technical effect of the corresponding program modules in the device are similar to those described in the above methods. The working process of the device can be referred to the corresponding process in the above methods, and will not be repeated here.
[0128] Based on the methods described in the above embodiments, this application provides an electronic device. The device may include at least one memory for storing a program and at least one processor for executing the program stored in the memory. When the program stored in the memory is executed, the processor performs the methods described in the above embodiments.
[0129] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 4As shown, the electronic device may include a processor 401, a communications interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communications interface 402, and the memory 403 communicate with each other via the communication bus 404. The processor 401 can call software instructions in the memory 403 to execute the methods described in the above embodiments.
[0130] Furthermore, the logical instructions in the aforementioned memory 403 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0131] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0132] Based on the methods in the above embodiments, this application provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0133] It is understood that the processor in the embodiments of this application can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor can be a microprocessor or any conventional processor.
[0134] The method steps in this application embodiment can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and 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 reside in an ASIC.
[0135] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. 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 one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0136] It is understood that the various numerical designations used in the embodiments of this application are merely for the convenience of description and are not intended to limit the scope of the embodiments of this application.
[0137] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A road congestion prediction method based on a trained model, characterized in that, The method includes: Obtain road information for the area to be predicted; Based on the road information, a pre-trained congestion prediction model is used to perform prediction processing to obtain the road congestion results; The road information includes at least one of the following: road images within the prediction area, road event information within the prediction area, time information, and weather condition information; The congestion prediction model is trained based on the following steps: Obtain road information samples labeled with road congestion and an initial congestion prediction model; Based on the road information samples with road congestion labels, the influence weights of different road event information, different time information, and different weather condition information on road congestion are determined. Based on the influence weights of different road event information, different time information, and different weather conditions 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 the error threshold. The congestion prediction model used in the last training process is then used as the completed congestion prediction model. The congestion prediction model used in each training process other than the first training process is obtained by updating the parameters of the congestion prediction model used in the previous training process based on the error between the prediction result of the previous training process and the road congestion label.
2. The road congestion prediction method according to claim 1, characterized in that, Any one of the training processes in the at least one training process includes: The congestion prediction model uses the channel attention module to perform feature extraction, pooling, and dimensionality adjustment on the road information samples labeled with road congestion to obtain channel features. Then, based on the spatial attention module in the congestion prediction model, the channel features are compressed to obtain the target key features. Generate target detection results corresponding to key target features, and perform prediction processing on the target detection results to obtain the prediction results obtained during the training process.
3. The road congestion prediction method according to claim 2, characterized in that, The feature extraction is achieved through one or more of the following modules in the congestion prediction model: Nonmaximum Suppression (NMS), Channel Attention (CAM), and Spatial Attention (SAM).
4. The road congestion prediction method based on a trained model according to claim 1, characterized in that, Based on the road information samples labeled with road congestion, the influence weights of different time information on road congestion are determined, including: Based on the road images, time information, and weather conditions in the road information samples, the influence weights of different light intensities on road congestion corresponding to the road information samples 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.
5. A road congestion prediction device based on a trained model, characterized in that, include: The acquisition module is used to acquire road information for the area to be predicted. The prediction module is used to perform prediction processing based on the road information using a pre-trained congestion prediction model to obtain road congestion results. The road information includes at least one of the following: road images within the prediction area, road event information within the prediction area, time information, and weather condition information; The prediction module is further configured to acquire road information samples labeled with road congestion tags and an initial congestion prediction model; based on the road information samples labeled with road congestion tags, determine the influence weights of different road event information, different time information, and different weather condition information on road congestion; based on the influence weights of different road event information, different time information, and different weather condition information on road congestion, and the road information samples labeled with road congestion tags, perform at least one training process on the congestion prediction model until the error between the prediction result obtained in the last training process and the road congestion tag is less than an error threshold, and use the congestion prediction model used in the last training process as the completed congestion prediction model; wherein, the congestion prediction model used in each training process other than the first training process is obtained by updating the parameters of the congestion prediction model used in the previous training process based on the error between the prediction result of the previous training process and the road congestion tag.
6. An electronic device / image signal generator / network device / transmitter / terminal / base station / industrial control computer, characterized in that, include: At least one memory for storing computer programs; At least one processor is configured to execute a program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to perform the method as described in any one of claims 1-4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is run on the processor, it causes the processor to perform the method as described in any one of claims 1-4.
8. A computer program product, characterized in that, When the computer program product is run on a processor, the processor causes the processor to perform the method as described in any one of claims 1-4.
Citation Information
Patent Citations
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 section traffic jam prediction method and system
CN116884213A
Road congestion condition prediction method and device
CN117391257A