An artificial intelligence detection evaluation method and system for resource-constrained end-side devices
By performing video decoding and image conversion on the computer, combined with strict reuse fingerprint and cache control, the problem of incorrect reuse of detection results and cache occupation in the artificial intelligence detection and evaluation of resource-constrained edge devices is solved. This enables efficient detection task scheduling and result parsing, and supports anomaly recovery and result traceability.
Patent Information
- Application Number
- CN202611359214.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-20
Smart Images

Figure CN123138076A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an artificial intelligence detection and evaluation method and system for resource-constrained edge devices. Background Technology
[0002] With the development of artificial intelligence (AI) technology, AI algorithms such as object detection and recognition have been gradually deployed in network cameras, smart doorbells, and other edge devices. Compared with servers or high-performance computing devices, these edge devices are typically limited by processing power, memory capacity, temporary storage space, and network transmission capabilities. During the development, upgrading, and iteration of AI algorithms, it is necessary to test and evaluate different algorithm versions, model versions, or runtime configurations deployed on edge devices to determine the differences in detection results and performance for different objects.
[0003] Existing AI detection and evaluation technologies typically use test images or videos as input, obtain detection results through AI detection algorithms, and then compare these results with manually labeled data, benchmark model detection results, or other reference results to obtain corresponding algorithm evaluation results.
[0004] For example, Chinese patent application CN119169416A discloses a "method, apparatus, device, and medium for evaluating image target recognition algorithms." This method acquires target object annotation data from image test samples and simultaneously uses multiple image target recognition algorithms to identify targets in the image test samples. Then, it determines the evaluation result of each algorithm based on the comparison between the recognition data and the annotation data obtained by each algorithm, thereby achieving automated evaluation of image target recognition algorithms. This scheme primarily focuses on comparing the recognition results of multiple image target recognition algorithms and evaluating their performance.
[0005] However, when the AI algorithm under test is actually deployed on resource-constrained edge devices such as network cameras, directly sending a large number of test images or complete videos to the edge device for detection may require the device to handle multiple processing tasks, including video decoding, image caching, AI inference, and result storage. When the test video is long or the target detection frame rate is high, a large number of images will be generated, easily increasing the cache space usage and data transmission burden on the edge device. Therefore, simply addressing how to evaluate the algorithm's detection results does not solve the problem of task execution and resource control on resource-constrained edge devices under large-scale test data conditions.
[0006] For example, Chinese patent CN105677489B discloses a "Dynamic Setting System and Method for Batch Interval Size under Discrete Streaming Processing Model." This system monitors load and network traffic information in the cluster using an observation module, dynamically determines the batch interval value based on the monitoring results, and then processes the streaming data in batches according to the determined batch interval, thereby adjusting system processing latency, throughput, and load. This solution demonstrates that dynamically adjusting data processing batches based on system load status is a feasible resource scheduling method.
[0007] For example, Chinese patent application CN113434303A discloses a "batch processing remote sensing image intelligent processing model prediction performance optimization system and method", which merges the preprocessing results of multiple remote sensing image model prediction requests into a model queue, dynamically adjusts the batch size according to the response delay of the model prediction request, hardware resource usage, etc., and then submits the corresponding batch data to the graphics processor (GPU) for model prediction, thereby improving the utilization rate and processing throughput of the graphics processor in the model prediction process.
[0008] The aforementioned dynamic batch processing or resource scheduling technologies primarily address throughput, latency, and computational resource utilization issues in batch processing systems or model prediction services. However, for edge AI algorithm evaluation scenarios, further problems exist: Firstly, the actual effective algorithm parameters, model versions, algorithm implementation versions, and operating environments of different edge devices may change. If the reuse of historical detection results is determined solely based on the task name, model name, or input file, it can easily lead to erroneous reuse of detection results. Secondly, when the input dataset changes only partially, the result parsing method changes, or device disconnection or network anomalies occur during the evaluation process, performing a re-detection of all images each time would result in a large amount of repetitive edge AI inference and data transmission.
[0009] Furthermore, the raw detection results output by different edge devices or different artificial intelligence models may differ in terms of category representation, bounding box coordinate format, confidence range, and extended attributes. When directly comparing the raw detection results of different objects, it is difficult to guarantee that the detection results have a unified data structure and temporal correspondence. At the same time, when the result parsing method changes, if the original detection results that can be re-parsed are not retained, it may be necessary to re-execute the edge AI detection.
[0010] Therefore, existing technologies still require an AI-based detection and evaluation method and system suitable for resource-constrained edge devices. This system should enable dynamic scheduling and caching control of image detection tasks without requiring the edge device to store the complete video or all images to be tested. It should also be able to determine the reuse boundaries of historical detection results by combining input content, actual operating configuration, and result parsing conditions, thereby reducing unnecessary duplicate detections, supporting the recovery of abnormal evaluation tasks, and achieving unified parsing, differential evaluation, and result traceability of detection results for different detection objects. Summary of the Invention
[0011] To address the problems existing in the prior art, this invention provides an artificial intelligence detection and evaluation method and system for resource-constrained edge devices.
[0012] To achieve the above objectives, the present invention provides an artificial intelligence detection and evaluation method for resource-constrained edge devices, comprising the following steps: Step S1: The computer-based evaluation scheduler establishes a connection with the detection object agent deployed on the edge device, and obtains the detection object capability information and actual operation configuration information. The detection object capability information includes at least the detection object identifier, detection object type, target detection frame rate, algorithm input resolution, and cache space threshold parameter. The actual operation configuration information includes at least the actual effective algorithm parameters, model version, algorithm implementation version, and runtime environment version. The actual operation configuration version is determined based on the actual operation configuration information. Step S2: The computer-based evaluation scheduler scans the input dataset and identifies the input asset as an image or video. For video input, video decoding is performed on the computer, and the frame to be detected and its corresponding timestamp are determined according to the target detection frame rate. The frame to be detected is then converted into an image at the algorithm input resolution. For image input, normalization processing is performed according to the algorithm input resolution to generate an image detection task carrying an input content identifier, frame identifier, timestamp, preprocessing configuration version, and detection object identifier. The complete video to be tested is not sent to the edge device. Step S3: The computer generates result reuse information for each image detection task. The result reuse information is bound to the input content, preprocessing configuration version, detection object identifier, actual running configuration version, and result parsing adapter version. The result reuse information is compared with the corresponding historical results. Based on the comparison results, a processing method is determined from the following: direct reuse, re-parsing based on historical original detection results, partial re-detection, or full re-detection. Step S4: For the image detection task determined in Step S3 to be either partial re-detection or full re-detection, the detection object agent obtains the currently available image cache space, the security retention cache, and the image size statistics of multiple recent images before each round of image detection task acquisition. Based on the currently available image cache space, the security retention cache, and the image size statistics, the number of image detection tasks that can be acquired in this round is determined. When the image cache usage reaches the pause acquisition threshold, the acquisition of new image detection tasks is paused. When the image cache usage decreases to below the recovery acquisition threshold, the acquisition of new image detection tasks is resumed. The pause acquisition threshold is higher than the recovery acquisition threshold. Step S5: The detection object agent obtains target resolution images in batches according to the number of image detection tasks determined in step S4, submits the target resolution images to the artificial intelligence detection algorithm for image-by-image detection, obtains the original frame-by-frame detection results, and sends back the corresponding original frame-by-frame detection results, detection status and resource status to the computer. After completing the detection of the corresponding image and sending back the results, the image cache occupied by the image is released. Step S6: The computer uses a result parsing adapter corresponding to the version of the result parsing adapter to convert the original frame-by-frame detection results of different detection objects into unified standard frame-by-frame detection results. The unified standard frame-by-frame detection results include at least the standard category, confidence level, target box, frame identifier, timestamp, parsing status, and original result reference. Step S7: The computer matches the frame-by-frame detection results of the unified standard with the baseline detection results of the local model, cloud model or historical model version on the computer according to the frame identifier, timestamp or timestamp tolerance, and generates a timestamp-level difference score based on the crossover ratio of the target bounding boxes of the matched targets, confidence difference, category difference and time offset. Step S8: The computer generates a traceable evaluation report based on the frame-by-frame detection results, result reuse status, timestamp-level difference score, image detection task status, parameter version, model version, and actual running configuration version according to the unified standard.
[0013] Preferably, in step S1, the actual running configuration information further includes a model identifier and a model verification value. The actual effective algorithm parameters, model identifier, model version, model verification value, algorithm implementation version, running environment version, and detection object identifier are serialized in a preset order, and a hash value is calculated based on the serialization result to generate the actual running configuration version. When the model file, algorithm implementation, or running environment changes, the actual running configuration version is regenerated.
[0014] Preferably, in step S2, when the input asset is a video, the computer generates a frame-sampling timeline based on the target detection frame rate; when the source video frame rate is lower than the target detection frame rate, an image detection task is generated using the actual valid frames in the source video, without generating a duplicate image detection task by copying the valid frames; the computer determines the dynamic frame-sampling interval based on the target detection frame rate, the frame redundancy of the current candidate frame relative to the sampled frames, the motion intensity, and the cache pressure or task queue pressure, wherein the dynamic frame-sampling interval is decreased when the motion intensity increases, and the dynamic frame-sampling interval is increased when the frame redundancy, cache pressure, or task queue pressure increases.
[0015] Preferably, in step S3, the result reuse information includes strict reuse fingerprints and approximate reuse fingerprints; the strict reuse fingerprint is generated at least based on the input content hash, preprocessing configuration version, actual running configuration version, result parsing adapter version, detection object identifier, timestamp, and target resolution; the approximate reuse fingerprint is generated at least based on the perceptual hash of the input content, preprocessing configuration version, actual running configuration version, category mapping version, and timestamp tolerance. The approximate reuse fingerprint is not used to directly reuse the corresponding historical detection results, but is used to determine the processing boundaries for re-parsing, partial re-detection, or full re-detection; when the strict reuse fingerprint is consistent and the historical detection status is successful, the corresponding historical detection results are directly reused; when the input content, preprocessing configuration, and actual running configuration have not changed, but the result parsing adapter version has changed and the historical original frame-by-frame detection results are available, the historical original frame-by-frame detection results are re-parsed; when the input dataset undergoes partial addition, deletion, or replacement, partial re-detection is performed on the image detection task affected by the changes. When the actual running configuration version changes due to changes in the model version, algorithm implementation version, or runtime environment version, a full re-detection is performed on the image detection task of the corresponding detection object.
[0016] Preferably, in step S3, when the detected object is disconnected, network communication is abnormal, the terminal device is restarted, or the evaluation task is interrupted, the computer terminal re-determines the strict reuse fingerprint and approximate reuse fingerprint corresponding to each image detection task when the evaluation is resumed; For image detection tasks with a historical detection status of success and a newly determined strict reuse fingerprint that matches the corresponding historical strict reuse fingerprint, the corresponding historical detection result is reused; for image detection tasks that are incomplete, fail to detect, time out, or have a newly determined strict reuse fingerprint that does not match the corresponding historical strict reuse fingerprint, the corresponding image detection task is added back to the pending execution queue.
[0017] Preferably, in step S4, let the currently available image cache space at time t be C_free,t, the safe retention cache be C_safe, the mean image size of the most recent N images be S_mean, the standard deviation of the image size be S_σ, the risk coefficient be k, and the number of image detection tasks that can be obtained in this round be B_t. When the current image cache usage reaches the pause threshold or C_free,t≤C_safe, B_t=0; otherwise, the number of image detection tasks that can be acquired in this round is determined according to the following formula: B_t = max{0, floor[(C_free, t-C_safe) / (S_mean+kS_σ)]}; where the pause acquisition threshold is higher than the resume acquisition threshold to form hysteresis control for image detection task acquisition; when the image cache usage reaches the pause acquisition threshold, the acquisition of new image detection tasks is stopped, and when the image cache usage decreases to below the resume acquisition threshold, the acquisition of new image detection tasks is resumed.
[0018] Preferably, in step S6, the result parsing adapter converts the original frame-by-frame detection result into a unified standard frame-by-frame detection result, including standard category, standard confidence, target box, frame identifier, timestamp, parsing status, and original result reference, based on the original category representation, coordinate format, confidence range, and extended attributes corresponding to the detected object. When the result parsing adapter is missing, the result parsing adapter version is mismatched, or at least some fields in the original frame-by-frame detection result fail to be parsed, the corresponding original result reference, parsing status, and parsing error information are retained for subsequent re-parsing.
[0019] Preferably, in step S7, when the frame identifiers of different detection objects cannot directly correspond or the timestamps are offset, the computer performs timestamp nearest neighbor matching between the unified standard frame-by-frame detection results and the benchmark detection results within a preset timestamp tolerance range, and determines the timestamp-level difference score S_diff according to the following formula: S_diff=w1(1-IoU)+w2|C_e-C_b|+w3I(Y_e≠Y_b)+w4|T_e-T_b| / T_tol; Where IoU is the intersection-union ratio of the matched target boxes, C_e and C_b are the confidence scores of the edge detection results and the baseline detection results, respectively, Y_e and Y_b are the categories of the edge detection results and the baseline detection results, respectively, T_e and T_b are the timestamps of the edge detection results and the baseline detection results, respectively, T_tol is the timestamp tolerance, w1, w2, w3 and w4 are the corresponding weights, and I(·) is the indicator function, which takes a value of 1 when the condition in the parentheses is true and a value of 0 when the condition in the parentheses is false. When the benchmark detection result contains a target but the end-side detection result does not contain a corresponding target, the corresponding event is determined as a missed detection event; when the end-side detection result contains a target but the benchmark detection result does not contain a corresponding target, the corresponding event is determined as a false detection event; frames whose timestamp-level difference scores exceed a preset difference threshold are determined as frames to be reviewed or candidate frames for retesting.
[0020] The present invention also provides an artificial intelligence detection and evaluation system for resource-constrained edge devices, including a computer-based evaluation system and a detection object agent deployed on the edge device; The computer-based assessment system includes a computer-based assessment scheduler, an input processing module, a task planning module, a result reuse and continuation testing module, a result parsing module, a difference scoring module, and a report analysis module. The computer-based evaluation scheduler is used to establish a connection with the agent of the object being tested, obtain the capability information and actual running configuration information of the object being tested, and determine the actual running configuration version based on the actual running configuration information. The input processing module is used to scan the input dataset, identify the input asset as an image or video, perform video decoding and frame extraction on the computer and convert it into an image of the target resolution, and perform normalization processing on the image input. The task planning module is used to generate an image detection task with input content identifier, frame identifier, timestamp, preprocessing configuration version and detection object identifier based on the processing result of the input processing module. The result reuse and retesting module is used to generate result reuse information based on the input content, preprocessing configuration version, detection object identifier, actual running configuration version, and result parsing adapter version, and to determine one of the following processing methods based on the result reuse information and corresponding historical results: direct reuse, re-parsing based on historical original detection results, partial re-detection, or full re-detection. The detection object proxy includes a cache-aware scheduling module and an image detection execution module; The cache-aware scheduling module is used to obtain the currently available image cache space, the secure retention cache, and the image size statistics of multiple recent images for image detection tasks determined by the result reuse and continuation testing module as either partial re-detection or full re-detection. Based on the currently available image cache space, the secure retention cache, and the image size statistics, the module determines the number of image detection tasks that can be acquired in this round, and controls the pause and resumption of image detection tasks based on the pause acquisition threshold and the resume acquisition threshold. The image detection execution module is used to acquire target resolution images in batches according to the determined number of image detection tasks, perform artificial intelligence detection on the acquired target resolution images, send back the corresponding original frame-by-frame detection results, detection status and resource status to the computer, and release the image cache occupied by the images that have completed detection. The result parsing module is used to convert the original frame-by-frame detection results into unified standard frame-by-frame detection results through a result parsing adapter corresponding to the result parsing adapter version, while retaining the original result references; The difference scoring module is used to match the frame-by-frame detection results of the unified standard with the benchmark detection results according to the frame identifier, timestamp, or timestamp tolerance, and generate a timestamp-level difference score based on the target box intersection-union ratio, confidence difference, category difference, and time offset. The report analysis module is used to generate a traceable evaluation report based on the frame-by-frame detection results, result reuse status, timestamp-level difference score, image detection task status, parameter version, model version, and actual running configuration version according to the unified standard.
[0021] Preferably, the detection object agent further includes an available cache space monitoring unit, an image task acquisition unit, a result return unit, a temporary image cleanup unit, and an anomaly recovery unit; The available cache space monitoring unit is used to obtain the current image cache usage, the current available image cache space, and the image size statistics of multiple recent images; The image task acquisition unit is used to acquire the corresponding target resolution image from the computer according to the number of image detection tasks determined by the cache awareness scheduling module. The result feedback unit is used to send the original frame-by-frame detection results, detection status, and resource status back to the computer. The temporary image cleaning unit is used to delete the corresponding temporary image and release the image cache it occupies after the corresponding image has been detected and the corresponding original frame-by-frame detection result has been returned. The anomaly recovery unit is used to clean up unfinished temporary images and request the image detection task that still needs to be executed from the computer after the detection object is disconnected, network communication is abnormal, the end device is restarted, or the evaluation task is interrupted.
[0022] The technical solution of this invention has the following beneficial effects: This invention sets the decoding, frame extraction, and target resolution processing of the video under test to be executed on the computer. It generates corresponding image detection tasks based on the target detection frame rate, without having to send the complete video under test to the resource-constrained edge device. This allows the edge device to mainly undertake the artificial intelligence detection of the target resolution image, thereby reducing the resource consumption of the edge device in decoding the complete video and storing a large number of video frames. This invention obtains the currently effective algorithm parameters, model version, algorithm implementation version, and runtime environment version of the detected object, and determines the actual runtime configuration version based on the actual runtime configuration information, so that the reuse judgment of historical detection results can correspond to the actual running state of the end device. When the model file, algorithm implementation, or runtime environment changes, the corresponding image detection task can be re-detected by changing the actual runtime configuration version, thereby reducing the possibility of incorrect reuse of historical detection results due to changes in runtime status. This invention generates strict reuse fingerprints and approximate reuse fingerprints for image detection tasks, and determines the corresponding processing method among direct reuse, re-parsing, partial re-detection, or full re-detection based on the result reuse failure state. This enables the detection of only affected images when the input data changes only locally, and the re-parsing based on historical original detection results when the result parsing adapter changes, thereby reducing unnecessary repeated end-side inference. This invention determines the number of image detection tasks that can be acquired in the current round based on the currently available image cache space on the edge device, the security reserve cache, and the statistical values of the image sizes of recent multiple images. Hysteresis control is established through pause and resume acquisition thresholds. When cache usage reaches the pause threshold, new image acquisition stops. After the results of detected images are returned, the corresponding temporary images are promptly deleted and the cache is released. Images are reacquired once cache usage drops below the resume threshold. This allows the edge image cache size to adjust according to actual resource status and image size changes, reducing the risk of insufficient cache space during fixed batch processing. This invention releases the corresponding image cache after a single image completes AI detection and result feedback, allowing the edge device to maintain only a limited number of images that are currently being acquired, waiting to be detected, or being detected. It avoids the need to accumulate all images to be tested over a long period as the length of the video to be tested increases, which is beneficial for continuously executing large-scale AI detection and evaluation tasks under limited cache resources. This invention uses a result parsing adapter to convert the raw frame-by-frame detection results output by different detection objects into unified standard frame-by-frame detection results, while retaining the original result references, parsing status, and parsing error information. When the result parsing adapter is subsequently upgraded, it can be re-parsed based on the saved raw detection results without re-executing edge-side AI detection, thereby improving the compatibility and reusability of detection results from different devices and different models. This invention matches the end-side detection results with the benchmark detection results by frame identifier, timestamp, or timestamp tolerance, and integrates the target box intersection-union ratio, confidence difference, category difference, and time offset to form a timestamp-level difference score. This can further locate detection differences such as missed detections, false detections, category bias, target box offset, and time offset, enabling unified horizontal comparison of detection results between different detection objects. This invention enables breakpoint continuation of evaluation tasks after the detection object is disconnected, network communication is abnormal, the end device is restarted, or the evaluation task is interrupted. It reuses existing successful detection results that still meet the reuse conditions, and only adds incomplete, failed, timed out, or unreliable image detection tasks back to the execution queue. This reduces the repetitive data transmission and end-side calculations caused by re-executing all detection tasks after an anomaly is resolved. The traceable evaluation report generated by this invention can link the image detection task status, result reuse status, model version, parameter version, actual running configuration version, result parsing adapter version, and timestamp-level difference information, thereby enabling the traceability of the source and running conditions of different evaluation results, facilitating subsequent algorithm version comparison, abnormal result location, and evaluation result verification. Attached Figure Description
[0023] Figure 1 A flowchart of the closed-loop evaluation and scheduling process according to an embodiment of the present invention; Figure 2 : A flowchart of a cache-aware dynamic image retrieval window according to an embodiment of the present invention; Figure 3 A flowchart illustrating the determination of reused fingerprints and processing methods according to an embodiment of the present invention; Figure 4 A flowchart of parsing adaptation and timestamp-level difference scoring according to an embodiment of the present invention; Figure 5 : Flowchart of abnormal interruption and breakpoint continuation test according to an embodiment of the present invention. Detailed Implementation
[0024] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0025] Reference Figures 1 to 5 This embodiment provides an AI detection and evaluation method for resource-constrained edge devices. The method is executed collaboratively by a computer-based evaluation scheduler and a detection object agent deployed on the edge device. The edge device can be a network camera, smart doorbell, or other device with AI detection capabilities but limited computing resources, storage resources, or image cache space.
[0026] The computer-based system, acting as the master control unit for the evaluation task, primarily handles tasks such as acquiring the detection object configuration, processing input data, planning image detection tasks, determining result reuse, scheduling image detection tasks, parsing detection results, performing difference analysis, and generating reports. The edge devices, on the other hand, are mainly responsible for the actual image detection process of the AI algorithm under test. Through this division of labor, the complete video to be tested does not need to be sent to the edge devices, and the edge devices do not need to additionally handle offline decoding of the complete video, batch frame extraction, and long-term caching of all images under test.
[0027] Specifically, the artificial intelligence detection and evaluation method in this embodiment includes steps S1 to S8.
[0028] Step S1: The computer-based evaluation scheduler establishes a connection with the detection object agent deployed on the edge device, obtains the detection object's capability information and actual operation configuration information, and determines the actual operation configuration version based on the actual operation configuration information.
[0029] Before officially executing the evaluation task, the computer-based evaluation scheduler can establish a communication connection with the agent of the test object based on the pre-configured network address and communication port of the end device, and perform health checks, identification of the test object, and check the status of the test object.
[0030] The computer obtains the detection object capability information from the detection object agent. The detection object capability information includes at least the detection object identifier, detection object type, target detection frame rate, algorithm input resolution, and cache space threshold parameter.
[0031] Among them, the detection object identifier is used to distinguish different detection objects; the detection object type is used to identify the type of the end device or other detection objects; the target detection frame rate is used to determine the detection frame time axis of the video input; the algorithm input resolution is used to determine the target image size that the AI detection algorithm under test can directly process; and the cache space threshold parameter is used to control the number of target resolution images acquired by the end device in the subsequent process.
[0032] Furthermore, the detection object capability information may also include algorithm name, image cache byte limit, image cache quantity limit, pause acquisition threshold, resume acquisition threshold, and result timeout.
[0033] In one specific implementation, the aforementioned detection object capability information can be recorded using the following parameters: detection object identifier (target_id), detection object type (target_type), algorithm name (algorithm_name), target detection frame rate (target_detect_fps), algorithm input width (algo_input_width), algorithm input height (algo_input_height), maximum image cache bytes (max_image_cache_bytes), maximum image cache count (max_image_cache_count), pause acquisition threshold (cache_pause_threshold), resume acquisition threshold (cache_resume_threshold), and result timeout (result_timeout_ms). These field names are merely one specific implementation example and are not intended to limit the specific data structure or communication protocol of the detection object capability information.
[0034] The computer-based evaluation scheduler further obtains actual runtime configuration information from the testing object agent. This actual runtime configuration information reflects the actual running configuration of the artificial intelligence algorithm of the current testing object, rather than just reflecting the pre-set planned test configuration.
[0035] The actual running configuration information includes at least the actual effective algorithm parameters, model version, algorithm implementation version, and running environment version, and may also include parameter version, parameter source, model identifier, and model verification value.
[0036] In one specific implementation, the actual runtime configuration information can be recorded through the actual effective algorithm parameters (effective_params), parameter version (param_version), parameter source (param_source), model identifier (model_id), model version (model_version), model checksum (model_checksum), algorithm implementation version (algorithm_version), runtime environment version (runtime_version), and actual runtime configuration version (effective_runtime_config_version).
[0037] To prevent the incorrect reuse of historical detection results after changes in model files, algorithm implementations, or operating environments, an actual operating configuration version can be generated based on the actual operating configuration information.
[0038] Specifically, the actual effective algorithm parameters, model identifier, model version, model verification value, algorithm implementation version, runtime environment version, and detection object identifier can be serialized in a preset order, and then the serialization result can be hashed to obtain a hash value that represents the actual runtime configuration version.
[0039] Therefore, even if the actual effective algorithm parameters remain unchanged, different actual running configuration versions can be obtained when the model file, algorithm implementation, or running environment changes. This allows subsequent result reuse judgments to be based on the actual effective running status of the detected object, rather than simply judging based on the model name or configuration file name.
[0040] For example, if the actual effective algorithm parameters have not changed, as long as at least one of the model file, post-processing logic, inference framework, device firmware, or operating environment changes, the actual running configuration version can be regenerated to characterize the current actual effective technical operating status of the detected object.
[0041] Step S2: The computer-based evaluation scheduler scans the input dataset, identifies the input assets, and converts them into an image detection task.
[0042] The computer scans the input dataset to be tested and identifies each input asset as either an image or a video.
[0043] For each input asset, the computer can read one or more of the following information: asset identifier (asset_id), asset type (asset_type), source name (source_name), source device (source_device), content hash (content_hash), source width (source_width), source height (source_height), source frame rate (source_fps), duration (duration_ms), and encoding format (codec), and associate the information with the subsequently generated image detection task.
[0044] When the input asset is an image, the computer reads the image's resolution and other metadata, and normalizes the image according to the resolution input of the AI detection algorithm under test.
[0045] For example, the original image can be proportionally converted according to the target input width to obtain the corresponding converted height, and the height deviation ratio can be determined based on the difference between the converted height and the target input height. When the absolute value of the height deviation ratio is within the preset resolution height tolerance range, the corresponding image is converted to the algorithm input resolution; for images that do not meet the corresponding tolerance requirements, the skip status and corresponding reasons can be recorded.
[0046] When the input asset is a video, video decoding and frame extraction are both completed on the computer, and the complete video to be tested is not sent to the edge device.
[0047] The computer-side establishes a corresponding frame-sampling timeline based on the target detection frame rate (target_detect_fps). Let the target detection frame rate be f_target, then the basic frame-sampling time interval can be expressed as: Δt = 1 / f_target; When milliseconds are used as the unit of time, it can be expressed as: sample_interval_ms=1000 / f_target.
[0048] The computer determines the frame to be detected and its corresponding timestamp (timestamp_ms) according to the above frame extraction timeline, and converts the frame to be detected into a target resolution image corresponding to the algorithm input resolution.
[0049] When the source video frame rate (source_fps) is lower than the target detection frame rate (target_detect_fps), the computer does not generate duplicate image detection tasks by copying valid frames from the source video. Instead, it generates image detection tasks using the valid frames that actually exist in the source video.
[0050] Additionally, a source frame rate lower than target frame rate status flag (source_fps_below_target) can be recorded in the corresponding image detection task and final evaluation report to indicate that the actual source frame rate of the current video is lower than the target detection frame rate.
[0051] This avoids the distortion of the test data caused by manually copying the same frame to meet the target detection frame rate.
[0052] In a preferred embodiment, the frame extraction interval can also be dynamically adjusted according to changes in video content and the operational pressure of the evaluation task. The dynamic frame extraction interval can be expressed as: Δt_i=clip[(1 / f_target)×(1+a×r_i-b×m_i+c×q_i), Δt_min, Δt_max]; Where f_target is the target detection frame rate, r_i is the frame redundancy of the current candidate frame relative to the sampled frames, m_i is the motion intensity, q_i is the buffer pressure or task queue pressure, a, b, and c are the corresponding weights, and Δt_min and Δt_max are the minimum and maximum allowed frame extraction intervals, respectively. clip[x, x_min, x_max] represents the clipping function, which limits x to between x_min and x_max; when x is less than x_min, x_min is used, and when x is greater than x_max, x_max is used.
[0053] Frame redundancy r_i is determined by the perceptual hash similarity between candidate frames and sampled frames, motion intensity m_i is determined by the proportion of the difference region between adjacent frames, cache pressure is determined by the ratio of cache usage to the pause acquisition threshold, and task queue pressure is determined by the ratio of the number of pending tasks to the upper limit of the queue.
[0054] When the motion intensity increases, shorten the dynamic frame extraction interval to increase the number of detection frames in video segments with significant motion changes; when frame redundancy increases or buffer pressure or task queue pressure increases, extend the dynamic frame extraction interval to reduce the number of detection frames with high repetition or reduce the pressure on the current detection task.
[0055] After the above processing, the computer generates the corresponding image detection task. Each image detection task has at least an input content identifier, a frame identifier, a timestamp, a preprocessing configuration version, and a detection object identifier. It may also include an image identifier, a target resolution, and a task status.
[0056] Step S3: The computer generates result reuse information for each image detection task and determines the processing method for the image detection task based on the result reuse information and the corresponding historical results.
[0057] To avoid repeatedly performing edge-side AI detection when the input content, preprocessing method, test model, operating environment, or result parsing method remain essentially unchanged, the computer generates result reuse information for each image detection task.
[0058] The result reuse information is bound to the input content, preprocessing configuration version, detection object identifier, actual running configuration version, and result parsing adapter version.
[0059] In one implementation, the result reuse information includes a strict reuse fingerprint (RID_strict) and an approximate reuse fingerprint (RID_approx).
[0060] The strictly reused fingerprint can be represented as: RID_strict=H(h_c||v_p||v_r||v_a||id_t||ts||res); Where H represents hash operation, h_c represents input content hash, v_p represents preprocessing configuration version, v_r represents actual running configuration version, v_a represents result parsing adapter version, id_t represents detection object identifier, ts represents frame timestamp, res represents target resolution, and "||" indicates that the corresponding data will be combined according to a preset method.
[0061] The strictly reused fingerprint simultaneously constrains the input content, preprocessing process, actual operating status, and result parsing conditions that affect the evaluation results.
[0062] The approximate multiplexed fingerprint can be represented as: RID_approx=H(h_p||v_p||v_r||class_map||tol_ts); Where h_p represents the perceptual hash of the input frame or input segment, class_map represents the class mapping version, and tol_ts represents the timestamp tolerance.
[0063] The approximate reuse fingerprint is not directly used to determine whether historical detection results can be reused, but rather to determine which processing boundary the image detection task should enter among re-parsing, partial re-detection, or full re-detection.
[0064] Furthermore, the computer can maintain a result reuse failure state machine. The states of the result reuse failure state machine include at least the new state, the reusable state, the reparse-only state, the partial retest state, the full retest state, the failed state, and the timeout state.
[0065] Among them, the new status indicates that there is no new image detection task with corresponding available historical results; the reusable status indicates that the corresponding historical detection results can be directly reused; the reparse_only status indicates that there is no need to re-execute the edge AI detection, only the historical original frame-by-frame detection results need to be re-parsed; the partial_retest status indicates that only the part of the image detection task affected by the changes in input data is re-detected; the full_retest status indicates that the image detection task of the corresponding detection object needs to be fully re-detected; the detection failed status indicates that the corresponding image detection task failed; and the detection timeout status indicates that the corresponding image detection task exceeded the preset result timeout time.
[0066] When the fingerprint is consistent and the corresponding historical detection status is successful, the current image detection task enters the reusable state, directly adopts the corresponding historical detection results, and does not resend the corresponding target resolution image to the edge device.
[0067] When the input content, preprocessing configuration, and actual runtime configuration remain unchanged, but the result parsing adapter version changes, and the historical raw frame-by-frame detection results are still available, the corresponding image detection task enters a reparse-only state. The computer calls the result parsing adapter corresponding to the current result parsing adapter version to reparse the historical raw frame-by-frame detection results, without re-executing the edge AI detection.
[0068] When the input dataset is partially added, deleted, or replaced, the image detection tasks affected by the changes are partially retested, and the corresponding image detection tasks enter the partial retest state (partial_retest); the image detection tasks that are not affected by the changes and meet the reuse conditions continue to use the corresponding historical results.
[0069] When the model version, algorithm implementation version, or runtime environment version changes, resulting in a change in the actual runtime configuration version, the image detection task of the corresponding detection object enters the full retest state and performs a full retest to avoid incorrectly using the detection results obtained under the original actual runtime configuration for the new actual runtime configuration.
[0070] Therefore, the result reuse failure state machine is not only used to save the state of the image detection task, but also to directly determine whether the corresponding image detection task enters the subsequent edge image acquisition and artificial intelligence detection process.
[0071] Furthermore, when the detection object is disconnected, network communication is abnormal, the terminal device is restarted, or the evaluation task is interrupted during the evaluation process, the computer terminal will re-determine the result reuse information of each image detection task when the evaluation is resumed.
[0072] Specifically, the computer can rescan the input assets, regenerate the current image detection task list, and recalculate the RID_strict and RID_approx of the corresponding image detection task for each item.
[0073] For image detection tasks with existing successful historical results and where the newly determined strictly reused fingerprint matches the corresponding historical strictly reused fingerprint, the corresponding historical detection result can be directly used. In one implementation, the above image detection task can be marked as reused successfully (reused_success) and directly proceed to the subsequent result aggregation.
[0074] For image detection tasks that are incomplete, fail to detect, time out, or whose re-determined strictly reused fingerprints are inconsistent with the corresponding historical strictly reused fingerprints, they are added back to the execution queue.
[0075] Therefore, in the event of an abnormal interruption, it is not necessary to re-detect the entire input dataset directly, but only to re-execute the image detection tasks that actually need to be re-detected.
[0076] In step S4, for image detection tasks that are determined to be partial or full re-detection in step S3, the detection object agent performs cache-aware dynamic image retrieval scheduling.
[0077] When the edge device is used as the detection object, it does not save the complete set of video frames generated by the complete video to be tested, nor does it undertake offline video decoding of the complete video to be tested. Instead, it only maintains the dynamic set of images to be tested that actually need to be processed.
[0078] Before each round of image detection tasks, the detection agent obtains the currently available image cache space C_free,t, the current image set occupied, remaining memory, remaining storage space, current number of images, and the image size statistics of the recent N images.
[0079] The statistical values of the image size of the recent N images include the mean image size S_mean and the standard deviation of image size S_σ.
[0080] Let the safe retention cache be C_safe, the risk coefficient be k, and the number of image detection tasks that can be obtained in this round be B_t.
[0081] When the current image cache usage reaches the pause threshold, or: C_free,t≤C_safe season: B_t=0.
[0082] Otherwise, the number of image detection tasks that can be obtained in this round is determined according to the following formula: B_t=max{0, floor[(C_free,t-C_safe) / (S_mean+kS_σ)]}; Here, floor indicates rounding down.
[0083] C_free,t-C_safe represents the cache space available for the current image detection task after deducting the safety reserve cache; S_mean+kS_σ represents the estimated cache usage per image after considering the recent average image size and image size fluctuations.
[0084] Therefore, when the image size increases or the fluctuation in image size increases, the number of image detection tasks that can be obtained in this round decreases accordingly; when the available image cache space increases, the number of image detection tasks that can be obtained in this round increases accordingly.
[0085] Meanwhile, the detection object agent uses a pause acquisition threshold and a resume acquisition threshold to form hysteresis control, wherein the pause acquisition threshold is higher than the resume acquisition threshold.
[0086] When the current image cache usage reaches the pause acquisition threshold, the detection object agent stops acquiring new image detection tasks, but continues to process the target resolution images that have already been acquired; after the detection is completed and the results are returned, the corresponding target resolution image is deleted and the corresponding cache is released; when the image cache usage drops below the resume acquisition threshold, the acquisition of new image detection tasks is resumed.
[0087] In one specific embodiment, the total memory of the edge device is approximately 64MB, the maximum temporary image cache space available for AI detection is approximately 25MB, the pause acquisition threshold can be set to 20MB, the resume acquisition threshold can be set to 10MB, and the security retention cache can be set to 5MB. These specific capacity values are merely preferred implementation parameters and are not intended to limit the scope of protection of this invention.
[0088] Furthermore, the lifecycle of the target resolution image in the terminal device can be managed in terms of state, including the image state of downloading, ready, processing, reported, cleaned, and failed.
[0089] The states are as follows: downloading indicates that the image at the target resolution is being acquired; ready indicates that the image has been acquired and is awaiting AI detection; processing indicates that the image is being processed by the AI detection algorithm; reported indicates that the original frame-by-frame detection results of the corresponding image have been reported; cleaned indicates that the corresponding temporary image has been deleted and the image cache it occupied has been released; and failed indicates that the acquisition of the corresponding image or the AI detection has not been completed normally.
[0090] When the edge device experiences an abnormal restart, it can first clear any unfinished temporary images before requesting the image detection task that still needs to be performed from the computer. Since the computer stores the global image detection task status and historical detection results, the edge device does not need to store completed historical images and results for an extended period.
[0091] Step S5: The detection object agent acquires target resolution images in batches according to the number of image detection tasks determined in step S4 and performs artificial intelligence detection.
[0092] The detection object agent obtains the corresponding target resolution image through the task service provided on the computer, and submits the obtained target resolution images one by one to the artificial intelligence detection algorithm corresponding to the current detection object.
[0093] After the AI detection algorithm completes the detection of a target resolution image, it outputs the corresponding raw frame-by-frame detection results. The detection object agent then sends the raw frame-by-frame detection results, detection status, and resource status back to the computer.
[0094] After the corresponding original frame-by-frame detection results are returned, the corresponding target resolution temporary image is deleted, and the image cache occupied by that image is released.
[0095] Therefore, the image cache of the edge device mainly consists of the current target resolution images that are in the acquisition, waiting to be detected, or being detected states, and will not continue to grow with the duration of the video to be tested and the total number of images to be tested.
[0096] In one specific implementation, the returned data of the raw frame-by-frame detection results may include one or more of the following: protocol version (protocol_version), target type (target_type), target identifier (target_id), device identifier (device_id), device model (device_model), algorithm name (algorithm_name), algorithm implementation version (algorithm_version), parameter version (param_version), effective runtime configuration version (effective_runtime_config_version), model identifier (model_id), model version (model_version), result parsing adapter identifier (parser_adapter_id), result parsing adapter version (parser_adapter_version), task identifier (task_id), video identifier (video_id), frame identifier (frame_id), timestamp (timestamp_ms), image identifier (image_id), image resolution (image_resolution), inference time (inference_time_ms), status (status), error code (error_code), error message (error_message), and raw result data (raw_result).
[0097] By simultaneously associating the detection object identifier, image detection task, model version, actual running configuration version, and result parsing adapter version with the detection results, subsequent result parsing, result reuse, and evaluation reports can be traced back to the actual running conditions corresponding to the generation of the current original frame-by-frame detection results.
[0098] Step S6: The computer uses the result parsing adapter to convert the original frame-by-frame detection results of different detection objects into unified standard frame-by-frame detection results.
[0099] Different detection objects, different artificial intelligence models, or different algorithm implementations may use different category numbers, target bounding box coordinate formats, confidence ranges, and extended attributes. Therefore, the computer-side maintains the result parsing adapter and the corresponding result parsing adapter version.
[0100] The result parsing adapter converts the original frame-by-frame detection results into unified standard frame-by-frame detection results based on the original category representation, coordinate format, confidence range, and extended attributes of the corresponding detection object.
[0101] In one specific implementation, the unified standard result model may include a set of detection results (detections), a standard class identifier (class_id), a standard class name (class_name), a standard confidence level (confidence), a bounding box format (bbox_format), a bounding box (bbox), a track identifier (track_id), extended attributes (attributes), a parse status (parse_status), a parse error message (parse_error), and a raw result reference (raw_result_ref).
[0102] When the result parsing adapter is missing, the result parsing adapter version is incompatible, or some fields cannot be parsed normally, the mismatched result parsing adapter will not be used to force the generation of normal detection results. Instead, the corresponding original result reference, parsing status, and parsing error information will be retained.
[0103] Specifically, it can retain the original result reference (raw_result_ref), the parsing status (parse_status), and the parsing error information (parse_error).
[0104] When the result parsing adapter is added or upgraded in the future, the original frame-by-frame detection results saved in history can be directly called to re-execute the parsing without the end device having to perform the corresponding image AI detection again, thus corresponding to the reparse_only state in step S3.
[0105] For video input, although the edge device performs image-by-image detection, the computer can re-aggregate the corresponding unified standard frame-by-frame detection results into video-level detection results based on the frame identifier (frame_id) and timestamp (timestamp_ms).
[0106] In one specific implementation, the video-level detection result may include the total number of sampled frames (total_sampled_frames), the number of successful frames (success_frames), the number of failed frames (failed_frames), the number of successfully reused frames (cached_success_frames), class segment information (class_segments), detected frame events (detected_frame_events), missed frame events (missed_frame_events), and representative timestamps (representative_timestamps_ms).
[0107] The number of successfully reused frames (cached_success_frames) is used to characterize the number of successful frames obtained by directly reusing historical detection results during this round of evaluation, so that the evaluation report can distinguish between the results of the actual re-execution of artificial intelligence detection in this round and the directly reused historical detection results.
[0108] In step S7, the computer matches the unified standard frame-by-frame detection results with the benchmark detection results and generates a timestamp-level difference score.
[0109] The benchmark detection results can be the detection results output by the local model on the computer, the cloud model, or a historical model version.
[0110] Before performing the comparison of detection results on the computer, the result parsing adapter unifies the category mapping, target box format, and confidence range for different detection objects.
[0111] In one specific implementation, the computer can prioritize aligning the edge detection results and the benchmark detection results according to the same asset identifier (asset_id), frame identifier (frame_id), and timestamp (timestamp_ms).
[0112] When different detection objects use different frame extraction strategies, resulting in frame_id not being able to correspond directly or there being a certain offset between frame timestamps, nearest neighbor timestamp matching can be performed based on the preset timestamp tolerance (timestamp_tolerance_ms).
[0113] After matching the corresponding results, the timestamp-level difference score S_diff can be calculated based on the intersection-union ratio of the target boxes, confidence difference, category difference, and time offset. S_diff=w1(1-IoU)+w2|C_e-C_b|+w3I(Y_e≠Y_b)+w4|T_e-T_b| / T_tol; Where IoU is the Intersection over Union (IoU) of the target bounding boxes, C_e and C_b are the confidence scores of the edge detection results and the baseline detection results, respectively, Y_e and Y_b are the categories of the edge detection results and the baseline detection results, respectively, T_e and T_b are the timestamps of the edge detection results and the baseline detection results, respectively, T_tol is the timestamp tolerance, w1, w2, w3 and w4 are the corresponding weights, and I(·) is the indicator function, which takes a value of 1 when the condition in parentheses is true, and a value of 0 otherwise.
[0114] The weights and difference thresholds can be determined through preset configurations, historical evaluation statistics, or manual calibration results.
[0115] The weights, timestamp tolerances, and difference thresholds can also be used to form analysis configuration versions (analysis_config_version), and these analysis configuration versions can be associated with the corresponding evaluation results so that the difference analysis conditions used in different evaluation reports can be traced.
[0116] When the baseline detection result contains a target but the end-side detection result does not contain a corresponding target, the corresponding event is identified as a missed detection event; when the end-side detection result contains a target but the baseline detection result does not contain a corresponding target, the corresponding event is identified as a false detection event.
[0117] When multiple targets exist at the same timestamp, they are matched one-to-one according to the intersection-union ratio of the target boxes from largest to smallest; the S_diff of each matched target is calculated, and the maximum value of the S_diff and the maximum value of the preset scores of the missed and false detection items is used as the difference score of the timestamp.
[0118] The output of the difference analysis may also include matching frames, edge-only detection frames, baseline-only detection frames, correct detection events, false detection events, missed detection events, confidence differences, crossover / union differences of target boxes, category-level statistics, and timestamp-level differences.
[0119] When the timestamp-level difference score exceeds the preset difference threshold, the corresponding frame can be identified as a frame to be reviewed or a candidate frame for retesting.
[0120] In one implementation, the corresponding high-difference results can be written into timestamp-level difference information and associated with the corresponding image detection task. Parsing failures, high-difference results, or abnormal states can also be fed back to the image detection task status and evaluation report status to determine the image frames to be reviewed or retested.
[0121] Step S8: The computer generates a traceable evaluation report based on the unified standard frame-by-frame detection results, result reuse status, timestamp-level difference score, image detection task status, parameter version, model version, and actual running configuration version.
[0122] The evaluation report may include image-level evaluation reports, video-level evaluation reports, comparison reports of detected objects, comparison reports of model versions, and timestamp-level difference information.
[0123] For video input, the unified standard frame-by-frame detection results can be remapped onto the timeline of the corresponding video based on the frame identifier (frame_id) and timestamp (timestamp_ms).
[0124] The evaluation report can record the task execution status of each image detection task, and record whether the corresponding detection results are obtained by re-executing the detection on the current edge device, directly reused from historical results, or re-analyzed from historical original frame-by-frame detection results.
[0125] Meanwhile, the evaluation report records the corresponding model version, actual running configuration version, and result parsing adapter version. This allows for further tracing of the actual running configuration and parsing conditions that caused the differences when discrepancies occur between different testing objects or different evaluation batches.
[0126] For example, when the end device disconnects during the evaluation task, after the evaluation is resumed, the computer re-executes the result reuse judgment in step S3. For image detection tasks that have been successfully completed and whose re-determined strict reuse fingerprints are consistent with the corresponding historical strict reuse fingerprints, the historical detection results are directly adopted. Only image detection tasks that have not been completed or whose re-determined strict reuse fingerprints are inconsistent with the corresponding historical strict reuse fingerprints are re-entered into steps S4 and S5.
[0127] When only the result parsing adapter is upgraded, while the input content, preprocessing configuration, and actual running configuration remain unchanged, it can enter the reparse-only state and directly re-execute step S6 based on the existing raw result data (raw_result) without re-executing the edge AI detection.
[0128] When the model or runtime environment changes and causes the actual runtime configuration version to change, the corresponding task enters the full retest state, and re-acquires images in batches according to the cache window determined in step S4 and performs the artificial intelligence detection in step S5.
[0129] To further illustrate the actual implementation of the above technical solutions in resource-constrained edge devices, the following explanation is based on exemplary measurement data. It should be noted that the following data are exemplary measurement data, used to illustrate the feasibility of the present invention in a typical low-power network camera AI detection and evaluation scenario and the relative effects between different implementation methods, and do not represent actual edge device testing. The exemplary measurements use a binary capacity caliber, i.e., 1MB = 1024KB, 1GB = 1024MB.
[0130] Under one exemplary testing condition, the duration of the video to be tested is 10 minutes, or 600 seconds; the AI detection frequency is 5FPS, 10FPS, or 15FPS, where FPS represents frames per second; the target resolution image is estimated at 100KB and 150KB; the effective copy throughput of the single-line TF card is estimated at 2MB / s, and the conservative throughput is estimated at 1.5MB / s; the total memory of the end device is 64MB, and the maximum temporary image cache space available for AI detection is 25MB.
[0131] Table 1 below shows the estimated frame data volume for a 10-minute video, calculated using 100KB single-frame images: Table 1
[0132] Table 2 below shows the estimated frame data volume for a 10-minute video, calculated using 150KB single-frame images.
[0133] Table 2
[0134] As shown in Tables 1 and 2, at testing frequencies of 10 FPS or 15 FPS, the target resolution image data size generated from a 10-minute video reaches hundreds of MB or even GB, significantly larger than the 25 MB temporary cache of the edge-side algorithm. Therefore, it is not suitable to cache all the images to be detected corresponding to the complete video on the edge device at once.
[0135] Furthermore, an exemplary calculation was performed on the cache-aware dynamic image capture window in step S4, and the results are shown in Table 3. Table 3 below is an exemplary calculation table of the peak risk of the cache window and the fixed batch size.
[0136] Table 3
[0137] The dynamic window in Table 3 is calculated with C_free,t=25MB and C_safe=5MB. When the recent average image size S_mean is 100KB, the standard deviation of image size S_σ is 20KB, and the risk coefficient k is 1.65, the denominator of the formula is approximately 133KB, and 20MB of available cache budget corresponds to approximately 154 images; when the recent average image size S_mean is 150KB, the standard deviation of image size S_σ is 30KB, the denominator of the formula is approximately 199.5KB, and 20MB of available cache budget corresponds to approximately 102 images.
[0138] Therefore, the number of images acquired in this round of image detection can be adjusted according to the recent image size and its fluctuation, rather than using a fixed batch size.
[0139] The following is an exemplary calculation of the result reuse and abnormal retesting process. The results are shown in Table 4. Table 4 below is an exemplary calculation table for result reuse and incremental retesting.
[0140] Table 4
[0141] For example, in a 10FPS video with 6000 frames to be detected, if the evaluation process is interrupted at 70% progress, the normal full re-detection method would require re-detecting 6000 frames. With the result reuse mechanism of this embodiment, 4200 frames that have been successfully detected can be reused, and only the remaining 1800 frames need to be re-detected using edge AI.
[0142] When the input dataset is expanded by approximately 10%, existing detection results that meet the criteria for result reuse can be retained, and AI detection can be performed only on the newly added portions. For example, if the original 6000 frames are increased to 6600 frames, detection only needs to be performed on the newly added 600 frames.
[0143] When the result-only parsing adapter is upgraded, it can enter the reparse-only state and perform reparse using the historically saved raw result data. The edge device does not need to re-execute the corresponding image AI detection. When the model or runtime environment changes and causes the actual runtime configuration version to change, it enters the full retest state to prevent the incorrect reuse of detection results generated under the old actual runtime configuration.
[0144] Furthermore, an example is given for the timestamp-level difference evaluation in step S7, as shown in Table 5. Table 5 below shows the timestamp-level difference scoring examples.
[0145] Table 5
[0146] The specific values in Table 5 above are only used to illustrate an exemplary calculation situation for timestamp-level difference evaluation, and are not intended to limit the specific difference threshold or judgment boundary used in this invention.
[0147] The above exemplary calculation results show that, under conditions of high detection frame rates and long video lengths, the amount of data corresponding to the target resolution image under test is significantly greater than the temporary image cache space that resource-constrained edge devices can provide. By dynamically adjusting the number of image detection tasks per round based on the currently available image cache space, the securely retained cache, and recent image size statistics, the edge image cache size can be adjusted accordingly to the actual image size and its fluctuations. Furthermore, by using result reuse fingerprints and result reuse failure state machines, the number of edge AI detection tasks that do not need to be re-executed can be reduced in the event of abnormal interruptions, incremental changes in the input dataset, or upgrades to the result parsing adapter.
[0148] This embodiment also provides an artificial intelligence detection and evaluation system for resource-constrained edge devices, used to implement the artificial intelligence detection and evaluation methods described in steps S1 to S8 above.
[0149] The artificial intelligence detection and evaluation system includes a computer-based evaluation system and a detection object agent deployed on the edge device.
[0150] The computer-based assessment system includes a computer-based assessment scheduler, an input processing module, a task planning module, a result reuse and continuation testing module, a result parsing module, a difference scoring module, and a report analysis module.
[0151] The computer-based evaluation scheduler is used to establish a connection with the agent of the object to be detected, obtain the capability information and actual operation configuration information of the object to be detected, and determine the actual operation configuration version based on the actual operation configuration information. At the same time, it maintains the life cycle of the evaluation task and coordinates input processing, image detection task execution, detection result reception and evaluation report generation.
[0152] The input processing module is used to scan the input dataset and identify whether the input asset is an image or a video, and read the content hash, resolution, frame rate, duration and encoding information of the input asset; for video input, video decoding and frame extraction are performed on the computer, and the frame to be detected is converted into an image of the target resolution; for image input, the image is normalized to the target resolution.
[0153] In one specific implementation, the input processing module can further implement input recognition, video frame extraction, and image normalization functions. Specifically, the input recognition function identifies input assets and reads corresponding input asset information; the video frame extraction function generates a video frame extraction timeline based on the target detection frame rate or dynamic frame extraction rules, and handles cases where the source video frame rate is lower than the target detection frame rate; the image normalization function performs resolution tolerance judgment and target resolution conversion. The above functional division is used to illustrate the specific functional implementation of the input processing module and does not require each function to correspond to an independent physical module.
[0154] The task planning module generates image detection tasks based on the processing results of the input processing module, and associates each image detection task with input content identifier, frame identifier, timestamp, image identifier, preprocessing configuration version, and detection object identifier to form a corresponding image detection task list.
[0155] The result reuse and continuation testing module is used to generate strict reuse fingerprints and approximate reuse fingerprints for each image detection task. Based on the strict reuse fingerprints, approximate reuse fingerprints and corresponding historical detection results, it determines whether the current image detection task is to be directly reused, re-parsed based on historical original frame-by-frame detection results, partially re-detected, or fully re-detected.
[0156] When the detection object is disconnected, network communication is abnormal, the end device restarts, or the evaluation task is interrupted, the result reuse and continuation module re-determines the result reuse information corresponding to the image detection task. For detection results with a historical detection status of success and whose re-determined strict reuse fingerprint is consistent with the corresponding historical strict reuse fingerprint, they continue to be reused. For image detection tasks that are incomplete, fail to detect, time out, or whose re-determined strict reuse fingerprint is inconsistent with the corresponding historical strict reuse fingerprint, they are added back to the execution queue.
[0157] The detection object proxy includes a cache-aware scheduling module and an image detection execution module.
[0158] The cache-aware scheduling module is used to obtain the currently available image cache space, the secure retention cache, and the image size statistics of multiple recent images for image detection tasks that are determined to be partial re-detection or full re-detection. Based on the currently available image cache space, the secure retention cache, and the image size statistics, it determines the number of image detection tasks that can be obtained in this round.
[0159] The cache-aware scheduling module is also used to control the acquisition status of image detection tasks based on pause and resume acquisition thresholds. When the image cache usage reaches the pause threshold, the acquisition of new image detection tasks is paused; when the acquired target resolution images have been detected and the corresponding image cache has been released, reducing the image cache usage to below the resume acquisition threshold, the acquisition of new image detection tasks is resumed.
[0160] The image detection execution module is used to acquire target resolution images in batches according to the number of image detection tasks determined by the cache awareness scheduling module, submit the target resolution images one by one to the artificial intelligence detection algorithm for detection, and after obtaining the corresponding original frame-by-frame detection results, send back the detection results, detection status and resource status to the computer, and release the image cache occupied by the corresponding target resolution images after the corresponding detection results are sent back.
[0161] Furthermore, the detection object agent may also include an available cache space monitoring unit, an image task acquisition unit, a result return unit, a temporary image cleanup unit, and an anomaly recovery unit.
[0162] The available cache space monitoring unit is used to obtain the current image cache usage, the current available image cache space, and the image size statistics of multiple recent images on the end device, and provides the information to the cache awareness scheduling module.
[0163] The image task acquisition unit is used to request the corresponding image detection task from the computer based on the number of image detection tasks determined by the cache-aware scheduling module, and to acquire the target resolution image corresponding to the image detection task.
[0164] The result feedback unit is used to send the corresponding original frame-by-frame detection results, detection status, and resource status back to the computer after the artificial intelligence detection algorithm completes the detection of the target resolution image.
[0165] The temporary image cleaning unit is used to delete the corresponding temporary image in the end device and release the corresponding image cache after the corresponding image has been detected and the corresponding original frame-by-frame detection results have been returned. This allows the end device to avoid having to keep historical images that have been detected for a long time.
[0166] The anomaly recovery unit is used to perform recovery processing after the detection object is disconnected, network communication is abnormal, the end device restarts, or the evaluation task is interrupted. In the case of an end device restart, it can first clear temporary images that have not been processed normally, and then request the image detection task that still needs to be performed from the computer.
[0167] The result parsing module is used to select the corresponding result parsing adapter based on the detection object and the corresponding result parsing adapter version, and convert the original frame-by-frame detection results returned by the detection object proxy into unified standard frame-by-frame detection results.
[0168] The unified standard frame-by-frame detection results include at least the standard category, confidence level, bounding box, frame identifier, timestamp, parsing status, and original result reference. When the result parsing adapter is missing, the result parsing adapter version is incompatible, or at least some original detection result fields fail to be parsed, the result parsing module retains the corresponding original result reference, parsing status, and parsing error information for subsequent re-parsing.
[0169] The difference scoring module is used to match the frame-by-frame detection results of the unified standard with the benchmark detection results formed by the local model on the computer, the cloud model, or the historical model version, according to the frame identifier, timestamp, or timestamp tolerance, and generate a timestamp-level difference score based on the intersection-union ratio of the target bounding boxes, confidence difference, category difference, and time offset of the matched targets.
[0170] When the baseline detection result contains a target but the edge detection result does not contain a corresponding target, it can be identified as a missed detection event; when the edge detection result contains a target but the baseline detection result does not contain a corresponding target, it can be identified as a false detection event; for image frames whose timestamp-level difference scores exceed the preset difference threshold, they can be further identified as frames to be reviewed or candidate frames for retesting.
[0171] The report analysis module is used to generate a traceable evaluation report based on frame-by-frame detection results, result reuse status, timestamp-level difference scores, image detection task status, parameter version, model version, and actual running configuration version according to a unified standard.
[0172] The evaluation report may include image-level evaluation reports, video-level evaluation reports, object comparison reports, model version comparison reports, and timestamp-level difference information. It can also record whether the corresponding detection results are obtained by re-detection by the current edge device, directly reused from historical detection results, or re-analyzed from historical original frame-by-frame detection results.
[0173] The aforementioned computer-based evaluation scheduler, input processing module, task planning module, result reuse and continuation testing module, cache-aware scheduling module, image detection execution module, result parsing module, difference scoring module, report analysis module, and the functional units within the detection object agent can be implemented through computer programs, or combined or separated according to the software and hardware architecture of the computing device. The above division of modules and units is primarily used to illustrate the correspondence between functions and does not require that each module or unit correspond to independent physical hardware.
[0174] In another embodiment, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes a corresponding computer system to perform the corresponding steps in the above-described artificial intelligence detection and evaluation method for resource-constrained edge devices, and completes the evaluation task in collaboration with a detection object agent deployed on the edge device.
[0175] The computer-readable storage medium may include a read-only memory, random access memory, flash memory, solid-state drive, memory card, disk, optical disk, or other media capable of storing computer program code.
[0176] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Equivalent substitutions or adjustments made by those skilled in the art to the above steps, data fields, communication methods, module divisions, parameters, or thresholds without departing from the technical concept of the present invention can all be applied to the specific implementation process of the present invention.
Claims
1. An artificial intelligence detection and evaluation method for resource-constrained edge devices, characterized in that, Includes the following steps: Step S1: The computer-based evaluation scheduler establishes a connection with the detection object agent deployed on the edge device, and obtains the detection object capability information and actual operation configuration information. The detection object capability information includes at least the detection object identifier, detection object type, target detection frame rate, algorithm input resolution, and cache space threshold parameter. The actual operation configuration information includes at least the actual effective algorithm parameters, model version, algorithm implementation version, and runtime environment version. The actual operation configuration version is determined based on the actual operation configuration information. Step S2: The computer-based evaluation scheduler scans the input dataset and identifies the input asset as an image or video. For video input, the computer decodes the video, determines the frame to be detected and its corresponding timestamp according to the target detection frame rate, and converts the frame to be detected into an image with the algorithm input resolution. For image input, the input resolution is normalized according to the algorithm to generate an image detection task carrying input content identifier, frame identifier, timestamp, preprocessing configuration version and detection object identifier. The complete video to be tested is not sent to the edge device. Step S3: The computer generates result reuse information for each image detection task. The result reuse information is bound to the input content, preprocessing configuration version, detection object identifier, actual running configuration version, and result parsing adapter version. The result reuse information is compared with the corresponding historical results. Based on the comparison results, a processing method is determined from the following: direct reuse, re-parsing based on historical original detection results, partial re-detection, or full re-detection. Step S4: For the image detection task determined in Step S3 to be either partial re-detection or full re-detection, the detection object agent obtains the currently available image cache space, the security retention cache, and the image size statistics of multiple recent images before each round of image detection task acquisition. Based on the currently available image cache space, the security retention cache, and the image size statistics, the number of image detection tasks that can be acquired in this round is determined. When the image cache usage reaches the pause acquisition threshold, the acquisition of new image detection tasks is paused. When the image cache usage decreases to below the recovery acquisition threshold, the acquisition of new image detection tasks is resumed. The pause acquisition threshold is higher than the recovery acquisition threshold. Step S5: The detection object agent obtains target resolution images in batches according to the number of image detection tasks determined in step S4, submits the target resolution images to the artificial intelligence detection algorithm for image-by-image detection, obtains the original frame-by-frame detection results, and sends back the corresponding original frame-by-frame detection results, detection status and resource status to the computer. After completing the detection of the corresponding image and sending back the results, the image cache occupied by the image is released. Step S6: The computer uses a result parsing adapter corresponding to the version of the result parsing adapter to convert the original frame-by-frame detection results of different detection objects into unified standard frame-by-frame detection results. The unified standard frame-by-frame detection results include at least the standard category, confidence level, target box, frame identifier, timestamp, parsing status, and original result reference. Step S7: The computer matches the frame-by-frame detection results of the unified standard with the baseline detection results of the local model, cloud model or historical model version on the computer according to the frame identifier, timestamp or timestamp tolerance, and generates a timestamp-level difference score based on the crossover ratio of the target bounding boxes of the matched targets, confidence difference, category difference and time offset. Step S8: The computer generates a traceable evaluation report based on the frame-by-frame detection results, result reuse status, timestamp-level difference score, image detection task status, parameter version, model version, and actual running configuration version according to the unified standard.
2. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 1, characterized in that, In step S1, the actual running configuration information also includes model identifier and model verification value. The actual effective algorithm parameters, model identifier, model version, model verification value, algorithm implementation version, running environment version, and detection object identifier are serialized in a preset order, and a hash value is calculated based on the serialization result. The actual running configuration version is generated using the hash value. When the model file, algorithm implementation, or running environment changes, the actual running configuration version is regenerated.
3. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 1, characterized in that, In step S2, when the input asset is a video, the computer generates a frame extraction timeline based on the target detection frame rate; when the source video frame rate is lower than the target detection frame rate, the effective frames actually existing in the source video are used to generate an image detection task, and the duplicate image detection task is not generated by copying the effective frames. The computer determines the dynamic frame extraction interval based on the target detection frame rate, the frame redundancy of the current candidate frame relative to the sampled frames, the motion intensity, and the buffer pressure or task queue pressure. The dynamic frame extraction interval is decreased when the motion intensity increases, and increased when the frame redundancy, buffer pressure, or task queue pressure increases.
4. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 1, characterized in that, In step S3, the result reuse information includes strict reuse fingerprints and approximate reuse fingerprints. The strict reuse fingerprint is generated at least based on the input content hash, preprocessing configuration version, actual running configuration version, result parsing adapter version, detection object identifier, timestamp, and target resolution. The approximate reuse fingerprint is generated at least based on the perceptual hash of the input content, preprocessing configuration version, actual running configuration version, category mapping version, and timestamp tolerance. The approximate reuse fingerprint is not used to directly reuse the corresponding historical detection results, but is used to determine the processing boundaries for re-parsing, partial re-detection, or full re-detection. When the strict reuse fingerprint is consistent and the historical detection status is successful, the corresponding historical detection results are directly reused. When the input content, preprocessing configuration, and actual running configuration have not changed, but the result parsing adapter version has changed and the historical original frame-by-frame detection results are available, the historical original frame-by-frame detection results are re-parsed. When the input dataset undergoes partial addition, deletion, or replacement, partial re-detection is performed on the image detection task affected by the changes. When the actual running configuration version changes due to changes in the model version, algorithm implementation version, or runtime environment version, a full re-detection is performed on the image detection task of the corresponding detection object.
5. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 4, characterized in that, In step S3, when the detected object is disconnected, network communication is abnormal, the terminal device is restarted, or the evaluation task is interrupted, the computer terminal re-determines the strict reuse fingerprint and approximate reuse fingerprint corresponding to each image detection task when the evaluation is resumed. For image detection tasks with a historical detection status of success and a newly determined strict reuse fingerprint that matches the corresponding historical strict reuse fingerprint, the corresponding historical detection result is reused; for image detection tasks that are incomplete, fail to detect, time out, or have a newly determined strict reuse fingerprint that does not match the corresponding historical strict reuse fingerprint, the corresponding image detection task is added back to the pending execution queue.
6. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 1, characterized in that, In step S4, let the available image cache space at time t be C_free,t, the safe retention cache be C_safe, the mean image size of the most recent N images be S_mean, the standard deviation of the image size be S_σ, the risk coefficient be k, and the number of image detection tasks that can be obtained in this round be B_t. When the current image cache usage reaches the pause threshold or C_free,t≤C_safe, B_t=0; otherwise, the number of image detection tasks that can be acquired in this round is determined according to the following formula: B_t = max{0, floor[(C_free, t-C_safe) / (S_mean+kS_σ)]}; where the pause acquisition threshold is higher than the resume acquisition threshold to form hysteresis control for image detection task acquisition; when the image cache usage reaches the pause acquisition threshold, the acquisition of new image detection tasks is stopped, and when the image cache usage decreases to below the resume acquisition threshold, the acquisition of new image detection tasks is resumed.
7. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 1, characterized in that, In step S6, the result parsing adapter converts the original frame-by-frame detection results into a unified standard frame-by-frame detection result that includes standard category, standard confidence, target box, frame identifier, timestamp, parsing status, and original result reference, based on the original category representation, coordinate format, confidence range, and extended attributes corresponding to the detected object. When the result parsing adapter is missing, the result parsing adapter version is mismatched, or at least some fields in the original frame-by-frame detection result fail to be parsed, the corresponding original result reference, parsing status, and parsing error information are retained for subsequent re-parsing.
8. The artificial intelligence detection and evaluation method for resource-constrained edge devices according to claim 7, characterized in that, In step S7, when the frame identifiers of different detection objects cannot directly correspond or the timestamps are offset, the computer performs timestamp nearest neighbor matching between the unified standard frame-by-frame detection results and the benchmark detection results within a preset timestamp tolerance range, and determines the timestamp-level difference score S_diff according to the following formula: S_diff=w1(1-IoU)+w2|C_e-C_b|+w3I(Y_e≠Y_b)+w4|T_e-T_b| / T_tol; Where IoU is the intersection-union ratio of the matched target boxes, C_e and C_b are the confidence scores of the edge detection results and the baseline detection results, respectively, Y_e and Y_b are the categories of the edge detection results and the baseline detection results, respectively, T_e and T_b are the timestamps of the edge detection results and the baseline detection results, respectively, T_tol is the timestamp tolerance, w1, w2, w3 and w4 are the corresponding weights, and I(·) is the indicator function, which takes a value of 1 when the condition in the parentheses is true and a value of 0 when the condition in the parentheses is false. When the benchmark detection result contains a target but the end-side detection result does not contain a corresponding target, the corresponding event is determined as a missed detection event; when the end-side detection result contains a target but the benchmark detection result does not contain a corresponding target, the corresponding event is determined as a false detection event; frames whose timestamp-level difference scores exceed a preset difference threshold are determined as frames to be reviewed or candidate frames for retesting.
9. An artificial intelligence detection and evaluation system for resource-constrained edge devices, characterized in that, This includes computer-based testing systems and testing object proxies deployed on edge devices; The computer-based assessment system includes a computer-based assessment scheduler, an input processing module, a task planning module, a result reuse and continuation testing module, a result parsing module, a difference scoring module, and a report analysis module. The computer-based evaluation scheduler is used to establish a connection with the agent of the object being tested, obtain the capability information and actual running configuration information of the object being tested, and determine the actual running configuration version based on the actual running configuration information. The input processing module is used to scan the input dataset, identify the input asset as an image or video, perform video decoding and frame extraction on the computer and convert it into an image of the target resolution, and perform normalization processing on the image input. The task planning module is used to generate an image detection task with input content identifier, frame identifier, timestamp, preprocessing configuration version and detection object identifier based on the processing result of the input processing module. The result reuse and retesting module is used to generate result reuse information based on the input content, preprocessing configuration version, detection object identifier, actual running configuration version, and result parsing adapter version, and to determine one of the following processing methods based on the result reuse information and corresponding historical results: direct reuse, re-parsing based on historical original detection results, partial re-detection, or full re-detection. The detection object proxy includes a cache-aware scheduling module and an image detection execution module; The cache-aware scheduling module is used to obtain the currently available image cache space, the secure retention cache, and the image size statistics of multiple recent images for image detection tasks determined by the result reuse and continuation testing module as either partial re-detection or full re-detection. Based on the currently available image cache space, the secure retention cache, and the image size statistics, the module determines the number of image detection tasks that can be acquired in this round, and controls the pause and resumption of image detection tasks based on the pause acquisition threshold and the resume acquisition threshold. The image detection execution module is used to acquire target resolution images in batches according to the determined number of image detection tasks, perform artificial intelligence detection on the acquired target resolution images, send back the corresponding original frame-by-frame detection results, detection status and resource status to the computer, and release the image cache occupied by the images that have completed detection. The result parsing module is used to convert the original frame-by-frame detection results into unified standard frame-by-frame detection results through a result parsing adapter corresponding to the result parsing adapter version, while retaining the original result references; The difference scoring module is used to match the frame-by-frame detection results of the unified standard with the benchmark detection results according to the frame identifier, timestamp, or timestamp tolerance, and generate a timestamp-level difference score based on the target box intersection-union ratio, confidence difference, category difference, and time offset. The report analysis module is used to generate a traceable evaluation report based on the frame-by-frame detection results, result reuse status, timestamp-level difference score, image detection task status, parameter version, model version, and actual running configuration version according to the unified standard.
10. The artificial intelligence detection and evaluation system for resource-constrained edge devices according to claim 9, characterized in that, The detection object agent also includes an available cache space monitoring unit, an image task acquisition unit, a result return unit, a temporary image cleanup unit, and an anomaly recovery unit; The available cache space monitoring unit is used to obtain the current image cache usage, the current available image cache space, and the image size statistics of multiple recent images; The image task acquisition unit is used to acquire the corresponding target resolution image from the computer according to the number of image detection tasks determined by the cache awareness scheduling module. The result feedback unit is used to send the original frame-by-frame detection results, detection status, and resource status back to the computer. The temporary image cleaning unit is used to delete the corresponding temporary image and release the image cache it occupies after the corresponding image has been detected and the corresponding original frame-by-frame detection result has been returned. The anomaly recovery unit is used to clean up unfinished temporary images and request the image detection task that still needs to be executed from the computer after the detection object is disconnected, network communication is abnormal, the end device is restarted, or the evaluation task is interrupted.
Citation Information
Patent Citations
System and method for dynamically setting batch interval size under discrete stream processing model
CN105677489B
Batch processing remote sensing image intelligent processing model prediction performance optimization system and method
CN113434303A
Evaluation method and device based on image target recognition algorithm, equipment and medium
CN119169416A
