An optimized method and terminal for accelerating video recognition

By using a method of fast frame extraction at preset intervals and frame-by-frame detection, the problem of low video recognition efficiency is solved, the detection efficiency of video streams is improved, and computing resources are saved.

CN118609030BActive Publication Date: 2026-01-30福建天晴在线互动科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410825133.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2026-01-30
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

In current video recognition processes, the high cost and limited availability of GPU resources result in low video recognition efficiency, making it impossible to efficiently utilize GPU computing power.

Method used

The system employs a preset interval for rapid frame sampling detection. If an abnormal frame is detected, frame-by-frame detection is performed within a preset time range before and after the abnormal frame. The detection ends once the alarm rules are met; otherwise, the interval is shortened and the detection is repeated until no abnormalities are detected in any frame of the video stream.

Benefits of technology

By optimizing the video recognition process, detection efficiency was improved, computer resources were saved, invalid frames were reduced, and more efficient video stream detection was achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118609030B_ABST
    Figure CN118609030B_ABST
Patent Text Reader

Abstract

This invention discloses an optimized method and terminal for accelerating video recognition. It prioritizes rapid frame extraction of the entire video stream at preset intervals, essentially performing a coarse inspection of the entire video stream. The selection of frames is based on the video stream length. If an abnormal frame is detected, further frame-by-frame inspection is performed near the abnormal frame until the detected abnormal frame meets the alarm rules. At this point, inspection of other parts is stopped, the detection process ends, and an alarm is triggered, saving computer resources, reducing the identification of invalid frames, and improving processing efficiency. If no abnormal frames are found during the coarse inspection, the preset interval is reduced, and the video stream is inspected again until no abnormalities are detected in any frame of the entire video stream, at which point the detection ends. If an abnormal frame is found after reducing the interval, frame-by-frame inspection is performed according to the above steps, improving the detection efficiency of the video stream while reducing resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video detection, and in particular to an optimized method and terminal for accelerating video recognition. Background Technology

[0002] Currently, common video recognition processes typically involve sequential frame extraction, with dozens of frames per second of video. These generated frames require analysis by a large AI model. Since this analysis consumes significant GPU resources, which are expensive, current methods generally only analyze and process 1-2 frames per second of video, issuing alerts only when the analysis results meet certain conditions.

[0003] For the reasons mentioned above, most video recognition methods operate on a second-by-second basis, sequentially extracting and recognizing frames. After extracting multiple consecutive frames, AI large-scale model programs are invoked serially or in parallel for image recognition. During this process, the high cost and limited availability of GPU computing resources restricts the overall efficiency of video recognition. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide an optimized method and terminal for accelerating video recognition, thereby solving the problem of low efficiency in the video recognition process.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0006] An optimized method for accelerating video recognition includes the following steps:

[0007] S1. Perform rapid frame extraction detection on the entire video stream at preset intervals. If abnormal frames are detected, proceed to step S2; otherwise, proceed to step S3.

[0008] S2. Perform frame-by-frame detection within a preset time range before and after the abnormal frame. If the detected abnormal frame meets the alarm rules, end the detection and alarm processing; otherwise, proceed to step S3.

[0009] S3. Determine whether all frames of the video stream have been detected. If yes, end the detection; otherwise, shorten the preset interval and return to step S1.

[0010] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:

[0011] An optimized terminal for accelerating video recognition includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:

[0012] S1. Perform rapid frame extraction detection on the entire video stream at preset intervals. If abnormal frames are detected, proceed to step S2; otherwise, proceed to step S3.

[0013] S2. Perform frame-by-frame detection within a preset time range before and after the abnormal frame. If the detected abnormal frame meets the alarm rules, end the detection and alarm processing; otherwise, proceed to step S3.

[0014] S3. Determine whether all frames of the video stream have been detected. If yes, end the detection; otherwise, shorten the preset interval and return to step S1.

[0015] The beneficial effects of this invention are as follows: It provides an optimized method and terminal for accelerating video recognition. The method prioritizes rapid frame extraction of the entire video at preset intervals, i.e., a coarse inspection of the entire video stream. The preset interval can be between 1 and 10 seconds, selected according to the length of the video stream. If an abnormal frame is detected, further frame-by-frame inspection is performed near the abnormal frame until the detected abnormal frame image meets the alarm rules. At this point, no further inspection is performed on other parts, and the detection process ends with an alarm, saving computer resources, reducing the identification of invalid frames, and improving processing efficiency. If no abnormal frame is found during the coarse inspection, the preset interval is reduced, and the video stream is inspected again until no abnormalities are detected in any frame of the entire video stream, at which point the detection ends. If an abnormal frame is found after reducing the interval, frame-by-frame inspection is performed according to the above steps, improving the detection efficiency of the video stream while reducing resource consumption. Attached Figure Description

[0016] Figure 1 This is a flowchart of an optimization method for accelerating video recognition in an embodiment of the present invention;

[0017] Figure 2 This is a schematic diagram of an optimized terminal for accelerating video recognition in an embodiment of the present invention;

[0018] Label Explanation:

[0019] 1. An optimized terminal for accelerating video recognition; 2. A memory; 3. A processor. Detailed Implementation

[0020] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0021] Please refer to Figure 1An optimized method for accelerating video recognition, characterized by the following steps:

[0022] S1. Perform rapid frame extraction detection on the entire video stream at preset intervals. If abnormal frames are detected, proceed to step S2; otherwise, proceed to step S3.

[0023] S2. Perform frame-by-frame detection within a preset time range before and after the abnormal frame. If the detected abnormal frame meets the alarm rules, end the detection and alarm processing; otherwise, proceed to step S3.

[0024] S3. Determine whether all frames of the video stream have been detected. If yes, end the detection; otherwise, shorten the preset interval and return to step S1.

[0025] As can be seen from the above description, the beneficial effects of the present invention are as follows: Firstly, the entire video is subjected to rapid frame extraction at a preset interval, i.e., a coarse inspection of the entire video stream is performed. The preset interval can be between 1 and 10 seconds, selected appropriately according to the length of the video stream. If an abnormal frame is detected, further frame-by-frame inspection is performed near the abnormal frame until the detected abnormal frame image meets the alarm rules. Then, no further inspection is performed on other parts, and the inspection ends directly with an alarm, saving computer resources and improving processing efficiency. If no abnormal frame is found in the above coarse inspection process, the preset interval is reduced, and the video stream is inspected again until no abnormalities are detected in any frame of the entire video stream, at which point the inspection ends. If an abnormal frame is found after reducing the interval, frame-by-frame inspection is performed according to the above steps, improving the detection efficiency of the video stream while reducing resource consumption.

[0026] Understandably, alarm rules are specific rules set based on actual situations. For example, in determining the behavior of running a red light at an intersection, if the frame image contains information about running a red light before, during, and after the intersection, then the alarm rule is considered to be met. Or, in detecting the behavior of riding an electric bike without a helmet, if the frame image shows information about the driver not wearing a helmet for 3-5 consecutive seconds during the ride, then the alarm rule is considered to be met.

[0027] In an embodiment of the present invention, step S1 further includes the step:

[0028] The video stream is sampled at preset intervals, and the action of each captured frame image is sent to a message queue. The consumer is controlled to request the AI ​​model to detect the frame image based on the message in the consumption queue, and the detected frame image and the corresponding detection result are cached in the database.

[0029] As described above, recording and caching each sampled frame image and its detection result facilitates joint verification with other abnormal frame images during subsequent detection processes, thereby determining whether the alarm rules are met and improving the versatility of the above method.

[0030] In an embodiment of the present invention, step S2 further includes the step:

[0031] The frame images within a preset time range are compared with the frame images in the database for consistency. Frame images that have already been detected in the database are filtered out, and the remaining frame images are detected using an AI model.

[0032] As can be seen from the above description, when detecting frames one by one near abnormal frames, the previously detected frame images are first screened out to reduce the process of repeated recognition and improve processing efficiency.

[0033] In an embodiment of the present invention, the message in the message queue includes a unique identifier of the frame image, a frame timestamp, and a video stream identifier. The consumer requests the AI ​​model to detect the frame image based on the message and stores the detection result together with the unique identifier and the frame timestamp of the frame image in the database.

[0034] As described above, the messages in the message queue include the unique identifier of the frame image, the frame timestamp, and the video stream identifier, ensuring accurate location and management of the detection results for each frame image. The consumer requests the AI ​​model to perform detection based on the message and stores the detection results, along with the unique identifier and timestamp of the frame image, in the database for easy subsequent querying and tracking management of the detection results.

[0035] In an embodiment of the present invention, step S3 further includes the step:

[0036] Before shortening the preset interval, the current detection frequency and system performance are evaluated, and the preset interval is dynamically adjusted.

[0037] As described above, this method dynamically adjusts the preset interval by evaluating the current detection frequency and system performance before shortening it, enabling the system to optimize the detection frequency based on actual conditions. This ensures timely detection of abnormal frames while avoiding excessive consumption of system resources, thus enhancing the system's intelligence and adaptability.

[0038] Please refer to Figure 2 An optimized terminal for accelerating video recognition includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it completes the steps of an optimized method for accelerating video recognition.

[0039] As described above, an execution platform for an optimized method to accelerate video recognition is provided. During the execution of this method, the entire video is first subjected to rapid frame-by-frame processing at preset intervals, i.e., a coarse inspection of the entire video stream. The preset interval can be between 1 and 10 seconds, selected appropriately based on the video stream length. If an abnormal frame is detected, further frame-by-frame inspection is performed near the abnormal frame until the detected abnormal frame image meets the alarm rules. At this point, no further inspection is performed on other parts, and the detection process ends with an alarm, saving computer resources and improving processing efficiency. If no abnormal frame is found during the coarse inspection, the preset interval is reduced, and the video stream is inspected again until no abnormalities are detected in any frame of the entire video stream, at which point the detection ends. If an abnormal frame is found after reducing the interval, frame-by-frame inspection is performed according to the above steps, improving the detection efficiency of the video stream while reducing resource consumption.

[0040] This invention provides an optimized method and terminal for accelerating video recognition, mainly applied to improving the detection efficiency of video streams. The following is a detailed description with reference to specific embodiments:

[0041] Please refer to Figure 1 Embodiment 1 of the present invention is as follows:

[0042] An optimization method for accelerating video recognition, characterized by the following steps:

[0043] S1. Perform rapid frame extraction detection on the entire video stream at preset intervals. If abnormal frames are detected, proceed to step S2; otherwise, proceed to step S3.

[0044] S2. Perform frame-by-frame detection within a preset time range before and after the abnormal frame. If the detected abnormal frame meets the alarm rules, end the detection and alarm processing; otherwise, proceed to step S3.

[0045] S3. Determine whether all frames of the video stream have been detected. If yes, end the detection; otherwise, shorten the preset interval and return to step S1.

[0046] In this example, the entire video is first subjected to rapid frame-by-frame processing at preset intervals, i.e., a coarse inspection of the entire video stream. The preset interval can be between 1 and 10 seconds, selected according to the length of the video stream. If an abnormal frame is detected, further frame-by-frame inspection is performed in the vicinity of the abnormal frame until the detected abnormal frame image meets the alarm rules. At this point, no further inspection is performed on other parts, the inspection ends directly, and an alarm is triggered, saving computer resources and improving processing efficiency. If no abnormal frame is found in the above coarse inspection process, the preset interval is shortened, and the video stream is inspected again until no abnormalities are detected in any frame of the entire video stream, at which point the inspection ends. If an abnormal frame is found after shortening the interval, frame-by-frame inspection is performed according to the above steps, improving the detection efficiency of the video stream while reducing resource consumption.

[0047] Embodiment 2 of the present invention is as follows:

[0048] Based on Embodiment 1, step S1 further includes the following step:

[0049] The video stream is sampled at preset intervals, and the action of each sampled frame is sent to a message queue. The consumer then requests the AI ​​model to detect the frame based on the messages in the queue, and caches the detected frame and its corresponding detection result in the database. Recording and caching each sampled frame and its detection result facilitates subsequent joint verification with other abnormal frame images during detection, thereby determining whether alarm rules are met and improving the versatility of the method.

[0050] Step S2 also includes the following steps:

[0051] The system compares frame images within a preset time range with frame images in the database for consistency. Frame images already detected in the database are filtered out, and the remaining frame images are then detected using an AI model. When detecting frames near abnormal frames, previously detected frame images are first filtered out to reduce redundant identification and improve processing efficiency.

[0052] Specifically, the message in the message queue includes the unique identifier of the frame image, the frame timestamp, and the video stream identifier. The consumer requests the AI ​​model to detect the frame image based on the message and stores the detection result together with the unique identifier and timestamp of the frame image in the database.

[0053] Step S3 also includes the following steps:

[0054] Before shortening the preset interval, the current detection frequency and system performance are evaluated, and the preset interval is dynamically adjusted. This method dynamically adjusts the preset interval by evaluating the current detection frequency and system performance before shortening it, allowing the system to optimize the detection frequency based on actual conditions. This ensures timely detection of abnormal frames while avoiding excessive consumption of system resources, thus improving the system's intelligence and adaptability.

[0055] Embodiment 3 of the present invention is as follows:

[0056] An optimization method for accelerating video recognition is applied as follows:

[0057] 1. Initialization settings:

[0058] The initial frame skipping interval is set to 5 seconds, and the video stream identifier is video_001.

[0059] 2. Frame skipping detection:

[0060] The system extracts one frame from video_001 every 5 seconds for detection.

[0061] When the first abnormal frame is detected (e.g., the frame at the 30th second), the system enters the abnormal frame detection step.

[0062] Frame-by-frame inspection:

[0063] Perform frame-by-frame detection on all frames within a 5-second range before and after the 30-second frame (from the 25th to the 35th second).

[0064] These frames are compared with the frames that have already been detected in the database, and the frames that have already been detected are filtered out.

[0065] 3. Use an AI model to detect the remaining frames.

[0066] The detection results showed that the frame at the 32nd second also had an anomaly and met the alarm rules, so the system issued an alarm and ended the detection.

[0067] 4. Dynamically adjust the detection frequency:

[0068] During the above process, if the sampling in the video stream has not been completed, the system will evaluate based on the current detection frequency and system performance. For example, if the system load is low, the preset interval will be shortened to 3 seconds. Return to step 1 and continue frame sampling detection.

[0069] Another application is as follows:

[0070] 1. Initialization settings:

[0071] The initial frame skipping interval is set to 10 seconds, and the video stream identifier is video_001.

[0072] 2. Frame skipping detection:

[0073] The system extracts one frame from video_001 every 10 seconds for detection.

[0074] No abnormalities were found in the first round of random inspections;

[0075] 3. Frame skipping interval adjustment

[0076] The frame extraction interval was adjusted to 5 seconds, and the extracted frames were compared with the frames that had already been detected in the database, and the frames that had already been detected were filtered out.

[0077] When the first abnormal frame is detected (e.g., the frame at the 15th second), the system enters the abnormal frame detection step.

[0078] 4. Frame-by-frame inspection:

[0079] Perform frame-by-frame detection on all frames within a 5-second range before and after the 15-second frame (from the 10th to the 20th second).

[0080] These frames are compared with the frames that have already been detected in the database, and the frames that have already been detected are filtered out.

[0081] 5. Use an AI model to detect the remaining frames.

[0082] The detection results showed that the frame at the 13th second also had an anomaly and met the alarm rules, so the system issued an alarm and ended the detection.

[0083] Please refer to Figure 2 Embodiment four of the present invention is as follows:

[0084] An optimized terminal 1 for accelerating video recognition includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, it completes the steps in any of the optimized methods for accelerating video recognition in embodiments one to three.

[0085] In summary, the optimized method and terminal for accelerating video recognition provided by this invention prioritizes rapid frame extraction processing of the entire video at preset intervals, i.e., coarse inspection of the entire video stream. The preset interval can be between 1 and 10 seconds, selected appropriately according to the length of the video stream. If abnormal frames are detected, further frame-by-frame inspection is performed near the abnormal frames until the detected abnormal frame images meet the alarm rules. At this point, inspection of other parts is stopped, and the detection ends directly with an alarm, saving computer resources, reducing the identification of invalid frames, and improving processing efficiency. If no abnormal frames are found in the above coarse inspection process, the preset interval is reduced, and the video stream is inspected again until no abnormalities are detected in any frame of the entire video stream, at which point the detection ends. If abnormal frames are found after reducing the interval, frame-by-frame inspection is performed according to the above steps, improving the detection efficiency of the video stream while reducing resource consumption.

[0086] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. An optimization method for accelerating video recognition, characterized in that: The method comprises the steps of: S1, frame detection is performed on the entire video stream at a preset interval, if an abnormal frame is detected, step S2 is entered; otherwise, step S3 is entered; frame collection is performed on the video stream at a preset interval, action sending messages of each frame picture collected are sent to a message queue, and a consumer is controlled to request an AI model to detect the frame pictures according to messages in the consumption queue, and the detected frame pictures and corresponding detection results are cached in a database; S2, frame-by-frame detection is performed within a preset time range before and after the abnormal frame, if the detected abnormal frame meets the alarm rule, the detection is ended and alarm processing is performed; otherwise, step S3 is entered; the frame pictures within the preset time range are compared with the frame pictures in the database for consistency, the frame pictures that have been detected in the database are screened out, and the remaining frame pictures are detected by using the AI model; S3, whether all frames of the video stream are detected is judged, if yes, the detection is ended; if no, the preset interval is shortened, and step S1 is returned.

2. The optimization method for accelerating video recognition according to claim 1, wherein: The messages in the message queue comprise a unique identifier of a frame picture, a frame timestamp and a video stream identifier, the consumer requests the AI model to detect the frame picture according to the messages, and the detection result is stored in the database together with the unique identifier of the frame picture and the frame timestamp.

3. The optimization method for accelerating video recognition according to claim 1, wherein: The step S3 further comprises the step of: Before the preset interval is shortened, the current detection frequency and system performance are evaluated, and the preset interval is dynamically adjusted.

4. An optimized terminal for accelerating video recognition, characterized by: The computer program product comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor completes the following steps when executing the computer program: S1, frame detection is performed on the entire video stream at a preset interval, if an abnormal frame is detected, step S2 is entered; otherwise, step S3 is entered; frame collection is performed on the video stream at a preset interval, action sending messages of each frame picture collected are sent to a message queue, and a consumer is controlled to request an AI model to detect the frame pictures according to messages in the consumption queue, and the detected frame pictures and corresponding detection results are cached in a database; S2, frame-by-frame detection is performed within a preset time range before and after the abnormal frame, if the detected abnormal frame meets the alarm rule, the detection is ended and alarm processing is performed; otherwise, step S3 is entered; the frame pictures within the preset time range are compared with the frame pictures in the database for consistency, the frame pictures that have been detected in the database are screened out, and the remaining frame pictures are detected by using the AI model; S3, whether all frames of the video stream are detected is judged, if yes, the detection is ended; if no, the preset interval is shortened, and step S1 is returned.

5. The optimized terminal for accelerating video recognition according to claim 4, wherein: The messages in the message queue comprise a unique identifier of a frame picture, a frame timestamp and a video stream identifier, the consumer requests the AI model to detect the frame picture according to the messages, and the detection result is stored in the database together with the unique identifier of the frame picture and the frame timestamp.

6. The optimized terminal for accelerating video recognition according to claim 4, wherein: The step S3 further comprises the step of: Before the preset interval is shortened, the current detection frequency and system performance are evaluated, and the preset interval is dynamically adjusted.

Citation Information

Patent Citations

  • Video frame extraction method, related equipment, abnormal scene early warning method and related equipment

    CN117579766A