Artificial intelligence target detection method and device based on dynamic threshold adaptive adjustment
By dynamically adjusting the target detection threshold, the problems of low environmental adaptability, high error rate, and resource waste caused by fixed thresholds in existing technologies are solved, thus achieving efficient and accurate target detection.
Patent Information
- Application Number
- CN202411971774.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Existing target detection methods suffer from low environmental adaptability, high error rate, low efficiency, and waste of resources due to fixed thresholds.
An AI-based target detection method with dynamic threshold adaptive adjustment is adopted. By initializing a time window queue, recording the time interval of target detection data, calculating the mean, and dynamically adjusting the threshold according to the mean and time interval, the target detection process is optimized.
It improves the accuracy and efficiency of target detection, avoids false detections and missed detections, optimizes computing resources, adapts to a variety of complex detection scenarios, and has good adaptability and scalability.
Smart Images

Figure CN119888268B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to an artificial intelligence target detection method and apparatus based on dynamic threshold adaptive adjustment. Background Technology
[0002] Object detection is one of the core tasks in computer vision, aiming to identify and locate target objects in images or videos. In practical applications, object detection models process input images through neural networks and output information such as target location, category, and confidence level.
[0003] Most existing object detection methods rely on fixed thresholds to determine whether an object is a valid detection. These methods set a fixed confidence threshold when processing objects in an image; only detection boxes with a confidence score higher than this threshold are considered valid objects. Many common object detection algorithms typically use a preset fixed threshold to filter the candidate boxes output by the model.
[0004] However, using a fixed threshold for target identification is difficult to adapt to changes in different scenes and environments. For example, changes in lighting, image noise, and target density can all affect the detection performance. In complex scenes, using a fixed threshold may lead to false positives or false negatives. On the other hand, traditional target detection methods cannot automatically adjust the threshold according to real-time environmental changes. When the detection scene changes, the fixed threshold is no longer applicable, resulting in reduced detection performance and an inability to effectively adapt to environmental changes. Furthermore, because a fixed threshold is used, the target detection model needs to process all candidate boxes regardless of whether they are valid targets, which wastes computational resources, especially when there are many low-confidence detection boxes. On the other hand, existing methods usually use a globally fixed threshold to adapt to all targets, which is difficult to handle complex tasks with large differences in target shape, size, and category, especially when there are many types of targets in the scene and a lot of background noise, leading to a decrease in accuracy.
[0005] In summary, existing object detection methods suffer from low environmental adaptability, high error rates, low efficiency, and resource waste due to fixed thresholds. Therefore, how to dynamically adjust the object detection threshold according to different scenarios to improve detection performance has become a key problem that urgently needs to be solved in object detection. Summary of the Invention
[0006] The present invention aims to solve the problems of low environmental adaptability, high error rate, low efficiency and waste of resources in the above-mentioned prior art target detection due to fixed threshold, and provides an artificial intelligence target detection method and device based on dynamic threshold adaptive adjustment.
[0007] This invention provides an artificial intelligence target detection method based on dynamic threshold adaptive adjustment, comprising the following steps:
[0008] Preprocessing: Initialize the time window queue; wherein, the time window queue includes multiple elements;
[0009] Data is collected through a pre-set acquisition module to obtain target detection data;
[0010] The target detection module receives the target detection data and records the time interval between the target detection data and the previous target detection data.
[0011] Update the time window queue according to the time interval;
[0012] Calculate the mean of the time window queue; wherein the mean is the average of all elements in the time window queue;
[0013] Determine whether to adjust the preset time window threshold based on the mean value;
[0014] If so, the threshold is dynamically adjusted based on the mean and the time interval to obtain the adjustment threshold;
[0015] Target detection is performed based on the adjusted threshold to obtain the detection results;
[0016] The detection results are post-processed and displayed on a preset screen.
[0017] Furthermore, the preprocessing step of initializing the time window queue includes:
[0018] Fill the time window queue.
[0019] Furthermore, the step of filling the time window queue includes:
[0020] The time window queue is filled with a preset maximum time window value.
[0021] Furthermore, before the step of receiving the detection target and recording the time interval between the detection target and the previous detection target, the method includes:
[0022] Determine whether the target confidence level of the detected target is greater than a preset confidence threshold;
[0023] If so, the time interval between the current detection time of the target and the previous target detection time is recorded, and the detection target is transmitted.
[0024] Furthermore, before the step of determining whether the target confidence of the detected target is greater than a preset confidence threshold, the following steps are included:
[0025] The detection target is subjected to data preprocessing; the data preprocessing includes, but is not limited to, size adjustment, color space conversion, noise reduction and grayscale conversion;
[0026] The confidence score of each detected target is calculated using a preset target detection algorithm.
[0027] Furthermore, the step of updating the time window queue according to the time interval includes:
[0028] The tail of the time window queue is updated according to the time interval; wherein the time interval includes a minimum time window value and a maximum time window value.
[0029] Furthermore, the step of updating the tail of the time window queue according to the time interval includes:
[0030] Determine whether the time interval is greater than the maximum time window value;
[0031] If so, then add an integer representing the maximum time window value to the end and reset the time interval;
[0032] If not, then the time interval is filled into the time window queue.
[0033] Furthermore, the step of determining whether to adjust the preset time window threshold based on the mean includes:
[0034] Compare the mean with the time window threshold;
[0035] If the mean is greater than the time window threshold, no adjustment is made;
[0036] If the mean is less than the time window threshold, then the time window threshold is adjusted to obtain the adjusted threshold.
[0037] Furthermore, the step of adjusting the time window threshold to obtain an adjusted threshold if the mean is less than the time window threshold includes:
[0038] The formula for adjusting the time window threshold is:
[0039]
[0040] Wherein, new_threshold represents the adjustment threshold, default_threshold represents the confidence threshold, mean represents the mean value, WINDOW_THRESH represents the time window threshold, and WINDOW_VALUE_MIN represents the minimum time window value.
[0041] This invention also provides an artificial intelligence target detection device based on dynamic threshold adaptive adjustment, comprising:
[0042] The data acquisition module is used to collect data to obtain target detection data;
[0043] The preprocessing module is used to initialize the time window queue;
[0044] The target detection module is used to receive the target detection data, record the time interval between the target detection data and the previous target detection data, and perform target detection according to the adjustment threshold to obtain the detection result;
[0045] An update module is used to update the time window queue according to the time interval;
[0046] The mean calculation module is used to calculate the mean of the time window queue;
[0047] The first judgment module is used to determine whether to adjust the preset time window threshold based on the mean value;
[0048] A dynamic threshold adjustment module is used to dynamically adjust the threshold based on the mean and the time interval if the condition is met, to obtain an adjusted threshold.
[0049] The post-processing module is used to perform post-processing on the detection results;
[0050] The display module is used to present the detection results on a preset display screen.
[0051] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program and the processor executes the computer program to implement the steps in any of the above methods.
[0052] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above methods.
[0053] This invention provides an artificial intelligence target detection method and apparatus based on dynamic threshold adaptive adjustment, which has the following beneficial effects:
[0054] Optimizing target detection through adaptive threshold adjustment allows for dynamic adjustment of the threshold, avoiding false positives and false negatives, and improving the accuracy and precision of target detection. Based on a time window queue mechanism, the threshold can be adaptively adjusted to adapt to the needs of different environments and time periods. It can filter targets with low confidence levels, avoiding redundant calculations, improving efficiency, optimizing computational resources, and preventing resource waste. It can adapt to various complex target detection scenarios, possessing strong adaptability, scalability, and broad application prospects. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the method steps of the artificial intelligence target detection method based on dynamic threshold adaptive adjustment in this invention;
[0056] Figure 2 This is a structural block diagram of the artificial intelligence target detection device based on dynamic threshold adaptive adjustment in this invention;
[0057] Figure 3 This is a structural block diagram of a computer device according to the present invention;
[0058] Figure 4 This is a flowchart illustrating an embodiment of the AI target detection method based on dynamic threshold adaptive adjustment of the present invention.
[0059] Figure 5 This is a schematic diagram illustrating an actual operation of an embodiment of the AI target detection method based on dynamic threshold adaptive adjustment according to the present invention.
[0060] Labeling description: Acquisition module 10, Preprocessing module 20, Target detection module 30, Update module 40, Mean calculation module 50, First judgment module 60, Dynamic threshold adjustment module 70, Postprocessing module 80, Display module 90. Detailed Implementation
[0061] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0062] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0063] Reference Appendix Figure 1 This is an embodiment of an artificial intelligence target detection method based on dynamic threshold adaptive adjustment, comprising:
[0064] S1, Preprocessing: Initialize the time window queue; where the time window queue includes multiple elements;
[0065] S2, data is collected through the preset acquisition module 10 to obtain target detection data;
[0066] S3, receive target detection data through the preset target detection module 30, and record the time interval between the target detection data and the previous target detection data;
[0067] S4, Update the time window queue according to the time interval;
[0068] S5, calculate the mean of the time window queue; where the mean is the average of all elements in the time window queue;
[0069] S6, determine whether to adjust the preset time window threshold based on the mean;
[0070] S7, if so, then dynamically adjust the threshold based on the mean and time interval to obtain the adjustment threshold;
[0071] S8, Target detection is performed based on the adjusted threshold to obtain the detection result;
[0072] S9 performs post-processing on the detection results and displays them on a preset screen.
[0073] In the above steps, the time window queue is first preprocessed. This queue contains multiple elements, representing the time interval during target detection. Each element is an integer between the minimum and maximum time window values. Specifically, the dynamic threshold adaptive adjustment mechanism is based on a time window queue of size `WINDOW_MAX_LENGTH`. The elements of this queue are integers between `WINDOW_VALUE_MIN` and `WINDOW_VALUE_MAX`, representing the time interval for target detection. This queue records the time intervals in target detection and dynamically adjusts the threshold based on these intervals. Next, target detection data is obtained through a pre-set acquisition module 10. The target detection module 30 receives the target detection data and records the time interval between the current target detection data and the previous target detection data. The time window queue is then updated based on the time intervals. The mean of the time window queue is then calculated, where the mean is the average of all elements in the queue. The time window threshold is adjusted based on the mean; if so, the threshold is dynamically adjusted according to the mean and the time intervals to obtain the adjusted threshold. Next, target detection is performed based on the threshold to obtain the detection results. Finally, the detection results are post-processed and displayed on a preset display screen.
[0074] This application sets up a time window queue mechanism to dynamically adjust the threshold of target detection. The threshold is adjusted according to the real-time feedback of target detection, thereby improving the accuracy and robustness of target detection. Robustness refers to the ability to maintain stable operation when faced with changes in internal structure or external environment.
[0075] In one embodiment, the preprocessing step of initializing the time window queue includes:
[0076] Fill the time window queue.
[0077] The steps for filling the time window queue include:
[0078] The time window queue is filled with a preset maximum time window value.
[0079] In this embodiment, the time window queue is first initialized. That is, when the target detection program starts executing, the time window queue is first filled with an integer of value `WINDOW_VALUE_MAX`, where `WINDOW_VALUE_MAX` is the maximum time window value. In other words, the initial value of all elements in the time window queue is `WINDOW_VALUE_MAX`. At this time, the target detection time interval for each time period is `WINDOW_VALUE_MAX` seconds.
[0080] In one embodiment, before the step of receiving a detection target and recording the time interval between the detection target and the previous detection target, the method includes:
[0081] Determine whether the target confidence level of the detected target is greater than a preset confidence threshold;
[0082] If so, record the time interval between the current time of the detected target and the time of the previous target detection, and then transmit the detected target.
[0083] In this embodiment, to ensure that only high-confidence detection targets are processed and to avoid wasting resources, a filtering process is performed based on a set confidence threshold. When the confidence of a detection target is higher than the set confidence threshold, the target is identified as a valid target and labeled or transmitted to the post-processing module 80. If the confidence is lower than the set confidence threshold, the target is discarded or ignored to avoid false detections, improve target detection accuracy, reduce the processing of invalid detection boxes, and avoid wasting computational resources. In a specific embodiment, non-maximum suppression (NMS) can also be combined to further extract low-confidence boxes with high overlap, thereby improving the accuracy and efficiency of target detection.
[0084] More specifically, when a target is detected, the confidence level of the target is determined to be greater than the preset confidence level threshold default_threshold, and the time interval between the current target detection and the previous target detection is recorded.
[0085] In one embodiment, before the step of determining whether the target confidence of the detected target is greater than a preset confidence threshold, the method includes:
[0086] Data preprocessing is performed on the target to be detected; data preprocessing includes, but is not limited to, size adjustment, color space conversion, noise reduction and grayscale conversion.
[0087] The confidence score for each detected target is calculated using a pre-defined target detection algorithm.
[0088] In this embodiment, the target detection module 30 receives data from a camera or other video stream input device in real time, enabling the acquisition of high-quality image or video streams, which are then input into the target detection task. Data transmission is performed in real time to ensure rapid acquisition of image frames from the video stream. After acquiring each image frame, preprocessing is performed, including but not limited to image resizing, color space conversion, denoising, and grayscale conversion. This reduces interference in the image, improves the quality of the image data, and provides clear input for subsequent target detection algorithms.
[0089] The preprocessed image is transmitted and then analyzed according to a preset object detection algorithm. This algorithm includes YOLO (You Only Look Once), SSD (Single Shot Multibox Detector), DETR (Detection Transformer), or other learning models. After training, the model can identify various objects in the image and generate corresponding detection boxes and confidence scores. During object detection, the algorithm identifies multiple targets and calculates a confidence score for each target, representing the probability that the target belongs to a preset target category.
[0090] In one embodiment, the step of updating the time window queue according to the time interval includes:
[0091] The tail of the time window queue is updated according to the time interval, which includes the minimum time window value and the maximum time window value.
[0092] The step of updating the tail of the time window queue according to the time interval includes:
[0093] Determine if the time interval is greater than the maximum time window value;
[0094] If so, add an integer representing the maximum time window value to the end and reset the time interval;
[0095] If not, the time interval is added to the time window queue.
[0096] In this embodiment, the minimum time interval is the minimum time window value, and the maximum time window value is the maximum time window value. The minimum time window value is WINDOW_VALUE_MIN, and the maximum value is WINDOW_VALUE_MAX. If the time interval between two target detections exceeds WINDOW_VALUE_MAX seconds, an integer with the value WINDOW_VALUE_MAX is added to the time window queue. If the time interval between target detections is less than WINDOW_VALUE_MAX seconds, the actual time interval is filled into the time window queue.
[0097] In one embodiment, the step of determining whether to adjust the preset time window threshold based on the mean includes:
[0098] Compare the mean with the time window threshold;
[0099] If the mean is greater than the time window threshold, no adjustment is made;
[0100] If the mean is less than the time window threshold, then the time window threshold is adjusted to obtain the adjusted threshold.
[0101] In this embodiment, the mean is calculated, which is the average value of all elements in the time window queue. This mean is then compared to a preset time window threshold. If the mean is greater than the time window threshold (WINDOW_THRESH), no adjustment is made. If the mean is less than the time window threshold (WINDOW_THRESH), then adjustment is performed.
[0102] In one embodiment, the step of adjusting the time window threshold if the mean is less than the time window threshold, to obtain the adjusted threshold, includes:
[0103] The formula for adjusting the time window threshold is:
[0104]
[0105] Wherein, new_threshold represents the adjusted threshold, default_threshold represents the confidence threshold, mean represents the mean value, WINDOW_THRESH represents the time window threshold, and WINDOW_VALUE_MIN represents the minimum time window value.
[0106] In this embodiment, as can be seen from the formula, when the mean of the time window queue is less than WINDOW_THRESH, the time window threshold will be adjusted according to the mean, so that the time window threshold can gradually decrease as the time interval of target detection increases, thereby reducing false detections and optimizing detection accuracy.
[0107] In summary, please refer to the appendix. Figure 4In implementation, initialization begins by setting the time window queue to a size of `WINDOW_MAX_LENGTH`, filling all elements with `WINDOW_VALUE_MAX`, and setting the default target detection threshold to `default_threshold`. Next, target detection begins. Each time a target is detected, the time interval since the last detection is recorded, and the time window queue is updated. If the detection interval exceeds `WINDOW_VALUE_MAX` seconds, a `WINDOW_VALUE_MAX` integer is added to the end of the queue; otherwise, it is added to the time window queue based on the actual time interval. The mean of the time window queue is then calculated after each target detection. Finally, the time window threshold is adjusted by comparing the mean of the time window queue with the preset time window threshold. If the mean is greater than the time window threshold (`WINDOW_THRESH`), no adjustment is made, and the current threshold is maintained. If the mean is less than the time window threshold (WINDOW_THRESH), the threshold is adjusted to new_threshold according to the formula. The final result is output, and target detection continues based on the adjusted time window threshold until completion. This application uses a dynamic threshold adaptive adjustment mechanism, recording the time interval of target detection through a time window queue and dynamically adjusting the time window threshold based on the mean, which significantly improves detection accuracy. Unlike traditional fixed threshold methods, it can provide real-time feedback and adjust the time window threshold, adaptively optimizing target detection performance in different scenarios and avoiding false positives and false negatives. Furthermore, the time window threshold adjustment formula uses adaptive calculation based on the mean of the time window queue to improve efficiency and accuracy in complex environments and multi-target detection tasks. This application further improves system efficiency by filtering low-confidence detection boxes and optimizing computational resources. Simultaneously, it possesses good scalability and stability, adapting to target detection tasks of different scales and needs. This application further improves system efficiency by filtering low-confidence detection boxes and optimizing computational resources. This involves employing a dynamic confidence threshold strategy to automatically filter out detection boxes with confidence scores below a set threshold during object detection, reducing the processing of invalid detection boxes and avoiding waste of computational resources. Furthermore, non-maximum suppression (NMS) is combined to further remove low-confidence boxes with high overlap, thereby improving the accuracy and efficiency of object detection. On the other hand, by optimizing the allocation of computational resources, the computational burden is reduced while maintaining detection accuracy. Using lightweight models, such as MobileNet (an existing network) and EfficientDet (with EfficienNet as the backbone feature extraction network), for object detection significantly reduces computational load and memory consumption.This application is highly flexible and can adapt to various application scenarios, providing a high-precision and high-efficiency target detection solution that can effectively reduce computational burden and improve usability.
[0108] Reference Appendix Figure 2 An AI-based target detection device with dynamic threshold adaptive adjustment comprises: a data acquisition module 10 for acquiring data to obtain target detection data; a preprocessing module 20 for initializing a time window queue; a target detection module 30 for receiving target detection data, recording the time interval between target detection data and the previous target detection data, and performing target detection according to the adjusted threshold to obtain detection results; an update module 40 for updating the time window queue according to the time interval; a mean calculation module 50 for calculating the mean of the time window queue; a first judgment module 60 for determining whether to adjust the preset time window threshold based on the mean; a dynamic threshold adjustment module 70 for dynamically adjusting the threshold according to the mean and time interval if the threshold is adjusted; a post-processing module 80 for post-processing the detection results; a display module 90 for displaying the detection results on a preset display screen; and a second judgment module for determining the detected target. The system includes: a target confidence level check unit; a recording module, which records the time interval between the current target detection time and the previous target detection time if the target confidence level is greater than a preset confidence level threshold, and transmits the detected target; a filling unit, which fills the time window queue; a data preprocessing unit, which performs data preprocessing on the detected targets; a calculation unit, which calculates the confidence score of each detected target using a preset target detection algorithm; an update unit, which updates the tail of the time window queue according to the time interval; a first judgment unit, which judges whether the time interval is greater than the maximum time window value; an addition unit, which adds an integer of the maximum time window value to the tail if the target confidence level is greater than the maximum time window value, and resets the time interval if the target confidence level is greater than the maximum time window value; a filling unit, which fills the time interval into the time window queue if the target confidence level is less than the maximum time window threshold; a comparison unit, which compares the mean value with the time window threshold; and an adjustment unit, which adjusts the time window threshold if the mean value is less than the time window threshold to obtain an adjusted threshold.
[0109] In this embodiment, the preprocessing module 20 first initializes the time window queue, and then the filling unit fills the time window queue; next, the acquisition module 10 acquires data to obtain target detection data, and the data preprocessing unit preprocesses the detected targets; then, the calculation unit calculates the confidence score of each detected target using a target detection algorithm, and the second judgment module judges whether the target confidence score of the detected target is greater than a preset confidence threshold; next, the recording module records the time interval between the current detected target time and the previous target detection time, and transmits the detected target; the target detection module 30 receives the target detection data and records the time interval between the current target detection data and the previous target detection data; the update module... Block 40 updates the time window queue according to the time interval; the first judgment unit judges whether the time interval is greater than the maximum time window value, the addition unit adds an integer of the maximum time window value to the end and resets the time interval; the filling unit fills the time interval into the time window queue; the mean calculation module 50 calculates the mean of the time window queue; the comparison unit compares the mean with the time window threshold; if the mean is less than the time window threshold, the adjustment unit adjusts the time window threshold to obtain the adjustment threshold; the dynamic threshold adjustment module 70 dynamically adjusts the threshold according to the mean and the time interval to obtain the adjustment threshold; the target detection module 30 performs target detection according to the adjustment threshold to obtain the detection result; finally, the display module 90 presents the detection result on the preset display screen.
[0110] To ensure good scalability and stability, this application adopts a modular design, with modules decoupled through standard interfaces, enabling flexible expansion and customization, and covering a wide range of application scenarios. In another specific embodiment, this application can also accelerate the target detection process by adding hardware, such as a GPU (Graphics Processing Unit) or an NPU (Neural Processing Unit), thereby improving processing speed.
[0111] In summary, in practical implementation, this application establishes a time window queue that records the time interval of the most recent `WINDOW_MAX_LENGTH` detections. After each detection, the time window queue is updated and its mean is calculated. When the queue mean is less than a set threshold (`default_threshold`), the time window threshold for target detection (`new_threshold`) is adjusted based on the mean to adaptively respond to changes in the environment and target density. Figure 5The diagram shown is a flowchart of a specific embodiment of this application. In this flowchart, RISP src stands for Real-Time Streaming Protocol, and src represents the source code; File src represents the source code of a file; Cam src represents the source code of a computer; Resize represents the change in the size of a computer image; Padding represents the spacing between elements; cvtColor represents color space conversion; NMS represents non-maximum suppression; and Draw represents drawing.
[0112] Specifically, when the video stream is captured and processed, the device continuously updates the time window queue and dynamically adjusts the time window threshold based on the time intervals in the queue, thereby effectively improving the accuracy and efficiency of target detection. It can flexibly adjust the detection strategy based on real-time feedback, optimize target detection results, and ensure that detection accuracy is not easily affected by changes in the scene.
[0113] Reference Appendix Figure 3 This application also provides a computer device, which can be a server, and its internal structure can be as follows: Figure 3 As shown, the computer device includes a processor, memory, a network interface, and a database. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data such as templates, tables, and preset fields. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an artificial intelligence target detection method based on dynamic threshold adaptive adjustment.
[0114] The above-mentioned processor executes the above-mentioned method for retrieving policy data, including the following steps:
[0115] Preprocessing: Initialize the time window queue; the time window queue contains multiple elements;
[0116] Data is collected through the preset acquisition module 10 to obtain target detection data;
[0117] The system receives target detection data through a preset target detection module 30 and records the time interval between the target detection data and the previous target detection data.
[0118] Update the time window queue according to the time interval;
[0119] Calculate the mean of the time window queue; where the mean is the average of all elements in the time window queue.
[0120] Determine whether to adjust the preset time window threshold based on the average value;
[0121] If so, the threshold is dynamically adjusted based on the mean and time interval to obtain the adjustment threshold;
[0122] Target detection is performed based on the adjusted threshold to obtain the detection results;
[0123] The test results are post-processed and displayed on a preset screen.
[0124] In one embodiment, the preprocessing step of initializing the time window queue includes:
[0125] Fill the time window queue.
[0126] In one embodiment, the step of filling the time window queue includes:
[0127] The time window queue is filled with a preset maximum time window value.
[0128] In one embodiment, before the step of receiving a detection target and recording the time interval between the detection target and the previous detection target, the method includes:
[0129] Determine whether the target confidence level of the detected target is greater than a preset confidence threshold;
[0130] If so, record the time interval between the current time of the detected target and the time of the previous target detection, and then transmit the detected target.
[0131] In one embodiment, before the step of determining whether the target confidence of the detected target is greater than a preset confidence threshold, the method includes:
[0132] Data preprocessing is performed on the target to be detected; data preprocessing includes, but is not limited to, size adjustment, color space conversion, noise reduction and grayscale conversion.
[0133] The confidence score for each detected target is calculated using a pre-defined target detection algorithm.
[0134] In one embodiment, the step of updating the time window queue according to the time interval includes:
[0135] The tail of the time window queue is updated according to the time interval, which includes the minimum time window value and the maximum time window value.
[0136] In one embodiment, the step of updating the tail of the time window queue according to the time interval includes:
[0137] Determine if the time interval is greater than the maximum time window value;
[0138] If so, add an integer representing the maximum time window value to the end and reset the time interval;
[0139] If not, the time interval is added to the time window queue.
[0140] In one embodiment, the step of determining whether to adjust the preset time window threshold based on the mean includes:
[0141] Compare the mean with the time window threshold;
[0142] If the mean is greater than the time window threshold, no adjustment is made;
[0143] If the mean is less than the time window threshold, then the time window threshold is adjusted to obtain the adjusted threshold.
[0144] In one embodiment, the step of adjusting the time window threshold if the mean is less than the time window threshold, to obtain the adjusted threshold, includes:
[0145] The formula for adjusting the time window threshold is:
[0146]
[0147] Wherein, new_threshold represents the adjusted threshold, default_threshold represents the confidence threshold, mean represents the mean value, WINDOW_THRESH represents the time window threshold, and WINDOW_VALUE_MIN represents the minimum time window value.
[0148] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.
[0149] One embodiment of this application also provides a computer storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements an artificial intelligence target detection method based on dynamic threshold adaptive adjustment, including the following steps:
[0150] Preprocessing: Initialize the time window queue; the time window queue contains multiple elements;
[0151] Data is collected through the preset acquisition module 10 to obtain target detection data;
[0152] The system receives target detection data through a preset target detection module 30 and records the time interval between the target detection data and the previous target detection data.
[0153] Update the time window queue according to the time interval;
[0154] Calculate the mean of the time window queue; where the mean is the average of all elements in the time window queue.
[0155] Determine whether to adjust the preset time window threshold based on the average value;
[0156] If so, the threshold is dynamically adjusted based on the mean and time interval to obtain the adjustment threshold;
[0157] Target detection is performed based on the adjusted threshold to obtain the detection results;
[0158] The test results are post-processed and displayed on a preset screen.
[0159] In one embodiment, the preprocessing step of initializing the time window queue includes:
[0160] Fill the time window queue.
[0161] In one embodiment, the step of filling the time window queue includes:
[0162] The time window queue is filled with a preset maximum time window value.
[0163] In one embodiment, before the step of receiving a detection target and recording the time interval between the detection target and the previous detection target, the method includes:
[0164] Determine whether the target confidence level of the detected target is greater than a preset confidence threshold;
[0165] If so, record the time interval between the current time of the detected target and the time of the previous target detection, and then transmit the detected target.
[0166] In one embodiment, before the step of determining whether the target confidence of the detected target is greater than a preset confidence threshold, the method includes:
[0167] Data preprocessing is performed on the target to be detected; data preprocessing includes, but is not limited to, size adjustment, color space conversion, noise reduction and grayscale conversion.
[0168] The confidence score for each detected target is calculated using a pre-defined target detection algorithm.
[0169] In one embodiment, the step of updating the time window queue according to the time interval includes:
[0170] The tail of the time window queue is updated according to the time interval, which includes the minimum time window value and the maximum time window value.
[0171] In one embodiment, the step of updating the tail of the time window queue according to the time interval includes:
[0172] Determine if the time interval is greater than the maximum time window value;
[0173] If so, add an integer representing the maximum time window value to the end and reset the time interval;
[0174] If not, the time interval is added to the time window queue.
[0175] In one embodiment, the step of determining whether to adjust the preset time window threshold based on the mean includes:
[0176] Compare the mean with the time window threshold;
[0177] If the mean is greater than the time window threshold, no adjustment is made;
[0178] If the mean is less than the time window threshold, then the time window threshold is adjusted to obtain the adjusted threshold.
[0179] In one embodiment, the step of adjusting the time window threshold if the mean is less than the time window threshold, to obtain the adjusted threshold, includes:
[0180] The formula for adjusting the time window threshold is:
[0181]
[0182] Wherein, new_threshold represents the adjusted threshold, default_threshold represents the confidence threshold, mean represents the mean value, WINDOW_THRESH represents the time window threshold, and WINDOW_VALUE_MIN represents the minimum time window value.
[0183] In summary, the AI target detection method and apparatus based on dynamic threshold adaptive adjustment provided in this application optimize target detection by adaptively adjusting the threshold. This allows for dynamic adjustment of the threshold, avoiding false detections and missed detections, and improving the accuracy and precision of target detection. Furthermore, it can adaptively adjust the threshold based on a time window queue mechanism to adapt to the needs of different environments and time periods. It can also filter targets with low confidence levels, avoiding redundant calculations, improving efficiency, optimizing computational resources, and preventing resource waste. Finally, it can adapt to various complex target detection scenarios, possessing strong adaptability, scalability, and broad application prospects.
[0184] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0185] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0186] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An artificial intelligence target detection method based on dynamic threshold adaptive adjustment, characterized in that, Includes the following steps: Preprocessing: Initialize the time window queue; wherein, the time window queue includes multiple elements; Data is collected through a pre-set acquisition module to obtain target detection data; The target detection module receives the target detection data and records the time interval between the target detection data and the previous target detection data. Update the time window queue according to the time interval; Calculate the mean of the time window queue; wherein the mean is the average of all elements in the time window queue; Determine whether to adjust the preset time window threshold based on the mean value; If so, the threshold is dynamically adjusted based on the mean and the time interval to obtain the adjustment threshold; Target detection is performed based on the adjusted threshold to obtain the detection results; The detection results are post-processed and displayed on a preset screen. The step of updating the time window queue according to the time interval includes: The tail of the time window queue is updated according to the time interval; wherein the time interval includes a minimum time window value and a maximum time window value; The step of updating the tail of the time window queue according to the time interval includes: Determine whether the time interval is greater than the maximum time window value; If so, then add an integer representing the maximum time window value to the end and reset the time interval; If not, then the time interval is filled into the time window queue; The step of determining whether to adjust the preset time window threshold based on the mean includes: Compare the mean with the time window threshold; If the mean is greater than the time window threshold, no adjustment is made; If the mean is less than the time window threshold, then the time window threshold is adjusted to obtain the adjusted threshold.
2. The artificial intelligence target detection method based on dynamic threshold adaptive adjustment according to claim 1, characterized in that, The preprocessing step of initializing the time window queue includes: Fill the time window queue.
3. The artificial intelligence target detection method based on dynamic threshold adaptive adjustment according to claim 2, characterized in that, The step of filling the time window queue includes: The time window queue is filled with a preset maximum time window value.
4. The artificial intelligence target detection method based on dynamic threshold adaptive adjustment according to claim 1, characterized in that, Before the step of receiving the detection target and recording the time interval between the detection target and the previous detection target, the method includes: Determine whether the target confidence level of the detected target is greater than a preset confidence threshold; If so, the time interval between the current detection target's time and the previous detection target's time is recorded, and the detection target is transmitted.
5. The artificial intelligence target detection method based on dynamic threshold adaptive adjustment according to claim 4, characterized in that, Before the step of determining whether the target confidence of the detected target is greater than a preset confidence threshold, the following steps are included: The detection target is subjected to data preprocessing; the data preprocessing includes, but is not limited to, size adjustment, color space conversion, noise reduction and grayscale conversion; The confidence score of each detected target is calculated using a preset target detection algorithm.
6. The artificial intelligence target detection method based on dynamic threshold adaptive adjustment according to claim 4, characterized in that, The step of adjusting the time window threshold if the mean is less than the time window threshold to obtain the adjusted threshold includes: The formula for adjusting the time window threshold is: ; in, This indicates adjusting the threshold. This represents the confidence threshold; This represents the mean; This represents the time window threshold; This represents the minimum time window value.
7. An artificial intelligence target detection device based on dynamic threshold adaptive adjustment, characterized in that, include: The preprocessing module is used to initialize the time window queue; The data acquisition module is used to collect data to obtain target detection data; The target detection module is used to receive the target detection data, record the time interval between the target detection data and the previous target detection data, and perform target detection according to the adjusted threshold to obtain the detection result; An update module is used to update the time window queue according to the time interval; The mean calculation module is used to calculate the mean of the time window queue; The first judgment module is used to determine whether to adjust the preset time window threshold based on the mean value; A dynamic threshold adjustment module is used to dynamically adjust the threshold based on the mean and the time interval if the condition is met, to obtain an adjusted threshold. The post-processing module is used to perform post-processing on the detection results; The display module is used to present the detection results on a preset display screen; An update unit is used to update the tail of the time window queue according to the time interval; The first judgment unit is used to determine whether the time interval is greater than the maximum time window value; Add a unit to append an integer representing the maximum time window value to the end if the condition is met, and reset the time interval. Fill in the cell; if not, fill the time interval into the time window queue. A comparison unit is used to compare the mean with the time window threshold; An adjustment unit is used to adjust the time window threshold if the mean is less than the time window threshold, thereby obtaining an adjustment threshold.
8. 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, it implements the steps in the artificial intelligence target detection method based on dynamic threshold adaptive adjustment as described in any one of claims 1 to 6.
9. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the artificial intelligence target detection method based on dynamic threshold adaptive adjustment as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Self-adaptation burst flow detection device and detection method thereof
CN103888315A
Infrared image target detection method and system based on deep learning
CN118644723A