Dynamic threshold alarm method based on hierarchical counting
Through the dynamic threshold alarm method based on hierarchical counting, the problem of mis-detection and missed detection in the security video surveillance system is solved, and efficient detection accuracy and system reliability are improved, especially the stability in the light mutation scenario.
Patent Information
- Application Number
- CN202510455008.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-09-02
AI Technical Summary
The existing target detection model is susceptible to the influence of environmental light changes in security video surveillance systems, resulting in false detection and missed detection, with high false alarm rate, and the detection accuracy of traditional NMS algorithms in complex scenarios decreases.
A dynamic threshold alarm method based on hierarchical counting is adopted. By configuring a dedicated counter and a nonlinear attenuation function, combined with sliding window verification, multiple categories of independent counting and three-level detection levels are realized, reducing the probability of false detection and missed detection.
Effectively reduce the false alarm rate by 65%, improve detection accuracy and system reliability, and maintain high detection accuracy, especially in light mutation scenarios, system stability is increased by 40%.
Smart Images

Figure CN120580469A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, in particular to a dynamic threshold alarm method based on hierarchical counting. Background Art
[0002] Security video surveillance systems use optical fiber, coaxial cable, or microwaves to transmit video signals within a closed loop. From camera capture to image display and recording, they form a self-contained, complete system. They provide a real-time, visual, and realistic representation of monitored objects, replacing manual surveillance for extended periods in harsh environments. With the advancement of computer vision technology, the application of object detection models in security video surveillance systems can efficiently identify and locate objects in images or videos, marking the location of each object of interest and labeling its category.
[0003] However, existing security video surveillance systems based on target detection models have two significant flaws:
[0004] First, due to factors such as changes in ambient lighting, the target detection model is prone to false detection, resulting in frequent false alarms in the system. When the false alarm rate exceeds 30%, it will seriously affect the reliability and availability of the system.
[0005] Second, the traditional NMS (non-maximum suppression) algorithm is prone to missed detection problems in complex scenarios, especially for dense targets or occluded targets, where the detection accuracy can drop by more than 20%.
[0006] In view of the problems in the prior art, the present invention provides a dynamic threshold alarm method based on hierarchical counting. Summary of the Invention
[0007] In view of the problems of the current prior art, the purpose of the present invention is to solve the technical defects of the existing target detection model post-processing method that is prone to false detection and missed detection.
[0008] The present invention provides a dynamic threshold alarm method based on hierarchical counting, the method comprising the following steps:
[0009] S1. Determine the persistence parameter corresponding to each detection category based on the target detection results;
[0010] S2. updating the counter corresponding to each detection category according to the persistence parameter to obtain a real-time count value;
[0011] S3. Determine the detection level corresponding to the detection category by sliding the window range, combining the real-time count value and a preset threshold.
[0012] According to one embodiment of the present invention, step S1 includes:
[0013] updating a grouping result of each of the detection categories according to the target detection result, wherein the grouping result includes a detected category and an undetected category;
[0014] The persistence parameters corresponding to the detected category and the undetected category are calculated respectively, wherein the persistence parameters include a detection parameter and a missed detection parameter.
[0015] According to one embodiment of the present invention, the persistence parameter of the detected category is calculated by the following expression:
[0016] m t =m t-1 +1
[0017] n t =0
[0018] Where: m t Represents the detection parameters at time t; m t-1 Indicates the detection parameters at time t-1; n t Indicates the missed detection parameter at time t.
[0019] According to one embodiment of the present invention, the persistence parameter of the undetected category is calculated by the following expression:
[0020] m t =0
[0021] n t =n t-1 +1
[0022] Where: n t-1 Indicates the missed detection parameter at time t-1.
[0023] According to one embodiment of the present invention, step S2 includes:
[0024] According to the detection parameters, the real-time count value corresponding to the detected category is calculated by using a forward cumulative expression;
[0025] The real-time count value corresponding to the undetected category is calculated based on the missed detection parameter and through an inverse decay expression.
[0026] According to one embodiment of the present invention, the forward cumulative expression is:
[0027]
[0028] The inverse decay expression:
[0029]
[0030] Where: C tIndicates the real-time count value at time t; C t-1 Indicates the real-time count value at time t-1; represents the rounding function; γ represents the attenuation base; k represents the attenuation coefficient.
[0031] According to an embodiment of the present invention, the preset thresholds include: a missed detection threshold, an alarm threshold, a attention threshold, and a warning threshold, wherein the alarm threshold>the attention threshold>the warning threshold.
[0032] According to one embodiment of the present invention, step S3 includes:
[0033] S31, determine whether the current moment is within the sliding window range, if so, proceed to step S32 or S33, if not, proceed to step S36;
[0034] S32, for the undetected category, determining whether the real-time count value meets the missed detection threshold; if so, proceeding to step S36; if not, returning to step S1;
[0035] S33, for the detected category, determining whether the real-time count value is less than the alarm threshold; if so, proceeding to step S34; if not, recording the detection level as the third level and proceeding to step S36;
[0036] S34, determining whether the real-time count value is less than the attention threshold, if so, proceeding to step S35, if not, recording the detection level as the second level and returning to step S1;
[0037] S35, determining whether the real-time count value is less than the warning threshold; if so, returning to step S1; if not, recording the detection level as the first level and returning to step S1;
[0038] S36: Reset the counter corresponding to each detection category, and return to step S1.
[0039] According to another aspect of the present invention, a storage medium is provided, which contains a series of instructions for executing the method steps described in any one of the above.
[0040] According to another aspect of the present invention, there is also provided a dynamic threshold alarm system based on hierarchical counting, which executes any of the above methods, and the system comprises:
[0041] A target detection model, which is used to output the target detection result;
[0042] A persistence module, which is used to determine the persistence parameters corresponding to each detection category based on the target detection results;
[0043] A real-time counting module, configured to update a counter corresponding to each detection category according to the persistence parameter to obtain a real-time counting value;
[0044] The detection level module is used to determine the detection level corresponding to the detection category through a sliding window range, combined with the real-time count value and a preset threshold.
[0045] The present invention provides a dynamic threshold alarm method based on hierarchical counting, which has the following advantages over the existing technology:
[0046] 1) The present invention proposes a multi-category independent counting mechanism, configuring a dedicated counter for each detection target category to achieve temporal detection in the category dimension, thereby improving detection accuracy and efficiency.
[0047] 2) The present invention proposes a three-level detection level, establishes a low, medium and high three-level cumulative alarm threshold architecture, and forms a corresponding three-level response strategy of warning, attention and alarm.
[0048] 3) The present invention proposes a sliding window verification, which uses a sliding window of length N seconds for continuous verification. An alarm is triggered if and only if the target's continuous detection count reaches the alarm threshold within the window period.
[0049] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0051] Figure 1 A flowchart of a dynamic threshold alarm method based on hierarchical counting according to an embodiment of the present invention is shown;
[0052] Figure 2 A flowchart of a dynamic threshold alarm method based on hierarchical counting according to another embodiment of the present invention is shown;
[0053] Figure 3 A timing diagram according to one embodiment of the present invention is shown.
[0054] In the accompanying drawings, the same reference numerals are used for the same parts. In addition, the accompanying drawings are not drawn according to the actual scale. DETAILED DESCRIPTION
[0055] To make the objectives, technical solutions and advantages of the present invention more clear, embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
[0056] The prior art (CN119625651A) discloses an intelligent monitoring platform and method based on AI vision. The video acquisition module is used to collect video data of the monitoring area in real time; the intelligent computing module includes intelligent devices deployed in the monitoring area, and the intelligent devices are responsible for feature extraction and preliminary analysis of the video data; the AI visual analysis module is used to use a cloud server to further extract features and analyze and classify the video data processed by the intelligent computing module; the alarm module is used to trigger an alarm when the intelligent computing module and the AI visual analysis module collaboratively detect abnormal behavior in the video data, thereby improving the real-time and accuracy of monitoring and reducing the false alarm rate and missed alarm rate; customized monitoring of specific environments improves the pertinence and effectiveness of monitoring.
[0057] The existing technology (CN119672933A) discloses a real-time warning method and system for abnormal behavior under intelligent security, which determines the monitoring environment feature set corresponding to the security monitoring area and formulates the behavior warning threshold corresponding to the security monitoring equipment; collects the dynamic behavior information of the personnel in the security monitoring area, analyzes the behavior mode analysis dimension corresponding to the security monitoring equipment, and evaluates the regional security situation corresponding to the security monitoring area; analyzes the physical feature attributes corresponding to the personnel in the security monitoring area, analyzes the action pattern characteristics corresponding to the personnel in the security monitoring area, and calculates the behavior risk entropy value corresponding to the personnel in the security monitoring area; analyzes the monitoring adaptability of the security monitoring equipment in the security monitoring area; formulates the abnormal behavior warning strategy corresponding to the security monitoring area, executes the real-time warning of abnormal behavior in the security monitoring area, obtains the warning result, and improves the efficiency of real-time warning of abnormal behavior under intelligent security.
[0058] Prior art (CN119355667A) discloses a target detection method, integrated circuit, sensor, and device. These methods perform distance-dimensional FFT on frame data; extract target data from the frame data obtained after the distance-dimensional FFT processing; window the target data using a sliding window, and perform digital signal processing on the windowed data. The sliding window length corresponds to a duration of the same order of magnitude as the period of the target's periodic motion. Through multi-frame joint processing technology, a target detection solution is implemented in spatial areas such as vehicle cabins, indoor spaces, and factory buildings. This effectively improves detection rates, reduces the number of false alarms, and significantly enhances the accuracy of angle estimation. This allows for the precise detection of special or weak targets such as infants and young children within the cabin, enabling applications such as CPD and SBR.
[0059] However, the above-mentioned existing technologies are unable to solve the technical defects of the existing target detection model post-processing methods, which are prone to false detection (e.g., due to factors such as changes in ambient lighting) and missed detection (e.g., prone to missed detection in complex scenarios).
[0060] In response to the problems of the existing technology, the present invention provides a dynamic threshold alarm method based on hierarchical counting, which introduces a nonlinear attenuation function. Compared with simply resetting the counter, it can better adapt to the scene of temporary target occlusion. It uses logarithmic accelerated accumulation to enhance the detection confidence of persistent targets. Combining the alarm level threshold and detection continuity can effectively reduce the impact of short-term occasional false detections.
[0061] Figure 1 A flowchart of a dynamic threshold alarm method based on hierarchical counting according to an embodiment of the present invention is shown.
[0062] like Figure 1 As shown, in step S1, the persistence parameter corresponding to each detection category is determined based on the target detection result.
[0063] Specifically, the video stream to be detected is input into the target detection model. After target detection, the target detection model outputs the target detection result.
[0064] Furthermore, target detection models include but are not limited to: YOLOv10, EfficientDet, RetinaNet, DETRv2, CenterNet++, FCOS, Swin Transformer, DINO, ViTAE, and BEiT.
[0065] It should be noted that, in practical applications, the target detection model to be used can be determined according to specific needs, and the present invention does not limit the type of target detection model.
[0066] In one embodiment, in step S1, the target detection results are analyzed to determine the detection categories in the target detection results at the current moment, so as to group each detection category, determine the detected categories and the undetected categories, and then calculate and update the persistence parameters corresponding to the detected categories and the undetected categories respectively.
[0067] Specifically, the persistence parameters include: detection parameters and missed detection parameters.
[0068] In one embodiment, in step S1, for the detected category, the persistence parameter is calculated using the following expression:
[0069] m t =m t-1 +1 (1)
[0070] n t=0 (2)
[0071] Where: m t Represents the detection parameters at time t; m t-1 Indicates the detection parameters at time t-1; n t Indicates the missed detection parameter at time t.
[0072] In one embodiment, in step S1, for the undetected category, the persistence parameter is calculated using the following expression:
[0073] m t =0 (3)
[0074] n t =n t-1 +1 (4)
[0075] Where: n t-1 Indicates the missed detection parameter at time t-1.
[0076] The present invention determines the persistence parameter corresponding to each detection category through step S1, while taking into account the effects of continuous detection and continuous missed detection, which can reduce the probability of false alarms and missed detections and improve detection accuracy.
[0077] like Figure 1 As shown, in step S2, the counter corresponding to each detection category is updated according to the persistence parameter to obtain a real-time count value.
[0078] In one embodiment, in step S2, a real-time count value corresponding to the detected category is calculated based on the detection parameters through a forward accumulation expression.
[0079] Furthermore, a nonlinear logarithmic counting strategy is implemented for the continuous detection target. During continuous detection, the counter is updated by the forward accumulation expression:
[0080]
[0081] Where: C t Indicates the real-time count value at time t; C t-1 Indicates the real-time count value at time t-1; Represents the ceiling function.
[0082] In one embodiment, in step S2, the real-time count value corresponding to the undetected category is calculated based on the missed detection parameter by using an inverse decay expression.
[0083] Furthermore, when a missed detection occurs, a nonlinear decay mechanism is executed and the counter is updated by the inverse decay expression:
[0084]
[0085] Where: C t Indicates the real-time count value at time t; C t-1 Indicates the real-time count value at time t-1; represents the rounding function; γ represents the attenuation base, and a larger value indicates a greater penalty for missed detection; k represents the attenuation coefficient, and a larger value indicates a faster attenuation.
[0086] The present invention configures a dedicated counter for each detection category in step S2 to achieve temporal detection of the category dimension, and adopts a logarithmic acceleration accumulation expression (5) to enhance the detection confidence of the persistent target. It also introduces a nonlinear attenuation function expression (6), which is more adaptable to the target's temporary occlusion scenario than simply resetting the counter.
[0087] like Figure 1 As shown, in step S3, the detection level corresponding to the detection category is determined by sliding the window range, combining the real-time count value and the preset threshold.
[0088] Specifically, the present invention provides a sliding window monitoring mechanism that maintains an N-second ring count buffer. After an alarm, the counter is reset to zero to prevent frequent alarms. It should be noted that the value of N should be set based on actual project needs; the present invention does not impose any restrictions on the range of the sliding window value N. For example, in a security monitoring scenario, N can be set to 30 seconds.
[0089] Furthermore, for the real-time count values of the counters corresponding to different detection categories calculated in step S2, the timer can be progressively updated at the frame level using the following expression:
[0090] C t =α×C t-1 +β×D t (7)
[0091] Where: C t Indicates the real-time count value at time t; C t-1 represents the real-time count value at time t-1; α represents the memory decay coefficient. A larger value indicates more emphasis on historical counts, while a smaller value indicates more emphasis on current counts; β represents the current frame detection coefficient. A larger value indicates more emphasis on current counts, while a smaller value indicates more emphasis on historical counts; D t Denotes the detection judgment coefficient, D t ∈{0,1},D t =1, indicating that the target is detected at time t, D t =0, indicating that no target is detected at time t.
[0092] In one embodiment, the preset thresholds include: a missed detection threshold, an alarm threshold, a attention threshold, and a warning threshold, wherein the alarm threshold>the attention threshold>the warning threshold.
[0093] Specifically, the present invention provides three levels of detection: Level 1, Level 2, and Level 3, corresponding to low, medium, and high severity warning levels. The present invention also provides corresponding trigger thresholds for each detection level. Specifically, Level 1 corresponds to the warning threshold, Level 2 corresponds to the caution threshold, and Level 3 corresponds to the alarm threshold.
[0094] The present invention adopts a dynamic and adaptive counter update counting mechanism through step S3 to ensure the accuracy of risk warning, and combined with the alarm level threshold and detection continuity, it can effectively reduce the impact of short-term occasional false detections. In addition, the ring buffer design set by the present invention makes the memory usage constant within 5MB (calculated based on 100 detection categories), which takes up little memory.
[0095] Figure 2 A flowchart of a dynamic threshold alarm method based on hierarchical counting according to another embodiment of the present invention is shown.
[0096] like Figure 2 As shown, in step S1, the persistence parameter corresponding to each detection category is determined based on the target detection result.
[0097] In one embodiment, Figure 2 As shown, in step S1, the video stream to be detected is first input into the target detection model, the target detection result is output, the target detection result is analyzed and the persistence parameter corresponding to each detection category is determined through steps S11 and S12.
[0098] Step S11: Update the grouping result of each detection category based on the target detection result, where the grouping result includes detected categories and undetected categories.
[0099] Specifically, if Figure 2 As shown, taking detection category A as an example, if the target detection result at the current time t points to detection category A, detection category A is assigned as the detected category; if the target detection result at the current time t does not point to detection category A, detection category A is assigned as the undetected category, and so on, each detection category is grouped.
[0100] Step S12: Calculate persistence parameters corresponding to the detected category and the undetected category respectively, wherein the persistence parameters include detection parameters and missed detection parameters.
[0101] Specifically, the detection parameters and missed detection parameters corresponding to the detected categories are calculated using expressions (1) to (2), and the detection parameters and missed detection parameters corresponding to the undetected categories are calculated using expressions (3) to (4).
[0102] like Figure 2As shown, in step S2, the counter corresponding to each detection category is updated according to the persistence parameter to obtain a real-time count value.
[0103] Specifically, the real-time count value corresponding to the detected category is calculated by expression (5), and the real-time count value corresponding to the undetected category is calculated by expression (6).
[0104] like Figure 2 As shown, in step S3, the detection level corresponding to the detection category is determined by sliding the window range, combining the real-time count value and the preset threshold.
[0105] In one embodiment, Figure 2 As shown, in step S3, the detection level corresponding to the detection category is determined through steps S31 and S36.
[0106] Step S31: Determine whether the current time is within the sliding window range. If so, proceed to step S32 or S33; if not, proceed to step S36. Specifically, determine whether the current time is within the N-second sliding window range. If so, proceed to the next step (step S32 or S33); otherwise, proceed to step S36 to reset all counters.
[0107] In step S32, for the undetected category, determine whether the real-time count value meets the missed detection threshold (e.g., missed detection threshold = 3 consecutive frames). If so, proceed to step S36; if not, return to step S1. Specifically, for the undetected category, the present invention implements a nonlinear attenuation mechanism through expression (6). When missed detections occur continuously, the real-time count value exhibits a nonlinear attenuation trend. When the missed detection threshold is met, indicating that the current detected category has missed detections for 3 consecutive frames, it is necessary to proceed to step S36 to reset the counter for the current detected category.
[0108] In step S33, for the detected category, it is determined whether the real-time count value is less than the alarm threshold (e.g., alarm threshold = 8). If so, the process proceeds to step S34. If not, the detection level is recorded as the third level and the process proceeds to step S36. Specifically, for the detected category, the present invention implements nonlinear positive accumulation through expression (5). When continuous detection occurs, the real-time count value shows a nonlinear growth trend. When it increases to the alarm threshold, it indicates that the current detection category has been detected multiple times in a row and is in a high-risk state. In this case, a third-level alarm needs to be triggered. After the alarm, the process proceeds to step S36 to reset the counter of the current detection category to prevent continuous alarms in a short period of time.
[0109] Step S34: Determine whether the real-time counter value is less than the caution threshold (e.g., caution threshold = 5). If so, proceed to step S35. If not, record the detection level as the second level and return to step S1. Specifically, for the detected category, if the real-time counter is determined to be less than the alarm threshold in step S33, then in step S34, further determine whether the real-time counter value is less than the caution threshold. If the real-time counter value is greater than or equal to the caution threshold and less than the alarm threshold, it indicates that the current detection category is in a medium-risk state, and a second-level alarm needs to be triggered. After the alarm is triggered, proceed to step S1 to continue testing the current detection category.
[0110] Step S35: Determine whether the real-time counter value is less than the warning threshold (e.g., warning threshold = 3). If so, return to step S1. If not, record the detection level as level 1 and return to step S1. Specifically, for the detected category, if the real-time counter value is less than the caution threshold in step S34, then in step S35, further determine whether the real-time counter value is less than the warning threshold. If the real-time counter value is greater than or equal to the warning threshold and less than the caution threshold, it indicates that the current detection category is in a low-risk state, and a level 1 alarm needs to be triggered. After the alarm, enter step S1 to continue testing the current detection category.
[0111] Step S36: reset the counter corresponding to each detection category and return to step S1. Specifically, the reset method can clear the current counter value to zero and can also take into account the current time and historical time at the same time to achieve progressive update through expression (7).
[0112] The present invention triggers a high-risk alarm through triple verification conditions that must be met at the same time: being within the sliding window and the cumulative count reaching the threshold for triggering the alarm, which can effectively reduce the frequency of false detection and missed detection and improve the efficiency and accuracy of detection.
[0113] Figure 3 A timing diagram according to one embodiment of the present invention is shown.
[0114] In order to simplify the description process, it is assumed that the missed detection threshold = 3 consecutive frames, the warning threshold = 3, the attention threshold = 5, the alarm threshold = 8, the attenuation coefficient k = 1, and the attenuation base γ = 0.5. The timing process is as follows: Figure 3 shown.
[0115] like Figure 3As shown, in frame 1, the target detection result points to detection category A and does not point to detection category B. At this time, detection category A is marked as a detected category and detection category B is marked as an undetected category. The A category detection parameter is updated to 1 and the missed detection parameter is updated to 0 through expressions (1) to (2). The B category detection parameter is updated to 0 and the B missed detection parameter is updated to 1 through expressions (3) to (4). The real-time count value of detection category A is calculated to be 0 according to expression (5), and the real-time count value of detection category B is calculated to be 0 according to expression (6).
[0116] like Figure 3 As shown, in frame 2, the target detection result points to detection category A and does not point to detection category B. At this time, detection category A is marked as a detected category and detection category B is marked as an undetected category. The A category detection parameter is updated by expressions (1) to (2) = 2 and the missed detection parameter is updated by expressions (3) to (4). The B category detection parameter is updated by expressions (3) to (4) = 0 and the B category missed detection parameter is updated by expressions (3). The real-time count value of detection category A is calculated by expression (5) = 1, and the real-time count value of detection category B is calculated by expression (6) = 0.
[0117] like Figure 3 As shown, in frame 3, the target detection result points to detection category A and detection category B. At this time, detection category A and detection category B are marked as detected categories. The A category detection parameter = 3, the A category missed detection parameter = 0, the B category detection parameter = 1, and the B category missed detection parameter = 0 are updated through expressions (1) to (2). According to expression (5), the real-time count value of detection category A is calculated to be 3, and the real-time count value of detection category B is calculated to be 0. At this time, detection category A reaches the warning threshold and triggers the first level alarm.
[0118] like Figure 3 As shown, in frame 4, the target detection result points to detection category A and does not point to detection category B. At this time, detection category A is marked as a detected category and detection category B is marked as an undetected category. The A category detection parameter is updated to 4 and the missed detection parameter is updated to 0 through expressions (1) to (2). The B category detection parameter is updated to 0 and the B missed detection parameter is updated to 1 through expressions (3) to (4). The real-time count value of detection category A is calculated to be 5 according to expression (5), and the real-time count value of detection category B is calculated to be 0 according to expression (6). At this time, detection category A reaches the attention threshold and triggers the second level alarm.
[0119] like Figure 3As shown, in frame 5, the target detection result points to detection category A and does not point to detection category B. At this time, detection category A is marked as a detected category and detection category B is marked as an undetected category. The A category detection parameter is updated by expressions (1) to (2) to be 5 and the missed detection parameter is updated by expressions (3) to (4). The B category detection parameter is updated by expressions (3) to (4) to be 0 and the B category missed detection parameter is updated by expressions (3) to (4). The real-time count value of detection category A is calculated by expression (5) to be 8, and the real-time count value of detection category B is calculated by expression (6) to be 0. At this time, detection category A reaches the alarm threshold, triggering the third level alarm and clearing the counter of detection category A.
[0120] like Figure 3 As shown, in frame 6, the target detection result does not point to detection category A and detection category B, then detection category A and detection category B are marked as undetected categories. The A category detection parameter = 0, missed detection parameter = 1, B category detection parameter = 0, and B category missed detection parameter = 3 are updated through expressions (3) to (4). According to expression (6), the real-time count value of detection category A = 0 and the real-time count value of detection category B = 0 are calculated.
[0121] like Figure 3 As shown, in frame 7, the target detection result points to detection category A and detection category B. At this time, detection category A and detection category B are marked as detected categories. The A category detection parameter = 1, the A category missed detection parameter = 0, the B category detection parameter = 1, the B category missed detection parameter = 0 are updated through expressions (1) to (2). According to expression (5), the real-time count value of detection category A = 0, and the real-time count value of detection category B = 0 are calculated.
[0122] like Figure 3 As shown, in frame 8, the target detection result points to detection category A and detection category B. At this time, detection category A and detection category B are marked as detected categories. The detection parameter of category A = 2, the missed detection parameter of category A = 0, the detection parameter of category B = 2, the missed detection parameter of category B = 0 are updated through expressions (1) to (2). According to expression (5), the real-time count value of detection category A = 1, and the real-time count value of detection category B = 1 are calculated.
[0123] like Figure 3 As shown, in frame 9, the target detection result points to detection category B, but not to detection category A. At this time, detection category A is marked as an undetected category, and detection category B is marked as a detected category. The A category detection parameter is updated to 0 and the A category missed detection parameter is updated to 1 through expressions (3) to (4). The B category detection parameter is updated to 3 and the B category missed detection parameter is updated to 0 through expressions (1) to (2). The real-time count value of detection category A is calculated to be 0 according to expression (6), and the real-time count value of detection category B is calculated to be 3 according to expression (5). At this time, detection category B reaches the warning threshold, triggering the first level alarm.
[0124] like Figure 3 As shown, in frame 10, the target detection result points to detection category B, but not to detection category A. At this time, detection category A is marked as an undetected category, and detection category B is marked as a detected category. The A category detection parameter is updated by expressions (3) to (4), and the A category missed detection parameter is updated by expressions (1) to (2), and the B category missed detection parameter is updated by expressions (1) to (2). The real-time count value of detection category A is calculated to be 0 according to expression (6), and the real-time count value of detection category B is calculated to be 5 according to expression (5). At this time, detection category B reaches the attention threshold, triggering the second level alarm.
[0125] like Figure 3 As shown, in frame 11, the target detection result does not point to detection category A and detection category B, then detection category A and detection category B are marked as undetected categories, and the A category detection parameter = 0, the A category missed detection parameter = 3, the B category detection parameter = 0, the B category missed detection parameter = 1 are updated through expressions (3) to (4). According to expression (6), the real-time count value of detection category A = 0, and the real-time count value of detection category B = 4 are calculated.
[0126] like Figure 3 As shown, in frame 12, the target detection result does not point to detection category A and detection category B, then detection category A and detection category B are marked as undetected categories, and the A category detection parameter = 0, the A category missed detection parameter = 4, the B category detection parameter = 0, the B category missed detection parameter = 2 are updated through expressions (3) to (4). According to expression (6), the real-time count value of detection category A is calculated to be 0, and the real-time count value of detection category B is calculated to be 1.
[0127] In this process, if the detection category B belongs to the category prone to false detection, it can be seen from the timing diagram that the use of the present invention can effectively reduce false alarms and improve the reliability and availability of the system.
[0128] Field tests have verified that this invention reduces the system's false alarm rate by approximately 65%, while increasing alarm accuracy to over 92% while maintaining baseline target detection accuracy. In particular, system stability improves by 40% in scenarios with sudden changes in illumination. Furthermore, when detecting 20 types of objects, memory usage increases by less than 5MB, demonstrating significant engineering value.
[0129] The dynamic threshold alarm method based on hierarchical counting provided by the present invention may also be used in conjunction with a computer-readable storage medium having a computer program stored thereon. The computer program is executed to implement the dynamic threshold alarm method based on hierarchical counting. The computer program is capable of executing computer instructions, which include computer program code. The computer program code may be in source code form, object code form, an executable file, or some intermediate form.
[0130] Computer-readable storage media may include: any entity or device that can carry computer program code, recording media, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0131] It should be noted that the content contained in computer-readable storage media can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable storage media do not include electrical carrier signals and telecommunications signals.
[0132] According to another aspect of the present invention, a dynamic threshold alarm system based on hierarchical counting is provided, which implements a dynamic threshold alarm method based on hierarchical counting. The system includes: a target detection model, a persistence module, a real-time counting module, and a detection level module.
[0133] In one embodiment, the target detection model is used to output the target detection results; the persistence module is used to determine the persistence parameters corresponding to each detection category based on the target detection results; the real-time counting module is used to update the counter corresponding to each detection category according to the persistence parameters to obtain a real-time count value; the detection level module is used to determine the detection level corresponding to the detection category through a sliding window range, combined with the real-time count value and a preset threshold.
[0134] In summary, the present invention provides a dynamic threshold alarm method based on hierarchical counting, which has the following advantages over the existing technology:
[0135] 1) The present invention proposes a multi-category independent counting mechanism, configuring a dedicated counter for each detection target category to achieve temporal detection in the category dimension, thereby improving detection accuracy and efficiency.
[0136] 2) The present invention proposes a three-level detection level, establishes a low, medium and high three-level cumulative alarm threshold architecture, and forms a corresponding three-level response strategy of warning, attention and alarm.
[0137] 3) The present invention proposes a sliding window verification, which uses a sliding window of length N seconds for continuous verification. An alarm is triggered if and only if the target's continuous detection count reaches the alarm threshold within the window period.
[0138] It should be understood that the embodiments disclosed herein are not limited to the specific structures, processing steps, or materials disclosed herein, but should extend to equivalent substitutions of these features understood by those skilled in the relevant art. It should also be understood that the terminology used herein is for the purpose of describing specific embodiments only and is not intended to be limiting.
[0139] In the description of the present invention, unless otherwise specified, "plurality" means two or more; terms such as "upper," "lower," "left," "right," "inner," "outer," "front end," "rear end," "head," and "tail" indicate positions or relationships based on those shown in the accompanying drawings. These terms are intended solely to facilitate the description of the present invention and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limiting the present invention. Furthermore, terms such as "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0140] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "connected" and "connection" should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integral connection; mechanical connection, electrical connection; direct connection, or indirect connection through an intermediary. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0141] Certain terms are used throughout this application document to indicate specific system components. As will be appreciated by those skilled in the art, different names may be used to indicate the same component, and thus this application document is not intended to distinguish between components that are only different in name but not in function. In this application document, the terms "comprise," "include," and "have" are used in an open format and should therefore be interpreted as meaning "including, but not limited to...". In addition, the terms "substantially," "substantially," or "approximately" that may be used herein refer to industry-accepted tolerances for the corresponding terms. The term "coupling," as used herein, includes direct coupling and indirect coupling via another component, element, circuit, or module, wherein for indirect coupling, the intervening component, element, circuit, or module does not change the information of the signal but can adjust its current level, voltage level, and / or power level. Inferred coupling (e.g., one element is coupled to another element by inference) includes direct and indirect coupling between two elements in the same manner as "coupling."
[0142] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, appearances of the phrases "one embodiment" or "an embodiment" in various places throughout this specification do not necessarily refer to the same embodiment.
[0143] The embodiments of the present invention are presented for purposes of illustration and description and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those skilled in the art. The embodiments are chosen and described in order to better illustrate the principles of the invention and its practical application and to enable those skilled in the art to understand the invention and design various embodiments with various modifications as suited for specific applications.
[0144] Although the embodiments disclosed herein are as described above, the contents described herein are merely embodiments for facilitating understanding of the present invention and are not intended to limit the present invention. Any person skilled in the art of the present invention may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed herein. However, the scope of patent protection of the present invention shall still be subject to the scope defined by the appended claims.
Claims
1. A dynamic threshold alarm method based on hierarchical counting, characterized in that: The method comprises the following steps: S1. Determine the persistence parameter corresponding to each detection category based on the target detection results; S2. updating the counter corresponding to each detection category according to the persistence parameter to obtain a real-time count value; S3. Determine the detection level corresponding to the detection category by sliding the window range, combining the real-time count value and a preset threshold.
2. The method according to claim 1, wherein Step S1 includes: updating a grouping result of each of the detection categories according to the target detection result, wherein the grouping result includes a detected category and an undetected category; The persistence parameters corresponding to the detected category and the undetected category are calculated respectively, wherein the persistence parameters include a detection parameter and a missed detection parameter.
3. The method according to claim 2, wherein The persistence parameter of the detected class is calculated by the following expression: m t =m t-1 +1 n t =0 Where: m t Represents the detection parameters at time t; m t-1 Indicates the detection parameters at time t-1; n t Indicates the missed detection parameter at time t.
4. The method according to claim 3, wherein The persistence parameter of the undetected category is calculated by the following expression: m t =0 n t =n t-1 +1 Where: n t-1 Indicates the missed detection parameter at time t-1.
5. The method according to claim 4, wherein Step S2 includes: According to the detection parameters, the real-time count value corresponding to the detected category is calculated by using a forward cumulative expression; The real-time count value corresponding to the undetected category is calculated based on the missed detection parameter and through an inverse decay expression.
6. The method according to claim 5, wherein The forward cumulative expression is: The inverse decay expression: Where: C t Indicates the real-time count value at time t; C t-1 Indicates the real-time count value at time t-1; represents the rounding function; γ represents the attenuation base; k represents the attenuation coefficient.
7. The method according to claim 5 or 6, wherein: The preset thresholds include: a missed detection threshold, an alarm threshold, a attention threshold, and a warning threshold, wherein the alarm threshold>the attention threshold>the warning threshold.
8. The method according to claim 7, wherein Step S3 includes: S31, determine whether the current moment is within the sliding window range, if so, proceed to step S32 or S33, if not, proceed to step S36; S32, for the undetected category, determining whether the real-time count value meets the missed detection threshold; if so, proceeding to step S36; if not, returning to step S1; S33, for the detected category, determining whether the real-time count value is less than the alarm threshold; if so, proceeding to step S34; if not, recording the detection level as the third level and proceeding to step S36; S34, determining whether the real-time count value is less than the attention threshold, if so, proceeding to step S35, if not, recording the detection level as the second level and returning to step S1; S35, determining whether the real-time count value is less than the warning threshold; if so, returning to step S1; if not, recording the detection level as the first level and returning to step S1; S36: Reset the counter corresponding to each detection category, and return to step S1.
9. A storage medium, characterized in that: It contains a series of instructions for executing the method steps according to any one of claims 1 to 8.
10. A dynamic threshold alarm system based on hierarchical counting, characterized in that: The method according to any one of claims 1 to 8 is performed, wherein the system comprises: A target detection model, which is used to output the target detection result; A persistence module, which is used to determine the persistence parameters corresponding to each detection category based on the target detection results; A real-time counting module, configured to update a counter corresponding to each detection category according to the persistence parameter to obtain a real-time counting value; The detection level module is used to determine the detection level corresponding to the detection category through a sliding window range, combined with the real-time count value and a preset threshold.
Citation Information
Patent Citations
Target detection method, integrated circuit, sensor and equipment
CN119355667A
Intelligent monitoring platform and method based on AI vision
CN119625651A
Abnormal behavior real-time early warning method and system based on intelligent security and protection
CN119672933A