Machine vision dark light target detection method and system based on target area enhancement
By combining Zero-DCE pre-enhancement and semantic segmentation with the Feature Guidance Module (FGM) and knowledge distillation mechanism, the target region is decomposed and enhanced, solving the problems of missed detection and false detection in machine vision target detection under low light conditions, and achieving efficient target detection in complex backgrounds.
Patent Information
- Application Number
- CN202510956278.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-11-18
AI Technical Summary
In low-light environments, traditional machine vision target detection methods struggle to effectively address issues such as insufficient brightness, reduced contrast, loss of detail, and noise enhancement. This leads to missed detections and false detections in complex backgrounds or small target scenes. Furthermore, existing technologies have failed to effectively resolve background noise interference and the collaborative optimization issues between enhancement and detection modules.
Zero-DCE is used to pre-enhance the low-light image. The image is segmented into foreground and background by the semantic segmentation model SAM. The semantic information is learned by TGE-Net using the feature guidance module FGM and knowledge distillation mechanism to decompose the image into illumination and reflection components. Only the target region is enhanced. Finally, the image is input into the target detection network YOLOv3 for detection.
It achieves precise enhancement of the target region, avoids background noise interference, improves the distinction between the target and the background, and significantly improves the robustness and accuracy of target detection. In particular, in extreme low-light scenes, the synergistic optimization of enhancement and detection tasks significantly improves the performance of the model.
Smart Images

Figure CN120976669A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine vision target detection, and particularly relates to a machine vision dark-light target detection method and system based on target region enhancement. BACKGROUND
[0002] In low-light environments, images often face problems such as insufficient brightness, decreased contrast, lost details, and enhanced noise, which seriously affect the target detection performance of machine vision systems. Especially in scenes with complex backgrounds or small target sizes, background noise is amplified and target edges are blurred, which easily leads to missed detection and false detection of detection models. For example, in night monitoring pedestrian detection, low-light industrial scene equipment fault identification and other tasks, the traditional detection model cannot effectively handle the dark-light degradation problem, and the accuracy is greatly reduced. In addition, the high dynamic range characteristics (overall dark but local brightness changes dramatically) of dark-light images further exacerbate the detection difficulty, making it difficult for general models to be directly adapted. Therefore, how to accurately enhance the features of the target region and suppress background interference in a dark-light environment has become a key challenge to improve the robustness of machine vision target detection, and is also a core problem that needs to be solved by the present application.
[0003] The traditional technical solution to solve the dark-light target detection mainly relies on the whole image enhancement method, that is, the brightness and contrast of the whole image are improved to improve the visual quality. In this method, the algorithm derived from the Retinex theory (such as RetinexNet) decomposes the image into illumination and reflection components and enhances them respectively, which restores the details to a certain extent; the no-reference enhancement model such as Zero-DCE realizes self-supervised enhancement by fitting the pixel enhancement curve, and optimizes the human visual perception effect. However, the whole image enhancement has significant defects: on the one hand, the noise in the background region will be amplified simultaneously with the brightness, which reduces the distinction between the background and the target and increases the risk of false detection; on the other hand, excessive enhancement will destroy the original semantic structure of the image, for example, misjudging the shadow area as a target or blurring the target edge details. In addition, the traditional method is not optimized for machine vision tasks, and the enhanced target is not consistent with the detection needs, making it difficult to directly improve the feature extraction ability of the detection model, and the performance improvement is limited in complex dark-light scenes.
[0004] In recent years, researchers have tried to combine the enhancement and detection tasks and proposed some improvement schemes. For example, the MAET framework improves the detection robustness by modeling the image degradation process and combining the tangent regularity constraint; the DAI-Net realizes zero-shot adaptation of day and night scenes by adopting a cross-domain alignment strategy to reduce the influence of light difference; and the IAT model simulates the ISP process to realize exposure correction and color optimization with a lightweight design. These methods have achieved certain results in specific scenarios, but still have limitations: first, most methods still rely on full-image enhancement, which does not fundamentally solve the problem of background noise interference; second, some schemes compress the model complexity through knowledge distillation (such as MobileSAM), but do not combine semantic segmentation information with the enhancement process, making it difficult to accurately locate the target area; third, the enhancement and detection modules in existing technologies lack end-to-end collaborative optimization, resulting in enhancement results that cannot efficiently serve the detection task, especially in extreme low-light scenarios, where performance improvement is still insufficient. SUMMARY
[0005] Based on the above technical problems, the application discloses a machine vision low-light target detection method and system based on target area enhancement, wherein the machine vision low-light target detection method based on target area enhancement is specifically:
[0006] S1, obtaining a low-light image, pre-enhancing the low-light image by using Zero-DCE to obtain a normal light image;
[0007] S2, inputting the normal light image into a semantic segmentation model SAM, modifying the MaskDecoder of the semantic segmentation model SAM to make the semantic segmentation model SAM segment the normal light image into two categories of foreground and background, and performing binaryzation processing on the segmented image to obtain a binaryzation segmentation image;
[0008] S3, constructing a feature guidance module FGM, guiding the TGE-Net to learn the semantic information of the foreground and the background by using the binaryzation segmentation image through a knowledge distillation method, and constraining the shallow feature map of the TGE-Net to be close to the segmentation feature map of the SAM by using a segmentation distillation loss function;
[0009] S4, decomposing the low-light image into a light component I and a reflection component R by using the TGE-Net, and obtaining a target area enhancement image through fusion processing;
[0010] S5, inputting the target area enhancement image into a target detection network YOLOv3 to perform target detection, and outputting a detection result.
[0011] Preferably, the low-light image in S1 is an image obtained in a low-light environment; the low-light image has insufficient brightness, decreased contrast, lost details, and enhanced noise.
[0012] Preferably, in step S1, Zero-DCE is used to pre-enhance the dark light image. Specifically, the Zero-DCE network is used to guide the network to fit the pixel enhancement curve of the image through a no-reference loss method, thereby performing self-supervised enhancement on the dark light image. This restores the dark light image to the feature domain of the normal light image pre-trained by SAM, improving the generalization performance of SAM. The formula is: S norm = Z(S), where S is the dark image, S norm The function Z represents the Zero-DCE network to represent the enhanced normal light image.
[0013] Preferably, in step S2, the normal light image is segmented into foreground and background categories using the MaskDecoder of the semantic segmentation model SAM, and the segmented image is binarized to obtain a binarized segmented image. Specifically, the MaskDecoder of SAM is modified so that it cannot distinguish between different instance categories, and all instances are classified as foreground. The image is then divided into foreground and background categories, as shown in the formula: S seg =M(S) norm ), where M represents the binary segmentation of the segmentation network SAM, S norm For normal light images, S seg It is the segmented image; for S seg Binarization is performed by setting all non-zero pixels in the image to 255 using a binarization function. Normalization then maps the pixel values to the [0,1] interval, meaning background pixels are 0 and foreground pixels are 1. The formula is: in The image is the segmented image obtained after 0-1 binarization, and B is the binarization function.
[0014] Preferably, the S3 feature guidance module FGM includes a low-light image enhancement network Zero-DCE for human vision, a semantic segmentation model SAM, and a semantic distillation loss; the mask enhancement module in the student model TGE-Net learns semantic segmentation knowledge from the teacher model SAM through knowledge distillation; knowledge distillation is divided into low-light image enhancement-assisted correction for human vision, foreground and background binarization segmentation of the image, and semantic feature distillation, ensuring that the enhancement process accurately enhances the target area without affecting the background area.
[0015] Preferably, in step S3, the fractional distillation loss function L is used. distill The shallow feature maps of TGE-Net are constrained to converge towards the segmentation feature maps of SAM, specifically by using the segmentation distillation loss function L. distill Binary cross-entropy loss L BCE and KL divergence loss L KL Composition, the formula is: L distill =LBCE +L KL Binary cross-entropy loss L BCE The formula used to measure the difference between the binarized segmented image generated by the student model TGE-Net and the binarized segmented image output by the teacher model SAM is as follows: Where i is the image index. I is the 0-1 binary label output by SAM. bin (i) represents the predictions from TGE-Net; KL divergence loss L KL The probability distribution information of the SAM output is used to learn the semantic features and details of the target. Through the joint loss function, the shallow feature map of TGE-Net is constrained to move closer to the segmentation feature map of SAM.
[0016] Preferably, the low-light image is decomposed into an illumination component I and a reflection component R using TGE-Net. The illumination component I is processed in two branches. The first branch performs semantic distillation using the FGM module to obtain the binarized illumination component I. bin The second branch performs enhancement processing through a semantically guided latent spatial feature enhancement module to obtain the enhanced illumination component I′; I′ is then... bin Multiply by I′ pixel by pixel, the formula is: Where Θ is the multiplication symbol, the illumination component I after fusing the mask information is obtained. final ; will I final The enhanced image of the target region is obtained by fusing it with the enhanced reflection component Rt.
[0017] Preferably, the I final The enhanced reflection component R′ is then fused with the fused component, using the formula: S final =I final ΘR′, where S final To enhance the image of the target region, R′ represents the reflection component, and Θ represents the multiplication sign.
[0018] Preferably, the overall loss function of the target detection network is composed of the target detection loss L of YOLOv3. detect and the split distillation loss function L distill The composition, the formula is: L = L detect +λ distill ·L distill , where λ distill L represents the weights of the semantic distillation loss. distill Binary cross-entropy loss L BCE and KL divergence loss L KL constitute.
[0019] The machine vision dim light target detection system based on target region enhancement comprises a feature guidance module (FGM), a TGE-Net module and a target detection network YOLOv3.
[0020] The feature guidance module (FGM) combines a human visual-oriented dim light image enhancement network Zero-DCE, a semantic segmentation model (SAM) and a semantic distillation loss function (L distill The mask enhancement module in the TGE-Net module learns semantic segmentation knowledge from the SAM through a knowledge distillation method, so that the enhancement process accurately enhances the target region without affecting the background region, the SAM segmentation performance is improved through the Zero-DCE pre-enhancement of the dim light image, the binary segmentation image is obtained through the SAM segmentation and binarization processing, and semantic feature distillation is realized.
[0021] The TGE-Net module distinguishes and enhances the background and foreground of the image, and is divided into two branches for processing through the decomposed illumination component, one branch obtains a binary illumination component I bin through semantic distillation of the FGM module, and the other branch obtains an enhanced illumination component through enhancement processing, and the target region enhanced image is obtained through fusion.
[0022] The target detection network YOLOv3 receives the target region enhanced image output by the TGE-Net module for target detection.
[0023] Compared with the prior art, the technical scheme of the present application has the following technical effects:
[0024] The present application realizes the targeted enhancement of the target region through the synergistic effect of the semantic segmentation model (SAM) and the feature guidance module (FGM), fundamentally avoids the problem that the background noise is amplified synchronously in the traditional full-image enhancement method, obtains the binary segmentation image of the foreground and background by modifying the MaskDecoder of the SAM, and guides the TGE-Net to learn semantic information through the knowledge distillation mechanism, so that the enhancement process only acts on the foreground target region, and the enhancement of the background region is significantly inhibited. This design ensures that the detailed features (such as edges and textures) of the target region are effectively retained and highlighted, while avoiding the interference of the excessive enhancement of irrelevant information (such as shadows and noise points) in the background on the detection model, thereby improving the discrimination between the target and the background and providing purer input features for the subsequent target detection network.
[0025] The application introduces a Zero-DCE network before the SAM to pre-enhance the dark light image, effectively solving the problem of performance decline of the SAM under low light conditions. Since the SAM is a model pre-trained on a normal light high-quality dataset, when directly processing the dark light image, the segmentation accuracy will be reduced due to insufficient brightness and loss of details. The Zero-DCE guides the network to fit the pixel enhancement curve through the no-reference loss, restores the dark light image to the normal light feature domain familiar to the SAM, so that the SAM can more accurately segment the foreground and background. The pre-processing strategy of the application not only improves the segmentation accuracy of the SAM, but also provides high-quality semantic labels for subsequent knowledge distillation, ensures that the TGE-Net can effectively learn reliable foreground features, and lays a solid foundation for target region enhancement.
[0026] The application adopts a knowledge distillation mechanism, takes the SAM as a teacher model and the TGE-Net as a student model, and constrains the feature learning process of the TGE-Net through the design of a segmentation distillation loss function (combining the binary cross-entropy loss and the KL divergence). In this way, the lightweight TGE-Net can efficiently obtain the semantic segmentation knowledge of the SAM, has a target region enhancement ability comparable to complex models while maintaining a small parameter size. Unlike the idea in the prior art of simply pursuing model complexity to improve performance, the present scheme realizes the balance of "lightweight + high performance" through knowledge compression: in the training phase, the powerful segmentation ability of the SAM is used to guide learning, and in the inference phase, only the TGE-Net and the YOLOv3 need to work together, without the need to additionally introduce the high computational overhead of the SAM, which significantly improves the applicability of the model in resource-constrained scenarios such as edge devices.
[0027] The application combines the loss of the target detection network YOLOv3 with the segmentation distillation loss to construct an end-to-end joint optimization framework, realizing the deep cooperation of the enhancement process and the detection task. In traditional methods, enhancement and detection are usually independent modules, and the enhancement result may not be suitable for the detection requirement. However, the present scheme closely links the two through the overall loss function (L=Ldetect+λdistill·Ldistill): the segmentation distillation loss ensures that the enhancement result of the TGE-Net is consistent with the semantic segmentation features of the SAM, and the target detection loss directly optimizes the final detection accuracy. This design makes the enhancement process always aim to improve the detection performance, and can adaptively adjust the enhancement intensity of the target region, effectively alleviating the influence of brightness fluctuation and noise interference on the detection result in complex scenes such as extreme dark light and dynamic light, and significantly improving the robustness and environmental adaptability of the model.
[0028] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings.
[0029] The above and other objects, advantages and features of this application will become more apparent to those skilled in the art from the following detailed description of specific embodiments in conjunction with the accompanying drawings. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0031] Figure 1 This is a flowchart of machine vision low-light target detection based on target region enhancement;
[0032] Figure 2 This is a schematic diagram of the SAM binarization segmentation process;
[0033] Figure 3 This is a structural diagram of a machine vision-based low-light target detection system with target region enhancement.
[0034] Figure 4 A visualization of the TGE-YOLO detection results on ExDark;
[0035] Figure 5 A visualization of the detection results of TGE-YOLO on DarkFace;
[0036] Figure 6 A comparison of feature enhancement visualizations between TGE-Net and the full-image dataset. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. In the following description, specific details such as specific configurations and components are provided merely to help fully understand the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. In addition, for clarity and brevity, descriptions of known functions and structures are omitted in the embodiments.
[0038] It should be understood that the phrase "an embodiment" or "this embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "an embodiment" or "this embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0039] Furthermore, reference numerals and / or letters may be repeated in different examples within this application. Such repetition is for the purpose of simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed.
[0040] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A exists alone, B exists alone, and A and B exist simultaneously. In this application, the term " / and" describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can represent two cases: A exists alone, and A and B exist alone. In addition, in this application, the character " / " generally indicates that the related objects before and after are in an "or" relationship.
[0041] In this application, the term "at least one" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.
[0042] It should also be noted that, in this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion.
[0043] Example 1
[0044] This embodiment mainly describes a machine vision-based low-light target detection method based on target region enhancement, such as... Figure 1 As shown, specifically:
[0045] S1. Acquire a low-light image and perform pre-enhancement processing on the low-light image using Zero-DCE to obtain a normal light image;
[0046] S2. Input the normal light image into the semantic segmentation model SAM. By modifying the MaskDecoder of the semantic segmentation model SAM, the semantic segmentation model SAM can segment the normal light image into two categories: foreground and background. The segmented image is then binarized to obtain a binarized segmented image.
[0047] S3. Construct a feature guidance module (FGM), which uses the binarized segmented image to guide TGE-Net in learning the semantic information of the foreground and background through knowledge distillation, and uses the segmentation distillation loss function to constrain the shallow feature map of TGE-Net to move closer to the segmentation feature map of SAM.
[0048] S4. The dark light image is decomposed into illumination component I and reflection component R by TGE-Net, and the enhanced image of the target region is obtained by fusion processing.
[0049] S5. Input the enhanced image of the target region into the YOLOv3 target detection network for target detection and output the detection results.
[0050] Furthermore, the low-light image mentioned in S1 refers to an image acquired in a low-light environment. Such images suffer from degradation problems such as insufficient brightness, decreased contrast, loss of detail, and increased noise. Especially in scenes with complex background information or small target size, background noise is easily amplified and target edges are easily blurred, which can easily lead to missed detections and false detections in the target detection process. At the same time, they also have high dynamic range characteristics, with the overall image being dark but local areas experiencing drastic changes in brightness, making it difficult to directly apply traditional target detection models.
[0051] Furthermore, in S1, Zero-DCE is used to pre-enhance the dark light image. Specifically, the Zero-DCE network is used to guide the network to fit the pixel enhancement curve of the image through a no-reference loss method, thereby performing self-supervised enhancement on the dark light image. This restores the dark light image to the feature domain of the normal light image pre-trained by SAM, improving the generalization performance of SAM. The formula is: S norm = Z(S), where S is the dark image, S norm The function Z represents the Zero-DCE network to represent the enhanced normal light image.
[0052] Furthermore, such as Figure 2As shown, in step S2, the normal light image is segmented into foreground and background categories using the MaskDecoder of the semantic segmentation model SAM. The segmented image is then binarized to obtain a binarized segmented image. Specifically, the MaskDecoder of SAM is modified so that it cannot distinguish between different instance categories, and all instances are classified as foreground. The image is then divided into foreground and background categories, as shown in the formula: S... seg =M(S) norm ), where M represents the binary segmentation of the segmentation network SAM, S norm For normal light images, S seg It is the segmented image; for S seg Binarization is performed by setting all non-zero pixels in the image to 255 using a binarization function. Normalization then maps the pixel values to the [0,1] interval, meaning background pixels are 0 and foreground pixels are 1. The formula is: in The image is the segmented image obtained after 0-1 binarization, and B is the binarization function.
[0053] Furthermore, the S3 feature guidance module FGM includes the low-light image enhancement network Zero-DCE for human vision, the semantic segmentation model SAM, and semantic distillation loss; it guides the mask enhancement module in the student model TGE-Net to learn semantic segmentation knowledge from the teacher model SAM through knowledge distillation; knowledge distillation is divided into low-light image enhancement-assisted correction for human vision, foreground and background binarization segmentation of the image, and semantic feature distillation, ensuring that the enhancement process accurately enhances the target area without affecting the background area.
[0054] Furthermore, in S3, the fractional distillation loss function L is utilized. distill The shallow feature maps of TGE-Net are constrained to converge towards the segmentation feature maps of SAM, specifically by using the segmentation distillation loss function L. distill Binary cross-entropy loss L BCE and KL divergence loss L KL Composition, the formula is: L distill =L BCE +L KL Binary cross-entropy loss L BCE The formula used to measure the difference between the binarized segmented image generated by the student model TGE-Net and the binarized segmented image output by the teacher model SAM is as follows: Where i is the image index. I is the 0-1 binary label output by SAM. bin (i) represents the predictions from TGE-Net; KL divergence loss L KL The formula used to learn the probability distribution information of the SAM output is: This helps TGE-Net capture the semantic features and details of the target. By using a joint loss function, it constrains the shallow feature map of TGE-Net to converge towards the segmentation feature map of SAM.
[0055] Furthermore, the low-light image is decomposed into an illumination component I and a reflection component R using TGE-Net. The illumination component I is processed in two branches. The first branch performs semantic distillation using the FGM module to obtain the binarized illumination component I. bin The second branch performs enhancement processing through a semantically guided latent spatial feature enhancement module to obtain the enhanced illumination component I′; I′ is then... bin Multiply by I′ pixel by pixel, the formula is: Where Θ is the multiplication symbol, the illumination component I after fusing the mask information is obtained. final ; will I final The enhanced image of the target region is obtained by fusing it with the enhanced reflection component Rt.
[0056] Furthermore, the I final The enhanced reflection component Rt is then fused with the fused component, using the formula: S final =I final ΘR′, where S final To enhance the image of the target region, R′ represents the reflection component, and Θ represents the multiplication sign.
[0057] Furthermore, the overall loss function of the target detection network in S5 is derived from the target detection loss L of YOLOv3. detect and the split distillation loss function L distill The composition, the formula is: L = L detect +λ distill ·I distill , where λ distill I represents the weights of the semantic distillation loss. distill Binary cross-entropy loss L BCE and KL divergence loss L KL constitute.
[0058] This embodiment details the machine vision low-light target detection method based on target region enhancement proposed in this invention, which differs fundamentally from existing technologies. Existing technologies often employ full-image enhancement or simple domain adaptation strategies, while this scheme innovatively introduces a semantic segmentation model (SAM) and a knowledge distillation mechanism, achieving precise enhancement of the target region through a feature guidance module (FGM). Specifically, this scheme first uses Zero-DCE to pre-enhance the low-light image to improve the segmentation accuracy of SAM. Then, it modifies the foreground-background binarized segmentation map output by the SAM's mask decoder. Subsequently, under semantic guidance, TGE-Net enhances only the target region, while simultaneously designing a segmentation distillation loss to constrain the enhancement process and align it with the segmentation features. This "semantically guided region enhancement" approach avoids the background noise amplification problem of full-image enhancement and achieves end-to-end collaborative optimization of enhancement and detection. It is completely different from the "indiscriminate enhancement" or "independent enhancement-detection" design concepts in existing technologies, significantly improving the accuracy and robustness of target detection in low-light scenes.
[0059] Example 2
[0060] This embodiment describes in detail a machine vision low-light target detection system based on target region enhancement, such as... Figure 3 As shown, specifically:
[0061] A machine vision low-light target detection system based on target region enhancement includes a feature guidance module (FGM), a TGE-Net module, and a target detection network (YOLOv3).
[0062] The feature guidance module FGM combines the low-light image enhancement network Zero-DCE (designed for human vision), the semantic segmentation model SAM, and the semantic distillation loss function L. distill The mask enhancement module in the TGE-Net module is guided to learn semantic segmentation knowledge from SAM through knowledge distillation, so that the enhancement process can accurately enhance the target region without affecting the background region. The segmentation performance of SAM is improved by pre-enhancing the low-light image through Zero-DCE. The binary segmented image is obtained by SAM segmentation and binarization, thus realizing semantic feature distillation.
[0063] The TGE-Net module performs discriminative enhancement on the background and foreground of the image. It processes the decomposed illumination components in two branches. One branch undergoes semantic distillation by the FGM module to obtain the binarized illumination component I. bin One branch is enhanced to obtain the enhanced illumination component, which is then fused to obtain the enhanced image of the target region;
[0064] The target detection network YOLOv3 receives the enhanced image of the target region output by the TGE-Net module and performs target detection.
[0065] This embodiment details how the Feature Guidance Module (FGM) combined with Zero-DCE, SAM, and semantic distillation loss guides TGE-Net to accurately enhance target regions, suppress background interference, and improve the segmentation generalization ability of SAM in low light. After Retinex decomposition, TGE-Net specifically processes the illumination and reflection components, and combines this with YOLOv3's joint loss optimization to achieve end-to-end collaboration. This effectively solves the problem of missed and false detections of targets in low light, enhances target features in complex scenes while avoiding background noise amplification, and significantly improves detection robustness and accuracy.
[0066] Based on Embodiment 1 or 2, this embodiment describes in detail the use of an improved Retinex algorithm to perform illumination equalization on the fused image during image preprocessing, and to remove highlight interference caused by reflections in the welding area. A combination of median filtering and Gaussian filtering is used to suppress image noise, specifically:
[0067] Quantitative tests were conducted on the ExDark low-light target detection dataset and the DarkFace low-light face detection dataset. This study used the mAP50 (%) index for analysis under complex lighting conditions.
[0068] In terms of experimental environment, the experiment was conducted on the Ubuntu system, and the hardware platform configuration was NVIDIA GeForce RTX 3090 GPU, Intel i7-12700F CPU and 32GB of memory.
[0069] Regarding training details, this paper uses the SGD optimizer for 25 rounds of fine-tuning training based on a YOLOv3 object detection model pre-trained on the COCO dataset. During training on the ExDark dataset, the batch size is set to 12, the momentum parameter is 0.9 to improve the stability of gradient updates, and the weight decay coefficient is set to 4×10⁻⁵ to prevent overfitting. Furthermore, a phased decay strategy is employed for the learning rate. In the first 2000 iterations, a learning rate warm-up mechanism is applied, gradually increasing the learning rate from a small initial value to 1×10⁻³. Subsequently, in the 7th, 12th, and 18th training rounds, the learning rate is decreased by a decay factor of 0.1 to improve training stability and final convergence performance.
[0070] During training on the DarkFace dataset, the batch size was set to 14, and the learning rate decayed in rounds 8 and 15. The remaining hyperparameter settings were consistent with those on the ExDark dataset. To supervise the distillation learning process of TGE-Net, this paper sets the weight λ of the semantic distillation loss. distill The value is 2.
[0071] In addition, to improve the model's generalization ability in complex environments, data augmentation strategies, including random pruning and random flipping, were introduced during training.
[0072] Benchmark tests were performed on the ExDark low-light target detection and DarkFace low-light face detection datasets;
[0073] The quantization results on ExDark are shown in Table 1. The TGE-YOLO proposed in this study demonstrates a significant performance breakthrough in the ExDark low-light detection benchmark. In terms of comprehensive evaluation metrics, TGE-YOLO broke through the 80% threshold for the first time with an mAP50 of 80.0%, which is 3.6 percentage points higher than the baseline model YOLOv3 (76.4%).
[0074] Table 1: Comparison of detection accuracy of different methods on ExDark
[0075]
[0076] Specifically, among the 12 target categories, TGE-YOLO (the method described in this application) achieved the best AP performance in 7 categories, including "bicycle (84.0%), bottle (80.0%), dog (83.8%), and motorcycle (78.5%)", especially in the "bottle" category, where it significantly outperformed all other methods, leading the second-best method, PE-YOLO (78.9%), by approximately 1.1 percentage points. In dynamic traffic targets, TGE-YOLO performed best in the "vehicle (84.5%)" category, while tying with DAI-Net for the best performance in the "bus (94.2%)" category, demonstrating good adaptability to complex backgrounds. Although slightly lower than some methods (such as PE-YOLO(48) at 83.4% and 83.4% respectively) in the categories of "people (83.2%)" and "cups (82.9%)", the difference is less than 0.5%, with small fluctuations, and still has a significant advantage over methods such as DAI-Net (80.7% and 79.2%). Overall, TGE-YOLO achieved 80.0% on the mAP50 index, significantly exceeding the existing mainstream methods (such as Zero-DCE+YOLOv3 at 75.9%, DAI-Net at 77.5%, and PE-YOLO(48) at 78.7%), fully verifying the effectiveness and robustness of this method in target detection in low-light environments; the experimental results verify that TGE-YOLO, by introducing a semantic knowledge distillation mechanism, effectively alleviates background noise interference in low-light scenes while maintaining the semantic features of the target.
[0077] As shown in Table 2, in the DarkFace low-light target detection benchmark, the TGE-YOLO proposed in this study refreshed the detection performance record with 57.6% mAP50, which is 9.3 percentage points higher than the baseline model YOLOv3 (48.3%), and surpasses the current best methods DAI-Net (57.0%) and EMV-YOLO (57.4%) by 0.6 and 0.2 percentage points, respectively.
[0078] Table 2: Comparison of detection accuracy of different methods on DarkFace
[0079]
[0080] Among machine vision-oriented methods, TGE-YOLO's mAP50 is 1.8% and 0.2% higher than the second-best methods MAET (55.8%) and EMV-YOLO (57.4%), respectively, significantly outperforming the similarly paradigmd PE-YOLO (51.2%) and DENet (53.1%). Compared to methods aimed at human vision enhancement (such as PairLIE+YOLOv3's 55.4% and Zero-DCE+YOLOv3's 54.2%), TGE-YOLO's detection accuracy improvement reaches 2.2%–3.4%, validating the advantages of the end-to-end feature learning paradigm in low-light face semantic representation. Although the domain-adaptive method DAI-Net (57.0%) achieves strong performance through cross-domain alignment strategies, TGE-YOLO still surpasses its performance ceiling with a 0.6% mAP50 advantage. The results show that the temporal gradient equalization mechanism proposed by TGE-YOLO can effectively suppress motion blur artifacts in low-light face images and enhance the response intensity of key facial regions (such as facial contours) through an attention-guided feature distillation strategy, thereby achieving more robust identity-sensitive feature extraction under extreme lighting conditions.
[0081] We extracted some images from the ExDark and DarkFace datasets, visualized and analyzed the detection results of TGE-YOLO, and compared the differences between the target region augmentation strategy and the full image augmentation strategy adopted by TGE-Net.
[0082] Visual analysis on the ExDark dataset, such as Figure 4 As shown in the visualization analysis, TGE-YOLO exhibits significant advantages in detection performance under different low-light scenarios:
[0083] In the human detection task in extremely dark environments (example in the first row), the model successfully located all human targets, demonstrating the strong robustness of the algorithm under extremely dark conditions;
[0084] For complex street scenarios (two- and three-line examples), TGE-YOLO achieved zero missed detections in dynamic environments where multiple scale targets (pedestrians, vehicles, and buses) are intertwined;
[0085] In a dimly lit indoor scene (last example), the model not only accurately detected large-scale furniture (dining table AP: 82.3%, chair AP: 74.5%), but also successfully identified small objects (cup AP: 83.1%) and a person almost invisible to the naked eye on the right. This demonstrates that TGE-YOLO can maintain stable multi-object perception capabilities under multiple disturbances such as illumination decay, motion blur, and changes in target scale, exhibiting better environmental adaptability than existing methods.
[0086] Visual analysis on the DarkFace dataset, such as Figure 5 As shown, in the more challenging DarkFace low-light face detection benchmark, most faces in the images are small targets, which places higher demands on the target detection algorithm. TGE-YOLO performs excellently in the dataset visualization results, successfully detecting all labeled face targets in the image without any missed detections. Especially under different lighting conditions, TGE-YOLO demonstrates its strong robustness in complex low-light environments. This result fully demonstrates the effectiveness and reliability of TGE-YOLO in face detection tasks in low-light environments;
[0087] Feature-enhanced visualization and comparative analysis, such as Figure 6 As shown, the visualization results of feature enhancement obtained by traditional enhancement methods using a full-image enhancement strategy and TGE-Net, which focuses on target region enhancement, are presented. Figure 6 It is evident that although traditional full-image augmentation methods strive to avoid over-enhancing irrelevant background information, some background noise and cluttered details are still incorrectly amplified during the actual augmentation process. This useless background information interferes with the target detection algorithm, misleading the detector in identifying targets and thus reducing detection accuracy. In contrast, TGE-Net employs an augmentation strategy targeting specific target regions, which more effectively suppresses background noise and redundant details, performing detailed augmentation only on the target regions of interest, thereby improving the accuracy and robustness of target detection.
[0088] To ensure that SAM provides high-quality semantic segmentation labels for TGE-Net during knowledge distillation, this application introduces the Zero-DCE algorithm to enhance low-light images before SAM. This design is based on the following considerations: First, SAM is a model trained on high-quality standard datasets, and its performance is excellent under ideal lighting conditions, but it exhibits significant performance degradation in low-light or unevenly lit scenes; second, as a student model, TGE-Net's learning performance is highly dependent on the quality of labels provided by the teacher model SAM. If the input image has insufficient lighting, it will directly affect the knowledge distillation effect. Therefore, this application uses Zero-DCE to preprocess low-light images, adaptively adjusting the image's lighting conditions through its no-reference learning characteristics, effectively improving the visibility of dark areas while maintaining image naturalness.
[0089] To verify the necessity of Zero-DCE, this application designed ablation experiments on the system. The experimental results are shown in Table 3. On the ExDark dataset, the TGE-YOLO enhanced with Zero-DCE (80.0% mAP50) improved by 0.2% compared to the unenhanced version's 79.8% mAP50, indicating that low-light enhancement effectively preserves the semantic prior knowledge of SAM. In the extreme low-light face detection task DarkFace, the gain effect of Zero-DCE is even more significant: the enhanced TGE-YOLO's mAP50 reaches 57.6%.
[0090] Table 3 Ablation experiments of the FGM module
[0091]
[0092] Continued from Table 3: Ablation experiments of the FGM module
[0093]
[0094]
[0095] However, through longitudinal comparison, TGE-YOLO without Zero-DCE performed even worse than EMV-YOLO on DarkFace (57.0% vs. 57.4%). This is because in extremely low-light scenarios, directly applying the pre-trained SAM leads to knowledge distillation producing low-quality outputs, which misleads the learning process of TGE-Net.
[0096] This experiment demonstrates that using Zero-DCE for pre-enhancement is more conducive to generating high-quality output in SAM, therefore the application of Zero-DCE in FGM is necessary. The gain effect of DCE is more significant: the mAP50 of TGE-YOLO after enhancement reaches 57.6%.
[0097] However, through longitudinal comparison, TGE-YOLO without Zero-DCE performed even worse than EMV-YOLO on DarkFace (57.0% vs. 57.4%). This is because in extremely low-light scenes, directly applying the pre-trained SAM leads to low-quality output from knowledge distillation, which misleads the learning process of TGE-Net. Experiments have shown that using Zero-DCE for pre-enhancement is more conducive to generating high-quality output from SAM. Therefore, applying Zero-DCE in FGM is necessary.
[0098] This embodiment details the proposed TGE-YOLO, which utilizes the lightweight enhancement module TGE-Net and incorporates knowledge distillation. It identifies foreground and background using the semantic segmentation model SAM, ensuring enhancement only of the target region and suppressing background interference. A feature guidance module FGM is designed, and the segmentation distillation loss Ldistill is introduced to optimize feature alignment in TGE-Net. During training, Zero-DCE is used to enhance the image before inputting it into SAM to improve segmentation accuracy, without incurring additional computational burden during the inference phase. Experimental results show that TGE-YOLO outperforms existing methods in low-light environments and learns more effective features with the same number of parameters as EMV-YOLO, enhancing its practical application value.
[0099] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any changes, modifications, substitutions, integrations, and parameter changes made to these embodiments within the spirit and principles of the present invention, without departing from the principles and spirit of the present invention, through conventional substitutions or to achieve the same function, fall within the scope of protection of the present invention.
Claims
1. A machine vision-based low-light target detection method based on target region enhancement, characterized in that, include: S1. Acquire a low-light image and perform pre-enhancement processing on the low-light image using Zero-DCE to obtain a normal light image; S2. Input the normal light image into the semantic segmentation model SAM. By modifying the MaskDecoder of the semantic segmentation model SAM, the semantic segmentation model SAM can segment the normal light image into two categories: foreground and background. The segmented image is then binarized to obtain a binarized segmented image. S3. Construct a feature guidance module (FGM), which uses the binarized segmented image to guide TGE-Net in learning the semantic information of the foreground and background through knowledge distillation, and uses the segmentation distillation loss function to constrain the shallow feature map of TGE-Net to move closer to the segmentation feature map of SAM. S4. The dark light image is decomposed into illumination component I and reflection component R by TGE-Net, and the enhanced image of the target region is obtained by fusion processing. S5. Input the enhanced image of the target region into the YOLOv3 target detection network for target detection and output the detection results.
2. The machine vision low-light target detection method based on target region enhancement according to claim 1, characterized in that, The dark image in S1 is an image acquired under low light conditions; the dark image has insufficient brightness, reduced contrast, loss of detail, and increased noise.
3. The machine vision low-light target detection method based on target region enhancement according to claim 1, characterized in that, In step S1, Zero-DCE is used to pre-enhance the dark light image. Specifically, the Zero-DCE network is used to guide the network to fit the pixel enhancement curve of the image through a no-reference loss method, thereby performing self-supervised enhancement on the dark light image. This restores the dark light image to the feature domain of the normal light image pre-trained by SAM, improving the generalization performance of SAM. The formula is: S norm = Z(S), where S is the dark image, S norm The function Z represents the Zero-DCE network to represent the enhanced normal light image.
4. The machine vision low-light target detection method based on target region enhancement according to claim 1, characterized in that, In step S2, the normal light image is segmented into foreground and background categories using the MaskDecoder of the semantic segmentation model SAM. The segmented image is then binarized to obtain a binarized segmented image. Specifically, the MaskDecoder of SAM is modified to prevent it from distinguishing between different instance categories, assigning all instances to the foreground category. The image is then divided into foreground and background categories, as shown in the formula: S seg =M(S) norm ), where M represents the binary segmentation of the segmentation network SAM, S norm For normal light images, S seg It is the segmented image; for S seg Binarization is performed by setting all non-zero pixels in the image to 255 using a binarization function. Normalization then maps the pixel values to the [0,1] interval, meaning background pixels are 0 and foreground pixels are 1. The formula is: in The image is the segmented image obtained after 0-1 binarization, and B is the binarization function.
5. The machine vision low-light target detection method based on target region enhancement according to claim 1, characterized in that, The S3 feature guidance module FGM includes the Zero-DCE low-light image enhancement network for human vision, the SAM semantic segmentation model, and the semantic distillation loss. It guides the mask enhancement module in the student model TGE-Net to learn semantic segmentation knowledge from the teacher model SAM through knowledge distillation. Knowledge distillation is divided into low-light image enhancement-assisted correction for human vision, foreground and background binarization segmentation of the image, and semantic feature distillation, ensuring that the enhancement process accurately enhances the target area without affecting the background area.
6. The machine vision low-light target detection method based on target region enhancement according to claim 1 or 5, characterized in that, In S3, the fractional distillation loss function L is utilized. distill The shallow feature maps of TGE-Net are constrained to converge towards the segmentation feature maps of SAM, specifically by using the segmentation distillation loss function L. distill Binary cross-entropy loss L BCE and KL divergence loss L KL Composition, the formula is: L distill =L BCE +L KL Binary cross-entropy loss L BCE The formula used to measure the difference between the binarized segmented image generated by the student model TGE-Net and the binarized segmented image output by the teacher model SAM is as follows: Where i is the image index. I is the 0-1 binary label output by SAM. bin (i) represents the predictions from TGE-Net; KL divergence loss L KL The probability distribution information of the SAM output is used to learn the semantic features and details of the target. Through the joint loss function, the shallow feature map of TGE-Net is constrained to move closer to the segmentation feature map of SAM.
7. The machine vision low-light target detection method based on target region enhancement according to claim 1, characterized in that, In step S4, the low-light image is decomposed into an illumination component I and a reflection component R using TGE-Net. The illumination component I is processed in two branches. The first branch performs semantic distillation using the FGM module to obtain the binarized illumination component I. bin The second branch performs enhancement processing through a semantically guided latent spatial feature enhancement module to obtain the enhanced illumination component I'; I' is then... bin Multiply by I' pixel by pixel, the formula is: Where Θ is the multiplication symbol, the illumination component I after fusing the mask information is obtained. final ; will I final The enhanced image of the target region is obtained by fusing it with the enhanced reflection component R'.
8. The machine vision low-light target detection method based on target region enhancement according to claim 7, characterized in that, The term I final The enhanced reflection component R' is then fused with it using the following formula: S final =I final ΘR', where S final To enhance the image of the target region, R' represents the reflection component, and Θ represents the multiplication sign.
9. The machine vision low-light target detection method based on target region enhancement according to claim 1, characterized in that, The overall loss function of the target detection network in S5 is derived from the target detection loss L of YOLOv3. detect and the split distillation loss function L distill The composition, the formula is: L = L distect +λ distill ·L distill , where λ distill L represents the weights of the semantic distillation loss. distill Binary cross-entropy loss L BCE and KL divergence loss L KL constitute.
10. A machine vision low-light target detection system based on target region enhancement, applicable to any one of claims 1-9, characterized in that, This includes the Feature Guidance Module (FGM), the TGE-Net module, and the object detection network YOLOv3; The feature guidance module FGM combines the low-light image enhancement network Zero-DCE (designed for human vision), the semantic segmentation model SAM, and the semantic distillation loss function L. distill The mask enhancement module in the TGE-Net module is guided to learn semantic segmentation knowledge from SAM through knowledge distillation, so that the enhancement process can accurately enhance the target region without affecting the background region. The segmentation performance of SAM is improved by pre-enhancing the low-light image through Zero-DCE. The binary segmented image is obtained by SAM segmentation and binarization, thus realizing semantic feature distillation. The TGE-Net module performs discriminative enhancement on the background and foreground of the image. It processes the decomposed illumination components in two branches. One branch undergoes semantic distillation by the FGM module to obtain the binarized illumination component I. bin One branch is enhanced to obtain the enhanced illumination component, which is then fused to obtain the enhanced image of the target region; The target detection network YOLOv3 receives the enhanced image of the target region output by the TGE-Net module and performs target detection.
Citation Information
Cited By
Method and system for identifying abnormal behaviors of personnel in tunnel construction environment
CN121838256A