A method and system for predicting the behavior of pedestrians running red lights in sparse scenarios
By setting up multiple zones at traffic intersections, using cameras to collect image data and building a red-light running prediction model, the problem of predicting pedestrian red-light running behavior in sparse scenarios is solved. This enables early identification and warning of pedestrians' intention to run red lights, reducing traffic hazards.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies cannot effectively predict pedestrians running red lights in sparse scenarios. They can only record the incident afterward and cannot identify in advance the dynamic intentions of pedestrians such as speeding in or hesitating, thus creating traffic hazards.
By setting up multiple zones at traffic intersections and collecting image data using traffic cameras, and combining object detection, behavior detection, and trajectory analysis, a red-light running prediction model is constructed to predict pedestrians' intention to run red lights. This includes the training and application of the object detection model, behavior detection model, and red-light running prediction model.
It enables the prediction and recognition of pedestrians running red lights in sparse scenarios, effectively preventing traffic violations and reducing the incidence of traffic accidents.
Smart Images

Figure CN121053612B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent traffic control, and particularly relates to a prediction method and system for pedestrian red-light-running behavior in a sparse scene. BACKGROUND
[0002] With the rapid development of intelligent traffic systems, pedestrian red-light-running monitoring technology has gradually become a core means to ensure intersection safety. However, in road sections with less traffic, the behavior of pedestrians running red lights is more likely to occur due to carelessness or recklessness. The existing technology in practical application adopts a static matching logic of "position-signal timing", such as determining a violation when a pedestrian enters a no-entry area and the red light is on. This method can only achieve post-recording and cannot identify dynamic intentions such as accelerating into the intersection or hesitating, which easily forms an unavoidable traffic hazard. SUMMARY
[0003] The problem to be solved by the present application is to realize the pre-judgment of pedestrian red-light-running behavior in a sparse scene, and a prediction method and system for pedestrian red-light-running behavior in a sparse scene are proposed.
[0004] To achieve the above-mentioned purpose, the present application realizes the following technical scheme:
[0005] A prediction method for pedestrian red-light-running behavior in a sparse scene, comprising the following steps:
[0006] S1. A first area and a second area are set in the traffic camera collection range of the traffic intersection, the first area is a pedestrian waiting area controlled by a traffic light, the second area is a pedestrian walking area not controlled by a traffic light, and the first area is adjacent to the second area;
[0007] S2. The traffic camera collects pedestrian image data of the first area and pedestrian image data of the second area, uses a target detection model to perform real-time target detection processing on the first area, judges whether a pedestrian enters the first area according to the target detection result, if a pedestrian enters the first area, uses a behavior detection model to perform static behavior detection on the pedestrian, and if the behavior of the pedestrian detected conforms to a preset behavior, determines that the pedestrian is a target pedestrian;
[0008] S3. The target pedestrian determined in step S2 is tracked using a target tracking method to obtain an image sequence of the target pedestrian in the first area, and a pedestrian re-identification method is used to find the second area image corresponding to the target pedestrian in the pedestrian image data of the second area to obtain an image sequence of the target pedestrian in the second area;
[0009] S4. Trajectory data of the target pedestrian is obtained by performing trajectory extraction on the image sequence of the target pedestrian in the first area and the image sequence of the target pedestrian in the second area obtained in step S3, and behavior sequence of the target pedestrian is obtained by performing behavior extraction.
[0010] S5. Based on the trajectory data of the target pedestrian and the behavior sequence of the target pedestrian obtained in step S4, whether the intention of the pedestrian is a red light running intention is determined by the speed trend of the trajectory data of the target pedestrian, and then the behavior probability value of the target pedestrian is calculated by the behavior sequence of the target pedestrian to determine whether the intention of the pedestrian is a red light running intention, to obtain positive samples and negative samples of red light running.
[0011] S6. Based on the positive samples and negative samples of red light running obtained in step S5, a training data set of the red light running prediction model is constructed.
[0012] S7. A red light running prediction model is constructed, the training data set of the red light running prediction model obtained in step S6 is used to train the red light running prediction model, a trained red light running prediction model is obtained, and the trained red light running prediction model is used to predict the red light running behavior of pedestrians in a sparse scene.
[0013] Further, the number of the first area in step S1 is 1, and the number of the second area is 2-4.
[0014] Further, the target detection model in step S2 is a convolutional neural network, the first sample image labeled with a pedestrian frame is input into the target detection model to be trained, the target detection model to be trained outputs a detection result, the detection result is a pedestrian target frame, a first error is calculated between the detected pedestrian target frame and the labeled pedestrian frame, a first error value is obtained, the first error value is used as an optimization target, the first error value is used for back propagation, model parameters in the target detection model to be trained are adjusted, and the adjustment process of the model parameters is iterated until the total error value reaches a preset value or the iteration number reaches a preset number, the training is stopped, and a trained target detection model is obtained.
[0015] The behavior detection model in step S2 is a convolutional neural network, the sample image labeled with a behavior label is used to train the behavior detection model, a trained behavior detection model is obtained, the sample image labeled with the behavior label is input into the behavior detection model to be trained, the behavior detection model to be trained outputs a detection result, the detection result is a pedestrian behavior, an error is calculated between the detected pedestrian behavior and the behavior label, a second error value is obtained, the error value is used as an optimization target, the error value is used for back propagation, model parameters in the behavior detection model to be trained are adjusted, and the adjustment process of the model parameters is iterated until the total error value reaches a preset value or the iteration number reaches a preset number, the training is stopped, and a trained behavior detection model is obtained.
[0016] Further, the specific implementation method of step S4 includes the following steps:
[0017] S4.1. Perform frame-by-frame target detection on the image sequence of the target pedestrian in the first area and the image sequence of the target pedestrian in the second area, obtain the target box of the target pedestrian, sort the center point positions of the target box according to the time sequence of the image frames, and obtain the trajectory data of the target pedestrian.
[0018] S4.2. Perform behavior detection on the target pedestrian in step S4.1, sort the behavior of the target pedestrian in each frame of image according to the time sequence of the image frames, and obtain the behavior sequence of the target pedestrian.
[0019] Further, the expression for calculating the behavior probability value of the target pedestrian in step S5 is:
[0020]
[0021] wherein r is the behavior probability value of the target pedestrian, N is the total number of behaviors in the behavior sequence, M is the number of target behaviors in the behavior sequence, n is the number of target behavior categories, m is the number of target behaviors in a category, is the time length of the jth target behavior in the ith category, is the occurrence frequency of a category, is the weight corresponding to the ith category, is the number of the ith category in the first half of the behavior sequence, is the number of the ith category in the second half of the behavior sequence.
[0022] Further, the positive samples in step S5 are the trajectory data and behavior sequence extracted from the real red light running videos, and the negative samples are the trajectory data and behavior sequence extracted from the real non-red light running videos.
[0023] Further, the red light running prediction model constructed in step S7 includes a first input network, a second input network, a feature extraction network, and an output network, wherein the first input network is used to encode the trajectory data into a first feature vector, the second input network is used to encode the behavior sequence into a second feature vector, the feature extraction network is used to perform channel fusion or splicing fusion on the first feature vector and the second feature vector, and extract an intermediate feature from the fused vector, and the output network decodes the intermediate feature to obtain the prediction probability of the red light running intention.
[0024] Further, in step S7, the first input network adopts Bi-LSTM, the second input network adopts 1D CNN, and the first feature vector and the second feature vector are fused through cross-attention Cross-Attention.
[0025] Further, the loss function of model training in step S7 is as follows:
[0026]
[0027] Wherein, L is an error loss value, N' is the sample quantity, is a label value, the label ∈{0,1} represents when the positive sample is 1, and the negative sample is 0, is an intention prediction probability.
[0028] Based on the fact that there is no trend of walking speed acceleration in the positive sample, the behavior probability value corresponding to the positive sample is calculated through the behavior probability value calculation formula, then ∈{0, } represents when the positive sample is , the negative sample is 0, is an intention prediction probability.
[0029] Each positive sample corresponding to the trend of no walking speed acceleration corresponds to a behavior probability value as a positive sample label, for the positive sample corresponding to the trend of walking speed acceleration, the positive sample label is still 1, and an improved loss function is obtained as follows:
[0030]
[0031] Wherein, is the i-th behavior probability value of the target pedestrian;
[0032] Through the improved loss function considering the behavior probability before running a red light, the positive sample corresponding to the trend of no walking speed acceleration is added as a difficult positive sample for training, and the corresponding behavior probability value is used as the corresponding positive sample label, so that the fitting result of model training is improved.
[0033] A pedestrian red light running behavior prediction system in a sparse scene, comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the computer program runs the steps of the pedestrian red light running behavior prediction method in a sparse scene.
[0034] The beneficial effects of the present application are:
[0035] The method for predicting the behavior of pedestrians running red lights in a sparse scene according to the present application can predict and identify the behavior of pedestrians running red lights in a sparse scene, mainly including the collection and processing of the trajectories and behaviors of pedestrians, and the judgment of the intentions of pedestrians. By effectively identifying the intention of pedestrians running red lights, the behavior of pedestrians trying to run red lights can be prompted to effectively prevent the traffic violation behavior of pedestrians and reduce the incidence of traffic accidents. The present application can effectively solve the problem in the prior art that the static identification of pedestrians running red lights in a sparse scene can only achieve post-recording and cannot identify the dynamic intentions of pedestrians such as accelerating into and hesitating to enter to give early warnings, which can easily form an unignorable traffic hazard. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 A flowchart of the method for predicting the behavior of pedestrians running red lights in a sparse scene according to the present application. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application, i.e., the described specific embodiments are only a part of the embodiments of the present application, but not all the specific embodiments. The components of the specific embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations, and the present application can also have other embodiments.
[0038] Therefore, the detailed description of the specific embodiments of the present application provided below in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected specific embodiments of the present application. Based on the specific embodiments of the present application, all other specific embodiments obtained by those skilled in the art without making creative efforts fall within the scope of the present application.
[0039] In order to further understand the inventive content, characteristics and effects of the present application, the following specific embodiments are exemplified, and the accompanying drawings are provided. Figure 1 The detailed description is as follows:
[0040] Example 1
[0041] A method for predicting the behavior of pedestrians running red lights in a sparse scene includes the following steps:
[0042] S1. A first area and a second area are set in the collection range of a traffic camera at a traffic intersection, the first area is a pedestrian waiting area controlled by a red light, the second area is a pedestrian walking area not controlled by a red light, and the first area and the second area are adjacent;
[0043] Furthermore, in step S1, the number of the first region is 1, and the number of the second region is 2 to 4;
[0044] S2. The traffic camera collects pedestrian image data of the first area and the second area. The target detection model is used to perform real-time target detection processing on the first area. Based on the target detection results, it is determined whether a pedestrian has entered the first area. If a pedestrian has entered the first area, the pedestrian is subjected to static behavior detection using a behavior detection model. If the detected pedestrian's behavior matches the preset behavior, the pedestrian is determined to be the target pedestrian.
[0045] Furthermore, in step S2, the target detection model is a convolutional neural network. The first sample image with the pedestrian bounding box is input into the target detection model to be trained. The target detection model to be trained outputs the detection result, which is the pedestrian bounding box. The detected pedestrian bounding box and the labeled pedestrian bounding box are compared to calculate the first error value. The first error value is minimized as the optimization objective. Backpropagation is performed through the first error value to adjust the model parameters in the target detection model to be trained. The adjustment process of the model parameters is iterated until the total error value reaches the preset value or the number of iterations reaches the preset number. Then, training stops, and the trained target detection model is obtained.
[0046] Furthermore, the object detection model can be a convolutional neural network (CNN), such as LeNet, AlexNet, VGGNet, etc. The first error can be calculated using the cross-entropy loss function or the squared difference loss function.
[0047] Furthermore, when the number of people waiting in the first area is less than or equal to one, and the pedestrian light is red, target detection is performed on the real-time image captured in the first area to detect pedestrian targets in the real-time image. If a new pedestrian target is detected in the real-time image, static behavior detection is performed on the new pedestrian target. If the detected pedestrian target's behavior matches a preset behavior (such as looking at a mobile phone, making a phone call, looking around, etc.), the pedestrian target is determined as the target pedestrian. The target pedestrian is tracked using a target tracking algorithm to obtain the first area image corresponding to the target pedestrian. Then, a pedestrian re-identification algorithm is used to find the second area image corresponding to the target pedestrian in the image data of the second area. The aforementioned target pedestrian can be at least one.
[0048] In step S2, the behavior detection model is a convolutional neural network. The behavior detection model is trained using sample images labeled with behavior tags to obtain a trained behavior detection model. The sample images labeled with behavior tags are then input into the behavior detection model to be trained, and the behavior detection model outputs the detection result, which is the pedestrian behavior. The error between the detected pedestrian behavior and the behavior tag is calculated to obtain a second error value. The optimization objective is to minimize the error value. Backpropagation is performed through the error value to adjust the model parameters in the behavior detection model to be trained, and the adjustment process of the model parameters is iterated until the total error value reaches a preset value or the number of iterations reaches a preset number, at which point training stops, and a trained behavior detection model is obtained.
[0049] Furthermore, the behavior detection model can be a convolutional neural network (CNN), such as the YOLOv series (YOLOv5, YOLOv8, YOLOv11, etc.), SLTM, etc. Error calculation can use the cross-entropy loss function or the squared difference loss function.
[0050] S3. For the target pedestrian determined in step S2, track the target pedestrian using the target tracking method to obtain the image sequence of the target pedestrian in the first region. Then, use the pedestrian re-identification method to find the image of the target pedestrian in the second region from the pedestrian image data in the second region to obtain the image sequence of the target pedestrian in the second region.
[0051] Furthermore, target tracking methods can employ Kalman filtering, MeanShift, Siam R-CNN, Transformer-Based, etc. Person re-identification methods include Part-Based CNN, HA-CNN, ASTPN, etc. Target tracking algorithms and person re-identification algorithms can be understood as algorithms that match the same target in different images based on the same attribute features.
[0052] S4. Perform trajectory extraction on the image sequence of the target pedestrian in the first area and the image sequence of the target pedestrian in the second area obtained in step S3 to obtain the trajectory data of the target pedestrian, and perform behavior extraction to obtain the behavior sequence of the target pedestrian;
[0053] Furthermore, the specific implementation method of step S4 includes the following steps:
[0054] S4.1. Perform frame-by-frame target detection on the image sequence of the target pedestrian in the first region and the image sequence of the target pedestrian in the second region to obtain the target bounding box of the target pedestrian. Sort the center point position of the target bounding box according to the time sequence of the image frames to obtain the trajectory data of the target pedestrian.
[0055] S4.2. Perform behavior detection on the target pedestrians in step S4.1, sort the behavior of the target pedestrians in each frame of the image according to the temporal order of the image frames, and obtain the behavior sequence of the target pedestrians.
[0056] S5. Based on the trajectory data and behavior sequence of the target pedestrian obtained in step S4, firstly, determine whether the pedestrian's intention is to run a red light by the speed trend of the target pedestrian's trajectory data, and then calculate the behavior probability value of the target pedestrian by the behavior sequence of the target pedestrian to determine whether the pedestrian's intention is to run a red light, and obtain positive and negative samples of running a red light.
[0057] Furthermore, based on the trajectory data, it can be determined whether the target pedestrian's walking speed is increasing. If so, the pedestrian's intention is to run a red light. If not, the behavioral sequence can be used to determine if the pedestrian failed to observe traffic lights. If so, the pedestrian's intention is to run a red light; otherwise, it is not. If the walking speed is decreasing, the pedestrian's intention is also not to run a red light. Failure to observe traffic lights can include using a mobile phone, answering a call, or observing traffic flow. In the step of determining whether a target pedestrian has failed to observe traffic lights based on the behavior sequence, the probability value of the target pedestrian failing to observe traffic lights can be calculated based on the duration, frequency, and proportion of the first and last occurrences of the target behavior in the behavior sequence. The magnitude of the behavior probability value determines whether the target pedestrian has failed to observe traffic lights. That is, if the behavior probability value is greater than or equal to the preset probability value, it can be determined that the target pedestrian has failed to observe traffic lights; if the behavior probability value is less than the preset probability value, it can be determined that the target pedestrian has not failed to observe traffic lights.
[0058] Furthermore, the expression for calculating the behavioral probability value of the target pedestrian in step S5 is as follows:
[0059]
[0060] Where r is the probability value of the target pedestrian's behavior, N is the total number of behaviors in the behavior sequence, M is the number of target behaviors in the behavior sequence, n is the number of categories of target behaviors, and m is the number of target behaviors in one category. Let be the duration of the j-th target behavior in the i-th category. The frequency of occurrence of a category, The weight corresponding to the i-th category, Let be the number of the i-th category in the first half of the behavior sequence. The number of the i-th category in the second half of the sequence after the behavior sequence.
[0061] Furthermore, in step S5, positive samples are trajectory data and behavior sequences extracted from real red-light running videos, while negative samples are trajectory data and behavior sequences extracted from real non-red-light running videos.
[0062] S6. Based on the positive and negative samples of red light violations obtained in step S5, construct the training dataset for the red light violation prediction model;
[0063] S7. Construct a red light running prediction model. Use the training dataset of the red light running prediction model obtained in step S6 to train the red light running prediction model to obtain a trained red light running prediction model, which is used to predict pedestrian red light running behavior in sparse scenarios.
[0064] Furthermore, the red-light running prediction model constructed in step S7 includes a first input network, a second input network, a feature extraction network, and an output network. The first input network is used to encode trajectory data into a first feature vector, the second input network is used to encode behavioral sequences into a second feature vector, the feature extraction network is used to perform channel fusion or concatenation fusion of the first and second feature vectors, and extract intermediate features from the fused vector, and the output network decodes the intermediate features to obtain the predicted probability of the red-light running intention.
[0065] Furthermore, in step S7, the first input network uses Bi-LSTM, the second input network uses 1D CNN, and the first feature vector and the second feature vector are fused through cross-attention.
[0066] Furthermore, the loss function for model training in step S7 is as follows:
[0067]
[0068] Where L is the error loss value, and N' is the sample size. For the tag value, the tag When ∈{0,1} represents a positive sample When the value is 1, it is a negative sample. =0, To predict the probability of the intention;
[0069] Based on the premise that there is no trend of increasing walking speed in positive samples, the behavior probability value corresponding to the positive sample is calculated using the behavior probability value calculation formula, and then adopted... ∈{0, } represents positive samples for When negative samples =0, To predict the probability of the intention;
[0070] For each positive sample that does not show a trend of increasing walking speed, there is a corresponding behavioral probability value. As positive sample labels, for positive samples corresponding to a trend of increasing walking speed, their positive sample label remains 1, resulting in the improved loss function. as follows:
[0071]
[0072] in, Let be the probability value of the i-th action of the target pedestrian;
[0073] Through the improved loss function Considering the probability of behavior before running a red light, positive samples that do not show a trend of increasing walking speed are added to the training as difficult positive samples, and their corresponding behavior probability values are used as the labels of the corresponding positive samples, thereby improving the fitting results of model training.
[0074] Furthermore, during the training process, samples are input into the red-light running model to be trained for processing to obtain intent prediction results. The intent prediction results and positive and negative sample labels are then compared using a loss function to calculate the error loss value. With the goal of minimizing the error loss value, the model parameters of the red-light running model to be trained are adjusted through the backpropagation algorithm, and the parameter adjustment process is iterated until the error loss value is less than a preset value or the number of iterations reaches a preset number. At this point, training stops, and the trained red-light running model is obtained.
[0075] Furthermore, after obtaining the trained red-light running model, the trajectory data and behavior sequence of the target pedestrian are input into the red-light running model for processing to obtain the predicted probability value of the target pedestrian's red-light running intention. If the predicted probability value is greater than or equal to the preset probability value, it can be determined that the target pedestrian's intention is to run a red light.
[0076] Example 2:
[0077] A prediction system for pedestrian red-light running behavior in sparse scenarios includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed, it implements the steps of the prediction method for pedestrian red-light running behavior in sparse scenarios as described in Embodiment 1.
[0078] Furthermore, when it is determined that the pedestrian's intention is to run a red light, if the current time at which the pedestrian's intention to run a red light is determined is not the initial time, the roadside voice device can be controlled to provide a prompt. The roadside voice device can have pre-stored prompts, such as "Red light, please wait" or "Please do not cross during the red light", to prompt the pedestrian.
[0079] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0080] Although this application has been described above with reference to specific embodiments, various modifications can be made and components can be replaced with equivalents without departing from the scope of this application. In particular, as long as there is no structural conflict, the features in the specific embodiments disclosed in this application can be combined with each other in any way. The lack of an exhaustive description of these combinations in this specification is merely for the sake of brevity and resource conservation. Therefore, this application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A method for predicting pedestrian red-light running behavior in sparse scenarios, characterized in that, Includes the following steps: S1. Set up a first area and a second area within the range of traffic cameras at the traffic intersection. The first area is a pedestrian waiting area controlled by traffic lights, and the second area is a pedestrian walking area not controlled by traffic lights. The first area and the second area are adjacent to each other. S2. The traffic camera collects pedestrian image data of the first area and the second area. The target detection model is used to perform real-time target detection processing on the first area. Based on the target detection results, it is determined whether a pedestrian has entered the first area. If a pedestrian has entered the first area, the pedestrian is subjected to static behavior detection using a behavior detection model. If the detected pedestrian's behavior matches the preset behavior, the pedestrian is determined to be the target pedestrian. S3. For the target pedestrian determined in step S2, track the target pedestrian using the target tracking method to obtain the image sequence of the target pedestrian in the first region. Then, use the pedestrian re-identification method to find the image of the target pedestrian in the second region from the pedestrian image data in the second region to obtain the image sequence of the target pedestrian in the second region. S4. Perform trajectory extraction on the image sequence of the target pedestrian in the first area and the image sequence of the target pedestrian in the second area obtained in step S3 to obtain the trajectory data of the target pedestrian, and perform behavior extraction to obtain the behavior sequence of the target pedestrian; S5. Based on the trajectory data and behavior sequence of the target pedestrian obtained in step S4, firstly, determine whether the pedestrian's intention is to run a red light by the speed trend of the target pedestrian's trajectory data, and then calculate the behavior probability value of the target pedestrian by the behavior sequence of the target pedestrian to determine whether the pedestrian's intention is to run a red light, and obtain positive and negative samples of running a red light. The expression for calculating the probability value of the target pedestrian's behavior in step S5 is as follows: ; Where r is the probability value of the target pedestrian's behavior, N is the total number of behaviors in the behavior sequence, M is the number of target behaviors in the behavior sequence, n is the number of categories of target behaviors, and m is the number of target behaviors in one category. Let be the duration of the j-th target behavior in the i-th category. The frequency of occurrence of a category, The weight corresponding to the i-th category, Let be the number of the i-th category in the first half of the behavior sequence. This represents the number of the i-th category in the latter half of the sequence following the behavior sequence; S6. Based on the positive and negative samples of red light violations obtained in step S5, construct the training dataset for the red light violation prediction model; S7. Construct a red light running prediction model. Use the training dataset of the red light running prediction model obtained in step S6 to train the red light running prediction model and obtain a trained red light running prediction model, which is used to predict pedestrian red light running behavior in sparse scenarios. The red-light running prediction model constructed in step S7 includes a first input network, a second input network, a feature extraction network, and an output network. The first input network encodes trajectory data into a first feature vector, the second input network encodes behavioral sequences into a second feature vector, the feature extraction network performs channel fusion or concatenation fusion of the first and second feature vectors, and extracts intermediate features from the fused vector, and the output network decodes the intermediate features to obtain the predicted probability of the red-light running intention.
2. The method for predicting pedestrian red-light running behavior in sparse scenarios according to claim 1, characterized in that, In step S1, the number of the first region is 1, and the number of the second region is 2 to 4.
3. The method for predicting pedestrian red-light running behavior in sparse scenarios according to claim 1 or 2, characterized in that, In step S2, the target detection model is a convolutional neural network. The first sample image with the pedestrian bounding box is input into the target detection model to be trained. The target detection model to be trained outputs the detection result, which is the pedestrian bounding box. The detected pedestrian bounding box and the labeled pedestrian bounding box are compared to calculate the first error value. The first error value is minimized as the optimization objective. Backpropagation is performed through the first error value to adjust the model parameters in the target detection model to be trained. The adjustment process of the model parameters is iterated until the total error value reaches the preset value or the number of iterations reaches the preset number. Then, training is stopped, and the trained target detection model is obtained. In step S2, the behavior detection model is a convolutional neural network. The behavior detection model is trained using sample images labeled with behavior tags to obtain a trained behavior detection model. The sample images labeled with behavior tags are then input into the behavior detection model to be trained, and the behavior detection model outputs the detection result, which is the pedestrian behavior. The error between the detected pedestrian behavior and the behavior tag is calculated to obtain a second error value. The optimization objective is to minimize the error value. Backpropagation is performed through the error value to adjust the model parameters in the behavior detection model to be trained, and the adjustment process of the model parameters is iterated until the total error value reaches a preset value or the number of iterations reaches a preset number, at which point training stops, and a trained behavior detection model is obtained.
4. The method for predicting pedestrian red-light running behavior in sparse scenarios according to claim 3, characterized in that, The specific implementation method of step S4 includes the following steps: S4.
1. Perform frame-by-frame target detection on the image sequence of the target pedestrian in the first region and the image sequence of the target pedestrian in the second region to obtain the target bounding box of the target pedestrian. Sort the center point position of the target bounding box according to the time sequence of the image frames to obtain the trajectory data of the target pedestrian. S4.
2. Perform behavior detection on the target pedestrians in step S4.1, sort the behavior of the target pedestrians in each frame of the image according to the temporal order of the image frames, and obtain the behavior sequence of the target pedestrians.
5. The method for predicting pedestrian red-light running behavior in sparse scenarios according to claim 4, characterized in that, In step S5, positive samples are trajectory data and behavior sequences extracted from real red-light running videos, while negative samples are trajectory data and behavior sequences extracted from real non-red-light running videos.
6. The method for predicting pedestrian red-light running behavior in sparse scenarios according to claim 5, characterized in that, In step S7, the first input network uses Bi-LSTM, the second input network uses 1D CNN, and the first feature vector and the second feature vector are fused through cross-attention.
7. The method for predicting pedestrian red-light running behavior in sparse scenarios according to claim 6, characterized in that, The loss function for model training in step S7 is as follows: ; Where L is the error loss value, and N' is the sample size. For the tag value, the tag When ∈{0,1} represents a positive sample When the value is 1, it is a negative sample. =0, To predict the probability of the intention; Based on the premise that there is no trend of increasing walking speed in positive samples, the behavior probability value corresponding to the positive sample is calculated using the behavior probability value calculation formula, and then adopted... ∈{0, } represents positive samples for When negative samples =0, To predict the probability of the intention; For each positive sample that does not show a trend of increasing walking speed, there is a corresponding behavioral probability value. As positive sample labels, for positive samples corresponding to a trend of increasing walking speed, their positive sample label remains 1, resulting in the improved loss function. as follows: ; in, Let be the probability value of the i-th action of the target pedestrian; Through the improved loss function Considering the probability of behavior before running a red light, positive samples that do not show a trend of increasing walking speed are added to the training as difficult positive samples, and their corresponding behavior probability values are used as the labels of the corresponding positive samples, thereby improving the fitting results of model training.
8. A prediction system for pedestrian red-light running behavior in sparse scenarios, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed, implements the steps of a method for predicting pedestrian red-light running behavior in sparse scenarios as described in any one of claims 1-7.
Citation Information
Patent Citations
Edge calculation signal lamp control method and system based on traffic participant behavior analysis
CN120526475A
Object or person attribute characterization
US11460857B1