A method and device for target statistical classification of surveillance videos
By dynamically dividing surveillance videos into time slices and adjusting model parameters, the problem of high computational complexity in target detection and statistical classification in surveillance videos is solved, efficient statistical classification of targets is achieved, processing speed is improved, and computing costs are reduced.
Patent Information
- Application Number
- CN202210646619.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-06-09
AI Technical Summary
The existing technology requires a large amount of calculation and high reasoning cost when detecting and statistically classifying targets in surveillance videos, which is difficult to effectively reduce, affecting the processing speed and accuracy.
By dynamically dividing the surveillance video into time slices, the optimization space on the target quantity classification interval is used to adjust the model input configuration parameters, including image resolution and time slice length, to reduce the amount of calculation while ensuring the accuracy of the classification results.
On the premise of ensuring the accuracy of target statistical classification results, the processing speed is significantly improved, the calculation cost is reduced, and a balance between result accuracy and processing speed is achieved.
Smart Images

Figure CN114998835B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of target detection and statistical classification, and in particular to a target statistical classification method and device for surveillance videos. Background Art
[0002] With the rapid development of electronic technology, video surveillance systems are becoming more and more popular in people's daily lives. By statistically classifying surveillance video targets, users can have a rough judgment on the density of targets. For example, statistical classification based on vehicles can get a rough idea of traffic congestion; statistical classification based on people can get information about the density of people. Based on this, statistical classification of surveillance video targets has important application value in traffic dispatching, urban public facilities construction, and the organization and arrangement of large-scale events. In traffic dispatching, statistical classification of surveillance videos can timely obtain traffic congestion and provide travel suggestions for the public. It can also provide decision-making basis for managers and arrange traffic diversion personnel in advance to avoid traffic accidents as much as possible. In the construction of urban public facilities, decision makers can analyze the classification data of surrounding people, traffic flow, etc. through statistical classification of surveillance videos, determine the best location of public facilities, functions of different partitions, etc. according to actual conditions, and improve the public's experience. In terms of organizing and arranging large-scale events, target statistical classification based on surveillance videos can enable organizers to know the crowd density information in different areas in a timely manner, and formulate different resolutions to alleviate the crowd congestion according to the crowd congestion in different areas. For example, the government can provide discounted services at uncrowded attractions to facilitate the dispersal of the crowd.
[0003] Due to the important role of target statistical classification of surveillance videos in traffic dispatching, enterprise safety production supervision and economic decision-making, the target statistical classification problem for surveillance videos has attracted widespread attention from scholars at home and abroad. The implementation process of target statistical classification of surveillance videos is to first detect single targets in video frames, then count the number of detected targets, and then classify them according to the statistical results. Although the current deep learning model can achieve high-precision target detection in surveillance videos, due to the huge volume of surveillance video data, there are problems such as large computational complexity and high inference cost. Summary of the invention
[0004] In view of the limitations of existing technologies, we propose a target statistical classification method for surveillance videos. This method makes full use of the optimization space on the target quantity classification interval to achieve the optimization goal of reducing the amount of calculation as much as possible while ensuring the accuracy of the target quantity classification results.
[0005] The present application provides a target statistical classification method for surveillance videos, comprising the following steps:
[0006] Step 1: cutting a time slice length video from the video to be processed, parsing the time slice length video into multiple image frames to obtain an image data set; based on the image data set, performing frame sampling according to a uniform distribution to obtain a sampled image data set;
[0007] Step 2: Use the current model to infer the images in the image data set to obtain the current model inference result; according to the current model inference result, perform target statistical classification on the images to obtain the image target statistical classification result of the current model; use the initial model to infer the images in the sampled image data to obtain the initial model inference result; according to the initial model inference result, perform target statistical classification on the images to obtain the sampled image target statistical classification result of the initial model;
[0008] Step 3: According to the sample size in the sampled image data set, calculate the ratio of the image target statistical classification result of the current model to the sampled image target statistical classification result of the initial model to obtain the consistency coefficient;
[0009] Step 4: According to the relationship between the consistency coefficient and the conditional threshold and the optimization threshold, the image resolution and time slice length of the current model input configuration parameters are adjusted, and the process returns to step 1 until the target statistical classification of the video to be processed is completed;
[0010] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0011] Preferably, according to the inference result, the image is subjected to target statistical classification based on a classification piecewise function.
[0012] Preferably, the target statistical classification category of the image is determined based on the interval into which the classification piecewise function and the number of targets in the image fall, wherein the category is determined by F(x), and F(x) is expressed as:
[0013]
[0014] in, Indicates the number of objects in the image; Represents the target statistical classification category of the image; and Indicates category Corresponding to the lower and upper bounds of the target statistical classification interval.
[0015] Preferably, according to the relationship between the consistency coefficient and the condition threshold and the optimization threshold, adjusting the image resolution and time slice length value of the current model input configuration parameters comprises the following steps:
[0016] When the consistency coefficient is less than the conditional threshold, the image resolution of the current model input configuration parameters is increased and the time slice length is reduced;
[0017] When the consistency coefficient is greater than the optimization threshold, the image resolution of the current model input configuration parameters is reduced and the time slice length is increased;
[0018] Otherwise, the image resolution and time slice length of the current model input configuration parameters remain unchanged;
[0019] Wherein, the optimization threshold is greater than the condition threshold.
[0020] Preferably, the optimization threshold is determined based on the conditional threshold and the consistency coefficient.
[0021] The present application also provides a target statistical classification device for surveillance videos, the device comprising:
[0022] The acquisition module cuts a time slice length video from the video to be processed, parses the time slice length video into multiple image frames, and obtains an image data set; based on the image data set, performs frame sampling according to a uniform distribution to obtain a sampled image data set;
[0023] The statistical classification module uses the current model to infer the images in the image data set to obtain the current model inference result; based on the current model inference result, the images are subjected to target statistical classification to obtain the image target statistical classification result of the current model; the initial model is used to infer the images in the sampled image data to obtain the initial model inference result; based on the initial model inference result, the images are subjected to target statistical classification to obtain the sampled image target statistical classification result of the initial model;
[0024] The calculation module calculates the consistency ratio between the image target statistical classification result of the current model and the sampled image target statistical classification result of the initial model according to the sample amount in the sampled image data set, and obtains the consistency coefficient;
[0025] An adjustment module, adjusting the image resolution and time slice length of the current model input configuration parameters according to the relationship between the consistency coefficient and the condition threshold and the optimization threshold;
[0026] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0027] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0028] Step 1: cutting a time slice length video from the video to be processed, parsing the time slice length video into multiple image frames to obtain an image data set; based on the image data set, performing frame sampling according to a uniform distribution to obtain a sampled image data set;
[0029] Step 2: Use the current model to infer the images in the image data set to obtain inference results; according to the inference results, perform target statistical classification on the images to obtain the image target statistical classification results of the current model; use the initial model to infer the images in the sampled image data to obtain inference results; according to the inference results, perform target statistical classification on the images to obtain the sampled image target statistical classification results of the initial model;
[0030] Step 3: According to the sample size in the sampled image data set, calculate the ratio of the image target statistical classification result of the current model to the sampled image target statistical classification result of the initial model to obtain the consistency coefficient;
[0031] Step 4: According to the relationship between the consistency coefficient and the conditional threshold and the optimization threshold, the image resolution and time slice length of the current model input configuration parameters are adjusted, and the process returns to step 1 until the target statistical classification of the video to be processed is completed;
[0032] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0033] The present application provides a target statistical classification method for surveillance videos. The method completes the target statistical classification of surveillance videos. The method makes full use of the optimization space on the target quantity classification interval to achieve the optimization goal of reducing the amount of calculation as much as possible under the premise of ensuring the accuracy of the target quantity classification result, and achieves a good balance between the result accuracy and the processing speed. The method dynamically divides the surveillance video into time slices, and dynamically adjusts the model input configuration parameters based on the optimization space on the target quantity segmented classification interval, so as to achieve the optimization goal of increasing the processing speed of the image data set in the cut time slice length video as much as possible under the premise of ensuring the accuracy of the target statistical classification result. By regularly sampling and comparing and verifying the image data set, the model configuration parameters and time slice length are optimized to the maximum extent under the premise of ensuring the accuracy of the target statistical classification, the subsequent surveillance video calculation cost and the amount of sampling comparison verification are reduced, and the processing speed is improved. The optimization space on the target quantity classification interval exists in the mapping from statistical count to classification. The method reduces the amount of calculation by reducing the target detection accuracy under the premise of ensuring the classification accuracy, and finally achieves a balance between accuracy and calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a flow chart of a target statistical classification method for surveillance videos in one embodiment;
[0035] Figure 2 The present invention is a structural block diagram of a target statistical classification device for surveillance video in one embodiment. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0037] In one embodiment, Figure 1 As shown, a target statistical classification method for surveillance video is provided, comprising the following steps:
[0038] Step 202, cutting a time slice length video from the video to be processed, parsing the time slice length video into multiple image frames to obtain an image data set; based on the image data set, performing frame sampling according to a uniform distribution to obtain a sampled image data set;
[0039] Step 204, using the current model to infer the images in the image data set to obtain the current model inference result; based on the current model inference result, the images are subjected to target statistical classification to obtain the image target statistical classification result of the current model; using the initial model to infer the images in the sampled image data to obtain the initial model inference result; based on the initial model inference result, the images are subjected to target statistical classification to obtain the sampled image target statistical classification result of the initial model;
[0040] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0041] In one implementation, according to the inference result, the image is statistically classified based on a classification piecewise function.
[0042] In one implementation, the target statistical classification category of the image is determined based on the interval in which the classification piecewise function and the number of targets in the image fall, wherein the category is determined by F(x), and F(x) is expressed as:
[0043]
[0044] in, Indicates the number of objects in the image; Represents the target statistical classification category of the image; and Indicates category Corresponding to the lower and upper bounds of the target statistical classification interval.
[0045] Step 206, calculating the consistency ratio between the image target statistical classification result of the current model and the sampled image target statistical classification result of the initial model according to the sample size in the sampled image data set, and obtaining a consistency coefficient;
[0046] In one implementation, adjusting the image resolution and time slice length value of the current model input configuration parameters according to the relationship between the consistency coefficient and the condition threshold and the optimization threshold includes the following steps:
[0047] When the consistency coefficient is less than the conditional threshold, the image resolution of the current model input configuration parameters is increased and the time slice length is reduced;
[0048] When the consistency coefficient is greater than the optimization threshold, the image resolution of the current model input configuration parameters is reduced and the time slice length is increased;
[0049] Otherwise, the image resolution and time slice length of the current model input configuration parameters remain unchanged;
[0050] Wherein, the optimization threshold is greater than the condition threshold.
[0051] In one embodiment, the optimization threshold is determined based on a condition threshold and the uniformization coefficient.
[0052] In one embodiment, Figure 2 As shown, a target statistical classification device for surveillance video is provided, comprising:
[0053] The acquisition module cuts a time slice length video from the video to be processed, parses the time slice length video into multiple image frames, and obtains an image data set; based on the image data set, performs frame sampling according to a uniform distribution to obtain a sampled image data set;
[0054] The statistical classification module uses the current model to infer the images in the image data set to obtain the current model inference result; based on the current model inference result, the images are subjected to target statistical classification to obtain the image target statistical classification result of the current model; the initial model is used to infer the images in the sampled image data to obtain the initial model inference result; based on the initial model inference result, the images are subjected to target statistical classification to obtain the sampled image target statistical classification result of the initial model;
[0055] The calculation module calculates the consistency ratio between the image target statistical classification result of the current model and the sampled image target statistical classification result of the initial model according to the sample amount in the sampled image data set, and obtains the consistency coefficient;
[0056] An adjustment module, adjusting the image resolution and time slice length of the current model input configuration parameters according to the relationship between the consistency coefficient and the condition threshold and the optimization threshold;
[0057] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0058] Each module in the above-mentioned target statistical classification device for surveillance video can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0059] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0060] Step 1: cutting a time slice length video from the video to be processed, parsing the time slice length video into multiple image frames to obtain an image data set; based on the image data set, performing frame sampling according to a uniform distribution to obtain a sampled image data set;
[0061] Step 2: Use the current model to infer the images in the image data set to obtain inference results; according to the inference results, perform target statistical classification on the images to obtain the image target statistical classification results of the current model; use the initial model to infer the images in the sampled image data to obtain inference results; according to the inference results, perform target statistical classification on the images to obtain the sampled image target statistical classification results of the initial model;
[0062] Step 3: According to the sample size in the sampled image data set, calculate the ratio of the image target statistical classification result of the current model to the sampled image target statistical classification result of the initial model to obtain the consistency coefficient;
[0063] Step 4: According to the relationship between the consistency coefficient and the conditional threshold and the optimization threshold, the image resolution and time slice length of the current model input configuration parameters are adjusted, and the process returns to step 1 until the target statistical classification of the video to be processed is completed;
[0064] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0065] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0066] Step 1: cutting a time slice length video from the video to be processed, parsing the time slice length video into multiple image frames to obtain an image data set; based on the image data set, performing frame sampling according to a uniform distribution to obtain a sampled image data set;
[0067] Step 2: Use the current model to infer the images in the image data set to obtain inference results; according to the inference results, perform target statistical classification on the images to obtain the image target statistical classification results of the current model; use the initial model to infer the images in the sampled image data to obtain inference results; according to the inference results, perform target statistical classification on the images to obtain the sampled image target statistical classification results of the initial model;
[0068] Step 3: According to the sample size in the sampled image data set, calculate the ratio of the image target statistical classification result of the current model to the sampled image target statistical classification result of the initial model to obtain the consistency coefficient;
[0069] Step 4: According to the relationship between the consistency coefficient and the conditional threshold and the optimization threshold, the image resolution and time slice length of the current model input configuration parameters are adjusted, and the process returns to step 1 until the target statistical classification of the video to be processed is completed;
[0070] The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes target recognition on the image, and the reasoning result includes the number of targets in the image.
[0071] The present application provides a target statistical classification method for surveillance videos. The method completes the target statistical classification of surveillance videos. The method makes full use of the optimization space on the target quantity classification interval to achieve the optimization goal of reducing the amount of calculation as much as possible while ensuring the accuracy of the target quantity classification results, and achieves a good balance between the result accuracy and the processing speed. The method dynamically divides the surveillance video into time slices, and based on the optimization space on the target quantity segmented classification interval, the model input configuration parameters are dynamically adjusted, so as to achieve the optimization goal of increasing the processing speed of the image data set in the video of the cut time slice length while ensuring the accuracy of the target statistical classification results. By regularly sampling and comparing and verifying the image data set, the model configuration parameters and time slice length are optimized to the maximum extent while ensuring the accuracy of the target statistical classification, and the subsequent surveillance video calculation cost and the amount of sampling, comparison and verification are reduced, thereby improving the processing speed.
[0072] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0073] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. When the technical features in different embodiments are embodied in the same figure, it can be regarded that the figure also discloses the combination examples of the various embodiments involved.
[0074] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A target statistical classification method for surveillance video, characterized in that: The method comprises the following steps: Step 1: cutting a time slice length video from the video to be processed, parsing the time slice length video into multiple image frames to obtain an image data set; based on the image data set, performing frame sampling according to a uniform distribution to obtain a sampled image data set; Step 2: Use the current model to infer the images in the image data set to obtain the current model inference result; according to the current model inference result, perform target statistical classification on the images to obtain the image target statistical classification result of the current model; The images in the sampled image data set are inferred using the initial model to obtain the initial model inference results; the images are subjected to target statistical classification according to the initial model inference results to obtain the sampled image target statistical classification results of the initial model; Step 3: According to the sample size in the sampled image data set, calculate the ratio of the image target statistical classification result of the current model to the sampled image target statistical classification result of the initial model to obtain the consistency coefficient; Step 4: According to the relationship between the consistency coefficient and the conditional threshold and the optimization threshold, the image resolution and time slice length of the current model input configuration parameters are adjusted, and the process returns to step 1 until the target statistical classification of the video to be processed is completed; The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes object recognition on the image, and the reasoning result includes the number of objects in the image; According to the relationship between the consistency coefficient and the condition threshold and the optimization threshold, the image resolution and time slice length value of the current model input configuration parameters are adjusted, including the following steps: When the consistency coefficient is less than the conditional threshold, the image resolution of the current model input configuration parameters is increased and the time slice length is reduced; When the consistency coefficient is greater than the optimization threshold, the image resolution of the current model input configuration parameters is reduced and the time slice length is increased; Otherwise, the image resolution and time slice length of the current model input configuration parameters remain unchanged; Wherein, the optimization threshold is greater than the condition threshold.
2. The target statistical classification method for surveillance video according to claim 1 is characterized in that: According to the inference result, the image is statistically classified based on the classification piecewise function.
3. The target statistical classification method for surveillance video according to claim 2 is characterized in that: Based on the interval in which the classification piecewise function and the number of targets in the image fall, the target statistical classification category of the image is determined, wherein the category is determined by F(x), and F(x) is expressed as: in, Indicates the number of objects in the image; Represents the target statistical classification category of the image; and Indicates category Corresponding to the lower and upper bounds of the target statistical classification interval.
4. The target statistical classification method for surveillance video according to claim 3 is characterized in that: The optimization threshold is determined based on a condition threshold and the consistency coefficient.
5. A target statistical classification device for surveillance video, characterized in that: The device comprises: The acquisition module cuts a time slice length video from the video to be processed, parses the time slice length video into multiple image frames, and obtains an image data set; based on the image data set, performs frame sampling according to a uniform distribution to obtain a sampled image data set; The statistical classification module uses the current model to infer the images in the image data set to obtain the current model inference result; based on the current model inference result, the images are subjected to target statistical classification to obtain the image target statistical classification result of the current model; the images in the sampled image data set are subjected to inference using the initial model to obtain the initial model inference result; based on the initial model inference result, the images are subjected to target statistical classification to obtain the sampled image target statistical classification result of the initial model; The calculation module calculates the consistency ratio between the image target statistical classification result of the current model and the sampled image target statistical classification result of the initial model according to the sample amount in the sampled image data set, and obtains the consistency coefficient; An adjustment module, adjusting the image resolution and time slice length of the current model input configuration parameters according to the relationship between the consistency coefficient and the condition threshold and the optimization threshold; The current model is trained using multiple sets of training data, the initial model is an image with a maximum resolution of the current model input configuration parameters, the reasoning includes object recognition on the image, and the reasoning result includes the number of objects in the image; According to the relationship between the consistency coefficient and the condition threshold and the optimization threshold, the image resolution and time slice length value of the current model input configuration parameters are adjusted, including the following steps: When the consistency coefficient is less than the conditional threshold, the image resolution of the current model input configuration parameters is increased and the time slice length is reduced; When the consistency coefficient is greater than the optimization threshold, the image resolution of the current model input configuration parameters is reduced and the time slice length is increased; Otherwise, the image resolution and time slice length of the current model input configuration parameters remain unchanged; Wherein, the optimization threshold is greater than the condition threshold.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
