A safety supervision field target detection correction method and system based on a scene feature library
By constructing a target detection correction method based on a scene feature library, and utilizing multi-scale feature extraction and feature compensation techniques, the problem of decreased target detection accuracy in complex scenes is solved, achieving high-precision and adaptive target detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THREE GORGES HI TECH INFORMATION TECH CO LTD
- Filing Date
- 2025-09-18
- Publication Date
- 2026-08-04
AI Technical Summary
In target detection in complex scenes, how can we achieve high-precision and robust target detection under extreme conditions such as occlusion, low resolution, and changes in lighting across scenes, while ensuring that the system can adapt to the dynamic changes of new scenes?
By constructing a target detection and correction method based on a scene feature library, and utilizing multi-scale feature extraction technology, local feature cascade verification mechanism and feature compensation technology, the feature library is dynamically updated to adapt to new scenes.
It significantly improves detection accuracy and robustness, can quickly adapt to complex environmental changes, and provides an efficient intelligent monitoring solution.
Smart Images

Figure CN121392233B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, specifically to a target detection and correction method and system for the field of safety supervision based on a scene feature library. Background Technology
[0002] In object detection tasks in complex scenarios, the core technical challenge lies in achieving high-precision and robust object detection under extreme conditions such as occlusion, low resolution, and cross-scene lighting variations, while ensuring the system can adapt to dynamic changes in new scenes. This problem stems from the complexity of real-world business scenarios. For example, in intelligent surveillance, targets may be partially occluded, leading to feature loss; low-resolution images make it difficult to capture details; and lighting variations in different scenes cause significant differences in the visual features of the same target, resulting in decreased accuracy or even failure of traditional detection methods. Further analysis reveals that occlusion causes incomplete local features of the target, making it difficult for detection algorithms to accurately distinguish between the target and the background; in low-resolution scenes, insufficient image details make feature extraction difficult, and traditional models cannot effectively infer the presence of the target; cross-scene lighting variations introduce dynamic changes in feature distribution, making fixed feature templates unable to adapt to new scenes, and detection results prone to bias or even errors. Furthermore, in long-term operation, the system must cope with the continuous emergence of new scenes, such as new target types or environmental changes. Traditional static models cannot dynamically adjust, leading to a degradation in detection performance over time.
[0003] These seemingly minor issues collectively constitute a core contradiction: how to ensure both high accuracy and robustness in detection, while simultaneously achieving rapid adaptation to unknown scenarios, under constraints such as feature loss, low image quality, and dynamic scene changes. This contradiction permeates the entire process of target detection in complex scenes, involving feature extraction, bounding box correction, and model adaptation. It urgently requires technological innovation to address this challenge and meet the practical needs of business scenarios such as intelligent monitoring. Summary of the Invention
[0004] This invention provides a target detection and correction method and system for the field of safety supervision based on a scene feature library. The purpose is to solve the problem of decreased target detection accuracy in existing technologies for business scenarios such as occlusion, low resolution, and cross-scene lighting changes.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A target detection and correction method for the field of safety supervision based on scene feature library includes: acquiring an input image, generating an initial set of detection boxes according to a target detection model, and obtaining features by combining a dynamic feature library of local target features; Based on multi-scale feature extraction technology, a dynamic feature library containing local features of the target is constructed to obtain cross-scene feature information after storage; The process of constructing a dynamic feature library containing local features of the target based on multi-scale feature extraction technology to obtain stored cross-scene feature information includes: generating multi-scale images for the region of interest of the input image, extracting scale-invariant feature transform features and Gaussian difference features to generate cross-scale feature descriptions; generating local feature attention maps through a pre-trained visual transformer model, assigning higher weights to features in key target regions, and suppressing background noise interference; performing real-time clustering of new features based on density clustering algorithm, merging new features with existing clusters if the distance between the new features and existing clusters is less than a preset threshold, otherwise creating new clusters; and evaluating the effectiveness of features in the dynamic feature library using a scoring function, deleting invalid features if the score is lower than a preset threshold. Based on the local feature cascade verification mechanism, the initial detection box set is corrected and the detection result is output; The local feature-based cascaded verification mechanism corrects the initial detection box set and outputs detection results, including: extracting scale-invariant feature transformation features of multiple key local regions for the initial detection boxes; retrieving the dynamic feature library using a fast similarity search tool; determining whether the feature matching scores of at least some key regions are greater than a preset threshold to obtain preliminary matching results; verifying whether the divergence between the global illumination histogram of the image to which the matching features belong and the current image is less than a preset threshold to exclude mismatches across illumination scenes; and adjusting the confidence and position information of the detection boxes according to the verification results to generate corrected detection results. Based on the detection results, occluded or low-resolution targets are screened out, and for the occluded or low-resolution targets, feature compensation technology is used to reconstruct the missing features. The step of filtering out occluded or low-resolution targets based on the detection results, and reconstructing missing features for the occluded or low-resolution targets using feature compensation technology, includes: determining whether the visible pixel ratio of the detection box is lower than a preset ratio; if it is lower, retrieving features of similar occlusion patterns from the dynamic feature library; for the retrieved similar occlusion pattern features, completing the missing feature vector of the detection box through feature interpolation; for targets with a resolution lower than a preset threshold, using the low-frequency components of high-resolution features in the dynamic feature library, combined with a super-resolution model to reconstruct target details; and adjusting the feature representation dimension of the detection box based on the reconstructed feature vector to generate a compensated detection result. Based on the feedback from the detection results, the dynamic feature library is dynamically updated to adapt to new scenarios; The step of dynamically updating the dynamic feature library to adapt to new scenarios based on the feedback of the detection results includes: determining whether the confidence level of the detection results is lower than a preset threshold; if so, transmitting the detection results to the manual review interface; generating new features and adding them to the dynamic feature library based on the annotation results returned by the manual review interface; re-indexing the dynamic feature library and updating the central features of the feature clusters; and triggering semi-supervised retraining based on the decrease in matching scores of similar hidden dangers detected over multiple consecutive days, thereby expanding the relevant feature clusters in the dynamic feature library.
[0006] In one aspect of this disclosure, the step of generating a multi-scale image based on the region of interest of the input image, extracting scale-invariant feature transform features and Gaussian difference features, and obtaining a cross-scale feature description includes: Generate a set of images with multiple magnification scales for the region of interest in the input image; For each scale of the image, scale-invariant feature transformation features are extracted to generate high-dimensional feature vectors; For each scale of the image, Gaussian difference features are calculated to generate low-dimensional edge feature descriptions; By fusing the scale-invariant feature transformation features and the Gaussian difference features, a cross-scale feature description is generated.
[0007] In one aspect of this disclosure, the step of verifying whether the divergence between the global illumination histogram of the image to which the matching feature belongs and the current image is less than a preset threshold, and eliminating false matching across illumination scenes, includes: Obtain the global illumination histogram of the image to which the matching feature belongs, and calculate the global illumination histogram of the current image; The difference between the global illumination histograms is calculated based on the kld quantization formula. Determine whether the difference value is less than a preset threshold; if it is less, determine that the matching feature is consistent with the current image illumination. Based on the illumination consistency verification results, matching features that do not meet the conditions are filtered out, and the final verification results are generated.
[0008] In one aspect of this disclosure, the step of reconstructing target details for a target with a resolution lower than a preset threshold by utilizing the low-frequency components of high-resolution features in the dynamic feature library and combining them with a super-resolution model includes: For targets with resolutions below a preset threshold, high-resolution features corresponding to the target category are extracted from the dynamic feature library; Based on principal component analysis, low-frequency components of the high-resolution features are extracted to generate low-dimensional feature representations; For the low-dimensional feature representation, an enhanced super-resolution generative adversarial network model is combined to reconstruct the high-resolution feature details of the target. The reconstructed features are fused with the original low-resolution features to generate a compensated high-dimensional feature vector.
[0009] In another aspect, this disclosure also relates to a target detection and correction system for the field of safety supervision based on a scene feature library, characterized in that it includes: The image acquisition module is used to acquire the input image and generate an initial set of detection boxes based on the target detection model. It also combines the dynamic feature library of local target features to obtain features. The feature extraction module is used to construct a dynamic feature library containing local features of the target based on multi-scale feature extraction technology, and obtain the stored cross-scene feature information. The process of constructing a dynamic feature library containing local features of the target based on multi-scale feature extraction technology to obtain stored cross-scene feature information includes: generating multi-scale images for the region of interest of the input image, extracting scale-invariant feature transform features and Gaussian difference features to generate cross-scale feature descriptions; generating local feature attention maps through a pre-trained visual transformer model, assigning higher weights to features in key target regions, and suppressing background noise interference; performing real-time clustering of new features based on density clustering algorithm, merging new features with existing clusters if the distance between the new features and existing clusters is less than a preset threshold, otherwise creating new clusters; and evaluating the effectiveness of features in the dynamic feature library using a scoring function, deleting invalid features if the score is lower than a preset threshold. A dynamic feature library is used to correct the initial set of detection boxes based on a local feature cascade verification mechanism and output the detection results. The local feature-based cascaded verification mechanism corrects the initial detection box set and outputs detection results, including: extracting scale-invariant feature transformation features of multiple key local regions for the initial detection boxes; retrieving the dynamic feature library using a fast similarity search tool; determining whether the feature matching scores of at least some key regions are greater than a preset threshold to obtain preliminary matching results; verifying whether the divergence between the global illumination histogram of the image to which the matching features belong and the current image is less than a preset threshold to exclude mismatches across illumination scenes; and adjusting the confidence and position information of the detection boxes according to the verification results to generate corrected detection results. The detection box generation module is used to filter out occluded or low-resolution targets based on the detection results, and to reconstruct missing features for the occluded or low-resolution targets using feature compensation technology. The step of filtering out occluded or low-resolution targets based on the detection results, and reconstructing missing features for the occluded or low-resolution targets using feature compensation technology, includes: determining whether the visible pixel ratio of the detection box is lower than a preset ratio; if it is lower, retrieving features of similar occlusion patterns from the dynamic feature library; for the retrieved similar occlusion pattern features, completing the missing feature vector of the detection box through feature interpolation; for targets with a resolution lower than a preset threshold, using the low-frequency components of high-resolution features in the dynamic feature library, combined with a super-resolution model to reconstruct target details; and adjusting the feature representation dimension of the detection box based on the reconstructed feature vector to generate a compensated detection result. The feature matching module is used to dynamically update the dynamic feature library to adapt to new scenarios based on the feedback of the detection results. The step of dynamically updating the dynamic feature library to adapt to new scenarios based on the feedback of the detection results includes: determining whether the confidence level of the detection results is lower than a preset threshold; if so, transmitting the detection results to the manual review interface; generating new features and adding them to the dynamic feature library based on the annotation results returned by the manual review interface; re-indexing the dynamic feature library and updating the central features of the feature clusters; and triggering semi-supervised retraining based on the decrease in matching scores of similar hidden dangers detected over multiple consecutive days, thereby expanding the relevant feature clusters in the dynamic feature library.
[0010] Compared with the prior art, the present invention has the following beneficial effects: This invention utilizes multi-scale feature extraction technology, fusing scale-invariant feature transformation and Gaussian difference features, to construct a dynamic feature library of target local features, capturing target cross-scene feature information. Combined with a local feature cascade verification mechanism, it employs fast similarity search and global illumination histogram divergence verification to correct initial detection boxes, significantly improving detection accuracy. For occluded or low-resolution targets, this invention uses feature compensation technology, reconstructing missing features through feature interpolation and a super-resolution model to ensure detection robustness. Simultaneously, through detection result feedback and manual review, the feature library is dynamically updated and semi-supervised retraining is triggered to adapt to new scene changes. This invention, through the dynamic construction and updating of the feature library, achieves high accuracy and adaptability in target detection under complex environments, significantly improving the robustness and reliability of cross-scene target detection, and providing an efficient solution for intelligent monitoring and analysis in complex scenarios. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0012] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0013] The present invention will be further described below with reference to embodiments. These embodiments are merely some, not all, of the embodiments described. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the protection scope of the present invention.
[0014] Example 1 Please see Figure 1 As shown, this embodiment discloses a target detection and correction method for the safety supervision field based on a scene feature library, including: acquiring an input image, generating an initial detection box set according to a target detection model, and obtaining features by combining a dynamic feature library of target local features; constructing a dynamic feature library containing target local features according to multi-scale feature extraction technology to obtain stored cross-scene feature information; correcting the initial detection box set based on a local feature cascade verification mechanism and outputting detection results; filtering out occluded or low-resolution targets according to the detection results, and reconstructing missing features for the occluded or low-resolution targets using feature compensation technology; and dynamically updating the dynamic feature library according to the feedback of the detection results to adapt to new scenes.
[0015] This invention utilizes multi-scale feature extraction technology, fusing scale-invariant feature transformation and Gaussian difference features, to construct a dynamic feature library of target local features, capturing target cross-scene feature information. Combined with a local feature cascade verification mechanism, it employs fast similarity search and global illumination histogram divergence verification to correct initial detection boxes, significantly improving detection accuracy. For occluded or low-resolution targets, this invention uses feature compensation technology, reconstructing missing features through feature interpolation and a super-resolution model to ensure detection robustness. Simultaneously, through detection result feedback and manual review, the feature library is dynamically updated and semi-supervised retraining is triggered to adapt to new scene changes. This invention, through the dynamic construction and updating of the feature library, achieves high accuracy and adaptability in target detection under complex environments, significantly improving the robustness and reliability of cross-scene target detection, and providing an efficient solution for intelligent monitoring and analysis in complex scenarios.
[0016] Example 2 Please see Figure 1 As shown, this embodiment is a further optimization based on Embodiment 1. In this embodiment, the detection method may specifically include: Step S101: Obtain the input image, generate an initial set of detection boxes through the target detection model, and extract features by combining the dynamic feature library of target local features; based on multi-scale feature extraction technology, construct a dynamic feature library containing target local features and store cross-scene feature information.
[0017] In one embodiment, an input image is acquired, an initial set of detection boxes is generated through an object detection model, and features are extracted by combining a dynamic feature library of local target features. Specifically, the process includes the following steps.
[0018] Step S1: Obtain the input image and generate an initial set of detection boxes using the object detection model.
[0019] Specifically, two-dimensional images collected by law enforcement recorders or drones are used as input images. A pre-trained YOLOv10 model is used to process the input images to generate an initial set of detection boxes containing location coordinates and confidence scores, such as target boxes for helmets or reflective vests.
[0020] Step S11: Extract features by combining the dynamic feature library of local features of the target.
[0021] For example, the scale pyramid method is applied to the region of interest within the initial detection box to generate multi-scale images, such as 1x, 2x, 4x and 8x magnification, from which SIFT features and LoG features are extracted. These features are then matched with entries in a dynamic feature library of local features of the target to correct the initial detection results.
[0022] In one possible implementation, this combination improves the accuracy of feature extraction from 70% to 92% in low-light environments because the dynamic library provides a reference for historical low-light features, effectively compensating for the degradation caused by the decrease in signal-to-noise ratio.
[0023] Step S2: Based on multi-scale feature extraction technology, construct a dynamic feature library containing local features of the target and store cross-scene feature information.
[0024] Specifically, multi-scale feature extraction technology is used to capture cross-scale information from regions of interest, and a dynamic library is built through incremental clustering to store features such as helmet buckle features under different lighting and angles to support cross-scene reuse.
[0025] Step S21: Generate multi-scale images of the region of interest and extract local features.
[0026] For example, a 4-scale image is generated for the region within the detection box, and 128-dimensional SIFT features and 64-dimensional LoG features are extracted. These features capture details from pixel-level edges to semantic-level structures, ensuring that the library contains comprehensive local information.
[0027] Step S211: Use an attention weighting mechanism to enhance the features of key regions.
[0028] Specifically, attention maps are generated using a pre-trained ViT-B / 16 model, and key areas such as safety helmet buckles are given double the weight to suppress background noise, thereby making the extracted features more focused on safety supervision targets and improving the targeting of the database.
[0029] Step S22: Perform dynamic management of the feature library and store cross-scene feature information.
[0030] For example, the newly extracted features are clustered in real time using the DBSCAN algorithm. If the cosine distance is less than 0.3, they are merged into the existing cluster; otherwise, a new cluster is created and the cluster center is updated. For example, the features of the safety helmet under side lighting are classified into the lighting interference cluster, and cross-scene information such as feature reuse from construction site to energy station is stored.
[0031] Step S221: Apply feature validity scoring to maintain library capacity.
[0032] For example, the scoring function is designed based on the ratio of the number of successful matches to the total number of matches. When the score is below 0.2, invalid features are deleted, keeping the library capacity to no more than 100,000 records. This ensures dynamic optimization and efficient storage of the library.
[0033] In one embodiment, this construction process significantly reduces the response cycle in safety supervision scenarios. For example, when new hidden dangers emerge, by reusing similar features in the library, the response time is shortened from 10 days to 2 days, which is beneficial for quickly adapting to complex environments such as nighttime construction and improving the detection recall rate to over 98%.
[0034] It should be noted that the initial set of detection boxes generated in step S1 is directly used as the input to the region of interest in step S2, forming a closed loop. For example, the features within the detection boxes are extracted and updated to the dynamic library, which in turn improves the accuracy of subsequent extractions.
[0035] In one embodiment, for the feature extraction in step S11, in small target scenarios, such as targets with pixels smaller than 80 x 80, the low-frequency components of high-resolution features in the library are combined with the ESRGAN model to reconstruct details, thereby increasing the feature dimension from 128 dimensions to 512 dimensions. This increases the small target detection rate from 60% to 90% in UAV inspection, which is beneficial for reducing missed detections.
[0036] For example, regarding the multi-scale extraction in step S21, in an occluded scene, if the visible pixel ratio is less than 50%, the features of similar occlusion patterns in the search library are interpolated to complete the missing vector. For example, if a safety helmet is occluded by a 40% mask, the missing vector is completed, improving the matching accuracy to over 85% and effectively solving the problem of missing context association.
[0037] In one possible implementation, the dynamic management of step S22 is automatically triggered during continuous detection. For example, when the matching score of similar hazards drops by 15%, clusters are expanded using unlabeled images. This reduces the false detection rate by 75% in construction site scenarios, such as reducing the probability of misidentifying a yellow plastic sheet as a safety helmet from 12% to 3%, and enhancing robustness through blacklist filtering.
[0038] Step S102: The initial detection box is corrected through a local feature cascade verification mechanism, and the detection result is output; for occluded or low-resolution targets, the missing features are reconstructed using feature compensation technology.
[0039] In one embodiment, the initial detection box is corrected through a local feature cascade verification mechanism, and the detection result is output. Specifically, the steps include: step S1, extracting features of key local regions from the detection box, performing coarse matching by searching the feature library, and requiring at least 3 regions to have matching scores higher than a preset threshold.
[0040] Step S11: Extract scale-invariant feature transformation features of 5 key local regions within the detection box. These regions include the top of the safety helmet and the left chest position of the reflective vest, etc. Calculate the matching score with the corresponding features in the feature library using cosine similarity.
[0041] Step S12: If the number of successfully matched regions reaches more than 3 and each region has a score greater than 0.7, then proceed to the fine verification stage; otherwise, mark them as potential false detections and adjust the confidence level.
[0042] For example, in a safety monitoring scenario, when processing nighttime construction images, this step can effectively filter out blurred features caused by lighting interference, ensuring that only reliably matching detection boxes continue to be processed, thereby reducing the false positive rate.
[0043] Step S2: For successfully matched features, verify that the global illumination histogram of the image to which it belongs has a Körbek-Leibler divergence with the current image that is less than 0.5 to avoid mismatches across illumination scenes, and correct the detection box position and confidence accordingly, and output the final detection result.
[0044] In one embodiment, the verification is achieved by comparing the differences in histogram distributions. If the divergence value is too high, the confidence level is reduced or feature clusters under similar lighting conditions are retrieved again, thereby improving accuracy in varying lighting environments.
[0045] For example, in scenarios where rapid worker movement causes motion blur, this mechanism corrects the detection frame of reflective clothing stripes, increasing the recall rate of the output results from the original 90% to over 98%, which is beneficial for timely detection of safety hazards.
[0046] For occluded or low-resolution targets, feature compensation technology is used to reconstruct missing features. Specifically, step S3 is as follows: if the visible pixel ratio of the detection box is less than 50%, features of the same type of target plus similar occlusion pattern in the feature library are automatically retrieved, and the feature vector of the missing region is completed by feature interpolation.
[0047] Step S31: Calculate the percentage of visible pixels and determine the degree of occlusion using the pixel counting method. If it is lower than the threshold, query the feature library for entries marked with the occlusion ratio, such as the feature that the safety helmet is 40% occluded by the face mask.
[0048] Step S32: Use linear interpolation to fuse the retrieved feature vectors with existing visible features to generate a complete feature representation for subsequent verification.
[0049] Specifically, this compensation technology is particularly effective in safety inspections. For example, when the safety rope is 70% covered by the tool bag, the accuracy of local feature matching is increased from 58% to 85% through interpolation reconstruction, reducing the probability of misjudging that the rope is not being worn.
[0050] Step S4: For targets with pixels smaller than 80x80, the low-frequency components of high-resolution features in the feature library are used to extract the first 32 principal components through principal component analysis. The enhanced super-resolution generative adversarial network model is then combined with the model to reconstruct details, thereby increasing the effective feature dimension to 512 dimensions.
[0051] In one embodiment, the reconstruction process first extracts low-frequency components as prior knowledge input to the model, then generates high-resolution image fragments, which are then fused back into the original detection boxes.
[0052] For example, when drones are used to inspect small targets at a distance, such as workers 300 meters away, this method increases the pixel size from extremely small to a detection rate of over 90%, which is beneficial for covering large construction sites without the need for additional hardware.
[0053] Step S103: Based on the detection result feedback, dynamically update the dynamic feature library to adapt to the new scenario.
[0054] In one embodiment, step S1 dynamically updates the dynamic feature library to adapt to new scenarios through detection result feedback. Specifically, step S11 involves obtaining detection results and determining the confidence level. When the confidence level is lower than 0.8, a feedback link is triggered to send the results to the review module for processing. The feedback link is built based on historical detection data to ensure that low-confidence results are intervened in a timely manner.
[0055] Step S12: Based on the output of the review module, generate new feature annotations, corresponding to local features in the detection results such as the edge of the safety helmet or the stripes of the reflective clothing, and perform vector extraction and annotation supplementation.
[0056] Step S13: Using the labeled features, update the dynamic feature library through a re-indexing mechanism, with the time taken within 5 minutes, to achieve real-time library refresh.
[0057] Step S14: Monitor continuous detection data. When the matching score of the same type of hidden danger drops by 15% for 3 consecutive days, semi-supervised retraining is automatically triggered. Expand relevant feature clusters using unlabeled images, such as expanding feature clusters under new lighting conditions to cover nighttime scenes.
[0058] Specifically, the update method provided by this implementation can be applied to target detection devices in safety supervision scenarios, forming a closed-loop optimization through the feedback loop of detection results. The feedback loop starts with the detection results, assessing the confidence level to determine whether to proceed to review. If the confidence level is low, image regions are extracted from the results, generating feature vectors such as 128-dimensional SIFT descriptors, and labeled as new entries. Subsequently, these labels are directly input into the re-indexing process, using the FAISS tool to quickly update the library, ensuring that new features are immediately available. The monitoring part statistically analyzes the matching score trend. For example, if the matching score of the feature "safety helmet under low light" drops from an initial 0.85 to 0.72 (a decrease of 15%) within three consecutive days, retraining is triggered. Unlabeled images are used to expand clusters through DBSCAN clustering, updating cluster centers to adapt to scene changes such as from day to night. This significantly improves the adaptability of the feature library, reducing the false negative rate in new scenarios from 25% in traditional methods to 5%, and shortening the response time to the minute level.
[0059] For example, in a construction site safety monitoring scenario, if the initial detection result shows that the confidence score of a safety helmet in a nighttime image is 0.75, which is below the threshold of 0.8, a feedback loop is triggered. The review module confirms that this is due to edge blurring caused by side lighting interference, and generates new feature annotations, including extracting the 64-dimensional LoG feature vector of the image and labeling it as "safety helmet under side lighting". Subsequently, this feature is re-indexed and merged into the existing "lighting interference" cluster, and the updated library capacity is kept below 100,000 entries. If the matching score of similar nighttime detections drops by 15% for three consecutive days, such as from 0.8 to 0.68, automatic retraining is performed. The cluster is expanded using unlabeled images collected on-site, introducing more samples with side lighting variations, thereby improving the accuracy of subsequent detections in similar scenarios from 85% to 95%, effectively adapting to the new environmental changes of nighttime construction.
[0060] In one embodiment, the dynamic update of step S1 is further optimized into an automated path. Step S111 collects statistical indicators of the detection results, including the number of successful matches and the number of aging days, and calculates the feature validity score, wherein the score formula is the sum of the number of successful matches divided by the total number of matches plus the number of aging days multiplied by 0.1, which is used to evaluate the validity of the feature entries.
[0061] In step S112, if the score is below 0.2, the corresponding invalid feature is deleted from the dynamic feature library to ensure the refinement of the library.
[0062] Step S113: For the remaining valid features, perform clustering and merging based on the feedback results. For example, use the DBSCAN algorithm to compare the new feedback features with the existing clusters. If the cosine distance is less than 0.3, merge them; otherwise, create new clusters.
[0063] Specifically, this implementation emphasizes the score calculation process. First, it extracts the number of successful matches (i.e., the count of features successfully used in actual detection) and the total number of matches (i.e., the total number of searches) from the detection results. The aging period is the number of days since the feature was last updated. The score is calculated using this formula. For example, if a feature matches successfully 10 times, has a total of 20 matches, and has been aged for 5 days, the score is approximately 0.49. If the score is below 0.2, it is deleted. This calculation ensures that only highly effective features are retained in the library, and the deletion process is automated, avoiding manual intervention. Subsequently, clustering and merging are performed using DBSCAN based on density clustering. The 128-dimensional vector of the new feedback feature is compared with the cosine distance to the cluster center, achieving seamless updates. This allows the feature library to dynamically remove outdated features when adapting to new scenarios such as small targets in drone inspections, improving the overall recall rate to over 98% and reducing storage overhead.
[0064] For example, considering low-resolution image scenes captured by safety supervision enforcement cameras, the detection results showed that a certain "reflective clothing stripe" feature only matched successfully 5 times in recent detections, out of a total of 30 matches. After aging for 10 days, the score was approximately 0.16, which is below 0.2 and therefore deleted. Subsequently, the newly fed-out stripe feature vector was compared with the existing clusters using DBSCAN. If the distance was less than 0.3 (0.25), it was merged into the "motion blur" cluster. After the update, the detection recall rate in similar low-resolution scenes increased from 90% to 98%, effectively adapting to the new scene requirements from static to dynamic shooting.
[0065] In one embodiment, the update for the occlusion scene in step S1 includes step S121, which analyzes the proportion of visible pixels in the detection results. If it is less than 50%, the occlusion mode features, such as the local vector of "the safety rope is 70% covered by the tool bag", are extracted from the feedback.
[0066] Step S122: Use the extracted features to retrieve the dynamic feature library, find entries with similar occlusion patterns, and fill in the vector of the missing region by interpolation.
[0067] Step S123: The completed features are used as new feedback to update the corresponding clusters in the library, thereby realizing the dynamic evolution of adaptation to occlusion.
[0068] Specifically, this implementation focuses on feedback updates for occlusion compensation. First, it calculates the percentage of visible pixels within the detection box, obtained by comparing the pixel count to the total number of pixels. If this percentage is below 50%, it's identified as occlusion feedback, and the remaining visible area's SIFT features (128 dimensions) are extracted. Then, the search library uses FAISS to quickly search for similar patterns, such as entries with a matching score higher than 0.7. The interpolation process then uses linear interpolation to fill in missing vector dimensions, ensuring a complete feature vector. During updates, this completed vector is clustered into relevant clusters, enhancing the library's coverage of occlusion scenarios. This allows the system to quickly adapt to new occlusion types in complex security monitoring environments through feedback, reducing the false positive rate from 32% to below 10%.
[0069] For example, in the safety supervision of high-altitude operations at construction sites, the detection results showed that 40% of the visible pixels in an image of a safety rope were below 50%. The 64-dimensional LoG features of the visible portion were extracted, and the entry "toolkit occlusion 50%" was found in the database with a matching score of 0.75. Interpolation was used to complete the missing 30% vector dimension, generating a complete 512-dimensional feature set, which was then updated to the "occlusion interference" cluster. After this update, the detection accuracy for similar scenarios improved from 58% to 85%, significantly improving adaptability to new occlusion patterns and reducing missed detections.
[0070] In one embodiment, the update of step S1 is extended to small target scenes. In step S131, targets with pixels lower than 80×80 in the detection results are identified, and their low-frequency components are extracted through the first 32 dimensions of PCA.
[0071] Step S132: Combine high-resolution features from the library and use the ESRGAN model to reconstruct details, increasing the feature dimension to 512 dimensions.
[0072] Step S133: Use the reconstructed features as feedback input to update the relevant small target clusters in the dynamic feature library to adapt to the new scenario of long-distance inspection.
[0073] Specifically, this implementation addresses the reconstruction feedback for small targets by first determining the target pixel size. If it's smaller than 80×80, low-frequency components are extracted, and PCA dimensionality reduction is used to retain the first 32 dimensions representing the main structure. Then, the ESRGAN model is fed these components along with high-resolution samples from the library to generate an enhanced image and extract 512-dimensional features. The update process clusters and integrates these features to ensure the library covers more variations in small targets. This improves the low-pixel detection rate to over 90%, adapting to new scenarios such as drones operating at distances of 300 meters.
[0074] For example, in drone-based safety inspections, feedback showed an image of a worker with a resolution of 60×60 pixels. The first 32 dimensions of low-frequency components were extracted using PCA, combined with high-resolution safety helmet features from the database, and reconstructed using ESRGAN. The feature dimension increased to 512 dimensions and was updated to the "small target" cluster. Subsequently, the recall rate for similar long-range detections increased from an initial 70% to 92%, effectively and dynamically adapting to new scenarios with varying inspection heights and reducing the risk of missed detections.
[0075] Step S104, the construction of a dynamic feature library containing local features of the target based on multi-scale feature extraction technology, includes: generating multi-scale images for the region of interest of the input image, extracting scale-invariant feature transformation features and Gaussian difference features, and generating cross-scale feature descriptions; generating local feature attention maps through a pre-trained visual transformer model, assigning higher weights to features in key target regions, and suppressing background noise interference; performing real-time clustering of new features based on a density clustering algorithm, merging new features with existing clusters if the distance between the new features and existing clusters is less than a preset threshold, otherwise creating new clusters; and evaluating the effectiveness of features in the dynamic feature library using a scoring function, deleting invalid features if the score is lower than a preset threshold.
[0076] In one embodiment, the construction of a dynamic feature library containing local features of the target based on multi-scale feature extraction technology includes the following steps.
[0077] Step 1: Generate multi-scale images for the region of interest in the input image, extract scale-invariant feature transformation features and Gaussian difference features, and generate cross-scale feature descriptions.
[0078] Step 1.1: Apply scale transformation to the region of interest to generate four levels of images, including the original scale, 2x magnification, 4x magnification, and 8x magnification, in order to capture detailed information at different resolutions.
[0079] Step 1.2: Extract scale-invariant feature transformation features from these scale images. These features are 128-dimensional vectors that describe the invariance of local key points, such as edges and corners. At the same time, extract Gaussian difference features, which are 64-dimensional vectors that highlight the edge response of the image. These features are obtained through Gaussian filter difference operations.
[0080] Step 1.3: The extracted features are fused into a cross-scale feature description for subsequent processing to ensure comprehensive representation from the pixel level to the semantic level.
[0081] For example, in safety supervision scenarios, after generating multi-scale images of the region of interest of a safety helmet in a nighttime construction image, the extracted scale-invariant feature transformation features can maintain robustness to the edge of the helmet brim. Even when the signal-to-noise ratio decreases when the illumination is below 10 lux, reliable cross-scale descriptions can still be generated, improving detection stability.
[0082] Step 2: Generate local feature attention maps using a pre-trained visual transformer model, assigning higher weights to features in key target regions to suppress background noise interference.
[0083] Step 2.1: Input the cross-scale feature description into the pre-trained visual transformer model. This model divides the image into blocks, calculates the relationship between the blocks through a self-attention mechanism, and generates an attention map.
[0084] Step 2.2: Based on the attention map, key areas such as helmet buckles or reflective clothing stripes are given double the weight. The feature values of these areas are enhanced through multiplication, while the weight of background areas is reduced to reduce the impact of noise.
[0085] Step 2.3: Output the weighted local features for the construction of the dynamic library, ensuring that the features focus on the core part of the safety supervision objectives.
[0086] In one possible implementation, this step is applied to low-light safety monitoring images. After processing by the visual transformer model, the attention weight of the safety helmet edge is increased, which can suppress the interference of construction site background noise, effectively improve the accuracy of feature extraction, and reduce misjudgments such as mistaking plastic sheeting for a safety helmet.
[0087] For example, in scenarios where workers are moving quickly, motion blur causes the resolution of reflective clothing stripes to be less than 2 pixels per cycle. By weighting the stripe region with an attention map, the feature representation is restored from a blurred state to a clear one, and the detection accuracy is increased from 75% to 92%, thereby reducing the risk of missed detections.
[0088] Specifically, in images of small targets such as distant workers inspected by drones, this mechanism assigns higher weight to small pixel regions, suppresses interference from distant backgrounds, makes feature descriptions more accurate, and supports subsequent clustering.
[0089] Step 3: Perform real-time clustering of new features based on density clustering algorithm. If the distance between the new feature and the existing cluster is less than a preset threshold, merge them; otherwise, create a new cluster.
[0090] Step 3.1: Input the weighted local features into the density clustering algorithm. This algorithm scans the feature space and identifies high-density regions as cluster cores.
[0091] Step 3.2: Calculate the minimum cosine distance between the new feature and the existing cluster. If the distance is less than 0.3, merge the new feature into the cluster and update the cluster center to the average vector of all features.
[0092] Step 3.3: If the distance is greater than or equal to 0.3, a new cluster is created, and the new feature is used as the initial center to realize the incremental update of the feature library.
[0093] Step 3.4: Through real-time clustering, ensure that the library can adapt to new scenarios, such as automatically classifying the newly added side-lighting safety helmet feature into the illumination interference cluster.
[0094] In one embodiment, this step demonstrates advantages in a dynamic safety monitoring environment. For example, when adding a low-light safety helmet feature, the density clustering algorithm quickly determines that the distance of 0.25 is less than the threshold and merges it into the existing cluster. After the update, the matching rate of similar features in the library is improved by 15%, reducing the need for retraining.
[0095] For example, when the feature of occlusion of safety rope is introduced, if the distance of 0.4 is greater than the threshold, after the new cluster is created, the library can cover more variant patterns, and the recall rate increases from 85% to 96%, effectively handling partial occlusion misjudgment.
[0096] Understandably, this real-time mechanism shifts the feature library from static to dynamic, accumulating experience through continuous detection. For example, if black shoe uppers are mistakenly identified as heads multiple times within three days, clustering automatically expands related clusters, optimizing the matching score.
[0097] Step 4: For the features in the dynamic feature library, use a scoring function to evaluate the effectiveness of the features. If the score is lower than a preset threshold, delete the invalid features.
[0098] Step 4.1: Apply the scoring function to calculate the score for each feature. This function considers the sum of the number of successful matches divided by the total number of matches plus the number of aging days multiplied by 0.1.
[0099] Step 4.2: If the score is below 0.2, the feature is deleted from the database to maintain the database capacity at no more than 100,000 entries and ensure efficiency.
[0100] For example, in the safety supervision feature database, a certain aging feature score is deleted after it drops to 0.15 to avoid interference from invalid data, keep the detection response time within 5 minutes, and maintain the overall accuracy rate above 90%.
[0101] Step S105, the correction of the initial detection box through the local feature cascade verification mechanism, includes: extracting scale-invariant feature transformation features of multiple key local regions for the initial detection box, and retrieving the dynamic feature library through a fast similarity search tool; determining whether the feature matching scores of at least some key regions are greater than a preset threshold to obtain preliminary matching results; verifying whether the divergence between the global illumination histogram of the image to which the matching features belong and the current image is less than a preset threshold for the preliminary matching results, and eliminating mismatches across illumination scenes; adjusting the confidence and position information of the detection box according to the verification results to generate the corrected detection results.
[0102] In one embodiment, the initial detection box is corrected through a local feature cascade verification mechanism, which specifically includes the following steps.
[0103] Step S1: Extract scale-invariant feature transformation features of multiple key local regions for the initial detection box, and retrieve the dynamic feature library using a fast similarity search tool.
[0104] Specifically, the image region within the initial detection box is divided into five key local regions, such as the top and edge of the safety helmet. Scale-invariant feature transformation features are extracted for each region. These features are 128-dimensional vectors that maintain invariance to scale, rotation, and some illumination changes. Subsequently, a fast similarity search tool is used to efficiently retrieve these features from a dynamic feature library. The library stores pre-constructed local features of various safety monitoring targets, such as reflective clothing stripes at different angles.
[0105] Step S2: Determine whether the feature matching score of at least some key regions is greater than a preset threshold, and obtain preliminary matching results.
[0106] After retrieval, the cosine similarity between the features of each key region and the features in the database is calculated as the matching score. If the scores of at least 3 regions are greater than 0.7, it is considered a preliminary match and a preliminary matching result is formed for subsequent verification.
[0107] Step S3: For the preliminary matching results, verify whether the divergence between the global illumination histogram of the image to which the matching feature belongs and the current image is less than a preset threshold, and eliminate false matching across illumination scenes.
[0108] Step S31: Calculate the global illumination histogram of the image to which the matching feature belongs and the global illumination histogram of the current image. The global illumination histogram is a 256-bin histogram obtained by statistically analyzing the pixel brightness distribution in the image, representing the illumination intensity distribution.
[0109] Step S32: Calculate the Körbek-Leibler divergence based on the two histograms. This divergence measures the difference between the two probability distributions. The calculation process involves summing the values of each bin. The formula involves an asymmetric measure of relative entropy. If the divergence is less than 0.5, it is confirmed that the illumination is consistent, thus avoiding mismatching daytime features with nighttime scenes.
[0110] For example, in a nighttime construction safety supervision scenario, if the safety helmet feature initially matched comes from a daytime image, its histogram shows a high brightness peak, while the current image histogram is biased towards low brightness. Matches are excluded when the divergence is greater than 0.5, thereby reducing the false positive rate.
[0111] In one possible implementation, this step can also incorporate dynamic lighting changes in the safety monitoring scenario, such as light fluctuations when workers move, to improve detection robustness after verification and help reduce feature degradation problems under low light conditions.
[0112] Step S4: Adjust the confidence and position information of the detection box based on the verification results to generate the corrected detection results.
[0113] If the verification passes, the confidence level of the detection box is increased by 10%, and its position is fine-tuned to align with the boundaries of the matching features; otherwise, the confidence level or the filter box is reduced, and the final correction result is generated to ensure the accurate positioning of safety monitoring targets such as safety helmets.
[0114] For example, when processing images that obscure safety ropes, after verification and adjustment, the confidence level increased from 0.6 to 0.75, the position shifted by 2 pixels, and the recall rate was improved to over 98%, which is beneficial for reducing missed detections in actual safety monitoring deployments.
[0115] Step S106, the step of reconstructing missing features using feature compensation technology for occluded or low-resolution targets, includes: determining whether the visible pixel ratio of the detection box is lower than a preset ratio; if so, retrieving features of similar occlusion patterns from the dynamic feature library; for the retrieved similar occlusion pattern features, completing the missing feature vector of the detection box through feature interpolation; for targets with resolution lower than a preset threshold, using the low-frequency components of high-resolution features in the dynamic feature library, combined with a super-resolution model to reconstruct target details; and adjusting the feature representation dimension of the detection box based on the reconstructed feature vector to generate a compensated detection result.
[0116] In one embodiment, it is determined whether the proportion of visible pixels in the detection box is lower than a preset ratio. If it is lower, features of similar occlusion patterns in the dynamic feature library are retrieved. Specifically, step S1 is to calculate the visible part of the pixels in the detection box and determine the proportion value by comparing the ratio of the number of visible pixels to the total number of pixels. The preset ratio is set to, for example, 50% to identify severe occlusion.
[0117] Step S2: Based on the percentage judgment result, if it is lower than the preset percentage, query the feature pattern in the dynamic feature library that is similar to the current target category and degree of occlusion. For example, match the existing feature entry "the safety helmet is occluded by the tool by 40%" by cosine similarity.
[0118] For example, this implementation can quickly respond to occlusion problems in safety monitoring scenarios. For instance, in nighttime construction images, if the visible pixel ratio of the safety rope detection frame is 45% or less than 50%, the system will search the feature library for features similar to "the safety rope is covered by the tool bag", thereby providing a basis for subsequent completion, avoiding direct missed detection, and improving the robustness of detection.
[0119] In one embodiment, for the retrieved similar occlusion pattern features, the missing feature vector of the detection box is completed by feature interpolation. Specifically, step S21 is to perform vector alignment on the retrieved features and map them to the visible feature part of the current detection box.
[0120] Step S22: Calculate the feature values of the missing region using a linear interpolation method. For example, for the missing dimension in the 128-dimensional SIFT feature vector, complete it based on the weighted average of adjacent visible features to form a complete feature representation.
[0121] Step S23: Verify the consistency of the completed vectors to ensure that the KL divergence between the completed part and the visible part is less than 0.5, so as to maintain the semantic coherence of the features.
[0122] Specifically, this completion mechanism is particularly effective in safety supervision environments. For example, when the stripes of reflective clothing are partially obscured, after retrieving similar patterns, the stripe feature vector is reconstructed by interpolation, expanding from the original 64 dimensions to the complete dimension, which improves the algorithm's ability to capture blurry details, thereby reducing the false judgment rate from 32% to less than 10%.
[0123] For example, in an image of a worker wearing a safety helmet, if the brim is 70% obscured by a face mask, the system retrieves high-confidence features of the "brim occlusion pattern" from the feature library, and then interpolates to complete the edge vector, so that the overall feature vector is restored from an incomplete state, thereby improving the context association and reducing the occurrence of false "not wearing" judgments. This approach is beneficial for continuously accumulating scene experience and enhancing the accuracy and recall of detection.
[0124] In one embodiment, for targets with resolutions lower than a preset threshold, the high-resolution feature low-frequency components in the dynamic feature library are used to reconstruct the target details in combination with a super-resolution model. Specifically, step S31 involves checking the target pixel size. If it is lower than the 80x80 threshold, the low-frequency components of the corresponding category of high-resolution features are extracted from the dynamic feature library. Here, the low-frequency components are extracted by principal component analysis to obtain the first 32 principal components. These principal components capture the overall structural information of the features, such as color distribution and basic shape.
[0125] Step S32: The extracted low-frequency components are input into an enhanced super-resolution generative adversarial network model, which includes a generator and a discriminator. The generator produces high-resolution details based on the low-frequency input, and the discriminator evaluates the realism. The refined target image is reconstructed through iterative optimization, for example, the original low-resolution safety helmet image is upgraded from 240x240 to a higher resolution.
[0126] Step S33: Fuse the reconstructed details with the original features to form an enhanced feature representation. The principal component analysis process involves performing singular value decomposition on the high-resolution feature matrix, retaining the first 32 dimensions to represent low-frequency information, thereby ensuring that the reconstructed details are consistent with the experience in the library.
[0127] For example, in the scenario of drone inspection for safety monitoring, if the pixel count of a small target at a distance, such as the reflective clothing of a worker 300 meters away, is below the threshold, the system extracts the low-frequency components of high-resolution stripes in the library, such as the stripe period information captured by the principal components, and then combines them with the model to reconstruct the details, thereby improving the feature resolution from 2 pixels per period to a higher level. This helps to reduce the false negative rate to below 5% and improves the overall detection accuracy through this compensation.
[0128] Specifically, the core of this reconstruction method lies in the utilization of low-frequency components. Principal component analysis first reduces the dimensionality of the feature vectors and extracts the dominant variation as the low-frequency basis. For example, for a 512-dimensional high-resolution feature, the first 32 dimensions are retained to represent the slowly changing structure. Then, the model generator learns to generate high-frequency details from these bases, such as edge sharpening, thereby recovering key information under low light or motion blur and significantly improving the representation bottleneck of small targets.
[0129] In one embodiment, based on the reconstructed feature vector, the feature representation dimension of the detection box is adjusted to generate a compensated detection result. Specifically, step S41 expands the completed or reconstructed feature vector to 512 dimensions and ensures compatibility with the original detection process through dimension mapping.
[0130] Step S42: Update the confidence and position parameters of the detection box to generate the final compensation result for subsequent verification or output.
[0131] For example, this adjustment ensures a seamless connection from compensation features to detection results. In safety monitoring applications, increasing the dimensionality can achieve a detection accuracy of over 98%, which is beneficial for forming a closed-loop optimization.
[0132] Step S107, the step of dynamically updating the dynamic feature library based on the detection result feedback, includes: determining whether the confidence level of the detection result is lower than a preset threshold; if it is lower, transmitting the detection result to the manual review interface; generating new features and adding them to the dynamic feature library based on the annotation results returned by the manual review interface; re-indexing the dynamic feature library and updating the central features of the feature clusters; and triggering semi-supervised retraining based on the decrease in matching scores of similar hidden dangers detected over multiple consecutive days, thereby expanding the relevant feature clusters in the dynamic feature library.
[0133] In one embodiment, the step of dynamically updating the dynamic feature library based on the detection results feedback specifically includes the following steps.
[0134] Step S1: Determine whether the confidence level of the detection result is lower than the preset threshold. If it is lower, transmit the detection result to the manual review interface.
[0135] Specifically, after target detection is completed, the confidence score of each detection box is numerically compared. For example, if the preset threshold is 0.8, a confidence score of 0.75 is considered below the threshold, and the detection result, including image data and preliminary classification information, is sent to a manual review interface. This judgment ensures that low-confidence results are further verified, which helps reduce potential errors in automated detection.
[0136] Step S2: Based on the annotation results returned by the manual review interface, generate new features and add them to the dynamic feature library.
[0137] In one possible implementation, this step first receives annotation results from a manual review interface. These results include the correct classification of detection boxes and the annotation of key regions, such as whether the buckle of a safety helmet is intact in a safety supervision scenario. Next, new features are extracted from the image based on the annotation results. For example, a scale-invariant feature transform algorithm is used to generate 128-dimensional descriptors for the annotated regions. These descriptors capture local edge and texture information. Then, the similarity of these new feature vectors is calculated with an existing feature library. If the similarity is below a threshold, it is added as a new feature. This generation and addition process enriches the feature library, which is beneficial to the accuracy of subsequent detection.
[0138] For example, in nighttime construction images, if a blurred area is manually confirmed to be a reflective clothing stripe, the 64-dimensional vector of the difference of Gaussians feature of that area is extracted and added to the feature library, thereby providing a reference for similar low-light scenes and improving the recall rate.
[0139] Step S21: Based on the returned annotation results, identify key local regions in the image and extract features.
[0140] Specifically, the annotation results specify areas such as the top of a safety helmet or the left chest area of a reflective vest. A scale pyramid method is applied to these areas to generate multi-level images, magnified from 1x to 8x, to extract scale-invariant feature transform features and Gaussian difference features. This extraction method captures cross-scale information, which is beneficial for processing safety monitoring images at different resolutions.
[0141] Step S22: Compare the extracted features with the existing content of the dynamic feature library to generate a new feature vector.
[0142] For example, cosine distance is used to calculate similarity. If the minimum distance is greater than 0.3, it is considered a new feature, and key regions are given twice the weight through attention weighting to generate the final vector. This comparison ensures the uniqueness of the new feature and is beneficial for library optimization.
[0143] Step S23: Add the generated new features to the dynamic feature library.
[0144] In one embodiment, the index structure of the library is updated immediately after the feature is added, ensuring that the new feature can be retrieved quickly. This addition forms a closed-loop feedback loop, which is beneficial for dynamically adapting to changes in safety supervision scenarios.
[0145] Step S3: Re-index the dynamic feature library and update the central features of the feature clusters.
[0146] Specifically, after adding new features, a density-based spatial clustering algorithm is used to re-cluster the entire library. For example, the new feature is compared with existing clusters, and if the minimum cosine distance to a cluster is less than 0.3, the cluster is merged, and the central feature of that cluster is recalculated as the average vector. This re-indexing maintains the organization of the library and is beneficial for efficient retrieval.
[0147] Step S4: Based on the decrease in matching scores of similar hidden dangers detected over multiple consecutive days, semi-supervised retraining is triggered to expand the relevant feature clusters in the dynamic feature library.
[0148] In one possible implementation, this step monitors the matching scores of similar hazards, such as safety rope obstruction, over three consecutive days. If the average score drops by 15%, the process is triggered. First, relevant unlabeled images are collected. Then, a semi-supervised method, such as training an initial classifier using labeled data, is applied to generate pseudo-labels for the unlabeled images, and the feature clusters are iteratively optimized. This triggering and expansion enhances the adaptability of the library, which is beneficial to the stability of long-term safety monitoring.
[0149] For example, in a construction site scenario, if the matching score for continuously detected ground crack hazards drops from 0.85 to 0.72, retraining is triggered. This involves expanding the crack feature clusters using newly added unlabeled images, increasing the cluster size by 20%, thereby improving the recall rate of subsequent detections to over 98%. This expansion forms an adaptive evolution, which is beneficial for addressing new types of hazards.
[0150] Step S41: Monitor the changes in matching scores for similar hazards over multiple consecutive days.
[0151] Specifically, the average matching score for each hazard type is recorded daily, calculated using cosine similarity, and the trend over three consecutive days is compared. If the score drops by more than 15%, it is marked as needing retraining. This monitoring ensures timely response and helps maintain detection accuracy.
[0152] Step S42 triggers the semi-supervised retraining process.
[0153] In one embodiment, after triggering, relevant feature clusters and unlabeled images are selected. Principal component analysis is used to extract low-frequency components as initial features, and then pseudo-labels are generated through iterative label propagation to optimize cluster centers. This retraining expands the cluster content and is beneficial for handling small targets or occlusion problems in safety monitoring.
[0154] Step S43: Expand the relevant feature clusters in the dynamic feature library based on the retraining results.
[0155] For example, newly generated pseudo-label features are added to clusters, and the central features are updated, allowing the library to cover more variations, such as helmet features under different lighting conditions. This expansion enhances cross-scene reuse and helps reduce the false detection rate by 75%.
[0156] In one embodiment, these steps together form a closed loop from detection results to feature library updates. For example, starting with a low-confidence judgment, new features are generated through manual annotation, added and re-indexed, and retraining is triggered by monitoring the decrease in scores. Finally, the cluster is expanded to ensure that the dynamic feature library continuously optimizes the detection of safety supervision targets.
[0157] Step S108, generating multi-scale images for the region of interest of the input image and extracting scale-invariant feature transform features and difference of Gaussian features, includes: generating a set of images at multiple magnified scales for the region of interest of the input image; extracting scale-invariant feature transform features for each scale image to generate a high-dimensional feature vector; calculating the difference of Gaussian features for each scale image to generate a low-dimensional edge feature description; and fusing the scale-invariant feature transform features and the difference of Gaussian features to generate a cross-scale feature description.
[0158] In one embodiment, a multi-scale image is generated for the region of interest of the input image, and scale-invariant feature transformation features and Gaussian difference features are extracted, including the following steps.
[0159] Step 1.1.1: Generate a set of images with multiple magnification scales for the region of interest in the input image.
[0160] Specifically, by applying bilinear interpolation to the region of interest, an image sequence is generated, magnified multiple times from the original scale. For example, the original image is magnified to 1x, then successively magnified to 2x, 4x, and 8x, forming a scale pyramid structure. This generation method ensures that subsequent feature extraction can capture details at different resolutions, avoiding the problem of feature loss in low-resolution images.
[0161] Step 1.1.2: For each scale of the image, extract scale-invariant feature transformation features to generate high-dimensional feature vectors.
[0162] For example, for each scale of the image, key points are first detected, and then the directional gradient histograms around these key points are calculated to generate 128-dimensional feature vectors. This extraction process is invariant to rotation and scale changes, which helps in processing safety helmet images at different angles in safety monitoring scenarios.
[0163] Step 1.1.3: For each scale of the image, calculate the difference of Gaussian features to generate a low-dimensional edge feature description.
[0164] In one possible implementation, a Gaussian filter is applied to each scale of the image for smoothing at different standard deviations. Then, the difference between adjacent Gaussian images is calculated to obtain an edge response map. Subsequently, 64-dimensional feature descriptors are extracted from the response map, focusing on pixel-level edge strength and orientation. Gaussian difference is an edge detection method that highlights edges and blobs in an image through the Laplacian operator approximation of a Gaussian function. The calculation involves convolution operations on the image, such as using Gaussian kernels with standard deviations of 1.0 and 1.6 to calculate the difference, resulting in a low-dimensional vector that emphasizes the edges. This method is effective in low-light environments because it amplifies weak edge signals and reduces noise interference. In safety monitoring applications, such as when the edges of safety helmets are blurred in nighttime construction images, this feature can provide a reliable edge description, improving detection robustness.
[0165] Step 1.1.3.1: Adjust the standard deviation of the Gaussian kernel according to the resolution of the scale image. For example, use a smaller standard deviation for a scale of 1 to capture fine edges, and use a larger standard deviation for a scale of 8 to emphasize the overall structure.
[0166] Step 1.1.3.2: Quantize the gradient values of the edge response map to generate a 64-dimensional vector, where the first 32 dimensions represent the horizontal edge strength and the last 32 dimensions represent the vertical edge strength, thus forming a low-dimensional edge feature description.
[0167] It should be noted that this calculation method ensures low feature dimensionality, which facilitates subsequent fusion. At the same time, in complex scenes such as motion blur, it can highlight persistent edges through difference, resulting in higher feature stability.
[0168] Step 1.1.4: Fuse the scale-invariant feature transformation features and the Gaussian difference features to generate a cross-scale feature description.
[0169] Specifically, a 128-dimensional scale-invariant feature transform vector extracted from multiple scales is concatenated with a 64-dimensional vector generated by Gaussian difference to form a 192-dimensional fusion vector. Principal component analysis is then applied to reduce the dimensionality to a fixed dimension, ensuring cross-scale information integration. The fusion process first normalizes the two types of features, for example, by using the L2 norm to make them of the same order of magnitude. Then, a weighted sum is performed, with the scale-invariant feature transform having a weight of 0.7 and the Gaussian difference having a weight of 0.3, to highlight the more invariant components. This fusion generates a cross-scale feature description capable of capturing comprehensive information from fine-grained edges to high semantic structures. In security monitoring scenarios, this description helps address the problem of local feature degradation because it integrates multi-scale data, improving accuracy under low light or small target conditions.
[0170] Step 1.1.4.1: Apply cosine similarity check to the fused vector to ensure consistency across multiple scales. If the similarity is less than 0.8, adjust the weights to optimize the description.
[0171] Step 1.1.4.2: Store the generated cross-scale feature descriptions in the feature library for subsequent dynamic management.
[0172] In one embodiment, for a region of interest of a safety helmet under low light conditions, the original image resolution is 240x240 pixels.
[0173] First, image sets at scales of 1x, 2x, 4x, and 8x are generated. Scale-invariant feature transformations are extracted at each scale to obtain a 128-dimensional vector for capturing key points of the hat brim. When calculating Gaussian differences, for blurred edges, standard deviation sequences of 1.0, 1.4, 2.0, and 2.8 are used to generate a 64-dimensional edge description, highlighting the brim contour. Then, during fusion, the dimensions are reduced to 128 after stitching, forming a cross-scale description. This approach improves the detection accuracy from 75% to 92% because fusion enhances feature robustness.
[0174] For example, in another embodiment, for small targets such as reflective stripes on clothing in the distance, after generating a scale set, scale-invariant feature transformation captures the stripe direction, and Gaussian difference emphasizes the stripe edges. After fusing to generate a description, it is used to compensate for the problem of insufficient pixels, and the recall rate is improved to over 95%, demonstrating the advantages of cross-scale fusion in the detection of small targets in safety supervision.
[0175] In one possible implementation, for safety rope images of occluded scenes, multi-level scales help magnify the occluded parts, Gaussian difference is used to extract visible edges, and the fused description can fill in missing features through interpolation, reducing the probability of misjudgment by 32% and bringing more reliable contextual association.
[0176] Step S109, the step of verifying the divergence between the global illumination histogram of the image to which the matching feature belongs and the current image based on the preliminary matching result, includes: obtaining the global illumination histogram of the image to which the matching feature belongs, and calculating the global illumination histogram of the current image; calculating the difference value between the global illumination histograms based on the Kohlbek-Leibler divergence; determining whether the difference value is less than a preset threshold, and if it is less, determining that the matching feature and the current image have consistent illumination; filtering out matching features that do not meet the conditions based on the illumination consistency verification result, and generating the final verification result.
[0177] In one embodiment, the step of verifying the divergence between the global illumination histogram of the image to which the matching features belong and the current image based on the preliminary matching results includes the following steps.
[0178] Step S1: Obtain the global illumination histogram of the image to which the matching feature belongs, and calculate the global illumination histogram of the current image.
[0179] Step S2: Calculate the difference between the global illumination histograms based on the Kolb-Leibler divergence.
[0180] Step S3: Determine whether the difference value is less than a preset threshold. If it is less than a threshold, determine that the matching feature is consistent with the current image illumination.
[0181] Step S4: Based on the illumination consistency verification results, filter out matching features that do not meet the conditions and generate the final verification results.
[0182] In one embodiment, step S1 involves obtaining the global illumination histogram of the image to which the matching feature belongs and calculating the global illumination histogram of the current image. Specifically, this includes step S11, extracting image data corresponding to the preliminary matching result from the feature library and calculating its global illumination histogram, which represents the overall brightness distribution of the image; and step S12, performing the same calculation on the input current image to generate its global illumination histogram, so as to ensure that the input for subsequent difference calculations is consistent.
[0183] For example, when processing nighttime construction images in a safety supervision scenario, the reference image to which the matched safety helmet features belong is first retrieved from the feature library, and its histogram is calculated. Then, the histogram of the current dim image is calculated, so that subsequent steps can compare the illumination based on these histograms.
[0184] In one embodiment, step S2, which calculates the difference between the global illumination histograms based on the Kohlbek-Leibler divergence, specifically includes: step S21, treating the two histograms as probability distributions, where the histogram of the image to which the matching feature belongs is used as the reference distribution, and the histogram of the current image is used as the distribution to be compared; step S22, applying the Kohlbek-Leibler divergence formula to calculate the difference, which measures the asymmetric difference between the two distributions, as follows:
[0185] Where P and Q are the distribution values of the two histograms, respectively, and the total difference value is obtained by summing the values of each brightness bin; Step S23: Normalize the calculation results to adapt to different image sizes, ensuring that the difference value is between 0 and 1, which facilitates threshold judgment.
[0186] Specifically, the Kolb-Leibler divergence is an information-theoretic metric used to quantify the difference between one probability distribution and another. Here, its specific calculation of the distribution difference in the illumination histogram involves: first, converting the histogram into a probability density function, i.e., dividing the value of each bin by the total number of pixels; then calculating for each bin... The values are summed, and if the difference is small, it indicates that the lighting is similar. This can avoid mismatching features under backlighting to images under normal lighting.
[0187] For example, when processing drone inspection images, if the reference features come from a low-light environment, its histogram shows that most pixels are in the low-brightness bin. If the current image is also in low light, the calculated divergence may be 0.3, indicating similarity. Conversely, if the current image is in strong light, the divergence may exceed 0.6, indicating inconsistency. This improves the accuracy of small target detection.
[0188] In one embodiment, for nighttime security monitoring scenarios, step S2 can be expanded to first smooth the histogram to reduce the impact of noise, and then calculate the divergence. For example, smoothing can use a Gaussian filter with a kernel size of 3 to ensure more robust calculation. In another embodiment, for occluded target images, step S2 adjusts the divergence calculation weight based on the proportion of visible pixels. If the visible pixels are less than 50%, the divergence is calculated only for the local histogram of the visible area to avoid overall deviation. In this way, in complex security monitoring environments, the divergence calculation can more accurately reflect the consistency of illumination and reduce the misjudgment rate.
[0189] For example, in an image where a worker wearing a safety rope is obscured by a tool bag, the histogram of the reference feature focuses on the rope texture area. When calculating the divergence of the current image, if the difference is 0.4, which is less than the threshold, then consistency is confirmed. This is beneficial for compensating for the occlusion feature and improving the recall rate to over 98%.
[0190] In one embodiment, step S3 involves determining whether the difference value is less than a preset threshold. If it is less, the matching feature is determined to be consistent with the current image illumination. This specifically includes: Step S31: Set the preset threshold to 0.5 and optimize it based on historical safety monitoring data; Step S32: If the difference value is less than 0.5, mark it as consistent lighting; otherwise, mark it as inconsistent.
[0191] For example, in the verification of low-light security monitoring images, if the calculated difference is 0.45, it is determined to be consistent, supporting subsequent filtering.
[0192] In one embodiment, step S4 filters out matching features that do not meet the conditions based on the illumination consistency verification result and generates a final verification result. Specifically, it includes step S41, removing features marked as inconsistent from the preliminary matching result; and step S42, summarizing the remaining features to form a final verification result for detection box correction.
[0193] For example, in safety helmet inspection, if a matching feature with inconsistent lighting is filtered out, the final result only retains the consistent features, thus reducing the false detection rate to 3% and improving the overall inspection quality.
[0194] In one embodiment, the verification process is applied to feature-based security target detection to ensure that the illumination consistency verification results are directly input into the false detection filtering mechanism, forming a closed-loop optimization.
[0195] Step S1010, the step of utilizing the low-frequency components of high-resolution features in the dynamic feature library for targets with resolutions lower than a preset threshold, includes: extracting high-resolution features corresponding to the target category in the dynamic feature library for targets with resolutions lower than the preset threshold; extracting the low-frequency components of the high-resolution features based on principal component analysis to generate a low-dimensional feature representation; reconstructing the high-resolution feature details of the target by combining the low-dimensional feature representation with an enhanced super-resolution generative adversarial network model; and fusing the reconstructed features with the original low-resolution features to generate a compensated high-dimensional feature vector.
[0196] In one embodiment, for targets with resolutions below a preset threshold, the high-resolution feature low-frequency components in the dynamic feature library are utilized, specifically including the following steps.
[0197] Step S1: For targets with resolutions lower than a preset threshold, extract high-resolution features corresponding to the target category from the dynamic feature library.
[0198] Specifically, the first step is to determine whether the target's resolution is lower than a preset threshold, such as 80×80 pixels. If it is lower than this threshold, high-resolution features matching the target category are queried from the dynamic feature library. These features are derived from the accumulation of historical high-definition images, ensuring that the extracted features contain rich details for subsequent compensation.
[0199] Step S2: Extract the low-frequency components of the high-resolution features based on principal component analysis to generate a low-dimensional feature representation.
[0200] For example, principal component analysis (PCA) is a statistical method used to reduce dimensionality and preserve the main variations in data. It works by calculating the covariance matrix of high-resolution features, solving for their eigenvalues and eigenvectors, and selecting the first few principal components to represent low-frequency information. The specific process involves standardizing the high-resolution feature data, calculating the covariance matrix, performing eigenvalue decomposition, and extracting the first 32 principal components. These principal components capture the low-frequency structure of the features, such as color distribution and basic shape, thus generating a low-dimensional vector representation that facilitates subsequent reconstruction processing. This extraction helps filter noise in security monitoring scenarios and improves the feature stability of small targets such as distant safety helmets.
[0201] In one possible implementation, for small targets in safety monitoring drone inspections, assuming the extracted high-resolution features are 1024-dimensional vectors, the first 32 dimensions are retained through principal component analysis to generate a low-dimensional representation. This representation retains about 85% of the original variation information, avoiding high-frequency noise interference in subsequent reconstruction.
[0202] Step S3: For the low-dimensional feature representation, combine the enhanced super-resolution generative adversarial network model to reconstruct the high-resolution feature details of the target.
[0203] Specifically, the enhanced super-resolution generative adversarial network (GAN) model is a GAN architecture comprising a generator and a discriminator. The generator learns to generate high-resolution images from low-dimensional input, while the discriminator evaluates realism. The model is optimized through adversarial training. The reconstruction process involves inputting low-dimensional feature representations into the generator, which then uses upsampling layers and residual blocks to progressively recover details. Simultaneously, the discriminator provides feedback loss to refine the output, ultimately yielding reconstructed high-resolution feature details. This combination effectively amplifies the details of low-resolution targets, significantly improving detection accuracy in security monitoring scenarios.
[0204] For example, when detecting small reflective clothing at a construction site at night, after the low-dimensional feature representation is input into the model, the generator reconstructs the stripe details through multiple convolutions and upsampling, and the discriminator ensures that the reconstruction result is close to the real high-resolution sample, thereby restoring the features from a blurry state to clarity and improving the detection recall rate to over 95%.
[0205] In one embodiment, for small targets under different lighting conditions, such as a safety rope under low light, the model is first pre-trained on feature library data, and then fine-tuned for a specific low-dimensional representation. The reconstruction process involves iteratively optimizing the parameters of the generator until the loss function converges. This helps to compensate for the loss of details caused by motion blur, and the beneficial effect is to reduce the false negative rate by up to 30%.
[0206] Step S4: Fuse the reconstructed features with the original low-resolution features to generate a compensated high-dimensional feature vector.
[0207] For example, the fusion process employs a weighted average or cascaded approach, concatenating or element-wise adding the reconstructed features with the original features to form a high-dimensional vector, such as increasing the original 128 dimensions to 512 dimensions. This ensures that the compensated vector contains low-frequency stability and high-frequency details for subsequent detection and correction. This fusion maintains the continuity of features and improves the overall representational capability.
[0208] In one possible implementation, the high-dimensional vector after fusion is directly input into the verification mechanism in the low-pixel image captured by the safety supervision enforcement device, which significantly reduces the probability of misjudgment. The beneficial effect is that it increases the accuracy of small target detection from 70% to over 90%.
[0209] In the description of this invention, it should be understood that the terms "coaxial," "bottom," "one end," "top," "middle," "other end," "upper," "side," "top," "inner," "front," "center," "both ends," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0210] Furthermore, the terms “first,” “second,” “third,” and “fourth” are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as “first,” “second,” “third,” or “fourth” may explicitly or implicitly include at least one of those features.
[0211] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," "connection," "fixing," "screw connection," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal connection of two components or the interaction between two components. Unless otherwise explicitly limited, those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0212] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A target detection and correction method for the field of safety supervision based on a scene feature library, characterized in that, include: The input image is acquired, and an initial set of detection boxes is generated based on the target detection model. The features are then obtained by combining the dynamic feature library of local target features. Based on multi-scale feature extraction technology, a dynamic feature library containing local features of the target is constructed to obtain cross-scene feature information after storage; The process of constructing a dynamic feature library containing local features of the target based on multi-scale feature extraction technology to obtain stored cross-scene feature information includes: generating multi-scale images for the region of interest of the input image, extracting scale-invariant feature transform features and Gaussian difference features to generate cross-scale feature descriptions; generating local feature attention maps through a pre-trained visual transformer model, assigning higher weights to features in key target regions, and suppressing background noise interference; performing real-time clustering of new features based on density clustering algorithm, merging new features with existing clusters if the distance between the new features and existing clusters is less than a preset threshold, otherwise creating new clusters; and evaluating the effectiveness of features in the dynamic feature library using a scoring function, deleting invalid features if the score is lower than a preset threshold. Based on the local feature cascade verification mechanism, the initial detection box set is corrected and the detection result is output; The local feature-based cascaded verification mechanism corrects the initial detection box set and outputs detection results, including: extracting scale-invariant feature transformation features of multiple key local regions for the initial detection boxes; retrieving the dynamic feature library using a fast similarity search tool; determining whether the feature matching scores of at least some key regions are greater than a preset threshold to obtain preliminary matching results; verifying whether the divergence between the global illumination histogram of the image to which the matching features belong and the current image is less than a preset threshold to exclude mismatches across illumination scenes; and adjusting the confidence and position information of the detection boxes according to the verification results to generate corrected detection results. Based on the detection results, occluded or low-resolution targets are screened out, and for the occluded or low-resolution targets, feature compensation technology is used to reconstruct the missing features. The step of filtering out occluded or low-resolution targets based on the detection results, and reconstructing missing features for the occluded or low-resolution targets using feature compensation technology, includes: determining whether the visible pixel ratio of the detection box is lower than a preset ratio; if it is lower, retrieving features of similar occlusion patterns from the dynamic feature library; for the retrieved similar occlusion pattern features, completing the missing feature vector of the detection box through feature interpolation; for targets with a resolution lower than a preset threshold, using the low-frequency components of high-resolution features in the dynamic feature library, combined with a super-resolution model to reconstruct target details; and adjusting the feature representation dimension of the detection box based on the reconstructed feature vector to generate a compensated detection result. Based on the feedback from the detection results, the dynamic feature library is dynamically updated to adapt to new scenarios; The step of dynamically updating the dynamic feature library to adapt to new scenarios based on the feedback of the detection results includes: determining whether the confidence level of the detection results is lower than a preset threshold; if so, transmitting the detection results to the manual review interface; generating new features and adding them to the dynamic feature library based on the annotation results returned by the manual review interface; re-indexing the dynamic feature library and updating the central features of the feature clusters; and triggering semi-supervised retraining based on the decrease in matching scores of similar hidden dangers detected over multiple consecutive days, thereby expanding the relevant feature clusters in the dynamic feature library. 2.The scene feature library-based target detection correction method for safety supervision field according to claim 1, characterized in that: The steps of generating multi-scale images based on the region of interest of the input image, extracting scale-invariant feature transform features and Gaussian difference features, and obtaining cross-scale feature descriptions include: Generate a set of images with multiple magnification scales for the region of interest in the input image; For each scale of the image, scale-invariant feature transformation features are extracted to generate high-dimensional feature vectors; For each scale of the image, Gaussian difference features are calculated to generate low-dimensional edge feature descriptions; By fusing the scale-invariant feature transformation features and the Gaussian difference features, a cross-scale feature description is generated. 3.The method of claim 1, wherein the method further comprises: The step of verifying whether the divergence between the global illumination histogram of the image to which the matching feature belongs and the current image is less than a preset threshold, and eliminating false matches across illumination scenes, includes: Obtain the global illumination histogram of the image to which the matching feature belongs, and calculate the global illumination histogram of the current image; The difference between the global illumination histograms is calculated based on the kld quantization formula. Determine whether the difference value is less than a preset threshold; if it is less, determine that the matching feature is consistent with the current image illumination. Based on the illumination consistency verification results, matching features that do not meet the conditions are filtered out, and the final verification results are generated. 4.The method of claim 1, wherein the method further comprises: The step of reconstructing target details for targets with resolution below a preset threshold by utilizing high-resolution features and low-frequency components from the dynamic feature library, combined with a super-resolution model, includes: For targets with resolutions below a preset threshold, high-resolution features corresponding to the target category are extracted from the dynamic feature library; Based on principal component analysis, low-frequency components of the high-resolution features are extracted to generate low-dimensional feature representations; For the low-dimensional feature representation, an enhanced super-resolution generative adversarial network model is combined to reconstruct the high-resolution feature details of the target. The reconstructed features are fused with the original low-resolution features to generate a compensated high-dimensional feature vector. 5.A scene feature library based safety supervision field target detection correction system, characterized in that, include: The image acquisition module is used to acquire the input image and generate an initial set of detection boxes based on the target detection model. It also combines the dynamic feature library of local target features to obtain features. The feature extraction module is used to construct a dynamic feature library containing local features of the target based on multi-scale feature extraction technology, and obtain the stored cross-scene feature information. The process of constructing a dynamic feature library containing local features of the target based on multi-scale feature extraction technology to obtain stored cross-scene feature information includes: generating multi-scale images for the region of interest of the input image, extracting scale-invariant feature transform features and Gaussian difference features to generate cross-scale feature descriptions; generating local feature attention maps through a pre-trained visual transformer model, assigning higher weights to features in key target regions, and suppressing background noise interference; performing real-time clustering of new features based on density clustering algorithm, merging new features with existing clusters if the distance between the new features and existing clusters is less than a preset threshold, otherwise creating new clusters; and evaluating the effectiveness of features in the dynamic feature library using a scoring function, deleting invalid features if the score is lower than a preset threshold. A dynamic feature library is used to correct the initial set of detection boxes based on a local feature cascade verification mechanism and output the detection results. The local feature-based cascaded verification mechanism corrects the initial detection box set and outputs detection results, including: extracting scale-invariant feature transformation features of multiple key local regions for the initial detection boxes; retrieving the dynamic feature library using a fast similarity search tool; determining whether the feature matching scores of at least some key regions are greater than a preset threshold to obtain preliminary matching results; verifying whether the divergence between the global illumination histogram of the image to which the matching features belong and the current image is less than a preset threshold to exclude mismatches across illumination scenes; and adjusting the confidence and position information of the detection boxes according to the verification results to generate corrected detection results. The detection box generation module is used to filter out occluded or low-resolution targets based on the detection results, and to reconstruct missing features for the occluded or low-resolution targets using feature compensation technology. The step of filtering out occluded or low-resolution targets based on the detection results, and reconstructing missing features for the occluded or low-resolution targets using feature compensation technology, includes: determining whether the visible pixel ratio of the detection box is lower than a preset ratio; if it is lower, retrieving features of similar occlusion patterns from the dynamic feature library; for the retrieved similar occlusion pattern features, completing the missing feature vector of the detection box through feature interpolation; for targets with a resolution lower than a preset threshold, using the low-frequency components of high-resolution features in the dynamic feature library, combined with a super-resolution model to reconstruct target details; and adjusting the feature representation dimension of the detection box based on the reconstructed feature vector to generate a compensated detection result. The feature matching module is used to dynamically update the dynamic feature library to adapt to new scenarios based on the feedback of the detection results. The step of dynamically updating the dynamic feature library to adapt to new scenarios based on the feedback of the detection results includes: determining whether the confidence level of the detection results is lower than a preset threshold; if so, transmitting the detection results to the manual review interface; generating new features and adding them to the dynamic feature library based on the annotation results returned by the manual review interface; re-indexing the dynamic feature library and updating the central features of the feature clusters; and triggering semi-supervised retraining based on the decrease in matching scores of similar hidden dangers detected over multiple consecutive days, thereby expanding the relevant feature clusters in the dynamic feature library.