Low-light target detection method and system for automatic inspection robot

CN122990160APending Publication Date: 2026-10-27JIANGXI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610854470.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-13
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供用于自动巡检机器人的低光目标检测方法及系统,旨在解决现有低光目标检测方法中增强模块与检测模块分离、缺乏端到端协同优化,且传统知识蒸馏策略无法适配目标检测多层级特征差异及跨光照域特征分布偏移,导致极端低光环境下检测精度低、实时性差的问题

Benefits of technology

针对传统方法中增强模块与检测模块分离导致的优化目标冲突,本发明将轻量级自适应增强网络与轻量化YOLOv5检测器级联为端到端融合模型,使增强模块不再追求人眼视觉美观而是直接以“提升检测精度”为优化导向,从根源上实现了增强任务与检测任务的协同适配。针对教师模型(标准光照域)与学生模型(低光增强域)之间显著的特征分布偏移,本发明提出的检测器感知型知识蒸馏并非简单模仿教师输出,而是根据检测任务中不同层级特征的语义属性进行差异化对齐:浅层特征采用边缘纹理注意力掩码引导,使模型聚焦目标轮廓细节;中层特征采用空间-通道双注意力加权,强化目标结构与上下文关联;深层特征采用类别感知通道权重对齐,保持高级语义判别性。同时引入跨层级特征金字塔一致性约束,强制浅层、中层、深层特征在目标区域内的响应保持语义连贯,从根本上避免了多尺度特征割裂导致的检测不一致问题。上述方案从而共同实现了从“像素级特征模仿”到“语义级检测知识迁移”的原理性跨越,为自动巡检机器人在极端低光环境下的高可靠感知提供了系统的技术解决方案。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990160A_ABST
    Figure CN122990160A_ABST
Patent Text Reader

Abstract

The application provides a low-light target detection method and system for an automatic inspection robot, the method comprising: constructing a lightweight adaptive enhancement network, inputting low-light and standard light images respectively enhanced to a teacher model and a student model, and extracting shallow, middle and deep features of the two; performing edge attention guidance, spatial-channel double attention weighting and class perception weighting on the three layers of features respectively, and introducing cross-level feature pyramid consistency constraints; calculating level distillation loss and weighted fusion, superimposing cross-level constraints to obtain total distillation loss, and then weightedly fusing the total distillation loss with a YOLO original detection loss to construct a joint loss for end-to-end training. The application realizes the cooperative optimization of low-light image enhancement and target detection, effectively solves the problems of cross-illumination domain feature distribution deviation and multi-level semantic fragmentation, and improves the target detection accuracy of the automatic inspection robot in an extreme low-light environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to a low-light target detection method and system for automated inspection robots. Background Technology

[0002] In the interdisciplinary field of mining engineering and computer vision, automated inspection robots face severe challenges when performing target detection tasks in extreme low-light environments (illuminance less than 5 lux), such as tailings dam drainage tunnels. These challenges include low image contrast, loss of detail, and severe noise interference. Traditional image enhancement methods (such as histogram equalization and Retinex theory) often fail to meet the requirements of subsequent target detection tasks, easily resulting in over-enhancement or detail distortion. Existing low-light target detection methods typically separate the enhancement module from the detection module, lacking end-to-end collaborative optimization. This leads to low detection accuracy and poor real-time performance in complex low-light scenarios, making it difficult to meet the inspection robot's need for accurate identification of small obstacles (such as rocks and silt) and seepage areas.

[0003] To address the aforementioned issues, knowledge distillation has been introduced into low-light vision tasks, aiming to transfer detection knowledge from the teacher model to the student model under standard illumination. However, existing distillation methods still have significant shortcomings: on the one hand, most focus on classification or image restoration tasks, failing to adapt to the differences in features at different levels (shallow edge texture, mid-level target structure, and deep semantic information) in target detection tasks; on the other hand, there is a significant feature distribution shift between the teacher and student models in the standard illumination domain and the low-light enhancement domain, making it difficult to achieve effective knowledge transfer by directly applying traditional distillation strategies. Therefore, there is an urgent need for a knowledge distillation method that can achieve synergistic optimization of enhancement and detection and possesses hierarchical perception capabilities to fill the aforementioned technical gaps and improve the target detection capabilities of automated inspection robots in complex low-light environments. Summary of the Invention

[0004] The purpose of this invention is to provide a low-light target detection method and system for automated inspection robots. It aims to solve the problems of low detection accuracy and poor real-time performance in extreme low-light environments caused by the separation of enhancement and detection modules, lack of end-to-end collaborative optimization, and the inability of traditional knowledge distillation strategies to adapt to multi-level feature differences and cross-illuminance feature distribution shifts in target detection.

[0005] In a first aspect, the present invention provides a low-light target detection method for an automated inspection robot, the method comprising: A lightweight adaptive augmentation network is constructed, and the target illumination image and the standard illumination image of the automatic inspection robot, which are less than the first preset threshold, are respectively input into the lightweight adaptive augmentation network for augmentation to obtain a first augmented image corresponding to the target illumination image and a second augmented image corresponding to the standard illumination image. The second enhanced image is input into the teacher model, and the first enhanced image is input into the student model. The teacher model is a YOLOv5x detector pre-trained under standard lighting, and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, so as to extract the shallow features, mid-level features and deep features of the enhanced image in the teacher model and the student model respectively. The shallow, medium, and deep features are processed with hierarchical differentiation, and a cross-level feature pyramid consistency constraint is introduced to constrain the response consistency of shallow, medium, and deep features in the target region. The hierarchical distillation loss is calculated based on the features of the teacher model and the student model at the same level. The hierarchical distillation loss of each level is weighted and fused, and then added to the consistency constraint of the cross-level feature pyramid to obtain the total distillation loss. The total distillation loss is weighted and fused with the YOLO native detection loss of the student model to obtain a joint optimized loss function. The student model is then trained end-to-end based on the joint optimized loss function to obtain the trained target detection model.

[0006] Secondly, the present invention provides a low-light target detection system for an automated inspection robot, the system comprising: The image enhancement module is used to construct a lightweight adaptive enhancement network and input the target illumination image and the standard illumination image of the automatic inspection robot, which are less than the first preset threshold, into the lightweight adaptive enhancement network for enhancement to obtain a first enhanced image corresponding to the target illumination image and a second enhanced image corresponding to the standard illumination image. The feature extraction module is used to input the second enhanced image into the teacher model and the first enhanced image into the student model. The teacher model is a YOLOv5x detector pre-trained under standard lighting, and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, so as to extract the shallow features, mid-level features and deep features of the enhanced image in the teacher model and the student model respectively. The feature constraint module is used to perform hierarchical differentiation processing on the shallow features, middle features and deep features respectively, and introduce cross-level feature pyramid consistency constraints to constrain the response consistency of shallow, middle and deep features in the target region. The loss fusion module is used to calculate the hierarchical distillation loss based on the features of the teacher model and the student model at the same level, and to perform weighted fusion of the hierarchical distillation loss of each level, and add it to the consistency constraint of the cross-level feature pyramid to obtain the total distillation loss. The model training module is used to weight and fuse the total distillation loss with the YOLO native detection loss of the student model to obtain a joint optimized loss function, and to perform end-to-end training on the student model based on the joint optimized loss function to obtain the trained target detection model.

[0007] Thirdly, the present invention provides a storage medium that stores one or more programs that, when executed by a processor, implement the aforementioned low-light target detection method for an automated inspection robot.

[0008] Fourthly, the present invention provides an electronic device, the electronic device comprising a memory and a processor, wherein: The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the aforementioned low-light target detection method for an automated inspection robot.

[0009] Compared with the prior art, the present invention has the following advantages: To address the conflict in optimization objectives caused by the separation of enhancement and detection modules in traditional methods, this invention cascades a lightweight adaptive enhancement network and a lightweight YOLOv5 detector into an end-to-end fusion model. This allows the enhancement module to shift its focus from aesthetic appeal to improving detection accuracy, fundamentally achieving collaborative adaptation between the enhancement and detection tasks. Addressing the significant feature distribution shift between the teacher model (standard illumination domain) and the student model (low-light enhancement domain), the detector-perceptual knowledge distillation proposed in this invention does not simply mimic the teacher's output. Instead, it differentiates and aligns features based on the semantic attributes of different levels of features in the detection task: shallow features are guided by edge texture attention masks, focusing the model on target contour details; mid-level features employ spatial-channel dual attention weighting to strengthen the target structure and contextual association; and deep features are aligned using category-aware channel weights to maintain high-level semantic discriminability. Simultaneously, a cross-level feature pyramid consistency constraint is introduced, forcing the responses of shallow, mid, and deep features within the target region to maintain semantic coherence, fundamentally avoiding detection inconsistencies caused by multi-scale feature fragmentation. The above solutions collectively achieve a fundamental leap from "pixel-level feature imitation" to "semantic-level detection knowledge transfer," providing a systematic technical solution for highly reliable perception of automated inspection robots in extreme low-light environments. Attached Figure Description

[0010] Figure 1This is a flowchart of a low-light target detection method for an automated inspection robot according to an embodiment of the present invention; Figure 2 for Figure 2 This is a diagram of the adaptive augmentation network structure; Figure 3 A diagram of the AEN-YOLO framework structure; Figure 4 A teacher-student framework diagram for the Detector-Aware Knowledge Distillation (DAKD) method; Figure 5 This is a comparison chart of detection results with and without the DAKD strategy. Figure 5 Image a shows the detection results without the DAKD strategy. Figure 5 b shows the detection results after introducing the DAKD strategy; Figure 6 A comparison chart of detection results between AEN-YOLO and other low-light detectors; Figure 7 AEN-YOLO confusion matrix heatmap; Figure 8 This is a schematic diagram of the inspection robot and its control panel. Figure 9 This is a schematic diagram of a low-light target detection system for an automated inspection robot according to an embodiment of the present invention.

[0011] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "comprising" and similar expressions used herein mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, but does not exclude other elements or objects.

[0013] like Figures 1 to 8 As shown, an embodiment of the present invention proposes a low-light target detection method for an automated inspection robot, the method comprising steps S101 to S105, wherein: Step S101: Construct a lightweight adaptive enhancement network, and input the target illumination image and standard illumination image of the automatic inspection robot that are less than the first preset threshold into the lightweight adaptive enhancement network for enhancement, to obtain a first enhanced image corresponding to the target illumination image and a second enhanced image corresponding to the standard illumination image. It should be noted that traditional image enhancement methods often pursue human visual effects, which may inadvertently damage features such as edges and textures that are crucial for detection. Therefore, this embodiment specifically designs a lightweight network. Through an encoder-decoder structure, it maps low-light images and standard-light images to a feature space more suitable for detector processing, thereby providing high-quality input for subsequent teacher and student models and solving the fundamental problem of inconsistency between the enhancement and detection task objectives.

[0014] Furthermore, target illumination images of automated inspection robots that are less than a first preset threshold are considered low-light images. For example, the first preset threshold can be 5 lux.

[0015] In some embodiments, the encoder extracts hierarchical features through three multi-scale residual downsampling blocks (MS-ResDown). Each downsampling block contains parallel 1×1, 3×3, and 5×5 convolutional branches, residual connections, and an average pooling branch with a stride of 2. Each convolutional branch is followed by batch normalization and a Swish activation function. A 1×1 projective convolution is used to ensure that the spatial size and number of channels of the residual branches are consistent with those of the main branches, thereby achieving a halving of spatial resolution and a gradual expansion of the number of channels (32→64→128). The feature extraction process is defined as follows:

[0016]

[0017]

[0018]

[0019] Where x is the input image; For encoder number Layer output feature map, This represents a convolutional branch with a kernel size of k×k and a stride of 2. Indicates channel-dimensional splicing. This represents a 1×1 projective convolution used for channel adaptation. For residual branch output features, This is an average pooling operation with a 2×2 pooling kernel and a step size of 2. For Swish activation function, For batch normalization operations, This is a feature concatenation of multi-scale convolutional branches. It uses a 1×1 convolution. Compared to traditional single convolution downsampling, this structure can improve the recognition of edge details of small objects.

[0020] The decoder reconstructs spatial details through three attention-guided upsampling blocks (Att-UP). Each upsampling block includes bilinear interpolation upsampling, a channel attention module (CAM), a spatial attention module (SAM), and an adaptive fusion operation with the corresponding level features from the encoder. The feature reconstruction process is defined as follows:

[0021]

[0022]

[0023]

[0024] in, For decoder number Layer output feature map; Indicates bilinear interpolation upsampling; This represents the attention weights generated jointly by channel attention and spatial attention. For channel attention module, This is for spatial attention modules. The above indexing relationship makes... Fusion , Fusion , Fusion This ensures that the jump connection between the encoder and decoder is consistent. The channel attention module learns channel weights through global average pooling, while the spatial attention module learns spatial weights through 7×7 convolution, thereby enhancing the features of the target region and suppressing background noise.

[0025] Then, a 1×1 convolutional layer maps the final feature map of the decoder into 3-channel image features, which are then normalized to the pixel value range adapted to the detection task using a dynamic adaptive Clip function, resulting in the enhanced image Y, defined as:

[0026]

[0027] in, To map the number of feature channels from 32 to 3 in a 1×1 convolutional layer, This is the final output feature map of the decoder. This is the result of a 3-channel mapping. , These are the 5% and 95% percentiles of the current batch's 3-channel mapping results, respectively. To prevent extremely small constants with a denominator of zero, i.e., non-zero constants, This is the Clip function. This dynamic range mapping avoids detail loss or over-enhancement caused by a fixed value range. Compared to fixed [0,1] normalization, it effectively improves detection accuracy in extremely low-light scenes (illuminance <5 lux).

[0028] In summary, this invention, through the refined design of a lightweight adaptive enhancement network (AEN), fundamentally achieves efficient mapping of low-light images to a detection-friendly domain. Specifically, the encoder employs three multi-scale residual downsampling blocks, each using convolutional branches with three different receptive fields (1×1, 3×3, and 5×5) in parallel. Combined with residual connections and average pooling with a stride of 2, it can expand the number of channels from 32 to 128 while progressively halving the spatial resolution. This effectively captures multi-scale hierarchical features from local details to global structure, resolving the contradiction that a single convolutional kernel cannot simultaneously handle the edge recognition of small targets and the overall perception of medium to large targets. The decoder reconstructs spatial details through three attention-guided upsampling blocks. Each upsampling block, based on bilinear interpolation, introduces a channel attention module and a spatial attention module. The former learns the dependencies between channels through global average pooling to strengthen key semantic channels, while the latter learns spatial location weights through 7×7 convolutions to focus on the target region and suppress background noise. These are then adaptively fused with the original features from the corresponding level of the encoder, thereby restoring resolution while preserving edge texture and structural information that are easily lost in low-light environments to the maximum extent. Finally, the dynamic adaptive Clip function uses the 5% and 95th percentiles of the current batch features for normalization, rather than using a fixed value range mapping. This allows for flexible adjustment of the enhancement range according to the actual pixel distribution of each image, avoiding detail loss or over-enhancement under extreme low-light conditions.

[0029] Step S102: Input the second enhanced image into the teacher model and the first enhanced image into the student model. The teacher model is a YOLOv5x detector pre-trained under standard illumination, and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, so as to extract the shallow features, mid-level features and deep features of the enhanced image in the teacher model and the student model respectively. It should be noted that in this step, the teacher model is trained using clear images under standard lighting conditions, thus mastering high-precision detection capabilities under ideal lighting conditions; the student model, on the other hand, is the target model to be trained and needs to learn to work in low-light environments. By feeding enhanced images of the same scene into the teacher and student models respectively, and extracting feature maps from both at different network depths, multi-layered "reference answers" are provided for the subsequent distillation process. This allows the student model not only to see the final detection results of the teacher model, but also to learn the complete feature construction process of the teacher model from shallow to deep layers.

[0030] In some embodiments, the specific process includes the following: (a) Train the teacher model according to the following formula:

[0031]

[0032]

[0033] in, For the nth second enhanced image, The YOLOv5x object detector pre-trained under standard lighting conditions is used for the teacher model. These are the teacher model parameters before training. These are the parameters of the teacher model after training. For teacher model parameters An optimization operator used as an optimization variable to minimize the detection loss function within the brackets. This represents the target detection prediction result output by the teacher model for the nth second enhanced image Y1n. Label the corresponding target. Based on the teacher model parameters after training The constructed teacher model inference mapping function, This parameter is to be frozen during subsequent distillation training.

[0034] (ii) During the student model training phase, the student device receives the low-light image and outputs a low-light enhanced image (first enhanced image). The first enhanced image serves as the input to the lightweight YOLOv5 student detector. The student YOLOv5 outputs the detection results and participates in backpropagation optimization. During distillation training, only the following are updated: Freeze the YOLOv5 parameters for students and the YOLOv5x parameters for teachers.

[0035] (III) Extract the corresponding features of the frozen teacher YOLOv5x and student YOLOv5x at the shallow, middle, and deep layers, respectively. The teacher YOLOv5x uses the second enhanced image as input, or uses the YOLOv5x image as input. nA pre-constructed teacher feature prototype serves as the supervision baseline; the student YOLOv5 uses the first augmented image as input. The input to this step is the teacher-level features and the student-level features, and the output is the student's shallow, medium, and deep features processed under the guidance of the teacher features, defined as follows:

[0036]

[0037] When the standard illumination image x n With low-light image x l When the samples are paired samples of the same scene or the same target, use directly. and Perform spatial correspondence feature distillation; when the two are unpaired samples, use a standard enhanced image. Supervised training is conducted using pre-constructed category-level or target region-level teacher feature prototypes. This teacher feature prototype library is constructed offline based on standard augmented samples after the teacher model training is complete and remains frozen during student distillation training. The teacher feature prototypes can be defined as follows:

[0038]

[0039] in, This represents the prototype of the teacher characteristics of the i-th layer and c-th class. Standard enhanced image The set of target regions corresponding to category c; This indicates feature pooling of the target region.

[0040] Based on semantic hierarchy, the teacher model features are divided into shallow, medium, and deep feature sets, and the student model features are similarly divided into shallow, medium, and deep feature sets, defined as follows:

[0041]

[0042]

[0043]

[0044] in, This represents the output feature of the j-th layer of the student model. The output features of the i-th layer of the teacher model. For the i-th feature extraction layer of the teacher model, For the j-th feature extraction layer of the student model, For the l-th first enhanced image, For the feature set corresponding to the teacher model, For the feature set corresponding to the student model, , , These represent the shallow, middle, and deep features of the student model. , , These represent the shallow, intermediate, and deep features of the teacher model. , These represent the k-th output feature of the teacher model and the student model, respectively. , These are the nth feature in the kth output feature of the teacher model and the student model, respectively. , , They are divided into shallow, middle, and deep layers. is the total number of features for the k-th output feature.

[0045] For example, assuming the input image resolution is 640×640, the YOLOv5 backbone network CSPDarknet contains multiple downsampling stages. The shallow features correspond to the outputs of Stage 1 and Stage 2 (downsampling by 2 to 4 times, feature map sizes of 320×320 and 160×160). This stage has fewer channels and higher spatial resolution, mainly encoding low-level visual information such as edges, corners, textures, and colors. It is sensitive to changes in illumination but retains precise spatial location. The middle features correspond to the outputs of Stage 3 (downsampling by 8 times, feature map size of 80×80). They have a moderate number of channels and an expanded receptive field. They mainly encode the component structure of the target (such as the human head and limbs), the spatial relationships between components, and local contextual information. They are robust to deformation and occlusion. The deep features correspond to the outputs of Stage 4 and Stage 5 (downsampling by 16 to 32 times, feature map sizes of 40×40 and 20×20). They have more channels and lower spatial resolution. They mainly encode category semantics, global layout, and high-level abstract information. They are illumination invariant and category discriminative.

[0046] In summary, by constructing a "teacher-student" dual-model distillation framework and explicitly decoupling and extracting multi-level features, the problem of feature distribution shift and semantic mismatch in cross-illumination domain knowledge transfer is fundamentally solved. Specifically, the multiple feature extraction layers of the teacher model (YOLOv5x pre-trained under standard illumination) and the student model (adaptive augmentation network and lightweight YOLOv5 cascaded) are first divided into three independent sets according to semantic attributes: shallow layer (edge ​​texture), middle layer (target structure and context), and deep layer (category semantics). The essential breakthrough of this design lies in the fact that traditional knowledge distillation often treats the teacher model as a "black box" for overall imitation, resulting in features at different semantic levels being forcibly aligned by the same loss function. Shallow features blur edge details in pursuit of semantic similarity, while deep features lose generalization ability in pursuit of pixel precision, leading to serious optimization conflicts and negative transfer effects. By decoupling teacher-detected knowledge into three independently supervised distillation channels, the shallow layer can employ a spatially sensitive alignment strategy to preserve edge accuracy, the middle layer can employ a structure-aware alignment strategy to strengthen the correlation between components, and the deep layer can employ a semantically direction-sensitive alignment strategy to maintain category discriminativeness, thus achieving a fundamental leap from "feature imitation" to "semantic distillation".

[0047] Step S103: Perform hierarchical differentiation processing on the shallow features, middle features and deep features respectively, and introduce cross-level feature pyramid consistency constraints to constrain the response consistency of shallow, middle and deep features in the target region. In this step, to address the inconsistency in channel count and spatial dimensions caused by the different structures of the teacher and student models, channel adaptation and spatial dimension alignment are first performed on the student features, defined as follows:

[0048]

[0049]

[0050] in, For the 1×1 channel adaptation layer corresponding to the nth matching feature of the kth level; This is a bilinear interpolation size alignment operation; This represents the spatial dimensions corresponding to the teacher's characteristics.

[0051] Next, shallow feature processing is performed. Specifically, an edge texture attention mask is generated from the teacher's shallow features, and this mask is used to guide the student's shallow feature enhancement. The processed student shallow features are then output, defined as follows:

[0052]

[0053] in, An attention mask for edge textures generated from shallow features of the teacher; The processed shallow features of students; This corresponds to the shallow reference features of the teacher.

[0054] Next, the mid-level features are processed. Specifically, spatial-channel dual attention weights are generated using the teacher's mid-level features, and these weights are used to guide the student's mid-level features to focus on the target contour, local structure, and contextual relationships. The weights are defined as follows:

[0055]

[0056]

[0057]

[0058] in, For channel attention module, For spatial attention modules; Spatial-channel dual attention weights generated from mid-level teacher features; The mid-level characteristics of the processed students.

[0059] Further processing of deep features involves generating category-aware channel weights based on the target category label and semantically weighting the student's deep features. Global aggregation is performed when calculating the deep semantic distillation loss, and the spatial structure before the gap is preserved when calculating the cross-level consistency loss. This structure is defined as follows:

[0060]

[0061]

[0062]

[0063] in, This is a multi-label category vector corresponding to an image or target region; This is the mapping matrix from category to channel; Category-aware channel weights; Indicates global average pooling; To preserve the deep characteristics of students' spatial structure before the gap; This is the processed deep semantic vector of the student; This corresponds to the teacher's deep semantic vector.

[0064] Finally, a cross-level constraint is designed: specifically, a feature pyramid consistency loss is constructed based on the processed shallow, middle, and deep spatial features of the student model to constrain the consistency of responses at different levels of the student model in the target region. The formula is as follows:

[0065]

[0066]

[0067]

[0068] in, This indicates averaging multiple matching features within the same level. Indicates feature normalization; This represents the target region mask generated from target annotations or detection candidate regions. This represents the mean square error function. Shallow feature pyramid response map generated for shallow matching features of the student model. Generate a mid-level feature pyramid response feature map for mid-level matching features in the student model, and upsample and align it to a shallow spatial scale. This is a bilinear interpolation upsampling operation. A deep feature pyramid response feature map is generated for deep matching features of the student model and upsampled and aligned to a shallow spatial scale. The feature pyramid consistency loss is used across different levels.

[0069] In summary, by designing differentiated processing strategies for shallow, mid-level, and deep features and introducing cross-level feature pyramid consistency constraints, the fundamental flaw of traditional distillation—that "a single alignment method cannot adapt to multi-level semantic features"—is fundamentally solved. Specifically, shallow features are enhanced using edge texture attention masks generated by the teacher's shallow features, enabling the student model to focus on details such as target contours and corners, avoiding positioning errors caused by edge blurring in low-light environments. Mid-level features are weighted and aligned using spatial-channel dual attention weights generated by the teacher's mid-level features. Channel attention strengthens semantic channels related to the target, while spatial attention suppresses background noise and focuses on the target region, allowing the student model to accurately capture the target component structure and contextual relationships. Deep features are semantically weighted using category-aware channel weights, and feature channels are differentiated and enhanced according to the target's category label, making the student model's deep expression more focused on discriminative semantics rather than background clutter.

[0070] Step S104: Calculate the hierarchical distillation loss based on the features of the teacher model and student model at the same level, and perform weighted fusion of the hierarchical distillation loss of each level, and add it to the consistency constraint of the cross-level feature pyramid to obtain the total distillation loss; It should be noted that the shallow layer uses L1 loss to preserve edge texture details, the middle layer uses mean squared error loss to align the target structure, and the deep layer uses cosine semantic loss to align high-level semantics, which is defined as follows:

[0071]

[0072]

[0073] in, , , represents the number of features involved in matching at the shallow, middle, and deep layers, respectively; Cos represents the cosine similarity. , , These represent the losses from shallow, middle, and deep distillation, respectively.

[0074] Differentiated weights are assigned to the distillation losses at different levels, and the cross-level feature pyramid consistency loss is incorporated to obtain the total distillation loss, which is defined as:

[0075] in, , , Weights for shallow, intermediate, and deep layers, respectively. The consistency constraint weights range from 0.08 to 0.12, with an optimal value of 0.1. This hierarchical weighting strategy enables the student model to focus on learning the deep semantic representation of the teacher model while retaining shallow texture and mid-level structural supervision, thus addressing the mismatch between distilled signals and detection task requirements, as well as the fragmentation of multi-scale features.

[0076] For example, ; ; .

[0077] Step S105: The total distillation loss is weighted and fused with the YOLO native detection loss of the student model to obtain a joint optimized loss function, and the student model is trained end-to-end according to the joint optimized loss function to obtain the trained target detection model.

[0078] It should be noted that YOLO's native detection loss includes bounding box regression loss, confidence loss, and classification loss, which are defined as follows:

[0079] in, The bounding box regression loss is calculated using CIoU loss. For target confidence loss, For both categories, the classification loss is calculated using binary cross-entropy loss.

[0080] The joint optimization loss function is obtained by weighted fusion of the total distillation loss and the YOLO native detection loss, and is defined as follows:

[0081] in, Weights for bounding box regression loss. Weight the target confidence level loss. For category classification loss weights, This is the loss from YOLO's native detection. The total distillation loss obtained in step S35; The balancing coefficient ranges from 0.2 to 0.4. Cross-validation on the validation set determined the optimal value to be 0.3. This coefficient balances knowledge transfer from distillation with optimization of the detection task, preventing the lightweight adaptive augmentation network from favoring visual aesthetic enhancement over detection-friendly enhancement, while also reducing AEN (Advanced Entity Reduction). S Optimization conflicts with the YOLO detection head.

[0082] Furthermore, the training process employed a stochastic gradient descent (SGD) optimizer with an initial learning rate of 0.001, a weight decay coefficient of 0.0005, a batch size of 16, and a training duration of 30 epochs, all completed on a single RTX 8000 GPU. After training, the model achieved a detection latency of ≤30ms on a self-built dataset of tailings dam drainage tunnels, meeting the real-time requirements of the inspection robot.

[0083] In summary, based on the aforementioned low-light target detection method for automated inspection robots, this invention addresses the optimization conflict caused by the separation of the enhancement and detection modules in traditional methods. It cascades a lightweight adaptive enhancement network and a lightweight YOLOv5 detector into an end-to-end fusion model, enabling the enhancement module to focus on "improving detection accuracy" rather than pursuing aesthetic appeal to the human eye, thus fundamentally achieving collaborative adaptation between the enhancement and detection tasks. Regarding the significant feature distribution shift between the teacher model (standard illumination domain) and the student model (low-light enhancement domain), the detector-based perceptual knowledge distillation proposed in this invention does not simply mimic the teacher's output. Instead, it differentiates and aligns features based on the semantic attributes of different levels of features in the detection task: shallow features are guided by edge texture attention masks, allowing the model to focus on target contour details; mid-level features employ spatial-channel dual attention weighting to strengthen the target structure and contextual association; and deep features use category-aware channel weight alignment to maintain high-level semantic discriminability. Simultaneously, a cross-level feature pyramid consistency constraint is introduced, forcing shallow, medium, and deep features to maintain semantic coherence in their responses within the target area, fundamentally avoiding the detection inconsistency problem caused by multi-scale feature fragmentation. These solutions collectively achieve a fundamental leap from "pixel-level feature imitation" to "semantic-level detection knowledge transfer," providing a systematic technical solution for highly reliable perception in extremely low-light environments for automated inspection robots.

[0084] like Figure 9 As shown, one embodiment of the present invention proposes a low-light target detection system for an automated inspection robot, the system comprising: Image enhancement module 10 is used to construct a lightweight adaptive enhancement network and input the target illumination image and standard illumination image of the automatic inspection robot, which are less than the first preset threshold, into the lightweight adaptive enhancement network for enhancement to obtain a first enhanced image corresponding to the target illumination image and a second enhanced image corresponding to the standard illumination image. The feature extraction module 20 is used to input the second enhanced image into the teacher model and the first enhanced image into the student model. The teacher model is a YOLOv5x detector pre-trained under standard illumination, and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, so as to extract the shallow features, mid-level features and deep features of the enhanced image in the teacher model and the student model respectively. The feature constraint module 30 is used to perform hierarchical differentiation processing on the shallow features, middle features and deep features respectively, and introduce cross-level feature pyramid consistency constraints to constrain the response consistency of shallow, middle and deep features in the target region. The loss fusion module 40 is used to calculate the hierarchical distillation loss based on the features of the teacher model and the student model at the same level, and to perform weighted fusion of the hierarchical distillation loss of each level, and add it to the consistency constraint of the cross-level feature pyramid to obtain the total distillation loss. The model training module 50 is used to weight and fuse the total distillation loss with the YOLO native detection loss of the student model to obtain a joint optimized loss function, and to perform end-to-end training on the student model according to the joint optimized loss function to obtain a trained target detection model.

[0085] In another aspect, the present invention also proposes a storage medium having stored one or more programs thereon, which, when executed by a processor, implement the aforementioned low-light target detection method for an automated inspection robot.

[0086] In another aspect, the present invention also proposes an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to realize the above-mentioned low-light target detection method for an automated inspection robot.

[0087] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain stored, communicated, propagated, or transmitted programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0088] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0089] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0090] While embodiments of the present invention have been described in detail above, it will be apparent to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations fall within the scope and spirit of the invention as set forth in the claims. Furthermore, the invention described herein may have other embodiments and can be implemented or carried out in various ways.

Claims

1. A low-light target detection method for an automated inspection robot, characterized in that, The method includes: A lightweight adaptive augmentation network is constructed, and the target illumination image and the standard illumination image of the automatic inspection robot, which are less than the first preset threshold, are respectively input into the lightweight adaptive augmentation network for augmentation to obtain a first augmented image corresponding to the target illumination image and a second augmented image corresponding to the standard illumination image. The second enhanced image is input into the teacher model, and the first enhanced image is input into the student model. The teacher model is a YOLOv5x detector pre-trained under standard lighting, and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, so as to extract the shallow features, mid-level features and deep features of the enhanced image in the teacher model and the student model respectively. The shallow, medium, and deep features are processed with hierarchical differentiation, and a cross-level feature pyramid consistency constraint is introduced to constrain the response consistency of shallow, medium, and deep features in the target region. The hierarchical distillation loss is calculated based on the features of the teacher model and the student model at the same level. The hierarchical distillation loss of each level is weighted and fused, and then added to the consistency constraint of the cross-level feature pyramid to obtain the total distillation loss. The total distillation loss is weighted and fused with the YOLO native detection loss of the student model to obtain a joint optimized loss function. The student model is then trained end-to-end based on the joint optimized loss function to obtain the trained target detection model.

2. The low-light target detection method for an automated inspection robot according to claim 1, characterized in that, The steps of constructing a lightweight adaptive enhancement network and inputting a target illumination image containing an automated inspection robot that is less than a first preset threshold into the lightweight adaptive enhancement network for enhancement to obtain an enhanced image include: The lightweight adaptive enhancement network adopts an encoder-decoder architecture, wherein: The encoder extracts hierarchical features through three multi-scale residual downsampling blocks. Each downsampling block contains parallel 1×1, 3×3, and 5×5 convolutional branches, residual connections, and an average pooling layer with a stride of 2. Each branch is followed by batch normalization and the Swish activation function. Feature extraction is performed according to the following formula: ; ; ; ; Where x is the input image, , The encoders are respectively Layer, First Layer output feature map; This represents a convolutional branch with a kernel size of k×k and a stride of 2; Indicates channel-dimensional splicing; This represents a 1×1 projective convolution used for channel adaptation. This is the output feature map of layer 0 of the encoder. For residual branch output features, This is an average pooling operation with a 2×2 pooling kernel and a step size of 2. For Swish activation function, For batch normalization operations, This is a feature concatenation of multi-scale convolutional branches. It is a 1×1 convolution; The decoder reconstructs spatial details using three attention-guided upsampling blocks. Each upsampling block contains bilinear interpolation upsampling, a channel attention module, and a spatial attention module, specifically reconstructed according to the following formula: ; ; ; ; in, For decoder number Layer output feature map, This indicates bilinear interpolation upsampling. This represents the decoder generated jointly by channel attention and spatial attention. Attention weights of layers For channel attention module, For spatial attention modules; The final feature map of the decoder is mapped to 3-channel features, and then normalized to the pixel value range adapted to the detection task using a dynamic adaptive Clip function to obtain the enhanced image: ; ; in, This is the 3-channel mapping result. This is a 1×1 convolutional layer that maps the number of feature channels from 32 to 3, where Y is the enhanced image. , These are the 5% and 95% percentiles of the current batch's 3-channel mapping results, respectively. It is a non-zero constant. This is the Clip function.

3. The low-light target detection method for an automated inspection robot according to claim 1, characterized in that, The step of inputting the second enhanced image into the teacher model and the first enhanced image into the student model, wherein the teacher model is a YOLOv5x detector pre-trained under standard illumination and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, to extract shallow, mid-level, and deep features of the enhanced image in the teacher model and the student model respectively, includes: The teacher model is trained using the following formula: ; ; ; in, For the nth second enhanced image, The YOLOv5x object detector pre-trained under standard lighting conditions is used for the teacher model. These are the teacher model parameters before training. These are the parameters of the teacher model after training. For teacher model parameters An optimization operator used as an optimization variable to minimize the detection loss function within the brackets. This represents the target detection prediction result output by the teacher model for the nth second enhanced image Y1n. Label the corresponding target. Based on the teacher model parameters after training The constructed teacher model inference mapping function, This parameter will be frozen during subsequent distillation training; Features are extracted using the following formula: ; ; Based on semantic hierarchy, the output features of both the teacher model and the student model are divided into shallow, medium, and deep features: ; ; ; ; in, This represents the output feature of the j-th layer of the student model. The output features of the i-th layer of the teacher model. For the i-th feature extraction layer of the teacher model, For the j-th feature extraction layer of the student model, For the l-th first enhanced image, For the feature set corresponding to the teacher model, For the feature set corresponding to the student model, , , These represent the shallow, intermediate, and deep features of the teacher model. , , These represent the shallow, middle, and deep features of the student model. , These represent the k-th output feature of the teacher model and the student model, respectively. , These are the nth feature in the kth output feature of the teacher model and the student model, respectively. , , They are divided into shallow, middle, and deep layers. is the total number of features for the k-th output feature.

4. The low-light target detection method for an automated inspection robot according to claim 1, characterized in that, The steps of performing hierarchical differentiation processing on the shallow, medium, and deep features respectively, and introducing cross-level feature pyramid consistency constraints to constrain the consistency of responses of shallow, medium, and deep features in the target region include: The student model's features are adapted for channel fitting and spatial size alignment according to the following formula: ; ; in, For the nth feature in the kth output feature of the aligned student model, For spatial dimension alignment operations, This is a 1×1 channel adaptation convolutional layer applied to the nth matching feature at the kth level of the student model, used to map the number of channels in the student model's output features to be consistent with the number of channels in the corresponding level's output features of the teacher model. It is the nth feature in the kth output feature of the aligned teacher model; The shallow features of the student model are enhanced according to the following formula: ; ; in, To and The corresponding edge texture attention mask, It is the Sigmoid activation function. The nth shallow feature output by the enhanced student model, The nth feature in the shallow features of the aligned student model; The mid-layer features are processed according to the following formula: ; ; ; ; in, The channel attention weights are generated from the mid-level features of the teacher. , These are the nth features in the middle-layer features of the aligned teacher and student models, respectively. For channel attention module, For spatial attention modules, Spatial attention weights generated from mid-level teacher features. Spatial-channel dual attention weights generated from mid-level teacher features. This is the nth shallow feature output by the processed student model; Deep features are processed according to the following formula: ; ; ; ; in, For category-aware channel weights, This is a mapping matrix from category to channel. This is a multi-label category vector corresponding to an image or target region. The nth deep feature output by the student model that preserves the spatial structure before the gap. For the nth feature in the deep features of the aligned student model, The processed deep semantic vector of the student. Indicates global average pooling. This corresponds to the teacher's deep semantic vector; Construct consistency constraints based on the following formula: ; ; ; ; in, Shallow feature pyramid response map generated for shallow matching features of the student model. Indicates feature normalization, This indicates averaging multiple matching features within the same level. Generate a mid-level feature pyramid response feature map for mid-level matching features in the student model, and upsample and align it to a shallow spatial scale. This is a bilinear interpolation upsampling operation. A deep feature pyramid response feature map is generated for deep matching features of the student model and upsampled and aligned to a shallow spatial scale. For cross-level feature pyramid consistency loss, Let be the mean square error function.

5. The low-light target detection method for an automated inspection robot according to claim 1, characterized in that, The steps of calculating the hierarchical distillation loss based on the features of the teacher model and the student model at the same level, weighting and fusing the hierarchical distillation losses of each level, and adding them to the cross-level feature pyramid consistency constraint to obtain the total distillation loss include: The stage distillation loss is calculated using the following formula: ; ; ; in, , , represents the number of features involved in matching at the shallow, middle, and deep layers, respectively, and Cos represents the cosine similarity. , , These represent the losses during shallow, middle, and deep distillation, respectively. The total distillation loss is calculated using the following formula: ; in, For total distillation losses, , , Weights for shallow, intermediate, and deep layers, respectively. The weights are for consistency constraints.

6. The step of weightedly fusing the total distillation loss with the YOLO native detection loss of the student model to obtain a joint optimized loss function, and then performing end-to-end training on the student model based on the joint optimized loss function to obtain the trained object detection model includes: The joint optimization loss function is calculated using the following formula: ; ; in, To jointly optimize the loss function, This is the loss from YOLO's native detection. For balance coefficient, For bounding box regression loss, For target confidence loss, For category classification loss, Weights for bounding box regression loss. Weight the target confidence level loss. Weights for category classification loss.

7. A low-light target detection system for an automated inspection robot, characterized in that, The system includes: The image enhancement module is used to construct a lightweight adaptive enhancement network and input the target illumination image and the standard illumination image of the automatic inspection robot, which are less than the first preset threshold, into the lightweight adaptive enhancement network for enhancement to obtain a first enhanced image corresponding to the target illumination image and a second enhanced image corresponding to the standard illumination image. The feature extraction module is used to input the second enhanced image into the teacher model and the first enhanced image into the student model. The teacher model is a YOLOv5x detector pre-trained under standard lighting, and the student model is an end-to-end fusion model composed of the lightweight adaptive enhancement network and the lightweight YOLOv5 detector, so as to extract the shallow features, mid-level features and deep features of the enhanced image in the teacher model and the student model respectively. The feature constraint module is used to perform hierarchical differentiation processing on the shallow features, middle features and deep features respectively, and introduce cross-level feature pyramid consistency constraints to constrain the response consistency of shallow, middle and deep features in the target region. The loss fusion module is used to calculate the hierarchical distillation loss based on the features of the teacher model and the student model at the same level, and to perform weighted fusion of the hierarchical distillation loss of each level, and add it to the consistency constraint of the cross-level feature pyramid to obtain the total distillation loss. The model training module is used to weight and fuse the total distillation loss with the YOLO native detection loss of the student model to obtain a joint optimized loss function, and to perform end-to-end training on the student model based on the joint optimized loss function to obtain the trained target detection model.

8. A storage medium, characterized in that, The storage medium stores one or more programs that, when executed by a processor, implement the low-light target detection method for an automated inspection robot as described in any one of claims 1-6.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein: The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the low-light target detection method for an automated inspection robot as described in any one of claims 1-6.