Video detection method and device
By acquiring the optical flow field of the video and combining it with a large visual model, motion components related to the risk category are extracted to generate preliminary risk detection results. This solves the problems of accuracy and generalization ability of existing video detection methods in complex scenarios, and achieves efficient and accurate risk identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-24
AI Technical Summary
Existing video detection methods are prone to failure in low-light, occluded, or small target scenarios, have weak generalization ability, and end-to-end behavior recognition models have difficulty accurately identifying the start and end times of events in complex scenarios, resulting in poor detection accuracy.
By acquiring the optical flow field of the video to be detected, motion components related to the preset risk category are extracted to generate preliminary risk detection results. Risk detection is then achieved by combining the optical flow field with a large visual model.
It improves the efficiency and semantic accuracy of risk identification, has good generalization ability, adapts to various risk scenarios, reduces computational overhead, and is practical and scalable.
Smart Images

Figure CN121725397A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of video recognition, in particular to a video detection method and device. BACKGROUND
[0002] With the development of artificial intelligence and computer vision technology, automatic risk identification and behavior analysis based on video are widely used in traffic monitoring, public security, content review and other fields. However, the existing video detection methods still face many challenges in practical application. Traditional methods usually rely on target detection, key point estimation or behavior recognition deep learning models to identify specific objects (such as bottles, mobile phones, vehicles) or human poses to judge risks, however, such methods have obvious limitations: on the one hand, target detection is prone to failure in low light, occlusion or small target scenes, and has weak generalization ability for unobserved object categories; on the other hand, end-to-end behavior recognition models often lack explainability, and have deviations in judging the start and end time of events in complex scenes (such as light changes, occlusions), resulting in poor detection accuracy. SUMMARY
[0003] Therefore, the embodiments of the present application provide a video detection method and device to improve risk identification efficiency and semantic accuracy.
[0004] In a first aspect, a video detection method is provided, the method comprising: obtaining a video to be detected; determining optical flow fields corresponding to each adjacent video frame in the video to be detected, respectively; determining risk preliminary detection results corresponding to each video frame according to motion components associated with a risk category to be detected in each optical flow field; determining risk statistical information corresponding to the video to be detected according to each risk preliminary detection result; filling the risk statistical information into a prompt template corresponding to the risk category to be detected to generate a risk verification prompt sentence corresponding thereto; inputting the risk verification prompt sentence into a visual large model to determine a risk detection result corresponding thereto.
[0005] Further, the determining of the risk preliminary detection results corresponding to each video frame according to the motion components associated with the risk category to be detected in each optical flow field comprises: determining a target region from each optical flow field, respectively; determining a detection direction corresponding to the risk category to be detected; extracting a motion component in the detection direction from the target region; determining a risk preliminary detection result of the corresponding video frame according to the motion component.
[0006] Further, determining the target region from each of the optical flow fields includes: The video frames are used to perform image recognition to determine the corresponding detection targets; The target area is determined based on the detection target.
[0007] Further, determining the target region from each of the optical flow fields includes: Determine the corresponding preset location based on the risk category to be detected; The region in the video frame located at the preset position is determined as the target region.
[0008] Further, determining the initial risk detection result of the corresponding video frame based on the motion components includes: The target region is divided into multiple sub-regions in the detection direction; The corresponding motion speed is determined based on the motion components within each sub-region; The initial risk assessment result for the corresponding video frame is determined based on the speed of each movement.
[0009] Furthermore, the risk category to be detected is vehicle collision risk, and the detection direction is the vertical direction; The determination of the initial risk detection result for the corresponding video frame based on each of the motion speeds includes: The corresponding time from collision is determined based on the movement speed of the sub-region and the relative position of the sub-region within the target region. The risk level of the corresponding video frame is determined based on the motion speed and the time from collision. The video frame is added to the risk video frame subsequence corresponding to the risk level.
[0010] Furthermore, the risk category to be detected is the risk of drinking behavior, and the detection direction is the vertical direction; The determination of the initial risk detection result for the corresponding video frame based on each of the motion speeds includes: The risk level of the corresponding video frame is determined based on the motion speed corresponding to the sub-region. The video frame is added to the risk video frame subsequence corresponding to the risk level.
[0011] Further, adding the video frame to the risk video frame subsequence corresponding to the risk level includes: In response to the presence of a number of consecutive data frames with a risk level higher than a preset risk level, each of the video frames is added to the risk video frame subsequence corresponding to the risk level.
[0012] Furthermore, the risk statistics information includes at least one risk video frame subsequence corresponding to a risk level, and / or, the time point corresponding to each video frame in the risk video frame subsequence.
[0013] Furthermore, after acquiring the video to be detected, the method further includes: Determine the type of risk to be detected corresponding to the video to be detected.
[0014] Secondly, a video detection device is provided, the device comprising: The acquisition module is used to acquire the video to be detected; The first determining module is used to determine the optical flow field corresponding to each adjacent video frame in the video to be detected; The second determining module is used to determine the initial risk detection result corresponding to each video frame based on the motion components in the optical flow field that are associated with the risk category to be detected. The third determining module is used to determine the risk statistics information corresponding to the video to be detected based on the initial risk detection results of each of the above-mentioned risks. The generation module is used to fill the risk statistics information into the prompt template corresponding to the risk category to be detected, and generate the corresponding risk inspection prompt statement. The detection module is used to input the risk inspection prompt statement into the visual large model and determine the corresponding risk detection result.
[0015] Thirdly, an electronic device is provided, including a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in the first aspect above.
[0016] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the method described in the first aspect.
[0017] Fifthly, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the method described in the first aspect above.
[0018] The technical solution of this invention first acquires the video to be detected, calculates the optical flow field between adjacent frames in the video, then extracts motion components (such as vertical or horizontal displacement) related to a preset risk category, generates a preliminary risk detection result for each frame, then statistically analyzes all preliminary detection results to form structured risk statistics, fills the corresponding preset risk category's prompt template with this risk statistics, automatically generates a risk verification prompt statement, and finally inputs the statement into a large-scale visual model to output the final risk detection result. This technical solution does not rely on complex modules such as object detection; it can capture key dynamic features and complete the preliminary risk detection solely through optical flow. Subsequently, by combining the prompt template with a large-scale visual model, risk verification is achieved, enabling high-precision semantic understanding. This reduces computational overhead while improving risk identification efficiency and semantic accuracy, and also possesses good generalization ability, adapting to various risk scenarios, combining practicality and scalability. Attached Figure Description
[0019] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which: Figure 1 This is a flowchart of the video detection method according to an embodiment of the present invention; Figure 2 This is a flowchart of the method for determining the initial risk detection results according to an embodiment of the present invention; Figure 3 A flowchart of a method for determining the initial risk detection results corresponding to vehicle collision risk according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a video frame according to an embodiment of the present invention; Figure 5 A flowchart for video detection methods corresponding to vehicle collision risks; Figure 6 This is a flowchart of the data processing method for a large visual model according to an embodiment of the present invention; Figure 7 This is a schematic diagram of a video detection device according to an embodiment of the present invention; Figure 8 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0020] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.
[0021] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0022] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".
[0023] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0024] The solutions described in this specification and embodiments, if involving the processing of personal information, will be processed only on the premise of having a legal basis (such as obtaining the consent of the personal information subject, or being necessary for the performance of a contract), and will only be processed within the scope stipulated or agreed upon. A user's refusal to process personal information beyond what is necessary for basic functions will not affect the user's use of basic functions.
[0025] With the explosive growth of video content on internet platforms, the demand for intelligent video analysis is becoming increasingly widespread, covering multiple fields such as ad review, content security, and behavior recognition. Traditional video detection methods mostly employ a fixed frame rate sampling strategy, that is, extracting video frames at constant time intervals for subsequent analysis. However, this type of time-series data processing method based on fixed frame rates has gradually revealed significant limitations when dealing with dynamic events.
[0026] First, the problem of missing information is prominent. Since fixed frame extraction cannot guarantee that the key action occurs exactly at the sampling point, short-term dynamic behaviors (such as dangerous driving actions and sudden abnormal behaviors) are easily missed. At the same time, long-term continuous events may be incorrectly segmented into multiple isolated segments due to excessively large inter-frame intervals, resulting in contextual breaks and affecting overall understanding.
[0027] Secondly, dynamic event boundaries are often blurred. Current mainstream Vision-Language Models (VLMs) typically rely on single frames or short segments as input when processing video sequences, leading to biases in determining the start and end times of events. Especially in complex scenes with changes in lighting, occlusion, and motion blur, the models struggle to accurately identify the true duration of events, easily resulting in misjudgments or missed detections.
[0028] Furthermore, the system suffers from insufficient adaptability to different scenarios. The accuracy and efficiency requirements for dynamic information extraction vary significantly across different business scenarios. For example, ad review requires high-precision capture of instantaneous violations, while content summarization focuses more on long-term trends. Traditional rule-based or fixed-window processing methods lack flexibility, making it difficult to adapt to diverse task requirements and limiting the system's versatility and scalability.
[0029] Therefore, there is an urgent need for a video analysis method that can overcome the limitations of fixed frame rates, accurately capture the entire process of dynamic events, and possess good scene generalization capabilities, in order to achieve efficient and reliable identification and understanding of complex dynamic behaviors. To this end, embodiments of this application provide a video detection method and apparatus to achieve the aforementioned functions.
[0030] Figure 1 This is a flowchart of a video detection method according to an embodiment of the present invention. Figure 1 As shown, the video detection method includes the following steps: Step S100: Obtain the video to be tested.
[0031] The video to be tested refers to digital video data containing dynamic visual content that needs to be assessed for the presence of specific risky behaviors or events. This video consists of a continuous sequence of image frames. Specific risks refer to various pre-defined risk categories, including but not limited to collision risks when vehicles are traveling straight, collision risks when vehicles are changing lanes too late, and risks related to behaviors such as drinking alcohol, as specified in short video reviews. The video content and source differ depending on the risk category. For example, if the risk category is collision risk when vehicles are traveling straight, the video source is an in-vehicle camera, and the video content is road traffic conditions. The video to be tested can be obtained through real-time acquisition, immediate storage and retrieval, network transmission and reception, or access from third-party systems.
[0032] In one possible implementation, after obtaining the video to be detected, the type of risk to be detected corresponding to the video can also be determined.
[0033] Optionally, the video to be detected carries a corresponding risk category label, and the corresponding risk category can be directly determined based on the label. This risk category label can be obtained through human interaction.
[0034] Optionally, the corresponding risk category to be detected can be determined based on the video source or metadata of the video to be detected. For example, videos from vehicle-mounted forward-facing cameras are classified as vehicle collision risk by default, while videos from Driver Monitoring System (DMS) cameras are classified as abnormal behavior detection of occupants by default.
[0035] Optionally, the risk category to be detected can include multiple risk categories. Simultaneously, motion component extraction rules and prompt templates for multiple risk categories are loaded, and corresponding preliminary risk detection results are generated for each risk category. Finally, the visual big data model comprehensively judges the most likely risk type.
[0036] Step S200: Determine the optical flow field corresponding to each adjacent video frame in the video to be detected.
[0037] The optical flow field refers to the vector representation of the motion trend of each pixel between two adjacent video frames. It describes the instantaneous motion direction and speed of each visible point in the picture in the time dimension, and is usually presented in the form of a two-dimensional vector.
[0038] Specifically, regarding the first in the video t Frame and the t +1 frame, the optical flow field is a two-dimensional array (or vector field) with the same spatial size as the video frame, where each position ( x , y () corresponds to a vector: in, This represents the displacement component of the pixel in the horizontal direction (i.e., the x-axis). This represents the displacement component of the pixel in the vertical direction (i.e., the y-axis), and both are measured in pixels per frame. >0 indicates moving to the right. =0 indicates that there was no movement in the horizontal direction. <0 indicates moving to the left. >0 indicates moving downwards. =0 indicates that there was no movement in the vertical direction. <0 indicates moving upwards.
[0039] Optical flow field, as the underlying dynamic feature carrier, is used to extract motion cues related to the risk category to be detected, such as the vertical negative velocity representing the approach of an object. Optical flow field has pixel-level accuracy, with each pixel having a corresponding motion vector (dense optical flow), which can capture subtle dynamics. Motion is estimated based solely on brightness / texture changes, without relying on object detection or semantic segmentation. It represents the relative motion between the camera and the scene (such as vehicle movement, pedestrian crossing, hand gestures, etc.). It can still be calculated under low illumination or no color information (grayscale image) conditions. Through statistical analysis of specific components in the optical flow field, unsupervised or weakly supervised initial screening of risky behaviors can be achieved, providing reliable input for subsequent semantic reasoning.
[0040] In one possible implementation, the optical flow field can be determined using methods based on traditional computer vision algorithms and deep learning. Traditional methods, such as Farnebäck, TV-L1, and DIS (Dense Inverse Search), solve for dense motion vectors directly from the pixel intensity changes in adjacent frames by modeling the assumption of constant image brightness and spatial smoothness constraints. Deep learning methods, such as FlowNet, PWC-Net, and RAFT, use convolutional neural networks to learn optical flow mapping relationships from large amounts of data, which are generally more accurate but have higher computational costs.
[0041] Optionally, strategies such as downsampling, region cropping, or hardware acceleration can be combined to improve computational efficiency while ensuring motion information in key areas, making it suitable for scenarios requiring high-efficiency detection, such as vehicle-mounted or real-time video analysis.
[0042] Step S300: Determine the initial risk detection result corresponding to each video frame based on the motion components in each optical flow field that are associated with the risk category to be detected.
[0043] The motion component refers to the projection value of the optical flow vector in a specific direction, usually u (horizontal) or v (vertical), and can also be extended to the amplitude ( The motion component associated with the risk category to be detected refers to the motion data in the direction that has the strongest discriminative power in judging the risk category. Specifically, the motion component associated with the risk category to be detected refers to the optical flow direction or combination features that are pre-determined according to the type of risk to be detected and have a significant indicative role in risk judgment. For example, when the risk category to be detected is a straight-ahead collision risk, the associated motion component is the vertical component in the optical flow field. If the risk to be detected is a forward collision, the focus is on its negative value region; if the risk to be detected is a rear-end collision, the focus is on its positive value region. By extracting and analyzing this specific motion component, the initial risk detection result corresponding to each video frame can be generated.
[0044] For example, the motion components include a motion component in the vertical direction (hereinafter referred to as the vertical motion component) and a motion component in the horizontal direction (hereinafter referred to as the horizontal motion component). The vertical motion component is also the one described above. The horizontal motion component is also mentioned above. .
[0045] The relationship between the risk category to be detected and the motion component is a pre-defined mapping relationship based on physical common sense or behavioral patterns. Different risk categories focus on different motion characteristics. For example, the motion component associated with the collision risk category when a vehicle is traveling straight is the vertical motion component, which is based on the physical fact that when a vehicle approaches from the front, it appears as an upward motion in the image. v<0), and the faster the speed, the more dangerous it is. The motion component associated with the risk category of pedestrians crossing the road while the vehicle is moving is the horizontal motion component. The corresponding physical basis is that when a pedestrian crosses the lane laterally, strong horizontal motion is generated. Large positive or negative values of the horizontal motion component can indicate the risk of pedestrians crossing the road. The motion component associated with the risk category of drivers looking down at their phones is the vertical motion component. The corresponding physical basis is that when drivers look down, the head image shifts downward in the image.
[0046] The aforementioned correlation transforms abstract risk semantics (such as vehicle collisions, pedestrians crossing the road, drivers looking down, etc.) into quantifiable optical flow features, thereby bridging the gap between underlying visual signals and high-level risk assessment.
[0047] Figure 2 This is a flowchart illustrating the method for determining the initial risk assessment results according to an embodiment of the present invention. Figure 2 As shown, the method for determining the initial risk assessment result includes the following steps: Step S310: Determine the target region from each of the optical flow fields.
[0048] The target region refers to a local spatial area extracted from the optical flow field corresponding to the video frame that is strongly correlated with the current risk category to be detected. This region is usually pre-defined or dynamically detected based on the physical characteristics or location of the risky behavior, and is used to focus on analyzing key motion cues and eliminate irrelevant background interference. In vehicle collision risk detection, the target region can be the lower half of the image, such as 40% to 100% of the height, corresponding to the area in front of the road and near the vehicle. In drinking behavior detection, the target region can be the mouth area of a face, the area of hand movement, or the area near the cup holder, which is obtained by cropping after localization by a face / hand detection model.
[0049] The introduction of the target region achieves the technical effects of focusing on key aspects, suppressing interference, and improving efficiency and accuracy. It serves as a crucial intermediary link connecting underlying optical flow features with high-level risk semantics. Taking vehicle collision risk detection as an example, extracting the target region from the entire optical flow field eliminates motion noise from irrelevant or interfering areas such as the sky, distant background, and dashboard reflections, making risk-related motion components more prominent and enhancing the feature signal-to-noise ratio. Focusing the analysis on high-risk areas such as the near lane avoids signal dilution caused by global averaging during subsequent speed calculations, helping to capture weak but crucial behavioral cues and improve detection accuracy. Furthermore, the location and extent of the target region can be flexibly configured according to the risk category to be detected, allowing the same optical flow analysis framework to be quickly transferred to detection tasks of different risk categories.
[0050] In one possible implementation, the target area can be further divided into functional sub-regions, such as near / middle / far layers, or hand / mouth / cup holder areas, to support more refined risk assessment logic and facilitate hierarchical or semantic modeling.
[0051] In the method corresponding to step S310 above, the complete dense optical flow field is first calculated for adjacent video frames, and then the target region is extracted from the optical flow field. This method ensures that the optical flow estimation makes full use of the context information of the entire image and avoids boundary distortion caused by local cropping, thereby improving the accuracy of subsequent initial risk detection.
[0052] In one possible implementation, the target region can also be extracted in step S200 above. That is, the target region is first extracted from the video frame, and then the dense optical flow field corresponding to the target region is calculated. This method is suitable for scenarios where computing resources are limited and the target region is far from the image boundary.
[0053] In one possible implementation, the target area can be extracted from the optical flow field based on a preset spatial location or target detection results.
[0054] Optionally, a preset location can be determined based on the risk category to be detected, and the area in the video frame at the preset location can be identified as the target area.
[0055] Specifically, the location and size of the target area are fixed before system deployment, such as the lower 40% to 100% of the screen or the center at 200×200 pixels. Its position does not change with the video content, making it suitable for scenarios with stable viewing angles. There is a mapping relationship between the risk categories to be detected and their corresponding preset positions. For example, the preset position for vehicle collision risk detection is the lower 40% to 100% of the screen because the lower half of the screen represents the area close to the vehicle. The preset position for vehicle rear-end collision risk detection is the upper 40% to 100% of the screen because, for the rear of the vehicle, the lower half of the screen represents the area close to the vehicle.
[0056] The method for determining the target area based on a preset spatial location does not rely on specific visual content, is sensitive to pose changes, requires no additional AI model, has extremely low computational overhead, exhibits predictable behavior, and is easy to debug and verify for compliance. It is suitable for fixed-view scenarios, such as vehicle collision detection. For details, please refer to the following embodiments, which will not be described in detail here.
[0057] Optionally, image recognition can be performed on the video frames to determine the corresponding detection targets, and then the target area can be determined based on the detection targets.
[0058] Specifically, by calling face detection, hand detection, or object detection models to locate key objects (i.e., detection targets), and then using their bounding boxes or key point regions as the target region for dynamic cropping, it is suitable for scenarios requiring high-precision behavior recognition.
[0059] The target region determination method based on object detection relies on visual content and is highly adaptable, adapting to different driver heights, sitting postures, and lighting conditions. It supports fine-grained behavior recognition, such as specifically distinguishing between drinking water and drinking alcohol. It can also reduce false alarms, avoiding misjudging dashboard reflections or passenger actions as risky driver behavior. It is suitable for scenarios requiring high-precision behavior recognition, such as detecting risky behaviors like drinking / smoking. Specific details can be found in the following embodiments, which will not be elaborated upon here.
[0060] Step S320: Determine the corresponding detection direction based on the risk category to be detected.
[0061] Specifically, there is a predetermined mapping relationship between the risk category to be detected and the detection direction. For example, the detection direction for vehicle collision risk detection is vertical, while the detection direction for pedestrian crossing risk detection is horizontal. The mapping relationship between the risk category to be detected and the detection direction is determined based on the behavioral logic of the behavior corresponding to the risk category.
[0062] Step S330: Extract the motion component in the detection direction from the target region.
[0063] For example, if the detection direction is vertical, the extracted motion component is the vertical motion component; if the detection direction is horizontal, the extracted motion component is the horizontal motion component.
[0064] Step S340: Determine the initial risk detection result of the corresponding video frame based on the motion components.
[0065] The initial risk assessment results include information such as the risk level, the time point of the corresponding video frame in the video to be tested, and the confidence level.
[0066] The methods for determining risk detection results based on motion components differ for different risk categories.
[0067] Figure 3 This is a flowchart illustrating the method for determining the initial risk assessment results corresponding to vehicle collision risks according to an embodiment of the present invention. Figure 3 As shown, the method for determining the initial risk assessment result corresponding to the vehicle collision risk includes the following steps: Step S341: The target region is divided into layers in the detection direction to obtain multiple sub-regions.
[0068] Further stratification of the target area is to simulate spatial depth. Vertical stratification can simulate spatial depth, distinguish the motion characteristics of areas at different distances, and thus more accurately assess risks. Specifically, the target area is divided into multiple sub-regions along the vertical direction, such as near, medium, and far. Each sub-region corresponds to a different distance range in the scene, such as a nearby lane or a distant road. Calculating the motion components and time-to-collision (TTC) for each layer separately avoids interference between motion signals from near and far objects. Furthermore, by adhering to the principle of the most dangerous layer dominating, it improves sensitivity and localization capabilities for emergency approach events. For example, rapid approach (high risk) in the near layer should not be diluted by slow movement (low risk) in the far layer; stratification can preserve local high-risk signals.
[0069] The target region can be represented as: in, Indicates the target area. This represents the dense optical flow field of the entire frame, with a shape of H×W×2, where H represents the total height of the video frame and W represents the total width of the video frame. Indicates the starting line of the target area, for example =0.4×H, which means only the lower 60% area of the image is considered.
[0070] In one possible implementation, when layering the target region, the layering parameters are first determined, including the number of layers and the pixel height of each layer. Assuming the number of layers is 3, i.e., L=3, then the corresponding pixel height of each layer is: No. The pixel range of the layer is [ ], , This indicates the nearest floor; this floor is the closest to the vehicle and is prioritized for higher risks. , Indicates the distant layer.
[0071] Step S342: Determine the corresponding motion speed according to the motion components in each of the sub-regions.
[0072] Here, the motion component refers to the component along the detection direction. The motion velocity corresponding to a sub-region is the average of the motion velocities of all pixels within that sub-region. When the risk category to be detected is vehicle collision risk, the above motion component is the vertical motion component.
[0073] The formula for extracting the vertical motion component is as follows: in, The optical flow field corresponding to the target region is characterized by the third dimension of the optical flow field as [u, v], where 0 represents the horizontal motion component and 1 represents the vertical motion component.
[0074] No. The speed of the layer's movement is: in, Indicates the first The speed of layer movement, Indicates the first The total number of pixels contained in the layer. Indicates the first The spatial region corresponding to the layer.
[0075] The movement speeds at different layers represent the overall approach trend of objects within different longitudinal distance zones. The near layer reflects urgent close-range risks, the middle layer reflects normal following conditions, and the far layer reflects long-distance traffic flow. This layering enables the system to have risk perception levels from near to far. If the movement speed of the entire target area is calculated directly without layering, the movement speed of the near layer will be lowered by the movement speed of the far layer, thus missing the risks in the near layer.
[0076] Step S343: Determine the initial risk detection result of the corresponding video frame based on the motion speed of each frame.
[0077] The initial risk assessment results include at least the risk level corresponding to the video frame. The risk level can be classified according to the actual situation, such as high risk, medium risk, and low risk.
[0078] In one possible implementation, the initial risk assessment result can be determined directly based on the motion speed and the speed range corresponding to the risk level. For example, if the motion speed falls within the speed range corresponding to low risk, then the risk level of the video frame is low. The mapping relationship between risk level and corresponding speed range is also predetermined.
[0079] In one possible implementation, the initial risk assessment result can be determined based on both motion speed and Time to Collision (TTC). Specifically, based on the motion speed corresponding to the sub-region and the relative position of the sub-region within the target region, the corresponding time to collision is determined, and based on the motion speed and the time to collision, the risk level of the corresponding video frame is determined.
[0080] The formula for calculating TTC is: in, Indicates the first The estimated distance and collision time of the layer. Indicates the first The distance level weights corresponding to each layer reflect the actual distance to that layer. Example setting: near layer Middle layer distant layer In actual use It can be calibrated or set empirically to compensate for the difference in the actual velocity corresponding to the same pixel velocity at different distances. Indicates the first The absolute value of the layer's motion velocity, ε, is a very small constant set to prevent division by zero errors; for example, it can be 10. 6 .
[0081] Optionally, a speed risk score is determined based on the motion speed, a TTC risk score is determined based on the TTC, a single-layer risk score for each sub-region is determined based on the speed risk score and the TTC risk score, and then the corresponding whole-frame risk score is determined based on the single-layer risk scores of all sub-regions.
[0082] The mapping relationships between movement speed and corresponding movement speed scores, and between TTC and corresponding TTC risk scores, are all pre-defined.
[0083] For example, the formula for scoring movement speed is: in, It refers to the first Motion velocity score for sub-regions.
[0084] The TTC risk scoring formula is: in, It refers to the first TTC risk score for the sub-region.
[0085] No. The single-layer risk score corresponding to the sub-region is: A higher score indicates a higher risk level.
[0086] The risk score for the entire frame can be the score corresponding to the most dangerous layer, that is: Easy to understand Figure 3The method shown is applicable to the initial detection of any risk category with a vertical detection direction. If the risk category is not a collision risk, the initial detection result can be determined solely based on the movement speed, without calculating the Total Time Tolerance (TTC). It is worth noting that movement speed can reflect movement patterns. For example, if the risk category to be detected is alcohol consumption, the target area can be taken from 20% to 80% of the video frames. Layering can be done according to the corresponding heights of the head, shoulders, and hands, resulting in corresponding sub-regions. The speed of each sub-region is calculated separately. If the sub-region speeds in consecutive video frames indicate that the sub-region corresponding to the hand moves first, then the sub-region corresponding to the shoulder moves, and finally the sub-region corresponding to the head moves, this movement pattern may indicate alcohol consumption. If the detection direction is horizontal, the same approach can be used. Figure 3 The method shown is used for initial risk assessment; simply changing direction is sufficient, so it will not be elaborated further here.
[0087] In one possible implementation, the risk category to be detected is the risk of drinking behavior, and the detection direction is the vertical direction. The method for determining the initial risk detection result is to determine the risk level of the corresponding video frame based on the movement speed corresponding to the sub-region.
[0088] In one possible implementation, after determining the risk level of a video frame according to the above method, the video frame is added to the risk video frame subsequence corresponding to the risk level. For example, if the risk level of a video frame is high risk, then the video frame can be submitted to the high-risk video frame subsequence.
[0089] In one possible implementation, in response to the presence of a number of consecutive data frames with a risk level higher than a preset risk level, each of the video frames is added to a risk video frame subsequence corresponding to the risk level.
[0090] Specifically, if a predetermined number of consecutive video frames have a risk level higher than a preset risk level, these consecutive video frames are added to the corresponding risk video frame subsequence; otherwise, they are discarded. By introducing temporal continuity constraints and a structured event aggregation mechanism, the accuracy, interpretability, and practicality of risk detection are significantly improved without adding complex perception modules.
[0091] High-risk single-frame events may be caused by image jitter, sudden changes in illumination, occlusion, or errors in optical flow calculation, and do not possess behavioral continuity. By requiring a predetermined number of consecutive frames (e.g., ≥3 frames) to exceed the risk threshold, isolated false alarms can be filtered out, significantly improving the stability and reliability of detection results. Real-world risk events (such as emergency vehicle approach or drinking) typically exhibit motion characteristics lasting for several frames or more. This mechanism ensures that risky behaviors are recorded only when they have temporal continuity, which is more consistent with the behavioral patterns of the physical world and improves the semantic rationality of the detection. Organizing consecutive high-risk frames into risk video frame subsequences forms traceable, replayable, and interpretable event units, facilitating subsequent review, accident evidence collection, or contextual understanding of large models, and avoiding fragmented judgments caused by scattered frames. Different risk levels can generate corresponding risk video frame subsequences, enabling not only the determination of whether there is a risk, but also the determination of the duration of the risk and whether the risk level has escalated / degraded, providing a data foundation for refined risk assessment and alarm strategies.
[0092] For example, a predetermined quantity of 3 frames is set, with a preset risk level of high risk. If frames 100, 101, and 102 are all at a high risk level, these three frames are added to a high-risk video frame subsequence. If the risk level of frame 103 drops to medium risk, the subsequence terminates there. This subsequence is then used as input to the complete event visual model, which can be used to determine whether it constitutes a real dangerous driving behavior.
[0093] Step S400: Determine the risk statistics information corresponding to the video to be detected based on the preliminary risk detection results.
[0094] The risk statistics include at least one risk video frame subsequence corresponding to a risk level, and / or the time point corresponding to each video frame in the risk video frame subsequence. Furthermore, the risk statistics may also include the analysis period, number of detections, number of frames corresponding to each risk level, risk distribution, detection confidence level, etc.
[0095] For example, the risk statistics are as follows: Analysis period: 00:00.00 to 00:34.00 (duration: 52.89 seconds) Total number of assessments: 341 Average processing time: 100.19 milliseconds per frame Severe risk: 0 times (0.0%) High risk: 1 time (0.3%) Medium risk: 5 times (1.5%) Low risk: 334 times (97.9%) Mean Time to Collision (TTC): 41.8 seconds Risk branch distribution: Approach risk: 1 time (0.3%) Safe distance (SAFE_DISTANCE): 253 times (74.2%) Unknown: 1 time (0.3%) Unreliable detection: 86 times (25.2%) High-risk frames: Frames 480 to 500 Step S500: Fill the risk statistics information into the prompt template corresponding to the risk category to be detected, and generate the corresponding risk inspection prompt statement.
[0096] The prompt template can include information such as the risk category to be detected and output requirements.
[0097] Optionally, the prompt template may also include visual descriptive text. Specifically, based on the inter-frame motion features and temporal order of the risk video frame sequence, a brief visual descriptive text is generated, such as "A vehicle is rapidly approaching from ahead, lasting for 3 frames," etc.
[0098] Taking vehicle collision risk as an example, the warning template can be: "Understanding Vehicle Dynamic Collision Risks: Please analyze potential collision events based on the [Risk Statistics Information Entry Location] and output a structured risk report in conjunction with the TTC (Time-To-Collision) context."
[0099] Please strictly follow the steps below to analyze the input information and images: 1. Provide image sequence description: Provide objective text descriptions of the input frame sequence, including key visual elements (e.g., vehicle type, location, direction of motion, environmental features, distance changes).
[0100] 2. Collision Risk Analysis 3. Conclusion Output: A unique conclusion must be selected from the following three categories: Collision risk: If the image clearly indicates an impending collision. No collision risk: If the image shows a safe state. More information needed: If the information is incomplete, additional information is required for judgment. It is easy to understand that the above prompt template is only an example, and the specific settings of the prompt template are not limited in the embodiments of this application.
[0101] By filling the risk statistics and other data into the prompt template corresponding to the risk category to be detected, the corresponding risk inspection prompt statement can be constructed.
[0102] Step S600: Input the risk inspection prompt statement into the visual large model and determine the corresponding risk detection result.
[0103] In one possible approach, if the risk statistics include risk video frames, then only the risk verification prompts are input into the large visual model.
[0104] Optionally, the video frames in the risk video frame sequence can also be preprocessed and encoded. The risk video frame sequence is a collection of multiple risk video frame subsequences. The video frames in the risk video frame sequence are preprocessed by scaling, normalization, etc., and then encoded into a format that can be input to a large visual model, such as an image sequence tensor.
[0105] In one possible approach, the risk statistics information does not include risk video frames, but only the time points corresponding to each video frame. In this case, the risk inspection prompt statement and the video to be detected are input into the visual big data model.
[0106] Figure 4 This is a schematic diagram of a video frame according to an embodiment of the present invention. Figure 4 As shown, the video frame corresponds to the vehicle collision detection video frame. Based on this video frame, the output of the large visual model is: The footage, captured from a bicycle dashcam's perspective, shows a car driving on the road. A large, cartoonish horse head decoration is mounted on the rear window; the white head has a brown mane and an exaggerated design, swaying in the wind. The background shows a clear sky and buildings on both sides of the road, with other vehicles driving normally. The top of the screen displays text such as "Introductory Price" and "Starting from 1 cent," while the bottom has the subtitle "Unexpectedly, I tried it out..." The overall style is clearly advertising.
[0107] Collision risk analysis: Although the distance or relative speed to the vehicle in front is not directly displayed in the video, the information provided by the professional optical flow processing model indicates that "the video vehicle is at risk of colliding with the vehicle in front: high risk: approach risk (APPROACHING_RISK); TTC has exceeded the threshold."
[0108] It can be determined that: The TTC has exceeded the safety threshold, meaning that the relative distance between the vehicle and the target ahead is decreasing rapidly, posing a high risk of an impending collision.
[0109] "Approach risk" indicates that a vehicle is detected approaching an object at a dangerous speed, and is in a critical state even before contact is made.
[0110] Conclusion: A car collision has occurred or is about to occur in this footage.
[0111] It should be understood that the aforementioned risk detection method is not limited to a single risk category. In practical applications, the selection method of associated motion components in the optical flow field and the content structure of the prompt template can be adjusted according to the characteristics of the risk category to be detected. For example, in vehicle collision risk monitoring scenarios, attention can be paid to the vertical negative motion components in the lower half of the image; while in drinking behavior detection scenarios, the focus can be on the coordinated motion characteristics of the hand and mouth areas. Therefore, this method can be applied to video intelligent analysis tasks in multiple fields such as transportation, security, and content moderation.
[0112] The method of this invention first acquires the video to be detected, calculates the optical flow field between adjacent frames in the video, then extracts motion components (such as vertical or horizontal displacement) related to a preset risk category, generates the initial risk detection result for each frame, then statistically analyzes all the initial detection results to form structured risk statistics, fills the risk statistics into the prompt template corresponding to the preset risk category, automatically generates a risk inspection prompt statement, and finally inputs the statement into the visual large model to output the final risk detection result. By integrating optical flow field analysis, vertical layering of target regions, construction of continuous high-risk frame subsequences, structured prompt templates, and visual large-scale model inference, efficient, robust, and interpretable video risk detection is achieved. On the one hand, it does not rely on target detection or a large amount of labeled data, but can capture dynamic clues related to risks based solely on pixel-level motion features. On the other hand, by simulating scene depth through target region layering, it effectively distinguishes the motion trends of near, middle, and far regions, avoiding the dilution of key risk signals by background noise. At the same time, a continuous frame verification mechanism is introduced, and a risk video frame subsequence is formed only when no less than a predetermined number of adjacent frames are continuously higher than the preset risk level, significantly suppressing instantaneous false detections. Furthermore, the statistical results are filled into the natural language prompt templates corresponding to the risk categories to generate standardized risk verification statements, which are then handed over to the visual large-scale model for semantic-level judgment, taking into account both low-level evidence and high-level understanding, greatly improving the generalization ability for complex and ambiguous behaviors. The overall solution has strong versatility and can be flexibly adapted to various application scenarios such as vehicle collision warning and drinking or smoking behavior recognition by configuring motion components and prompt templates associated with different risk categories.
[0113] Figure 5 This is a flowchart illustrating video detection methods for vehicle collision risk. Figure 5 As shown, the video detection method corresponding to the vehicle collision risk includes the following steps: Step S501: Read the video to be detected frame by frame.
[0114] The video to be tested is one that includes the road scene ahead of the vehicle while it is in motion.
[0115] Step S502: Determine whether the currently read video frame is the first frame.
[0116] If yes, proceed to step S501; otherwise, proceed to step 503.
[0117] Step S503: Determine the optical flow fields corresponding to the current video frame and the previous video frame.
[0118] Step S504: Determine the target region from the optical flow field.
[0119] Step S505: Extract the vertical motion component from the target region.
[0120] Step S506: Vertically divide the target area into multiple sub-regions.
[0121] Step S507: Determine the corresponding motion velocity based on the motion components in each sub-region.
[0122] Step S508: Determine the corresponding collision time based on the movement speed of the sub-region and the relative position of the sub-region within the target region.
[0123] Step S509: Determine the risk level of the corresponding video frame based on the motion speed and the time from collision.
[0124] Step S510: Determine whether the corresponding video frame meets the addition conditions.
[0125] The added condition is that the risk level of the video frame is higher than the preset risk level if there are at least a predetermined number of consecutive data frames before and after it.
[0126] If the condition is met, proceed to step S511; otherwise, proceed to step S501.
[0127] Step S511: Add the video frame to the risk video frame subsequence corresponding to the risk level.
[0128] Step S512: Preprocess and encode the video frames in the risk video frame sequence.
[0129] Step S513: Generate a brief visual description text based on inter-frame motion features and temporal order.
[0130] Step S514: Construct the corresponding risk inspection prompt statement based on the prompt template.
[0131] Specifically, the risk statistics, visual description text, and other information are filled into the prompt template corresponding to the risk category to be detected, and the corresponding risk inspection prompt statement is generated.
[0132] Step S515: Input the risk inspection prompt statement into the visual large model and determine the corresponding risk detection result.
[0133] Figure 6This is a flowchart of a data processing method for a large visual model according to an embodiment of the present invention. Figure 6 As shown, the data processing method for large visual models includes the following steps: Step S601: Read the video frames in the risk video frame sequence.
[0134] Step S602: Perform single-frame and / or continuous frame information analysis on the video frame.
[0135] Specifically, single-frame video frame detection is performed on the video frame. Then, joint semantic understanding of the temporal context of this video frame and the preceding and following video frames is conducted to extract high-level, interpretable risk behavior features.
[0136] Step S603: Generate risk inspection results.
[0137] Specifically, risk assessment results include descriptions of risky behaviors, confidence levels, and contextual interpretations.
[0138] Step S604: Confirm whether the confidence level of the risk test result is greater than the preset confidence level.
[0139] If yes, proceed to step S605; otherwise, proceed to step S606.
[0140] Step S605: Determine the risk inspection information corresponding to the video frame.
[0141] Step S606: Confirm whether the confidence level of the risk test result is less than the preset confidence level.
[0142] If yes, proceed to step S607; otherwise, proceed to step S608.
[0143] Step S607: Delete the risk inspection information corresponding to the video frame.
[0144] Step S608: Expand the analysis scope by adding more preceding and following video frames.
[0145] Step S609: Determine whether there are any untested video frames in the risk video frame sequence.
[0146] If yes, proceed to step S601; otherwise, proceed to step S610.
[0147] Step S610: Generate risk inspection results based on the risk inspection information corresponding to each video frame.
[0148] The specific implementation of each step in this embodiment can be found in the above embodiments, and will not be repeated here.
[0149] The method of this invention does not rely on complex modules such as target detection. It can capture key dynamic features and complete the initial risk detection by optical flow alone. Then, it combines the prompt template with the large visual model to realize risk verification and achieve high-precision semantic understanding. It can improve the efficiency and semantic accuracy of risk identification while reducing computational overhead. It also has good generalization ability and can be adapted to a variety of risk scenarios, combining practicality and scalability.
[0150] Figure 7 This is a schematic diagram of a video detection device according to an embodiment of the present invention. Figure 7 As shown, the video detection device includes: The acquisition module 701 is used to acquire the video to be detected.
[0151] The first determining module 702 is used to determine the optical flow field corresponding to each adjacent video frame in the video to be detected.
[0152] The second determining module 703 is used to determine the initial risk detection result corresponding to each video frame based on the motion components in the optical flow field that are associated with the risk category to be detected.
[0153] The third determining module 704 is used to determine the risk statistics information corresponding to the video to be detected based on the preliminary risk detection results.
[0154] The generation module 705 is used to fill the risk statistics information into the prompt template corresponding to the risk category to be detected, and generate the corresponding risk inspection prompt statement.
[0155] The detection module 706 is used to input the risk inspection prompt statement into the visual large model and determine the corresponding risk detection result.
[0156] The apparatus of this invention is used to acquire a video to be detected, calculate the optical flow field between adjacent frames in the video, extract motion components (such as vertical or horizontal displacement) related to a preset risk category, generate a preliminary risk detection result for each frame, statistically analyze all preliminary detection results to form structured risk statistics, fill the corresponding prompt template for a preset risk category with this risk statistics, automatically generate a risk verification prompt statement, and finally input the statement into a large-scale visual model to output the final risk detection result. This apparatus does not rely on complex modules such as object detection; it can capture key dynamic features and complete the preliminary risk detection solely through optical flow. Then, by combining the prompt template with a large-scale visual model, it achieves risk verification and high-precision semantic understanding. It can improve risk identification efficiency and semantic accuracy while reducing computational overhead, and also has good generalization ability, adapting to various risk scenarios, combining practicality and scalability.
[0157] Figure 8This is a schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device 800 includes a server, a terminal, etc. Figure 8 As shown, the electronic device 800 includes at least one processor 801; a memory 802 communicatively connected to at least one processor 801; and a communication component 803 communicatively connected to a scanning device, wherein the communication component 803 receives and transmits data under the control of the processor 801; wherein the memory 802 stores instructions executable by at least one processor 801, which are executed by at least one processor 801 to implement the above-described video detection method.
[0158] Specifically, the electronic device includes: one or more processors 801 and a memory 802. Figure 8 Taking a processor 801 as an example, the processor 801 and the memory 802 can be connected via a bus or other means. Figure 8 Taking a bus connection as an example, memory 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Processor 801 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in memory 802, thereby implementing the aforementioned video detection method.
[0159] Memory 802 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store an option list, etc. Furthermore, memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 802 may optionally include memory remotely located relative to processor 801, and these remote memories can be connected to external devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0160] One or more modules are stored in memory 802, and when executed by one or more processors 801, they perform the video detection method in any of the above method embodiments.
[0161] The above-mentioned products can perform the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects of performing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.
[0162] The technical solution of this invention first acquires the video to be detected, calculates the optical flow field between adjacent frames in the video, then extracts motion components (such as vertical or horizontal displacement) related to a preset risk category, generates a preliminary risk detection result for each frame, then statistically analyzes all preliminary detection results to form structured risk statistics, fills the corresponding preset risk category's prompt template with this risk statistics, automatically generates a risk verification prompt statement, and finally inputs the statement into a large-scale visual model to output the final risk detection result. This technical solution does not rely on complex modules such as object detection; it can capture key dynamic features and complete the preliminary risk detection solely through optical flow. Subsequently, by combining the prompt template with a large-scale visual model, risk verification is achieved, enabling high-precision semantic understanding. This reduces computational overhead while improving risk identification efficiency and semantic accuracy, and also possesses good generalization ability, adapting to various risk scenarios, combining practicality and scalability.
[0163] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program that, when executed by a processor, implements some or all of the above-described method embodiments.
[0164] Another embodiment of the present invention relates to a computer program product, including a computer program / instructions that, when executed by a processor, implement some or all of the above-described method embodiments.
[0165] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0166] The above-mentioned products can perform the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects of performing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.
[0167] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A video detection method, characterized in that, The method includes: Obtain the video to be tested; Determine the optical flow field corresponding to each adjacent video frame in the video to be detected; Based on the motion components in each optical flow field that are associated with the risk category to be detected, the initial risk detection result corresponding to each video frame is determined; Based on the preliminary risk detection results, determine the risk statistics information corresponding to the video to be detected; Fill the risk statistics information into the prompt template corresponding to the risk category to be detected, and generate the corresponding risk inspection prompt statement; Input the risk inspection prompt statement into the visual large model to determine the corresponding risk detection result.
2. The method according to claim 1, characterized in that, The step of determining the initial risk detection result corresponding to each video frame based on the motion components in each optical flow field associated with the risk category to be detected includes: The target region is determined from each of the optical flow fields; Determine the corresponding detection direction based on the risk category to be detected; Extract the motion component in the detection direction from the target region; The initial risk detection result of the corresponding video frame is determined based on the motion components.
3. The method according to claim 2, characterized in that, Determining the target region from each of the optical flow fields includes: The video frames are used to perform image recognition to determine the corresponding detection targets; The target area is determined based on the detection target.
4. The method according to claim 2, characterized in that, Determining the target region from each of the optical flow fields includes: Determine the corresponding preset location based on the risk category to be detected; The region in the video frame located at the preset position is determined as the target region.
5. The method according to claim 2, characterized in that, The step of determining the initial risk detection result of the corresponding video frame based on the motion components includes: The target region is divided into multiple sub-regions in the detection direction; The corresponding motion speed is determined based on the motion components within each sub-region; The initial risk assessment result for the corresponding video frame is determined based on the speed of each movement.
6. The method according to claim 5, characterized in that, The risk category to be detected is vehicle collision risk, and the detection direction is the vertical direction; The determination of the initial risk detection result for the corresponding video frame based on each of the motion speeds includes: The corresponding time from collision is determined based on the movement speed of the sub-region and the relative position of the sub-region within the target region. The risk level of the corresponding video frame is determined based on the motion speed and the time from collision. The video frame is added to the risk video frame subsequence corresponding to the risk level.
7. The method according to claim 5, characterized in that, The risk category to be detected is the risk of drinking behavior, and the detection direction is vertical. The determination of the initial risk detection result for the corresponding video frame based on each of the motion speeds includes: The risk level of the corresponding video frame is determined based on the motion speed corresponding to the sub-region. The video frame is added to the risk video frame subsequence corresponding to the risk level.
8. The method according to claim 6 or 7, characterized in that, Adding the video frame to the risk video frame subsequence corresponding to the risk level includes: In response to the presence of a number of consecutive data frames with a risk level higher than a preset risk level, each of the video frames is added to the risk video frame subsequence corresponding to the risk level.
9. The method according to claim 1, characterized in that, The risk statistics information includes at least one risk video frame subsequence corresponding to a risk level, and / or the time point corresponding to each video frame in the risk video frame subsequence.
10. The method according to claim 1, characterized in that, After acquiring the video to be detected, the method further includes: Determine the type of risk to be detected corresponding to the video to be detected.
11. A video detection device, characterized in that, The device includes: The acquisition module is used to acquire the video to be detected; The first determining module is used to determine the optical flow field corresponding to each adjacent video frame in the video to be detected; The second determining module is used to determine the initial risk detection result corresponding to each video frame based on the motion components in the optical flow field that are associated with the risk category to be detected. The third determining module is used to determine the risk statistics information corresponding to the video to be detected based on the initial risk detection results of each of the above-mentioned risks. The generation module is used to fill the risk statistics information into the prompt template corresponding to the risk category to be detected, and generate the corresponding risk inspection prompt statement. The detection module is used to input the risk inspection prompt statement into the visual large model and determine the corresponding risk detection result.
12. An electronic device comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-10.
14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1-10.