Accident detection method and device based on large model

By using a target detection algorithm to screen suspected accidents in video frames and using multi-modal large models for accurate analysis, the problem of low accident detection accuracy and efficiency in the existing technology is solved, and efficient and accurate accident detection is achieved.

CN118779720APending Publication Date: 2024-10-15HISENSE GRP HLDG CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410865185.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The accuracy and efficiency of accident detection in the existing technology are low, and the large number of parameters and calculation volume of multi-modal large models cannot meet the real-time processing requirements.

Method used

Use a target detection algorithm to obtain the position information of the target in the video frame, screen out frames where accidents may occur, and input consecutive frames into a multi-modal large model for accurate detection. Use the target detection algorithm to initially screen suspected accidents, and then use the multi-modal large model to Conduct precise analysis to improve detection efficiency and accuracy.

Benefits of technology

The target detection algorithm is used to screen suspected accidents and use multi-modal large models for accurate detection, which improves the efficiency and accuracy of accident detection and meets the requirements of real-time processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779720A_ABST
    Figure CN118779720A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to an accident detection method and device based on a large model. Based on a target detection algorithm, position information of each target included in each image frame in a to-be-detected video is obtained, an identifier corresponding to each target is determined, and if it is determined that a first distance between different targets in any image frame is smaller than a preset distance according to the position information, it is determined that an accident may occur in the image frame. And acquiring a preset number of continuous image frames including the image frame in the to-be-detected video, and inputting the continuous image frames, the suspected identifier of the corresponding suspected target when the first distance is smaller than the preset distance, and the prompt text into the multi-modal large model to obtain a detection result. Suspected accidents are screened by using a target detection algorithm, and then the suspected accidents are accurately detected by using a multi-modal large model, so that the efficiency and accuracy of accident detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an accident detection method and device based on a large model. Background Art

[0002] In recent years, with the continuous advancement of urbanization and the construction requirements of smart cities, it is no longer possible to process the massive amount of surveillance video data in cities simply by using manpower, and the use of computer vision technology to analyze video data has gradually become the mainstream. Timely and accurate detection of accidents and alarms can effectively reduce the loss of life and property, and alleviate traffic congestion caused by traffic accidents. However, in the face of traffic accident problems, traditional algorithms can only achieve accident detection based on detection and tracking combined with complex logical judgments, and the accuracy of accident detection is not very high. In related technologies, accident detection is also based on multimodal large models. Due to its superior video / image understanding and semantic understanding capabilities, it can accurately detect whether a traffic accident has occurred in a video or image based on the input prompt text (prompt). However, the high number of parameters and high computational complexity of multimodal large models make it impossible to meet the requirements of real-time processing.

[0003] Therefore, how to improve the accuracy and efficiency of accident detection has become an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a large model-based accident detection method and device to solve the problems of low accident detection efficiency and accuracy in the prior art.

[0005] The present application provides an accident detection method based on a large model, the method comprising:

[0006] Based on the target detection algorithm, obtain the position information of each target included in each image frame in the video to be detected, and determine the identifier corresponding to each target;

[0007] If it is determined according to the position information of each target that a first distance between different targets in any image frame is less than a preset distance, a preset number of continuous image frames including the image frame are obtained in the video to be detected;

[0008] The continuous image frames, the suspected identification of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text are input into the multimodal large model to obtain a detection result, which is the result determined by the multimodal large model after analyzing whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text.

[0009] The present application also provides an accident detection device based on a large model, the device comprising:

[0010] A determination module, used to obtain the position information of each target included in each image frame in the video to be detected based on the target detection algorithm, and determine the identifier corresponding to each target;

[0011] An acquisition module, configured to acquire a preset number of continuous image frames including the image frame in the video to be detected if it is determined, based on the position information of each target, that the first distance between different targets in any image frame is less than a preset distance;

[0012] The detection module is used to input the continuous image frames, the suspected identification of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text into the multimodal large model to obtain a detection result, wherein the detection result is the result determined by the multimodal large model after analyzing whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text.

[0013] The present application also provides an electronic device, which includes a processor, and the processor is used to implement the steps of any of the above-mentioned large model-based accident detection methods when executing a computer program stored in a memory.

[0014] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-mentioned large model-based accident detection methods.

[0015] In the embodiment of the present application, based on the target detection algorithm, the position information of each target included in each image frame in the video to be detected is obtained, and the identification corresponding to each target is determined. If it is determined that the first distance between different targets in any image frame is less than the preset distance based on the position information, it is determined that an accident may have occurred in the image frame, and the initial screening of the accident is achieved. In the video to be detected, a preset number of continuous image frames including the image frame are obtained, and the continuous image frames, the suspected identification of the suspected target corresponding to the first distance less than the preset distance, and the prompt text are input into the multimodal large model, so that the multimodal large model analyzes whether an accident has occurred with the suspected target included in the continuous image frame according to the prompt text, and obtains the detection result. The target detection algorithm is used to screen suspected accidents, and the multimodal large model is then used to accurately detect suspected accidents, thereby improving the efficiency and accuracy of accident detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 A schematic diagram of a process flow of an accident detection process based on a large model provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of a human-vehicle coordinate system and relative positions provided in an embodiment of the present application;

[0019] Figure 3 A LoRA fine-tuning schematic diagram provided for an embodiment of the present application;

[0020] Figure 4 A schematic diagram of an accident detection process based on a large model provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of an accident detection process based on a large model provided in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of the structure of an accident detection device based on a large model provided in an embodiment of the present application;

[0023] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the embodiment of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.

[0025] In view of the problem that the monocular camera in the traffic monitoring scene cannot effectively measure the distance, the small detection models such as YOLO can detect in real time but the accident judgment logic is complex, resulting in low detection accuracy, and the multimodal large model has a strong understanding and cognitive ability of the accident but the high resource occupation leads to the inability to detect in real time, the embodiment of the present application provides an accident detection method, device, equipment and medium based on a large model, in which the method is based on the target detection algorithm, the position information of each target included in each image frame in the video to be detected is obtained, and the corresponding identification of each target is determined; if it is determined that the first distance between different targets in any image frame is less than the preset distance according to the position information of each target, then in the video to be detected, a preset number of continuous image frames including the image frame are obtained; the continuous image frames, the suspected identification of the suspected target corresponding to the first distance less than the preset distance, and the prompt text are input into the multimodal large model to obtain the detection result, which is the result determined by the multimodal large model after analyzing whether the suspected target included in the continuous image frame has an accident according to the requirements of the prompt text. The present application is improved from two aspects: algorithm design and model, which can effectively improve the accuracy and speed of human-vehicle accident detection. Taking the detection of human-vehicle accidents as an example, in terms of algorithm design, based on detection and tracking, the distance between motor vehicles and pedestrians is detected in real time and suspected accidents are screened out by combining the height of pedestrians, the relative position of people and vehicles, and the width-to-height ratio of motor vehicles. Then, a multimodal large model is used to accurately detect and judge suspected accidents. In terms of models, a batch of high-quality human-vehicle accident data with time series and location information is constructed, and then the multimodal large model is fine-tuned by LoRA on this basis to further improve the model's understanding and cognitive ability of human-vehicle accidents. The following is a detailed description of the accident detection process based on the large model in conjunction with various embodiments.

[0026] Figure 1 A flow chart of an accident detection process based on a large model provided in an embodiment of the present application is as follows: Figure 1 As shown, the process includes the following steps:

[0027] S101: Based on a target detection algorithm, obtain the position information of each target included in each image frame in a video to be detected, and determine an identifier corresponding to each target.

[0028] The large model-based accident detection method provided in the present application is applied to electronic devices, which may be servers, PCs, mobile terminals, etc.

[0029] In order to be able to detect in real time whether an accident has occurred in the video to be detected, in an embodiment of the present application, the position information of each target included in each image frame in the video to be detected can be obtained based on the target detection algorithm. Among them, the video to be detected can be an offline video or a real-time video. The offline video can be historical data collected and saved by an image acquisition device, for example, video data collected from the 10th to the 20th of last month. The real-time video can be a video being collected by an image acquisition device. Among them, the position information can be the position information of the detection frame of the corresponding target. The target can include vehicles, pedestrians, animals, plants, roadblocks, etc. Exemplarily, the target detection algorithm YOLOV8 can be used to obtain the detection frame of all targets appearing in the video frame, and the vertices of the detection frame are used as the position information.

[0030] In order to facilitate the analysis of each target, in the embodiment of the present application, the identifier corresponding to each target can be determined. The identifier corresponding to each target can be manually marked, or it can be determined by formulating rules based on the similarity between each target and the set identifier after each target is determined.

[0031] In order to facilitate the subsequent acquisition of information of each target in each image frame, in an embodiment of the present application, data such as identification and location information corresponding to each target can be saved in a cache dictionary to provide basic information for subsequent accident detection and judgment.

[0032] S102: If it is determined that a first distance between different targets in any image frame is less than a preset distance based on the position information of each target, a preset number of continuous image frames including the image frame are obtained in the video to be detected.

[0033] After determining the position information of each target, the first distance between each target in each image frame can be determined in units of image frames. If the first distance is less than the preset distance, it means that the distance between the corresponding two targets is too close, and it can be considered that an accident is suspected to have occurred between the two targets.

[0034] When determining the first distance between different targets, the first distance between all targets in the global range can be calculated. However, since one image frame may include multiple targets, and most accidents occur with other targets at close range, in the embodiment of the present application, for each target, the detection frame of the target can be used as the center, and the detection area can be expanded outward by one time, and the first distance is calculated only when other targets enter the detection area.

[0035] In order to accurately detect accidents, after determining that an accident may have occurred in a certain frame in the video to be detected, a preset number of continuous image frames including the image frame can be obtained in the video to be detected. Assuming that the preset number is N+1, then, when it is determined that the first distance between different targets in a certain image frame is less than the preset distance, N image frames after the image frame can be obtained in the video to be detected; or N image frames before the image frame can be obtained; or M image frames before the image frame and K image frames after the image frame can be obtained, where M+K=N.

[0036] In a possible implementation, since the content included in adjacent image frames in a video does not change much, when acquiring continuous image frames, 10 seconds of video before and after the moment corresponding to the image frame can be captured, and 10 image frames can be acquired as continuous image frames at an interval of one image frame every 2 seconds.

[0037] S103: Input the continuous image frames, the suspected mark of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text into the multimodal large model to obtain a detection result, wherein the detection result is determined by the multimodal large model after analyzing whether an accident occurs to the suspected target included in the continuous image frames according to the requirements of the prompt text.

[0038] After acquiring the continuous image frames, whether an accident has actually occurred in the continuous image frames can be accurately detected based on the multimodal large model to obtain the detection result. In the embodiment of the present application, the target corresponding to the first distance less than the preset distance can be determined as a suspected target, and the mark corresponding to the suspected target can be determined as a suspected mark. The suspected targets can be two or more.

[0039] In an embodiment of the present application, the acquired continuous image frames, suspected signs, and prompt texts can be input into a multimodal large model, so that the multimodal large model analyzes whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text, and outputs the detection results.

[0040] In a possible implementation, since the identifier corresponding to each target included in each image frame in the video to be detected has been determined in advance, in the embodiment of the present application, each suspected target can be identified in each image frame of the acquired continuous image frames according to the suspected identifier. When identifying suspected targets, a detection frame can be used for identification. For example, different suspected targets are identified using detection frames of different colors. At the same time, a pre-designed prompt text is obtained, which can be "The image is an image frame extracted from a video, arranged in chronological order. Analyze whether an accident occurs between the motor vehicle in the red frame and the pedestrian in the blue frame in the video. If so, please give a detailed explanation." It should be noted that technicians in this field can design prompt texts as needed, and the embodiment of the present application does not limit this. The continuous image frames with added detection frames and the prompt text are input into the multimodal large model, and the multimodal large model is used to determine whether the suspected accident actually occurred.

[0041] In the embodiment of the present application, based on the target detection algorithm, the position information of each target included in each image frame in the video to be detected is obtained, and the identification corresponding to each target is determined. If it is determined that the first distance between different targets in any image frame is less than the preset distance based on the position information, it is determined that an accident may have occurred in the image frame, and the initial screening of the accident is achieved. In the video to be detected, a preset number of continuous image frames including the image frame are obtained, and the continuous image frames, the suspected identification of the suspected target corresponding to the first distance less than the preset distance, and the prompt text are input into the multimodal large model, so that the multimodal large model analyzes whether an accident has occurred with the suspected target included in the continuous image frame according to the prompt text, and obtains the detection result. The target detection algorithm is used to screen suspected accidents, and the multimodal large model is then used to accurately detect suspected accidents, thereby improving the efficiency and accuracy of accident detection.

[0042] In order to further improve the accuracy of accident detection, based on the above embodiment, in the embodiment of the present application, after obtaining the position information of each target included in each image frame in the video to be detected, and before determining the identifier corresponding to each target, the method further includes:

[0043] Determine a first area occupied by each target in a corresponding image frame according to the position information of each target;

[0044] If the ratio of the first area to the total area of ​​the corresponding image frame is less than a first preset threshold, the position information of the corresponding target is deleted from the corresponding image frame.

[0045] Since the acquisition range of the image acquisition device is limited, the accuracy of the images collected for targets far away from the image acquisition device is not very high. Therefore, in order to further improve the accuracy of accident detection, after determining the location information of each target and before determining the identification corresponding to each target, the targets far away from the image acquisition device can be filtered.

[0046] Since the area occupied by objects that are closer to the image acquisition device is relatively large, and the area occupied by objects that are farther away from the image acquisition device is relatively small. Therefore, in an embodiment of the present application, the first area occupied by each target in the corresponding image frame can be determined based on the position information of each target. Thus, based on whether the ratio of the first area to the total area of ​​the corresponding image frame is less than the first preset threshold, it is determined whether the corresponding target is far away from the image acquisition device. If it is determined that the ratio is less than the first preset threshold, it means that the corresponding target is far away from the image acquisition device, and the position information of the corresponding target can be deleted in the corresponding image frame. Among them, the first preset threshold can be any decimal greater than 0 and less than 1.

[0047] In addition, since different types of targets have different volumes, the areas occupied by different types of targets in the image frame will also be different. Therefore, in the embodiment of the present application, different first preset thresholds can be set for different types of targets. For example, the first preset threshold corresponding to a motor vehicle is set to 1%, and the first preset threshold corresponding to a pedestrian is set to 0.3%.

[0048] In order to further improve the efficiency of accident detection, based on the above embodiments, in the embodiment set of the present application, determining the identifier corresponding to each target includes:

[0049] Based on the target tracking algorithm, determining the motion trajectory of each target in the video to be detected;

[0050] And according to each of the motion trajectories, an identifier is set for the target included in each image frame in the video to be detected.

[0051] Since there are many targets included in the video to be detected, in order to further improve the efficiency of accident detection, in the embodiment of the present application, when determining the identifier corresponding to each target, the motion trajectory of each target in the video to be detected can be determined based on the target tracking algorithm. In other words, it is determined which targets in different image frames belong to the same target. Optionally, the target tracking algorithm used to determine the motion trajectory can be a BoT-SORT algorithm.

[0052] After obtaining the motion trajectory of each target, it is possible to determine which targets in different image frames belong to the same target, and to assign an identifier to each motion trajectory, which can be used as the identifier of the corresponding target. In other words, the identifier of the same target in different image frames is the same.

[0053] In order to further improve the accuracy of accident detection, based on the above embodiments, in the embodiment of the present application, the process of determining the first distance between each target includes:

[0054] According to the position information of each target, determine the coordinates of the center point of each target;

[0055] The first distance is determined according to the coordinates of the center points of every two targets.

[0056] Since the volumes and shapes of different targets are different, in order to improve the accuracy of accident detection, in the embodiment set of the present application, when determining the first distance between each target, the center point coordinates of each target can be determined based on the position information of each target, and the distance between the center point coordinates of each target can be calculated, and the distance is determined as the first distance.

[0057] Specifically, when determining the first distance, the Euclidean distance can be used for calculation. The Euclidean distance calculation formula is as follows:

[0058]

[0059] Among them, d represents the first distance; x1 represents the x-coordinate of the center point of target 1; y1 represents the y-coordinate of the center point of target 1; x2 represents the x-coordinate of the center point of target 2; y2 represents the y-coordinate of the center point of target 2.

[0060] In order to further improve the accuracy of accident detection, based on the above embodiments, in the embodiment of the present application, when determining the first distance between the pedestrian and the vehicle, the process of determining the preset distance includes:

[0061] If the pedestrian is in a standing state, the height of the detection frame of the pedestrian is determined according to the position information of the pedestrian, and the height is determined as the preset distance.

[0062] Since a monocular camera cannot accurately measure distance, in an embodiment of the present application, if it is determined whether the first distance between a pedestrian and a vehicle is less than a preset distance, it can be determined whether the pedestrian is in a standing state. Specifically, the detection frame corresponding to the pedestrian can be determined based on the position information of the pedestrian. If the width of the detection frame corresponding to the pedestrian is less than the height, it means that the pedestrian is in a standing state. Among them, the information on the height of the detection frame can be calculated in real time based on the position information, or it can be obtained from a cache dictionary. That is to say, after determining the position information corresponding to each target in the image frame, other relevant information that can be determined based on the position information is also saved in the cache dictionary. For example, the height, width, diagonal length, etc. of the detection frame corresponding to the target are all saved.

[0063] If the pedestrian is in a standing state, the height of the pedestrian with a relatively stable height can be used as the basic alarm distance in the embodiment of the present application. The height of the detection frame corresponding to the pedestrian can be used as the preset distance.

[0064] Specifically, assuming that the width of the detection frame determined according to the position information is 15 pixels and the height is 25 pixels. Since the width is smaller than the height, it can be determined that the pedestrian corresponding to the detection frame is in a standing state, and 25 pixels can be determined as the preset distance.

[0065] In order to further improve the accuracy of accident detection, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0066] If the pedestrian is located in a preset area of ​​the vehicle, the preset area includes an area corresponding to a non-door side, the preset distance is enlarged according to a saved first proportional coefficient to obtain a second distance, and the preset distance is updated using the second distance.

[0067] If, when determining the first distance based on the coordinates of the center point of each target, the first distance calculated when the pedestrian is located on the door side is smaller than the first distance calculated when the pedestrian is located on the diagonal of the vehicle, provided that the pedestrian and the vehicle have not collided. If the same preset distance is used to determine whether a suspected accident has occurred, it is very likely that an accident has occurred when the pedestrian is located on the diagonal side of the vehicle, but the first distance calculated at this time is greater than the preset distance, and the occurrence of the accident is not detected. Therefore, in the embodiment of the present application, different preset thresholds can be set according to the relative positions of the pedestrian and the vehicle.

[0068] In the embodiment of the present application, a preset area may be pre-configured, and the preset area may be an area corresponding to the non-door side of the vehicle. If a pedestrian is located in the preset area of ​​the vehicle, the preset distance may be amplified according to the saved first proportional coefficient to obtain a second distance, and the second preset distance may be used to update the originally saved preset distance. The first proportional coefficient may be any decimal greater than 1, for example, the first proportional coefficient is 1.5.

[0069] Specifically, when determining which area of ​​the vehicle the pedestrian is located in, the coordinates of the center point of the vehicle's detection frame can be used as the origin of the relative coordinate system between the person and the vehicle, and the aspect ratio of the vehicle's detection frame can be calculated. If the aspect ratio is greater than or equal to 1, the vehicle is determined to be horizontal, and a relative coordinate system can be constructed with the horizontal direction as the X-axis and the vertical direction as the Y-axis; if the aspect ratio is less than 1, the vehicle is determined to be longitudinal, and a relative coordinate system can be constructed with the vertical direction as the X-axis and the horizontal direction as the Y-axis, and the coordinates of the person and the vehicle are transformed. The relative position between the vehicle and the pedestrian is calculated based on the following formula:

[0070]

[0071] Among them, Deg pv The angle between the pedestrian and the vehicle, that is, the relative position between the vehicle and the pedestrian; y pc Indicates the y coordinate of the pedestrian's center point; vc Indicates the y coordinate of the center point of the vehicle; x pc represents the x coordinate of the pedestrian's center point; vc Indicates the x-coordinate of the center point of the vehicle.

[0072] When the relative position of the pedestrian's center point and the vehicle's center point Deg pv Less than or equal to When the pedestrian is not at the door side, it is determined that the pedestrian is not at the door side; when Deg pv lie in When the pedestrian is within the range, it is determined that the pedestrian is located in the diagonal direction of the vehicle. When the preset distance is adjusted based on the first proportionality coefficient.

[0073] In order to solve the problem that pedestrians collide with the front body and diagonal position of the vehicle but the warning distances are obviously different, a coordinate system of the relative position of pedestrians and vehicles is constructed to ensure that the positions of pedestrians and vehicles and the width and height of the motor vehicle are calculated in a unified manner when the motor vehicle is facing different directions. The basic warning distance is corrected using the relative position of pedestrians and vehicles and the width-to-height ratio of the motor vehicle. Figure 2 A schematic diagram of a human-vehicle coordinate system and relative positions provided in an embodiment of the present application, such as Figure 2 As shown, due to Figure 2The aspect ratio of the detection frame of the vehicle in is greater than 1. Therefore, it can be determined that the vehicle is horizontal. The coordinate system can be constructed with the center point of the detection frame of the vehicle as the origin of the coordinate system, the horizontal direction as the X-axis, and the vertical direction as the Y-axis. Figure 2 The angle between the line between the center point of the vehicle and the center point of the pedestrian and the X-axis is the relative position of the pedestrian and the vehicle. pv .

[0074] In order to further improve the accuracy of accident detection, based on the above embodiments, in the embodiment of the present application, the process of determining the first proportionality coefficient includes:

[0075] Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle;

[0076] Determine a first value according to a first preset hyperparameter, a width and a diagonal length of the vehicle detection frame;

[0077] Determine a second value according to a second preset hyperparameter, a width and a height of the vehicle detection frame;

[0078] The first proportionality coefficient is determined according to the first value and the second value.

[0079] In the embodiment of the present application, the first proportionality coefficient can be determined in real time according to the width and height of the detection frame of the vehicle. In the embodiment of the present application, the vehicle detection frame corresponding to the vehicle can be determined according to the position information of the corresponding vehicle.

[0080] After the vehicle detection frame is determined, the height and width of the vehicle detection frame can be obtained. And according to the width and height, the diagonal length of the vehicle detection frame is determined. And the first product value of the first preset parameter and the diagonal length is determined, and the ratio of the first product value to the width is determined as the first value. At the same time, according to the second product value of the second hyperparameter and the width, the ratio of the second product value to the height is determined as the second value. Among them, the first preset hyperparameter and the second preset hyperparameter are empirical values ​​determined through a large number of experiments, and the first preset hyperparameter and the second preset hyperparameter can be any value greater than 1, for example, 1.5, 1.2, 1.8, etc. It should be noted that the first preset hyperparameter can be greater than the second preset hyperparameter, can be less than the second preset hyperparameter, and can also be equal to the second preset hyperparameter.

[0081] After the first value and the second value are determined, the first proportionality coefficient may be determined according to the first value and the second value. For example, the product or sum of the first value and the second value may be determined as the first proportionality coefficient.

[0082] For ease of understanding, the first value may be determined based on the following formula:

[0083]

[0084] Among them, Ratio diagonal represents the first value; α represents the first preset hyperparameter; h v Indicates the height of the vehicle detection frame; w v Indicates the width of the vehicle detection box; Indicates the diagonal length of the vehicle detection box.

[0085] The second value can be determined based on the following formula:

[0086]

[0087] Among them, Ratio wh represents the second value; β represents the second preset hyperparameter; h v Indicates the height of the vehicle detection frame; w v Indicates the width of the vehicle detection box.

[0088] In the embodiment of the present application, when the preset distance is enlarged based on the first proportionality coefficient, it can be based on the following formula:

[0089] distance warning2 =h p ×Ratio wh ×Ratio diagonal

[0090] Among them, distance warning Indicates the second distance; h p Indicates the preset distance, such as the height of the pedestrian detection box; Ratio diagonal Indicates the first value; Ratio wh Indicates the second value.

[0091] In order to further improve the accuracy of accident detection, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0092] If the pedestrian is located in the area corresponding to the door side of the vehicle, the preset distance is enlarged according to the saved second proportional coefficient to obtain a third distance, and the preset distance is updated using the third distance, and the second proportional coefficient is smaller than the first proportional coefficient.

[0093] When determining the first distance based on the center point coordinates of each target, if the volume of the vehicle is relatively large, when an accident occurs between a pedestrian and a vehicle in the area corresponding to the door side, the first distance between the center point coordinates of the pedestrian and the center point coordinates of the vehicle may be greater than the preset distance. Therefore, in order to increase the fault tolerance of accident detection, in an embodiment of the present application, a second proportional coefficient may be saved, which is smaller than the first proportional coefficient. If the pedestrian is located in the area corresponding to the door side of the vehicle, the preset distance is enlarged according to the saved second proportional coefficient to obtain a third distance, and the preset distance is updated using the third distance.

[0094] In order to further improve the accuracy of accident detection, on the basis of the above embodiments, in the embodiment of the present application, the process of determining the second proportional coefficient includes:

[0095] Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle;

[0096] A second value is determined according to a second preset hyperparameter and the width and height of the vehicle detection frame, and the second value is determined as the second proportional coefficient.

[0097] In the embodiment of the present application, the second proportionality coefficient can be determined in real time according to the width and height of the detection frame of the vehicle. In the embodiment of the present application, the vehicle detection frame corresponding to the vehicle can be determined according to the position information of the corresponding vehicle.

[0098] After the vehicle detection frame is determined, the height and width of the vehicle detection frame can be obtained. And according to the second product value of the second hyperparameter and the width, the ratio of the second product value to the height is determined as the second value. Among them, the second preset hyperparameter is an empirical value determined through a large number of experiments, and the second preset hyperparameter can be any value greater than 1, for example, 1.5, 1.2, 1.8, etc. It should be noted that the second preset hyperparameter is the same as the second preset hyperparameter when determining the first proportional coefficient.

[0099] After the second value is determined, the second value can be directly determined as the second proportionality coefficient. The calculation formula of the second value has been described in detail in the above embodiment, and will not be repeated in the embodiment of the present application.

[0100] When the preset distance is magnified according to the saved second proportional coefficient to obtain the third distance, the magnification is performed based on the following formula:

[0101] distance warning3 =h p ×Ratio wh

[0102] Among them, distance warning3 Indicates the third distance; hp Indicates the preset distance, such as the height of the pedestrian detection box; Ratio wh Indicates the second value.

[0103] In summary, the preset distance can be determined based on the following formula:

[0104]

[0105] Among them, distance warning Indicates the final preset distance; h p Indicates the initial preset distance, i.e. the basic alarm distance; Ratio wh Indicates the second value; Ratio diagonal Denotes the first value; Deg pv Indicates the relative position between pedestrians and vehicles; h v Indicates the height of the vehicle detection frame; w v Indicates the width of the vehicle detection box.

[0106] In order to further improve the accuracy of accident detection, based on the above embodiments, in the embodiment of the present application, after determining that the first distance between different targets in any image frame is less than the preset distance, before obtaining a preset number of continuous image frames including the image frame in the video to be detected, the method further includes:

[0107] Acquire other image frames within a preset time length after the image frame, and if the suspected targets in the other image frames meet at least one accident judgment condition, continue to execute the subsequent step of acquiring a preset number of continuous image frames including the image frame in the video to be detected; wherein the accident judgment conditions include: the fourth distance change between the suspected targets in the other image frames is less than the second preset threshold, the position information of the suspected targets in the other image frames has not changed, and the suspected targets include pedestrians and the pedestrians are in a lying state.

[0108] After determining that a suspected accident has occurred in a certain image frame, in order to further improve the accuracy of accident detection, other image frames within a preset time length after the image frame can be obtained. And it is determined whether the suspected target in the other image frame meets at least one accident judgment condition. If so, it is determined that a suspected accident may exist, and the subsequent step of obtaining a preset number of continuous image frames including the image frame in the video to be detected can be continued.

[0109] The accident discrimination condition may be that the fourth distance change between the suspected targets in the other image frames is less than the second preset threshold, wherein the second preset threshold may be a smaller value, for example, 0.5. The purpose of the accident discrimination condition is to determine whether the distance between the suspected targets fluctuates within a small range or remains unchanged.

[0110] The accident discrimination condition may also be that the position information of the suspected target in the other image frame has not changed. When the position information of any suspected target has not changed, or the position information of each suspected target has not changed, it can be determined that the accident discrimination condition is met. In the embodiment of the present application, it can be determined whether the target is in motion or stationary state based on the motion trajectory determined by the target tracking algorithm, thereby determining whether the position information has changed.

[0111] The accident judgment condition may also be that the suspected target in the other image frame includes a pedestrian and the pedestrian is in a lying state. In the embodiment of the present application, it is possible to determine whether the pedestrian is in a lying state based on the size relationship between the width and height of the detection frame of the pedestrian. When the width of the detection frame of the pedestrian is greater than the height, it can be determined that the corresponding pedestrian is in a lying state.

[0112] Since the installation position of the image acquisition device is fixed, generally speaking, the target will not exist in the video to be detected for a long time. Therefore, in order to save memory consumption during the operation of the algorithm, if a target (vehicle or pedestrian) is not judged to have a human-vehicle accident within a set time after being detected and tracked for the first time, such as within five minutes, and is not detected again, it is considered that the target has safely moved away from the monitoring area of ​​the image acquisition device, and the corresponding identification, location information and other information of the target can be deleted from the cache dictionary.

[0113] In order to further improve the accuracy of accident detection, on the basis of the above embodiments, in the embodiments of the present application, the multimodal large model used for accident detection can be a model obtained through fine-tuning training.

[0114] In general, the original multimodal large model is a general large model, which has a certain ability to understand accidents, but cannot meet the requirements for accurate accident identification. In the embodiment of the present application, the multimodal large model can be guided to better understand accidents by designing question-answer data containing timing and location information, thereby improving the accuracy of the multimodal large model in judging suspected accidents. In the embodiment of the present application, the data construction of human-vehicle accidents is used for illustration, and the process of constructing question-answer data containing timing and location information is as follows:

[0115] 1) Collect a batch of videos of human-vehicle accidents that occur under the monitoring perspective, and extract a 1-2 minute accident segment containing the time of the accident, and obtain accident image frames at an interval of one frame per second.

[0116] 2) Label the motor vehicles and pedestrians involved in the vehicle-pedestrian accident in the image frame and describe the cause of the accident in detail.

[0117] 3) According to the detection frame coordinates of motor vehicles and pedestrians in the annotation, they are marked with red and blue frames respectively.

[0118] 4) Design the following questions:

[0119] “Frame1: person_vehicle_accident / frame1.png\nFrame2: person_vehicle_accident / frame2.png\nFrame3:

[0120] person_vehicle_accident / frame3.png\nThe image is a key frame extracted from the video, arranged in chronological order. The red box is a motor vehicle, and the blue box is a pedestrian. Please analyze whether the motor vehicle and pedestrian framed in the video have an accident. If so, please give a detailed explanation."

[0121] The correct answer to the question is "A motor vehicle and a pedestrian had an accident, and the cause of the accident was..."

[0122] Figure 3 A LoRA fine-tuning schematic diagram provided in an embodiment of the present application is as follows: Figure 3 As shown, the multimodal large model generally includes W q (Query), W k (Key), W v (Value) matrix, self-attention mechanism (Self-Attention), feedforward network (Feed-Forward). The LoRA fine-tuning method does not change the original weights (Pre-trainedWeights) of the multimodal large model, but adds a bypass next to the original model, and multiplies the front and back matrices A and B. The first matrix A is responsible for dimensionality reduction, and the second matrix B is responsible for dimensionality increase. The middle layer dimension is r to simulate the so-called intrinsic rank. During the fine-tuning process, the original weights are frozen and remain unchanged. Only the added AB matrix is ​​updated, and the output is BA plus the original model. The amount of LoRA fine-tuning training is very small. It only amplifies the features that are useful for human-vehicle accident detection, and can achieve rapid migration of tasks online. The embodiment of the present application constructs a data set containing timing and location information, and further improves the multimodal large model's ability to understand accidents through LoRA fine-tuning.

[0123] The following describes the accident detection method based on the large model in conjunction with a specific embodiment. Figure 4 A schematic diagram of an accident detection process based on a large model is provided in an embodiment of the present application, such as Figure 4 As shown in the figure, the accident detection method based on the large model adopts the framework of target detection + target tracking + human-vehicle distance detection + multimodal large model detection, which mainly includes the following four parts: video acquisition, detection and tracking, small model screening, and large model detection.

[0124] The video acquisition part mainly acquires the video collected by the image acquisition device, including monitoring video streams and offline videos.

[0125] The detection and tracking part mainly detects each target in each image frame of the collected video and determines the location information of each target. At the same time, based on the target tracking algorithm, the motion trajectory of each target is determined, and the identification of each target is set according to the determined trajectory.

[0126] The small model screening part mainly calculates the distance based on the location information of each target to determine the first distance between different targets, and then screens suspected accidents based on the first distance and the preset distance.

[0127] The large model detection part mainly extracts continuous image frames related to suspected accidents in the video, and then inputs the continuous image frames, suspected signs and pre-designed prompt texts into the multimodal large model, which then accurately detects whether an accident has actually occurred.

[0128] The following describes the accident detection method based on the large model in conjunction with another specific embodiment. Figure 5 A schematic diagram of an accident detection process based on a large model is provided in an embodiment of the present application, such as Figure 5 As shown, when performing accident detection based on a large model, a surveillance video can be acquired, and target detection can be performed on each target (including vehicles and pedestrians) included in each image frame in the surveillance video to determine the location information of each target.

[0129] After determining the position information corresponding to each target, determine the ratio of the first area occupied by each target in the corresponding image frame to the total area of ​​the corresponding image frame according to the position information of each target, and judge whether the ratio is less than the first preset threshold value, if so, delete the position information of the corresponding target in the corresponding image frame, if not, retain the position information of the corresponding target. In other words, delete the target that is far away from the image acquisition device.

[0130] After determining the position information corresponding to each target, target tracking is performed, that is, the motion trajectory of each target is determined based on the target tracking algorithm, and then the corresponding identification of each target is determined according to each motion trajectory.

[0131] For each vehicle, determine whether there are other targets in the detection area of ​​the vehicle.

[0132] If there are other targets in the detection area, the first distance and relative position between the center point of the vehicle and the other target are calculated. If the other target is not located on the door side, the preset distance (i.e., the basic alarm distance) is corrected according to the first proportional coefficient, and the preset distance is updated using the corrected distance. If the other target is located on the door side, the preset distance (i.e., the basic alarm distance) is corrected according to the second proportional coefficient, and the preset distance is updated using the corrected distance.

[0133] If the first distance between the other target and the vehicle is less than the updated preset distance, and the first distance is less than the latest alarm distance, it is determined to be a suspected accident, and the multimodal large model is used to further judge the obtained detection results.

[0134] If the first distance between the other target and the vehicle is not less than the updated preset distance, it is determined that no accident has occurred.

[0135] If there are other targets in the detection area of ​​the vehicle, but no accident occurs to the other targets within 5 minutes, the saved relevant information of the other targets will be deleted.

[0136] Under the condition of a monocular camera, the embodiment of the present application realizes accurate measurement of the distance between pedestrians and vehicles based on the height of pedestrians, the relative position of pedestrians and vehicles, and the aspect ratio of motor vehicles, and uses a small model to screen suspected accidents. The large model is used to accurately detect suspected accidents and realizes real-time detection while ensuring the detection effect.

[0137] Based on the same inventive concept, the embodiment of the present application also provides an accident detection device based on a large model. Figure 6 A schematic diagram of the structure of an accident detection device based on a large model provided in an embodiment of the present application, the device comprises:

[0138] The determination module 601 is used to obtain the position information of each target included in each image frame in the video to be detected based on the target detection algorithm, and determine the identifier corresponding to each target;

[0139] The acquisition module 602 is used to acquire a preset number of continuous image frames including the image frame in the video to be detected if it is determined that the first distance between different objects in any image frame is less than a preset distance according to the position information of each object;

[0140] The detection module 603 is used to input the continuous image frames, the suspected identification of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text into the multimodal large model to obtain a detection result, which is the result determined by the multimodal large model after analyzing whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text.

[0141] In a possible implementation manner, the determination module 601 is further configured to determine a first area occupied by each target in a corresponding image frame according to the position information of each target;

[0142] The screening module 604 is configured to delete the location information of the corresponding target in the corresponding image frame if the ratio of the first area to the total area of ​​the corresponding image frame is less than a first preset threshold.

[0143] In a possible implementation, the determination module 601 is specifically configured to determine a motion trajectory of each target in the video to be detected based on a target tracking algorithm; and to set an identifier for the target included in each image frame in the video to be detected according to each motion trajectory.

[0144] In a possible implementation, the determination module 601 is specifically configured to determine the coordinates of the center point of each target according to the position information of each target; and determine the first distance according to the coordinates of the center points of every two targets.

[0145] In a possible implementation, the determination module 601 is specifically configured to determine, if the pedestrian is in a standing state, a height of a detection frame of the pedestrian according to the position information of the pedestrian, and determine the height as the preset distance.

[0146] In a possible implementation, the determination module 601 is also used to, if the pedestrian is located in a preset area of ​​the vehicle, the preset area includes an area corresponding to a non-door side, amplify the preset distance according to a saved first proportional coefficient to obtain a second distance, and use the second distance to update the preset distance.

[0147] In a possible implementation, the determination module 601 is specifically used to determine a vehicle detection frame corresponding to the vehicle based on the position information of the vehicle; determine a first value based on a first preset hyperparameter, a width and a diagonal length of the vehicle detection frame; determine a second value based on a second preset hyperparameter, a width and a height of the vehicle detection frame; and determine the first proportional coefficient based on the first value and the second value.

[0148] In a possible implementation, the determination module 601 is also used to amplify the preset distance according to a saved second proportional coefficient to obtain a third distance if the pedestrian is located in the area corresponding to the door side of the vehicle, and use the third distance to update the preset distance, and the second proportional coefficient is smaller than the first proportional coefficient.

[0149] In a possible implementation, the determination module 601 is specifically used to determine a vehicle detection frame corresponding to the vehicle based on the position information of the vehicle; determine a second value based on a second preset hyperparameter and the width and height of the vehicle detection frame, and determine the second value as the second proportional coefficient.

[0150] In a possible implementation, the determination module 601 is also used to obtain other image frames within a preset time length after the image frame. If the suspected target in the other image frames satisfies at least one accident judgment condition, the subsequent step of obtaining a preset number of continuous image frames including the image frame in the video to be detected is continued; wherein the accident judgment conditions include: the fourth distance change between the suspected targets in the other image frames is less than the second preset threshold, the position information of the suspected targets in the other image frames has not changed, and the suspected targets include pedestrians and the pedestrians are in a lying state.

[0151] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, it includes: a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704;

[0152] The memory 703 stores a computer program. When the program is executed by the processor 701, the processor 701 performs the following steps:

[0153] Based on the target detection algorithm, obtain the position information of each target included in each image frame in the video to be detected, and determine the identifier corresponding to each target;

[0154] If it is determined according to the position information of each target that a first distance between different targets in any image frame is less than a preset distance, a preset number of continuous image frames including the image frame are obtained in the video to be detected;

[0155] The continuous image frames, the suspected identification of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text are input into the multimodal large model to obtain a detection result, which is the result determined by the multimodal large model after analyzing whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text.

[0156] In a possible implementation, after acquiring the position information of each target included in each image frame in the video to be detected and before determining the identifier corresponding to each target, the method further includes:

[0157] Determine a first area occupied by each target in a corresponding image frame according to the position information of each target;

[0158] If the ratio of the first area to the total area of ​​the corresponding image frame is less than a first preset threshold, the position information of the corresponding target is deleted from the corresponding image frame.

[0159] In a possible implementation manner, determining the identifier corresponding to each target includes:

[0160] Based on the target tracking algorithm, determining the motion trajectory of each target in the video to be detected;

[0161] And according to each of the motion trajectories, an identifier is set for the target included in each image frame in the video to be detected.

[0162] In a possible implementation, the process of determining the first distance between each target includes:

[0163] According to the position information of each target, determine the coordinates of the center point of each target;

[0164] The first distance is determined according to the coordinates of the center points of every two targets.

[0165] In a possible implementation manner, when determining the first distance between the pedestrian and the vehicle, the process of determining the preset distance includes:

[0166] If the pedestrian is in a standing state, the height of the detection frame of the pedestrian is determined according to the position information of the pedestrian, and the height is determined as the preset distance.

[0167] In a possible implementation, the method further includes:

[0168] If the pedestrian is located in a preset area of ​​the vehicle, the preset area includes an area corresponding to a non-door side, the preset distance is enlarged according to a saved first proportional coefficient to obtain a second distance, and the preset distance is updated using the second distance.

[0169] In a possible implementation manner, the process of determining the first proportionality coefficient includes:

[0170] Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle;

[0171] Determine a first value according to a first preset hyperparameter, a width and a diagonal length of the vehicle detection frame;

[0172] Determine a second value according to a second preset hyperparameter, a width and a height of the vehicle detection frame;

[0173] The first proportionality coefficient is determined according to the first value and the second value.

[0174] In a possible implementation, the method further includes:

[0175] If the pedestrian is located in the area corresponding to the door side of the vehicle, the preset distance is enlarged according to the saved second proportional coefficient to obtain a third distance, and the preset distance is updated using the third distance, and the second proportional coefficient is smaller than the first proportional coefficient.

[0176] In a possible implementation manner, the process of determining the second proportional coefficient includes:

[0177] Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle;

[0178] A second value is determined according to a second preset hyperparameter and the width and height of the vehicle detection frame, and the second value is determined as the second proportional coefficient.

[0179] In a possible implementation manner, after determining that a first distance between different targets in any image frame is less than a preset distance, and before acquiring a preset number of continuous image frames including the image frame in the video to be detected, the method further includes:

[0180] Acquire other image frames within a preset time length after the image frame, and if the suspected targets in the other image frames meet at least one accident judgment condition, continue to execute the subsequent step of acquiring a preset number of continuous image frames including the image frame in the video to be detected; wherein the accident judgment conditions include: the fourth distance change between the suspected targets in the other image frames is less than the second preset threshold, the position information of the suspected targets in the other image frames has not changed, and the suspected targets include pedestrians and the pedestrians are in a lying state.

[0181] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 702 is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0182] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0183] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the following steps when executing:

[0184] Based on the target detection algorithm, obtain the position information of each target included in each image frame in the video to be detected, and determine the identifier corresponding to each target;

[0185] If it is determined according to the position information of each target that a first distance between different targets in any image frame is less than a preset distance, a preset number of continuous image frames including the image frame are obtained in the video to be detected;

[0186] The continuous image frames, the suspected identification of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text are input into the multimodal large model to obtain a detection result, which is the result determined by the multimodal large model after analyzing whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text.

[0187] In a possible implementation, after acquiring the position information of each target included in each image frame in the video to be detected and before determining the identifier corresponding to each target, the method further includes:

[0188] Determine a first area occupied by each target in a corresponding image frame according to the position information of each target;

[0189] If the ratio of the first area to the total area of ​​the corresponding image frame is less than a first preset threshold, the position information of the corresponding target is deleted from the corresponding image frame.

[0190] In a possible implementation manner, determining the identifier corresponding to each target includes:

[0191] Based on the target tracking algorithm, determining the motion trajectory of each target in the video to be detected;

[0192] And according to each of the motion trajectories, an identifier is set for the target included in each image frame in the video to be detected.

[0193] In a possible implementation, the process of determining the first distance between each target includes:

[0194] According to the position information of each target, determine the coordinates of the center point of each target;

[0195] The first distance is determined according to the coordinates of the center points of every two targets.

[0196] In a possible implementation manner, when determining the first distance between the pedestrian and the vehicle, the process of determining the preset distance includes:

[0197] If the pedestrian is in a standing state, the height of the detection frame of the pedestrian is determined according to the position information of the pedestrian, and the height is determined as the preset distance.

[0198] In a possible implementation, the method further includes:

[0199] If the pedestrian is located in a preset area of ​​the vehicle, the preset area includes an area corresponding to a non-door side, the preset distance is enlarged according to a saved first proportional coefficient to obtain a second distance, and the preset distance is updated using the second distance.

[0200] In a possible implementation manner, the process of determining the first proportionality coefficient includes:

[0201] Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle;

[0202] Determine a first value according to a first preset hyperparameter, a width and a diagonal length of the vehicle detection frame;

[0203] Determine a second value according to a second preset hyperparameter, a width and a height of the vehicle detection frame;

[0204] The first proportionality coefficient is determined according to the first value and the second value.

[0205] In a possible implementation, the method further includes:

[0206] If the pedestrian is located in the area corresponding to the door side of the vehicle, the preset distance is enlarged according to the saved second proportional coefficient to obtain a third distance, and the preset distance is updated using the third distance, and the second proportional coefficient is smaller than the first proportional coefficient.

[0207] In a possible implementation manner, the process of determining the second proportional coefficient includes:

[0208] Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle;

[0209] A second value is determined according to a second preset hyperparameter and the width and height of the vehicle detection frame, and the second value is determined as the second proportional coefficient.

[0210] In a possible implementation manner, after determining that a first distance between different targets in any image frame is less than a preset distance, and before acquiring a preset number of continuous image frames including the image frame in the video to be detected, the method further includes:

[0211] Acquire other image frames within a preset time length after the image frame, and if the suspected targets in the other image frames meet at least one accident judgment condition, continue to execute the subsequent step of acquiring a preset number of continuous image frames including the image frame in the video to be detected; wherein the accident judgment conditions include: the fourth distance change between the suspected targets in the other image frames is less than the second preset threshold, the position information of the suspected targets in the other image frames has not changed, and the suspected targets include pedestrians and the pedestrians are in a lying state.

[0212] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0213] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0214] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0215] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0216] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An accident detection method based on a large model, characterized in that: The method comprises: Based on the target detection algorithm, obtain the position information of each target included in each image frame in the video to be detected, and determine the identifier corresponding to each target; If it is determined according to the position information of each target that a first distance between different targets in any image frame is less than a preset distance, a preset number of continuous image frames including the image frame are obtained in the video to be detected; The continuous image frames, the suspected identification of the suspected target corresponding to the first distance being less than the preset distance, and the prompt text are input into the multimodal large model to obtain a detection result, which is the result determined by the multimodal large model after analyzing whether an accident has occurred with the suspected target included in the continuous image frames according to the requirements of the prompt text.

2. The method according to claim 1, characterized in that After acquiring the position information of each target included in each image frame in the video to be detected and before determining the identifier corresponding to each target, the method further includes: Determine a first area occupied by each target in a corresponding image frame according to the position information of each target; If the ratio of the first area to the total area of ​​the corresponding image frame is less than a first preset threshold, the position information of the corresponding target is deleted from the corresponding image frame.

3. The method according to claim 1, characterized in that The process of determining the first distance between each target includes: According to the position information of each target, determine the coordinates of the center point of each target; The first distance is determined according to the coordinates of the center points of every two targets.

4. The method according to claim 1, characterized in that: When determining the first distance between the pedestrian and the vehicle, the process of determining the preset distance includes: If the pedestrian is in a standing state, the height of the detection frame of the pedestrian is determined according to the position information of the pedestrian, and the height is determined as the preset distance.

5. The method according to claim 4, characterized in that The method further comprises: If the pedestrian is located in a preset area of ​​the vehicle, the preset area includes an area corresponding to a non-door side, the preset distance is enlarged according to a saved first proportional coefficient to obtain a second distance, and the preset distance is updated using the second distance.

6. The method according to claim 5, characterized in that The process of determining the first proportionality coefficient includes: Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle; Determine a first value according to a first preset hyperparameter, a width and a diagonal length of the vehicle detection frame; Determine a second value according to a second preset hyperparameter, a width and a height of the vehicle detection frame; The first proportionality coefficient is determined according to the first value and the second value.

7. The method according to claim 4, characterized in that The method further comprises: If the pedestrian is located in the area corresponding to the door side of the vehicle, the preset distance is enlarged according to the saved second proportional coefficient to obtain a third distance, and the preset distance is updated using the third distance, and the second proportional coefficient is smaller than the first proportional coefficient.

8. The method according to claim 7, characterized in that The process of determining the second proportional coefficient includes: Determining a vehicle detection frame corresponding to the vehicle according to the position information of the vehicle; A second value is determined according to a second preset hyperparameter and the width and height of the vehicle detection frame, and the second value is determined as the second proportional coefficient.

9. The method according to claim 1, characterized in that: After determining that the first distance between different targets in any image frame is less than the preset distance, and before acquiring a preset number of continuous image frames including the image frame in the video to be detected, the method further includes: Acquire other image frames within a preset time length after the image frame, and if the suspected targets in the other image frames meet at least one accident judgment condition, continue to execute the subsequent step of acquiring a preset number of continuous image frames including the image frame in the video to be detected; wherein the accident judgment conditions include: the fourth distance change between the suspected targets in the other image frames is less than the second preset threshold, the position information of the suspected targets in the other image frames has not changed, and the suspected targets include pedestrians and the pedestrians are in a lying state.

10. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to implement the steps of the accident detection method based on a large model as claimed in any one of claims 1 to 9 when executing a computer program stored in a memory.

Citation Information

Cited By

  • Video-based traffic accident analysis method, device, equipment and medium

    CN119206593A

  • Data backflow study and judgment method, device and equipment and storage medium

    CN119229382A

  • Traffic accident auxiliary responsibility judgment method based on large language model

    CN119961611A

  • Small model algorithm self-evolution optimization system and method based on multi-mode large model driving

    CN121121749A

  • Accident detection method and apparatus, and storage medium

    WO2026090901A1