A traffic accident video understanding method and system based on key frame visual guidance
By acquiring collision keyframes from traffic accident videos and using visual features to supervise a visual language model, the problem of the low proportion of accident keyframes in existing technologies is solved, improving the accuracy and reliability of accident video understanding and meeting the needs of intelligent traffic accident analysis and insurance claims.
Patent Information
- Application Number
- CN202611659184.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-26
- Publication Date
- 2026-11-20
AI Technical Summary
In existing methods for understanding traffic accident videos, key collision frames account for a relatively small percentage of the complete video, making it difficult for visual language models to effectively extract collision-related visual evidence. This results in insufficient accuracy in identifying the collision subject, determining the accident type, and understanding vehicle interaction relationships.
By acquiring collision keyframes from traffic accident videos and using the visual features of these keyframes as supervisory targets, a visual language model is guided to learn key visual information about collisions in traffic accident videos. Furthermore, spatial understanding is used to enhance the training process and improve the model's ability to understand the spatial and motion relationships of vehicles.
It improves the accuracy and reliability of traffic accident video understanding results, and can better meet the application needs of intelligent traffic accident analysis, auxiliary liability determination and insurance claims.
Smart Images

Figure CN123142133A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of intelligent transportation, computer vision and artificial intelligence, and in particular relates to a method and system for understanding traffic accident videos based on keyframe visual guidance. Background Technology
[0002] With the development of intelligent transportation systems and vehicle-mounted video acquisition equipment, automated analysis of traffic accident videos collected by dashcams, vehicle cameras, and road monitoring equipment has become an important technological direction for assisting in accident handling, liability determination, insurance claims, and driving safety analysis. Existing methods for understanding traffic accident videos typically analyze vehicles, road environments, and behavioral processes in accident videos using computer vision models or visual language models to achieve accident detection, classification, or description generation. However, traffic accidents are inherently instantaneous and complex. The visual information that truly determines the accident type, collision relationship, and liability determination is usually concentrated in a small number of video frames before and after the collision. Complete accident videos often contain a large amount of non-critical content such as normal driving and changes in the road environment, making it easy for effective accident clues to be weakened by a large amount of irrelevant video information. This affects the model's accurate understanding of the collision subjects, vehicle interaction processes, and accident causes.
[0003] In recent years, some studies have attempted to utilize visual language models for semantic understanding of traffic scenes, aiming to convert video content into natural language descriptions. For example, patent application CN121074749A relates to a method for traffic event analysis based on video content. It primarily achieves traffic event identification through video information extraction and model inference. However, this type of method mainly focuses on understanding the overall video content, lacking specific attention to how the model can effectively utilize a small amount of key visual evidence of collisions during an accident. Patent application CN121789184A relates to technologies related to traffic scene understanding, emphasizing the analysis of traffic objects or events based on visual information. However, it still relies heavily on the model's own learning of video features, making it difficult to address the low proportion of key moment information in accident videos and the susceptibility to misjudgment of fine-grained spatial relationships. Therefore, while the aforementioned existing technologies can achieve a certain degree of traffic video analysis, they cannot effectively guarantee the consistency between the model-generated results and the key visual evidence of the accident.
[0004] Furthermore, existing visual language models typically employ a uniform text generation optimization approach when generating accident descriptions. They lack specific learning mechanisms for spatial semantic information such as vehicle left-right direction, front-rear relationships, lane positions, and lane-change directions, making them prone to errors in spatial relationship descriptions. For example, in complex traffic environments, the model may fail to accurately distinguish between left or right lane changes, the lane a vehicle is in, and the relative motion between vehicles, thus reducing the reliability of accident analysis results. Simultaneously, while methods relying on auxiliary key images or manual information sifting can improve the model's understanding of specific scenarios, they increase the data input requirements in practical applications, hindering the rapid deployment of accident video understanding systems. Summary of the Invention
[0005] The main technical problem to be solved by this invention is that, in existing traffic accident video understanding methods, the key collision frames of the accident account for a relatively low proportion in the complete video, making it difficult for the visual language model to effectively extract collision-related visual evidence, resulting in insufficient accuracy in collision subject identification, accident type judgment, and understanding of vehicle interaction relationships.
[0006] Therefore, this invention provides a method for understanding traffic accident videos based on keyframe visual guidance, comprising: Obtain traffic accident videos and corresponding structured accident description tags, determine collision key frames from the traffic accident videos, and obtain key frame guidance features based on the visual features of the collision key frames. The visual language model is trained based on traffic accident videos and structured accident description tags. The visual language model generates structured accident descriptions based on traffic accident videos and generates latent visual representations at potential visual prediction positions after the structured accident descriptions. Keyframe guiding features serve as the supervision target of the latent visual representations. By constraining the visual semantic consistency between the latent visual representations and the keyframe guiding features, the visual language model is guided to learn the key visual information of collisions in traffic accident videos. Traffic accident videos are input into a trained visual language model to generate corresponding structured accident understanding results.
[0007] Furthermore, the visual language model also includes a spatial understanding enhancement training process: Semantic analysis is performed on the structured accident description tags to determine the spatial semantic text tags that represent vehicle direction relationships, vehicle position relationships, and / or vehicle motion relationships, and spatial semantic supervision information is generated based on the position of the spatial semantic text tags in the structured accident description tags. Based on the aforementioned spatial semantic supervision information, the prediction results of the spatial semantic text tags output by the visual language model are enhanced and constrained, thereby improving the visual language model's ability to understand the spatial and motion relationships of vehicles in traffic accident scenarios.
[0008] Furthermore, the acquisition of the keyframe guidance features includes: visually encoding the collision keyframe to obtain the corresponding keyframe visual feature sequence; dividing the keyframe visual feature sequence into multiple visual feature groups, and fusing the visual features in each visual feature group to obtain a fixed number of keyframe guidance features, so that the keyframe guidance features retain the visual semantic information related to the accident process in the collision keyframe, and are used to supervise the visual language model to learn the key collision visual representation.
[0009] Furthermore, the visual features in each visual feature group are fused, including: weighted fusion of multiple visual feature vectors in the same visual feature group, or average fusion of multiple visual feature vectors in the same visual feature group, to obtain the corresponding keyframe guiding feature vector, so that the keyframe guiding feature vector comprehensively represents the spatial position relationship, motion state and collision state change information of the colliding vehicles in the corresponding time stage.
[0010] Furthermore, a latent visual marker position is set after the text sequence corresponding to the structured accident description label, and the latent visual marker position is used as the output position for the visual language model to learn latent visual representation; during the training process, the visual language model outputs the corresponding hidden state representation at the latent visual marker position according to the video visual features corresponding to the traffic accident video, and the hidden state representation is used as the latent visual representation. Calculate the feature similarity or feature distance between the latent visual representation and the keyframe guiding features, and construct visual semantic consistency constraints based on the feature similarity or feature distance to ensure that the latent visual representation and the keyframe guiding features maintain a correspondence, thereby guiding the visual language model to learn the vehicle state, spatial position relationship and visual information of the collision process related to the occurrence of the accident in the collision keyframe.
[0011] Preferably, when training the visual language model, the parameters of the visual language model are optimized based on a joint loss function, which includes text generation loss, latent visual tag prediction loss, and visual semantic consistency constraint loss. The text generation loss is used to constrain the consistency between the structured accident description generated by the visual language model from the traffic accident video and the corresponding label. The latent visual label prediction loss is used to constrain the visual language model to output the corresponding latent visual representation at the latent visual label position. The visual semantic consistency constraint loss is used to constrain the correspondence between the latent visual representation and the keyframe guiding features.
[0012] Furthermore, the spatial understanding enhancement training process includes: The structured accident description tags are segmented to obtain an accident description text sequence composed of multiple text tags; the text tags are matched based on a preset spatial semantic rule base to determine the spatial semantic text tags that represent vehicle direction relationships, vehicle position relationships and / or vehicle motion relationships, and a spatial semantic mask is generated according to the position of each spatial semantic text tag in the accident description text sequence. Enhanced supervision is applied to the prediction results of the corresponding text tags output by the visual language model based on the spatial semantic mask, so that the positions belonging to the spatial semantic text tags are given higher training weights than the positions of non-spatial semantic text tags, thereby optimizing the visual language model's ability to understand vehicle direction changes, vehicle relative positions, and vehicle trajectory in traffic accident scenarios.
[0013] Furthermore, the enhanced supervision includes: The supervision weights corresponding to each text tag are determined based on the spatial semantic mask, and the spatial semantic enhancement loss is calculated based on the supervision weights. The spatial semantic enhancement loss and the text generation loss are jointly optimized to adjust the model parameters of the visual language model. The spatial semantic enhancement loss is used to improve the prediction accuracy of the visual language model for spatial semantic text tags, and the text generation loss is used to constrain the consistency between the structured accident description generated by the visual language model based on the traffic accident video and the corresponding label.
[0014] Based on the above method, the present invention also provides a traffic accident video understanding system, the system comprising: The video data acquisition module is used to acquire traffic accident videos and their corresponding structured accident description tags; The keyframe guidance feature generation module is used to determine the collision keyframes from traffic accident videos, extract and fuse visual features from the collision keyframes, and obtain keyframe guidance features that represent key visual information of the accident. A visual language model training module is used to train a visual language model based on the traffic accident video, structured accident description labels, and keyframe guidance features. The visual language model training module is configured to enable the visual language model to generate a structured accident description from the traffic accident video, form a latent visual representation at a potential visual prediction position following the structured accident description, use the keyframe guidance features as the supervision target of the latent visual representation, and learn key visual information in the collision keyframes by constraining the visual semantic consistency between the latent visual representation and the keyframe guidance features. The accident understanding result generation module is used to acquire traffic accident videos to be understood and input them into the trained visual language model to generate corresponding structured accident understanding results.
[0015] Furthermore, the system also includes a spatial understanding enhancement training module, which is connected to the visual language model training module and is used to enhance the training of the visual language model based on the spatial semantic information in the structured accident description labels. The spatial understanding enhancement training module is configured to perform semantic analysis on structured accident description labels to determine spatial semantic text tags that represent vehicle directional relationships, vehicle positional relationships, and / or vehicle motion relationships; generate spatial semantic supervision information based on the position of the spatial semantic text tags in the structured accident description labels; and enhance the text prediction position of the visual language model based on the spatial semantic supervision information to improve the visual language model's ability to understand vehicle spatial relationships in traffic accident scenarios.
[0016] Compared with the prior art, the present invention has at least the following beneficial effects: This invention utilizes collision keyframes to construct visual supervision constraints during the training phase, enabling the model to move beyond relying solely on the statistical correlation between the overall visual features of the video and text labels. Instead, it actively learns the correspondence between accident descriptions and real collision visual evidence, thereby reducing interference from the large amount of normal driving in traffic accident videos on the learning of key accident information and improving the model's accuracy in understanding the collision subject, accident type, vehicle motion state, and accident development.
[0017] Specifically, this invention compresses the visual features of collision keyframes to a fixed length, converting them into a unified form of keyframe guiding features, and uses these features as the supervision target for the potential visual prediction task. By setting potential visual prediction positions after the generation of structured accident descriptions, the model continues to learn the potential representations corresponding to key collision visual information after completing the text understanding task. Furthermore, by utilizing visual semantic alignment constraints, the hidden states within the model gradually approach the visual features corresponding to the real collision keyframes, thereby enhancing the model's ability to focus on key visual evidence of accidents.
[0018] Furthermore, addressing the issue that existing visual language models are prone to errors in judging vehicle direction, lane position, and spatial motion relationships in complex traffic scenarios, this invention proposes a spatial understanding enhancement training mechanism. By identifying spatial semantic markers containing directional, positional, and motion relationships from structured accident description text and constructing spatial semantic masks for these markers, additional supervision is applied to spatially relevant output positions during model training, enabling the model to obtain more concentrated spatial relationship learning signals. Compared to traditional unified text generation training methods, this invention avoids the problem of spatial semantic information being diluted by a large amount of general descriptive information due to the low proportion of text, allowing the model to more accurately understand fine-grained traffic spatial relationships, thereby reducing analytical bias caused by misjudgments of spatial relationships in accident descriptions.
[0019] Meanwhile, this invention employs a two-stage training strategy, enabling the model to balance the ability to utilize key visual information with ease of practical deployment. In the first stage of training, a visual guidance mechanism using collision keyframes establishes the correlation between visual information from the accident video and key collision evidence. In the second stage, spatial semantic supervision further enhances the model's understanding of vehicle spatial relationships, and keyframes and potential visual markers are removed, allowing the model to gradually adapt to real-world application environments. The resulting traffic accident video understanding model does not rely on additional keyframe information during the inference stage; it only requires a complete accident video and task prompts to output structured accident understanding results, including collision vehicle information, accident location, accident type, vehicle trajectory, and a summary of the accident process.
[0020] Therefore, without changing the main structure of the existing visual language model, this invention achieves a transformation from video content description to deep understanding of traffic accidents based on key visual evidence through innovation in training mechanisms and supervision methods. This improves the accuracy, reliability, and interpretability of traffic accident video understanding results, and can better meet the application needs of intelligent analysis of traffic accidents, auxiliary liability determination, insurance claims, and traffic safety management. Attached Figure Description
[0021] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0022] Figure 1 This is a schematic diagram of the technical framework provided in the embodiments of the present invention; Figure 2 This is a schematic diagram of keyframe visual guidance provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of spatial semantic mask supervision provided in an embodiment of the present invention; Figure 4 This is an example of the structured accident understanding results provided in the embodiments of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, other embodiments obtained by those skilled in the art without creative effort are all within the scope of protection of the present invention.
[0024] Example 1 This embodiment provides a traffic accident video understanding method based on keyframe visual guidance. It utilizes transfer learning on a pre-trained existing visual language model to enable it to perform structured understanding of traffic accident videos. It should be noted that this embodiment does not change the main network structure of the existing visual language model. Instead, it builds upon it by constructing training samples suitable for traffic accident scenarios, introducing collision keyframe visual guidance information, and adding supervisory constraints on spatial relationships. This allows the model to more accurately understand information such as the collision subject, accident location, accident type, vehicle trajectory, and accident process in the accident video.
[0025] The visual language model can employ a multimodal model capable of processing both visual and textual information simultaneously, such as the Qwen series of visual language models, or other visual language models with visual encoding and language generation modules. In this embodiment, Qwen2.5-VL-7B is used as the basic visual language model.
[0026] Visual language models typically include a visual encoding module, a visual language feature mapping module, and a language generation module. The visual encoding module converts input images or video frames into visual feature representations. The visual language feature mapping module maps visual features to a feature space consistent with the language model's hidden space, enabling visual information to participate in the language model's inference process. The language generation module usually employs an autoregressive language model based on a Transformer structure to progressively generate the target text result based on the input text features and visual features. Existing solutions for traffic scene understanding using visual language models generally involve the following process: For input traffic accident videos, the visual encoding module first samples the video frames and divides each frame into multiple visual regions, extracting visual feature sequences containing vehicle, road environment, and motion states through a visual attention mechanism. Subsequently, after visual language mapping, the visual features, along with text prompts, are input into the language generation module, which generates the corresponding accident description text based on the visual information.
[0027] This embodiment, while maintaining the aforementioned basic structure, adjusts the organization of input information and the optimization objective during the training phase, enabling the visual language model to focus on the crucial visual information related to the collision that plays a decisive role in the accident process. For example... Figure 1 As shown, the method described in this embodiment mainly includes the following steps: S1. Obtain traffic accident videos and construct structured accident description tags.
[0028] First, acquire traffic accident videos collected by dashcams, in-vehicle cameras, or other first-person perspective video capture devices, including video data of traffic events such as vehicle collisions, scrapes, lane change conflicts, and rear-end collisions. For each traffic accident video segment, construct corresponding structured accident description tags.
[0029] The structured incident description tag includes at least one or more of the following information: (1) Collision vehicle information, used to describe the type, color or relative position of the vehicles involved in the collision; (2) Accident location information, used to describe the road area, lane location or spatial environment where the accident occurred; (3) Accident type information, used to describe accident categories such as rear-end collision, side collision, and lane change collision; (4) Vehicle trajectory information, used to describe the driving status of the collected vehicle before and after the accident; (5) The target vehicle's trajectory information, used to describe the driving status of other participating vehicles before and after the accident; (6) Accident process summary information, used to describe the complete event process before and after the accident.
[0030] Structured accident description labels can be obtained manually from accident videos. This involves labelers observing vehicle state changes frame-by-frame in the video, manually analyzing the vehicles involved, their directions of movement, spatial locations, and the accident outcome, and generating structured labels according to a predefined field format. To improve the efficiency of building large-scale training data, existing multimodal models can be used to generate candidate descriptions from the accident videos. These candidate descriptions are then manually verified for vehicle relationships, spatial orientation, and factual consistency to obtain the final training labels. By constructing the aforementioned structured accident description labels, this embodiment expands the traditional single accident category identification task in traffic accident analysis into a comprehensive understanding task that includes vehicle identification, spatial relationship understanding, motion trajectory analysis, and accident process generation. This enables the subsequent visual language model to learn the correspondence between visual information and semantic descriptions in accident videos, providing an effective data foundation for subsequent keyframe visual guidance training and spatial semantic supervision training.
[0031] S2. Identify collision keyframes in traffic accident videos. Since a large number of video frames in traffic accident videos only contain the normal driving process, while the collision process that truly determines the type of accident and the relationship of responsibility is usually concentrated in a small number of consecutive frames, it is necessary to identify video frames that can characterize the key state of the accident from the complete accident video.
[0032] In this embodiment, a pre-trained traffic accident keyframe extraction network is used to analyze accident videos. Candidate keyframes are determined based on the relevance scores of each video frame to the accident. For example, the sequence of accident video frames is input into a Dynamic Spatial-Temporal Attention Network (DSTA). Candidate collision times are then determined based on the accident relevance or risk response results output by the DSTA, and corresponding candidate keyframes are extracted. Finally, the candidate frames are manually checked to ensure they clearly cover the collision time or key vehicle interaction states. If a candidate frame has a time offset, occlusion, or incomplete information, it is manually reselected from its neighboring frames.
[0033] S3. Visually encode the accident video and collision keyframes. The complete accident video obtained in step S1 and the corresponding collision keyframes determined in step S2 are input into the visual encoding module to convert the original video image information into a continuous visual feature representation that can be processed by the visual language model.
[0034] In this embodiment, the existing visual encoder in the basic visual language model is used without adding an additional independent visual encoding network. Specifically, the visual encoding module within the Qwen2.5-VL-7B visual language model is directly used to extract features from the input video frames and keyframe images. The accident video and keyframes are processed using the same visual encoder, sharing visual encoding parameters, which ensures that the two types of visual information are within a unified visual feature space.
[0035] It should be noted that the visual encoding module can employ any neural network structure capable of converting image or video frames into sequential visual representations, such as the Vision Transformer (ViT), Swing Transformer, Convolutional Neural Network (CNN), or other visual feature extraction networks. When using different visual encoders, as long as their output visual features can be converted into continuous vectors in the language model's hidden space through the visual-language mapping module, they can be applied to this embodiment.
[0036] (1) Visual feature extraction from accident video First, the complete traffic accident video is preprocessed. Since the original accident video typically contains a large number of consecutive video frames, to reduce computational load and ensure effective preservation of temporal information, this embodiment performs frame sampling of the accident video according to a preset sampling strategy. For example, partial video frames can be extracted from the original video at fixed time intervals:
[0037] in, This indicates that you need to input a video of a traffic accident. Indicates the first Each sampled video frame, This represents the number of video frames after sampling.
[0038] The video frame is then input into the visual encoding module. The visual encoding module can further divide a single video frame into multiple local image regions (patches) and perform feature mapping on each region.
[0039] For example, for the first Frame video image:
[0040] in, Indicates the first The first video frame Image regions, This represents the number of image regions obtained from the division.
[0041] Subsequently, the visual encoder extracts features from each image region.
[0042] After the above processing, each video frame is converted into multiple visual feature vectors.
[0043] The visual features corresponding to all video frames are combined in chronological order to form a sequence of visual features from the accident video:
[0044] in, For the first Each video visual feature vector This represents the total number of visual features in the video.
[0045] For example, an accident video, after sampling, contains 20 frames. Each frame is visually encoded to generate several visual tokens. Then, the visual tokens corresponding to all video frames are arranged in chronological order to form a complete video visual feature sequence.
[0046] (2) Visual feature extraction of collision keyframes Unlike complete accident video, collision keyframes are primarily used to provide high-value visual information about the moment the accident occurred and the vehicle's interaction status. Similarly, the set of collision keyframes determined in step S2... The same visual encoding module is input for each keyframe. The corresponding visual features are then input into the visual encoder.
[0047] When a keyframe image is divided into multiple visual regions, it can be further represented as:
[0048] After encoding, all keyframe visual features are combined to form a keyframe visual feature sequence:
[0049] in, Indicates the first Keyframe visual feature vectors This represents the number of visual features in the keyframe.
[0050] Through the above processing, visual features of the accident video and visual features of the collision keyframes were obtained. The accident video visual features describe the overall process before and after the accident, while the collision keyframe visual features primarily provide crucial visual evidence that can determine the accident type, vehicle interaction relationships, and spatial relationships. S4. Compress keyframe features to obtain latent visual features. Since the number of keyframes and image resolution may vary in different accident videos, directly inputting all keyframe visual features into a language model would result in changes in input length and increase model processing complexity. Therefore, this embodiment performs fixed-length compression on the keyframe visual features.
[0051] For keyframe visual feature sequences First, the feature vectors are divided into K groups according to continuous segments. Then, mean pooling is performed on the feature vectors in each group to obtain a fixed number of K keyframe guiding feature vectors.
[0052] in, This represents the feature grouping of the i-th keyframe. This indicates the number of keyframe visual features contained in the group. Guide the feature vector for the keyframe corresponding to this feature group.
[0053] For multiple keyframe visual features within the same group, a new feature vector is obtained through methods such as vector averaging or weighted summation. This new feature vector comprehensively represents information from multiple visual regions and multiple key states within the same time period. After the above processing, we obtain:
[0054] in, This represents the compressed set of keyframe guiding features.
[0055] By using a fixed-length compression method, different accident videos can be converted into a consistent number of potential visual features, which can then be used as keyframe guidance feature supervision targets corresponding to the potential output representation of the model.
[0056] S5. Perform the first phase of keyframe visual guidance training. After completing the extraction of visual features from traffic accident videos and the construction of collision keyframe guidance features, this embodiment further utilizes the obtained training data to conduct the first stage of training on the visual language model.
[0057] It should be noted that in this embodiment, the collision keyframes are not used as direct inputs in the process of generating accident descriptions by the visual language model, but are used to construct keyframe visual supervision information. That is, during the first stage of training, the visual language model still completes the accident description generation task based on the visual information of the accident video, while using the visual features provided by the collision keyframes as auxiliary supervision signals, enabling the model to absorb key accident visual information during the training phase and complete accident understanding based solely on ordinary accident videos during the actual deployment phase.
[0058] (1) Constructing the first-stage training sample sequence In the first phase of training, multimodal training samples for training the visual language model are first constructed.
[0059] For each traffic accident sample, the training data includes accident video, system prompts, task prompts, and structured accident description text labels. The accident video provides visual information about the entire accident process; the system prompts define the model's task role and response principles, for example, it could be set as "You are a traffic accident video understanding assistant. Please analyze strictly based on what can be observed in the input video, and do not supplement information that is not present in the video. Please accurately describe the colliding vehicles, road environment, lane position, vehicle movement direction, and collision process"; the task prompts specify the accident understanding content the model needs to output. For example, a comprehensive accident understanding task could be set as "Please analyze the input traffic accident video and output the colliding vehicles, accident location, accident type, vehicle trajectory, target vehicle trajectory, and a summary of the accident process in sequence."
[0060] The structured accident description text labels serve as the model training targets. To enable the visual language model to further focus on key visual information about the collision, this embodiment sets a potential visual prediction position after the structured accident description text.
[0061] Specifically, several consecutive potential markers are added to the end of the structured accident description text:
[0062] Where Z represents the latent visual marker sequence, Indicates the first A potential visual marker.
[0063] The latent visual markers serve as the placeholders for keyframe guiding features in the output sequence of the visual language model. During the first stage of training, the visual language model will output the predicted value of the keyframe guiding feature at the latent marker position. As its corresponding label, the keyframe guiding feature obtained in step S4 will be embedded at the corresponding latent marker position after the structured accident description text label.
[0064] (2) Generating structured accident descriptions based on accident videos After obtaining the first-stage training sample sequence, it is input into the visual language model so that the visual language model can understand the traffic accident process based on the visual information and text prompts contained in the accident video and generate the corresponding structured accident description results.
[0065] In the actual training process, the structured accident description labels are processed through word segmentation to form the target output text sequence:
[0066] in, This represents a sequence of manually annotated, authentic structured accident description texts. Indicates the first in the target text sequence A text tag, This indicates the total number of text tags contained in the structured incident description text after word segmentation.
[0067] Visual language models, based on historical information in the input sequence, progressively predict each text tag in the target text sequence, ultimately generating an accident understanding result.
[0068] in, This represents the predicted accident description generated by the visual language model based on the accident video. The model represents the first time. Predicted text tags generated at each location.
[0069] To achieve the training objective, this embodiment uses text generation loss to constrain the model's output. The text generation loss employs the cross-entropy loss function, and its calculation formula is as follows:
[0070] in, This represents the text generation loss, used to measure the difference between the model's predicted results and the actual accident description labels; This means the model can predict the correct text tags given prior input information. The probability of.
[0071] By minimizing the aforementioned text generation loss, the visual language model can gradually learn key semantic information from traffic accident videos. For example, based on changes in vehicle position, direction of vehicle movement, and collision status in the accident video, the model can generate a structured description including the colliding vehicles, accident type, accident location, and a summary of the accident process.
[0072] (3) Set up a latent visual representation prediction task When trained using only the aforementioned text generation loss, the visual language model primarily optimizes based on the statistical correlation between the visual features of the input video and the text labels. Because natural language descriptions have strong contextual patterns, the model may rely on existing language patterns to complete descriptions in some scenarios, failing to fully utilize crucial visual evidence at the moment of the accident. For example, in similar traffic scenarios where both vehicles are changing lanes, if the distribution of language descriptions in the training samples is biased, the model may determine the direction of lane changes based on historical text patterns, rather than accurately determining the true motion relationship based on the positional changes between vehicles at the moment of collision. Especially in traffic accident video understanding tasks, the information determining accident responsibility and type is usually concentrated in a small number of key video frames before and after the collision, while the complete accident video contains a large amount of normal driving activity. If the model is optimized solely using ordinary text generation loss, it is difficult to guarantee that the accident semantic representation learned internally by the model always maintains a correspondence with the actual visual evidence of the collision.
[0073] Therefore, this embodiment further introduces a latent visual representation prediction task to utilize the key visual information contained in the collision keyframes to constrain the training of the visual language model. It is important to emphasize that in this embodiment, the keyframe guiding features obtained after visual encoding and feature compression of the collision keyframes are not directly input into the visual language model to participate in the generation process of the accident description text. Instead, they serve as visual supervision information during the training phase, guiding the model to learn the correspondence between the semantic representation of the accident and the key collision visual evidence.
[0074] In the actual training process, the visual language model first generates a corresponding structured accident description text based on the visual features of the accident video, system prompts, and task prompts. After the model completes the accident description generation, it does not immediately stop outputting. Instead, it continues to predict the positions of potential visual markers located after the text description based on the obtained accident semantic information and visual context information, thereby obtaining the corresponding hidden state representation.
[0075] Let the visual language model be in the first... The hidden states output at each potential visual marker location are: During training, the hidden states output by the visual language model at potential visual prediction locations are... Corresponding keyframe guiding features Visual semantic alignment is performed so that the latent visual representation output by the model gradually approaches the visual features corresponding to the real collision keyframes.
[0076] Specifically, cosine similarity is used to calculate the feature distance between the two:
[0077] in, This represents the visual semantic alignment loss. This represents the dot product of the hidden state vector and the keyframe guided feature vector. Represents the hidden state vector The 2-norm, Represents the keyframe guiding feature vector The 2-norm.
[0078] Through the aforementioned visual-semantic alignment constraints, the model, during optimization, must not only focus on the accuracy of the accident text description but also ensure that its internally formed accident semantic representation corresponds to the visual information in the actual collision keyframes. For example, when the accident type depends on whether the target vehicle changed lanes to the right into the lane where the vehicle is located, in order to reduce the visual-semantic alignment loss, the model needs to learn to focus on the changes in the vehicle's spatial position, direction of movement, and vehicle interaction status in the collision keyframes, rather than generating an accident description solely based on textual statistical patterns or road environment features.
[0079] like Figure 2 As shown, to ensure that the potential visual prediction task and the accident description generation task can be optimized together, this embodiment jointly trains the text generation loss and the visual semantic alignment loss. The overall training objective in the first stage can be expressed as:
[0080] in, This indicates the losses incurred during the first phase of joint training. This indicates the potential visual label prediction loss. Indicates the weights of the potential label prediction loss. This represents the weights of the visual semantic alignment loss.
[0081] The latent visual marker prediction loss is used to constrain the visual language model to continue predicting latent visual representations according to preset latent visual marker positions after generating the structured accident description. Specifically, consecutive latent visual marker positions are set after the accident description text sequence, and the model uses its original autoregressive prediction mechanism to predict the corresponding latent visual markers based on the preceding input information. Since the latent visual markers use the same special placeholder markers in discrete space, this loss is not used to distinguish the semantic categories of different latent markers, but rather to guide the model into the latent visual representation learning stage, providing positional constraints and a training basis for subsequent visual semantic alignment using keyframe-guided features. The latent visual marker prediction loss is expressed using the cross-entropy loss function as follows:
[0082] in, The number of potential visual markers, Indicates the first The real label of a potential visual marker, that is, a pre-defined special placeholder mark; The parameter is The visual language model is based on the first The potential visual markers are predicted from the input sequence preceding the potential visual markers. The probability of this is determined by minimizing the latent visual marker prediction loss. This allows the visual language model to stably enter the latent visual prediction stage after completing the accident text understanding task. Furthermore, the subsequent visual semantic alignment loss further constrains the latent visual hidden state to maintain consistency with the collision keyframe guiding features, thereby enhancing the model's ability to focus on key visual evidence of the accident.
[0083] S6. Perform the second phase of spatial understanding enhancement training. The primary objective of the first phase of training is to leverage the visual supervision information provided by collision keyframes to enable the visual language model to learn the correspondence between key visual evidence and semantic descriptions of accidents in accident videos. However, in real-world traffic accident understanding tasks, simply generating accurate accident categories and summaries of the accident process is insufficient to meet the needs of accident analysis. The model also needs to accurately understand the spatial relationships between vehicles. For example, in lane-change collisions, it is necessary to accurately determine whether the target vehicle is changing lanes to the left or right; in multi-vehicle interaction scenarios, it is necessary to accurately determine whether a vehicle is in front of, behind, to the left of, or to the right of the vehicle; and in complex road environments, it is also necessary to accurately identify the lane in which the vehicle is located and the relative motion relationships between vehicles.
[0084] Existing visual language models typically employ a uniform text generation loss to supervise all output text tags, applying the same weights for optimization regardless of whether the tags in the output text contain spatial relationship information. However, in traffic accident descriptions, words indicating spatial relationships usually constitute only a small proportion, with descriptive text, vehicle category text, and event outcome text making up the majority. Therefore, during the uniform text generation optimization process, the training signals obtained from tags related to spatial direction, lane position, and motion relationships are easily diluted by other non-spatial semantic tags. This means that while the model can generate accident descriptions with relatively reasonable overall semantics, it is prone to errors in fine-grained spatial relationships. For example, for an accident description of "the target vehicle changed lanes to the right and entered the lane where the vehicle was located, resulting in a collision," ordinary text generation training can enable the model to learn the overall semantics of "the vehicle changed lanes, causing a collision." However, because spatial information such as "to the right" and "lane" accounts for a relatively low proportion in the entire text sequence, the model may not be able to fully learn the specific direction of vehicle movement, thus incorrectly generating "the target vehicle changed lanes to the left" or incorrectly determining the vehicle's location.
[0085] Therefore, this embodiment further introduces a spatial semantic supervision mechanism based on the completion of the first stage of training, such as... Figure 3 As shown, by identifying text tags related to spatial relationships from structured accident description text tags and constructing spatial semantic masks for these tags, additional supervision is applied to spatial semantic locations during model training, enabling the model to obtain more focused spatial relationship learning signals.
[0086] Specifically, in the second phase of training, the collision keyframe information and potential visual markers from the first phase of training are no longer used. Instead, only accident videos, task prompts, and structured accident description text labels are input.
[0087] For structured accident description text tags, they are segmented to obtain a text tag sequence. After obtaining the text tag sequence, this embodiment establishes spatial semantic recognition rules to determine the location of target text tags that contain vehicle spatial and motion relationships. The spatial semantic recognition rules can be implemented through a preset spatial semantic vocabulary, or dynamically determined through rule matching, natural language processing models, or language model recognition methods. The spatial semantic vocabulary includes at least words or phrases representing directional, positional, and motion relationships, such as: left, right, front, back, left turn, right turn, change lanes to the left, change lanes to the right, leftmost lane, rightmost lane, adjacent lane, etc.
[0088] When the structured accident description text contains the aforementioned spatial semantic information, the corresponding text marker position is determined as the spatial semantic supervision position. For example, for the structured accident description text "The target vehicle changes lanes to the right and enters the lane where the vehicle is located," after word segmentation, we can obtain:
[0089] For the above text sequence, identify text markers containing spatial relationships, including right turn, lane change, and lane, and then construct the corresponding binary spatial semantic mask:
[0090] in, Represents a spatial semantic mask sequence, where the element values Indicates the first The mask value corresponding to each text tag, when When, it indicates the first Each text tag belongs to spatial semantic information and requires additional spatial supervision; when When, it indicates the first These text tags do not belong to spatial semantic information and only participate in the training of ordinary text generation.
[0091] Through the above method, this embodiment can automatically extract spatial semantic information closely related to accident liability determination from accident description text and convert it into a supervision signal that can be used for model optimization.
[0092] After constructing the spatial semantic mask, the visual features of the accident video, task prompts, and structured accident description text are input into the visual language model for the second stage of training. During this training process, the complete text generation loss is retained to ensure the model can generate semantically complete descriptions that conform to the accident process. Additionally, extra spatial supervision loss is added for the spatial semantic mask marking positions.
[0093] The cross-entropy loss function described above is still used for the full text generation loss. Based on this, the spatial supervision loss is further calculated using the spatial semantic mask:
[0094] in, Represents spatial semantic supervision loss; For the first The spatial semantic mask value corresponding to each text tag, when At that time, this location participates in the calculation of spatial surveillance loss; when At this point, the location is not included in the additional spatial supervision calculation; the meanings of the remaining symbols are the same as those of the text generation loss described above.
[0095] Since spatial supervision loss only applies to spatially semantically related labels, the model can obtain more focused training signals during the optimization process. For example, when describing "the target vehicle changes lanes to the right to enter the lane where the vehicle is located," the model will focus on optimizing the prediction ability of positions such as "to the right," "change lanes," and "lane," making the model pay more attention to the vehicle's direction of movement and spatial positional relationships, rather than just learning the overall linguistic rules of accident description.
[0096] The second-stage training objective is obtained by jointly optimizing the full text generation loss and the spatial semantic supervision loss:
[0097] in, This represents the total loss from the second-stage spatial understanding enhancement training. These represent the spatial semantic supervision weight coefficients, used to adjust the influence of the spatial relation learning task on the overall training process. Weight coefficients The accuracy of spatial relationship recognition in the validation dataset can be adjusted. For example, if the model has a high error rate in vehicle direction and lane position determination, the accuracy can be appropriately increased. Enhance spatial semantic supervision; when the overall text generation capability of the model declines, the level can be appropriately reduced. Maintaining a balance between spatial understanding and overall descriptive ability.
[0098] Through the aforementioned second-stage spatial understanding enhancement training, this embodiment enables the model to acquire enhanced spatial relationship capabilities for traffic accident scenarios without altering the main structure of the visual language model. On one hand, by retaining the complete text generation loss, it ensures that the model can still output a complete and coherent description of the accident process. On the other hand, by using spatial semantic supervision loss to optimize key markers such as direction, lane, steering, and vehicle motion relationships, the model can more accurately understand fine-grained spatial relationships during the accident process, reducing accident description bias caused by errors in judging left and right directions, vehicle positions, and motion trajectories. Simultaneously, since the second-stage training no longer relies on collision keyframe input, the trained model can be directly applied to real-world accident analysis scenarios, outputting structured accident understanding results containing colliding vehicles, accident locations, accident types, vehicle motion trajectories, and accident process summaries from ordinary accident videos. This training method balances the ability to utilize key accident visual information with practical deployment convenience, improving the applicability of traffic accident video understanding methods.
[0099] S7. Generate structured understanding results of traffic accidents. After completing the first stage of keyframe-guided training and the second stage of spatial understanding enhancement training, a trained traffic accident video understanding model is obtained. During training, this model has established the correlation between visual information from the accident video, semantic descriptions of the accident text, and key visual evidence of the collision. Simultaneously, spatial semantic supervision enhances its ability to understand fine-grained spatial information such as vehicle direction, lane position, and vehicle motion relationships. Therefore, in practical applications, the model does not need to rely on the collision keyframe information used in the training stage; it only needs to input the traffic accident video to be analyzed and the corresponding task prompts to automatically understand the accident process.
[0100] In practical applications, the first step is to acquire the video of the traffic accident to be analyzed. Unlike the training phase, in the actual inference process, it is not necessary to use a keyframe extraction network to filter keyframes in the accident video, nor is it necessary to input manually confirmed collision keyframes. The model analyzes the accident process solely based on the visual information contained in the complete accident video, thereby reducing data dependence and processing complexity in actual deployment. Task prompts specify the accident understanding tasks that the model needs to complete, such as requiring the model to output information such as the colliding vehicles, accident location, accident type, vehicle trajectory, and a summary of the accident process. Based on the visual features of the input video and the task prompts, the visual language model utilizes the accident visual semantic relationships and spatial understanding capabilities learned during the training phase to comprehensively analyze the vehicle state, spatial relationships, and event development process in the accident video, and outputs the corresponding structured accident understanding results through the language generation module.
[0101] Structured accident understanding results can be represented in various forms according to actual application needs, such as natural language descriptions, key-value pairs, JSON data structures, or preset template tables. In one implementation, accident understanding results can be output according to fixed fields, so that subsequent traffic accident management systems, insurance claims systems, or accident retrieval systems can directly call them.
[0102] like Figure 4 As shown, the structured accident understanding results can include one or more of the following: collision vehicle information, accident location information, accident type information, vehicle trajectory information, target vehicle trajectory information, and accident process summary information. Specifically, collision vehicle information represents the vehicles involved in the collision, such as vehicle type, color, and collision relationship between vehicles; accident location information represents the road area, lane position, and spatial relationship between vehicles at the time of the accident; accident type information indicates the specific accident category, such as rear-end collision, side collision, or lane change collision; vehicle trajectory information describes the driving state of the vehicle that captured the accident video before and after the accident, such as going straight, turning, decelerating, or stopping; target vehicle trajectory information describes the movement of other vehicles involved in the accident, such as lane change direction, driving direction, and positional changes relative to the vehicle; and accident process summary information provides a comprehensive description of the entire accident process, including changes in vehicle movement, causes of the collision, and collision results.
[0103] Because the model has learned the correspondence between key collision visual information and accident semantic description by using the collision keyframe visual guidance mechanism during the training phase, and strengthened the learning of spatial information such as vehicle direction, lane position and motion relationship by using the spatial semantic supervision mechanism, the model can still extract the key visual information that determines the accident understanding result from the complete accident video without relying on additional keyframe input, and generate structured analysis results consistent with the real accident process.
[0104] Table 1 Comparison of Quantitative Results from the Accident Process Understanding Task
[0105] Table 1 presents a comparison of some general visual language models with the method of this invention. As can be seen from Table 1, the method of this invention achieves high comprehensive semantic scores in the three dimensions of colliding vehicle, accident location, and accident type, indicating that keyframe visual guidance and spatial semantic supervision can improve the consistency between accident process description and video evidence.
[0106] Example 2 Based on the above method, this embodiment provides a traffic accident video understanding system. The system is built on a pre-trained visual language model. By performing transfer training on the visual language model for traffic accident scenarios, it enables the model to extract key visual information from traffic accident videos, understand vehicle spatial relationships, and generate structured accident analysis results.
[0107] The system mainly includes a video data acquisition module, an accident label construction module, a keyframe extraction module, a visual feature encoding module, a keyframe guided feature generation module, a keyframe visual guided training module, a spatial understanding enhancement training module, and an accident understanding result generation module.
[0108] The video data acquisition module is used to acquire traffic accident video data and input the acquired video data into the system for subsequent analysis and processing. The accident tag construction module is used to construct corresponding structured accident description tags for the acquired traffic accident videos. During the training phase, this module generates structured semantic information corresponding to the accident process based on the accident video content. The structured accident description tags include collision vehicle information, accident location information, accident type information, vehicle trajectory information, target vehicle trajectory information, and accident process summary information.
[0109] The keyframe extraction module is used to identify collision keyframes that reflect the critical state of the accident from complete traffic accident videos. In traffic accident videos, a large number of frames only contain the normal driving process, while the information that truly determines the accident type, vehicle liability, and collision outcome is usually concentrated in a small number of video frames before and after the collision. Therefore, the keyframe extraction module analyzes the video frames to identify those highly relevant to the accident.
[0110] In one implementation, the keyframe extraction module employs a pre-trained traffic accident keyframe extraction network, such as the DSTA network, to perform spatiotemporal feature analysis on the input accident video and determine candidate keyframes based on the accident relevance score corresponding to each video frame. Subsequently, manual verification can be used to determine whether the candidate keyframes completely cover the collision process and vehicle interaction status. If there is a time shift, occlusion, or incomplete information, a new keyframe is selected from adjacent video frames to obtain a collision keyframe that accurately reflects the critical state of the accident.
[0111] The visual feature encoding module is used to extract visual features from accident videos and collision keyframes. This module can directly call the visual encoder in the pre-trained visual language model. Specifically, the visual feature encoding module first samples the input accident video, converting continuous video frames into a video frame sequence suitable for processing by the visual encoding network, and then uses the visual encoder to extract video visual features containing vehicle targets, road environment, and motion state. Simultaneously, this module uses the same visual encoder to encode the collision keyframes, obtaining the corresponding keyframe visual features. Because the accident video and collision keyframes are processed using shared visual encoding parameters, the two types of visual information can be kept within a unified visual feature space, providing a foundation for subsequent key visual supervision.
[0112] The keyframe guidance feature generation module generates fixed-length keyframe guidance features based on the visual features of collision keyframes. Since the number of keyframes, video length, and number of visual features vary across different accident videos, directly using all keyframe features for training would lead to changes in model input length and increased computational complexity. Therefore, the keyframe guidance feature generation module compresses the keyframe visual features, converting keyframe visual information of varying lengths into a fixed number of keyframe guidance features. Specifically, this module first divides the keyframe visual features into multiple feature groups according to a preset number, then aggregates features from each feature group to obtain a fixed number of keyframe guidance feature vectors. These keyframe guidance features are not used as input information in the actual inference phase of the system, but rather as visual supervision targets during the training phase to constrain the visual language model's learning of key collision visual information.
[0113] The keyframe visual guidance training module is connected to the visual feature encoding module, the keyframe guidance feature generation module, and the visual language model to execute the first stage of keyframe visual guidance training. During training, the keyframe visual guidance training module first inputs the accident video visual features, system prompts, task prompts, and structured accident description text into the visual language model, enabling the model to generate corresponding accident descriptions based on the accident video information. Simultaneously, a latent visual prediction position is set after the structured accident description text, allowing the visual language model to continue outputting latent visual representations after generating the accident description.
[0114] This training module enables visual language models to no longer rely solely on the overall visual content of accident videos and textual statistical relationships for accident description, but to proactively focus on changes in vehicle position, motion relationships, and key accident areas at the moment of collision, thereby improving the consistency between accident understanding results and real visual evidence.
[0115] The spatial understanding enhancement training module performs the second stage of spatial understanding enhancement training to improve the system's ability to understand the spatial and motion relationships of vehicles in traffic accident scenarios. During training, this module no longer uses collision keyframe information and latent visual markers, but instead utilizes only visual features from accident videos, task prompts, and structured accident description text. The module first performs semantic analysis on the accident description text, identifying spatial semantic information containing directional, positional, and motion relationships, and generates spatial semantic supervision information based on the identification results. After training with this module, the visual language model can not only generate a complete description of the accident process but also more accurately distinguish between left-right directions, front-back relationships, and lane positions, reducing accident description bias caused by errors in understanding spatial relationships in complex traffic scenarios.
[0116] Finally, the accident understanding result generation module is used to generate structured accident understanding results based on the traffic accident video to be analyzed during the practical application phase. In specific applications, users only need to input the traffic accident video to be analyzed and the corresponding task prompts. After two stages of training, the visual language model, based on its learned key visual association capabilities and spatial understanding capabilities, comprehensively analyzes the vehicle status, spatial relationships, and event development process in the accident video, and outputs structured accident understanding results through the language generation module, including collision vehicle information, accident location information, accident type information, vehicle trajectory information, target vehicle trajectory information, and accident process summary information.
[0117] The above system can execute the method described in Embodiment 1, and has the corresponding functional modules and beneficial effects of the method. For technical details not described in detail in this embodiment, please refer to Embodiment 1 of the present invention.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for understanding traffic accident videos based on keyframe visual guidance, characterized in that, include: Obtain traffic accident videos and corresponding structured accident description tags, determine collision key frames from the traffic accident videos, and obtain key frame guidance features based on the visual features of the collision key frames. The visual language model is trained based on traffic accident videos and structured accident description tags. The visual language model generates structured accident descriptions based on traffic accident videos and generates latent visual representations at potential visual prediction positions after the structured accident descriptions. Keyframe guiding features serve as the supervision target of the latent visual representations. By constraining the visual semantic consistency between the latent visual representations and the keyframe guiding features, the visual language model is guided to learn the key visual information of collisions in traffic accident videos. Traffic accident videos are input into a trained visual language model to generate corresponding structured accident understanding results.
2. The traffic accident video understanding method as described in claim 1, characterized in that, The visual language model also includes a spatial understanding enhancement training process: Semantic analysis is performed on the structured accident description tags to determine the spatial semantic text tags that represent vehicle direction relationships, vehicle position relationships, and / or vehicle motion relationships, and spatial semantic supervision information is generated based on the position of the spatial semantic text tags in the structured accident description tags. Based on the aforementioned spatial semantic supervision information, the prediction results of the spatial semantic text tags output by the visual language model are enhanced and constrained, thereby improving the visual language model's ability to understand the spatial and motion relationships of vehicles in traffic accident scenarios.
3. The traffic accident video understanding method as described in claim 1, characterized in that, The acquisition of the keyframe guidance features includes: visually encoding the collision keyframe to obtain the corresponding keyframe visual feature sequence; dividing the keyframe visual feature sequence into multiple visual feature groups, and fusing the visual features in each visual feature group to obtain a fixed number of keyframe guidance features, so that the keyframe guidance features retain the visual semantic information related to the accident process in the collision keyframe, and are used to supervise the visual language model to learn the key collision visual representation.
4. The traffic accident video understanding method as described in claim 3, characterized in that, The visual features in each visual feature group are fused, including: weighted fusion of multiple visual feature vectors in the same visual feature group, or average fusion of multiple visual feature vectors in the same visual feature group, to obtain the corresponding key frame guiding feature vector, so that the key frame guiding feature vector comprehensively represents the spatial position relationship, motion state and collision state change information of the colliding vehicles in the corresponding time stage.
5. The traffic accident video understanding method as described in claim 1, characterized in that, A latent visual marker position is set after the text sequence corresponding to the structured accident description label, and the latent visual marker position is used as the output position for the visual language model to learn latent visual representation. During the training process, the visual language model outputs the corresponding hidden state representation at the latent visual marker position according to the video visual features corresponding to the traffic accident video, and the hidden state representation is used as the latent visual representation. Calculate the feature similarity or feature distance between the latent visual representation and the keyframe guiding features, and construct visual semantic consistency constraints based on the feature similarity or feature distance to ensure that the latent visual representation and the keyframe guiding features maintain a correspondence, thereby guiding the visual language model to learn the vehicle state, spatial position relationship and visual information of the collision process related to the occurrence of the accident in the collision keyframe.
6. The traffic accident video understanding method as described in claim 5, characterized in that, When training the visual language model, the parameters of the visual language model are optimized based on a joint loss function, which includes text generation loss, latent visual tag prediction loss, and visual semantic consistency constraint loss. The text generation loss is used to constrain the consistency between the structured accident description generated by the visual language model from the traffic accident video and the corresponding label. The latent visual label prediction loss is used to constrain the visual language model to output the corresponding latent visual representation at the latent visual label position. The visual semantic consistency constraint loss is used to constrain the correspondence between the latent visual representation and the keyframe guiding features.
7. The traffic accident video understanding method as described in claim 2, characterized in that, The spatial understanding enhancement training process includes: The structured accident description tags are segmented to obtain an accident description text sequence composed of multiple text tags; the text tags are matched based on a preset spatial semantic rule base to determine the spatial semantic text tags that represent vehicle direction relationships, vehicle position relationships and / or vehicle motion relationships, and a spatial semantic mask is generated according to the position of each spatial semantic text tag in the accident description text sequence. Enhanced supervision is applied to the prediction results of the corresponding text tags output by the visual language model based on the spatial semantic mask, so that the positions belonging to the spatial semantic text tags are given higher training weights than the positions of non-spatial semantic text tags, thereby optimizing the visual language model's ability to understand vehicle direction changes, vehicle relative positions, and vehicle trajectory in traffic accident scenarios.
8. The traffic accident video understanding method as described in claim 7, characterized in that, The enhanced supervision includes: The supervision weights corresponding to each text tag are determined based on the spatial semantic mask, and the spatial semantic enhancement loss is calculated based on the supervision weights. The spatial semantic enhancement loss and the text generation loss are jointly optimized to adjust the model parameters of the visual language model. The spatial semantic enhancement loss is used to improve the prediction accuracy of the visual language model for spatial semantic text tags, and the text generation loss is used to constrain the consistency between the structured accident description generated by the visual language model based on the traffic accident video and the corresponding label.
9. A traffic accident video understanding system based on keyframe visual guidance, characterized in that, include: The video data acquisition module is used to acquire traffic accident videos and their corresponding structured accident description tags; The keyframe guidance feature generation module is used to determine the collision keyframes from traffic accident videos, extract and fuse visual features from the collision keyframes, and obtain keyframe guidance features that represent key visual information of the accident. A visual language model training module is used to train a visual language model based on the traffic accident video, structured accident description labels, and keyframe guidance features. The visual language model training module is configured to enable the visual language model to generate a structured accident description from the traffic accident video, form a latent visual representation at a potential visual prediction position following the structured accident description, use the keyframe guidance features as the supervision target of the latent visual representation, and learn key visual information in the collision keyframes by constraining the visual semantic consistency between the latent visual representation and the keyframe guidance features. The accident understanding result generation module is used to acquire traffic accident videos to be understood and input them into the trained visual language model to generate corresponding structured accident understanding results.
10. The traffic accident video understanding system as described in claim 9, characterized in that, It also includes a spatial understanding enhancement training module, which is connected to the visual language model training module and is used to enhance the training of the visual language model based on the spatial semantic information in the structured accident description labels. The spatial understanding enhancement training module is configured to perform semantic analysis on structured accident description labels to determine spatial semantic text tags that represent vehicle directional relationships, vehicle positional relationships, and / or vehicle motion relationships; generate spatial semantic supervision information based on the position of the spatial semantic text tags in the structured accident description labels; and enhance the text prediction position of the visual language model based on the spatial semantic supervision information to improve the visual language model's ability to understand vehicle spatial relationships in traffic accident scenarios.
Citation Information
Patent Citations
Traffic video processing analysis method, system and equipment
CN121074749A
Semantic segmentation-oriented traffic scene key event description generation method and system
CN121789184A
