A method for constructing a low-light environment-oriented safety target detection model
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]本发明的目的在于提供一种面向低光照环境的安全目标检测模型的构建方法,有效解决核电站场景中普遍存在的小目标检测困难、复杂背景干扰显著以及训练资源开销大的问题
[0052]与现有技术相比,本发明的有益技术效果是:(1)提升小目标的检测能力:通过细粒度特征增强模块并行融合3×3组卷积与1×1全通道点卷积,在保留全通道原始信息的同时增强局部空间细节捕捉,强化模型对安全帽、剂量计等个人防护装备微小目标的特征表征。
Smart Images

Figure CN122548447A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of security target detection model construction technology, and particularly relates to a method for constructing a security target detection model for low-light environments. Background Technology
[0002] The safe operation of nuclear power plants has always been a core research direction in the field of industrial intelligence and intelligent monitoring. Compared with conventional industrial environments, the internal working environment of nuclear power plants has significant characteristics such as limited lighting conditions, complex spatial structure, dense equipment and pipelines, significant background interference, and frequent target obstruction, which bring great difficulties to on-site safety supervision. Traditional methods relying on manual inspection are not only labor-intensive and limited by radiation dose, but also cannot meet the real-time and accuracy requirements of the continuous operation environment of nuclear power plants. With the rapid development of deep learning and computer vision technologies, target detection methods based on convolutional neural networks and Transformer architectures have made significant progress in security monitoring, industrial inspection, and other fields, providing a feasible technical path for the automatic perception and identification of safety targets in nuclear power plants.
[0003] In nuclear power plant safety monitoring, safety targets such as personnel, safety helmets, dosimeters, and protective gloves directly reflect the operational status and protection level. Efficient and accurate automatic detection of these targets has significant engineering application value for preventing safety accidents and ensuring personnel safety. However, nuclear power plant monitoring images generally suffer from large areas of darkness, localized strong reflections, and significant brightness unevenness, leading to blurred target edges, loss of texture details, and decreased contrast. Safety helmets, dosimeters, and other protective equipment occupy a small pixel proportion in the image, representing typical small and fine-grained targets. Simultaneously, the complex textures of background elements such as pipes, valves, instruments, and cable trays within nuclear power plants can easily be confused with safety targets. These factors make it difficult for general target detection models to meet practical requirements in terms of detection accuracy and robustness when directly applied to nuclear power plant scenarios. Therefore, how to balance small target detection capability, anti-interference capability, and real-time performance in the complex, low-light environment of a nuclear power plant has become a critical problem that urgently needs to be solved in current research.
[0004] Current research on nuclear power plant safety target detection mainly focuses on the following directions: (1) Two-stage detection methods based on convolutional neural networks: The two-stage detection method represented by Faster R-CNN first generates candidate target regions through the Region Proposal Network (RPN), and then classifies and regresses the bounding boxes of the candidate regions. This type of method usually has high detection accuracy and strong target representation ability in the complex background of nuclear power plants. However, its reasoning process is relatively complex, the computational overhead is large, and the real-time performance is insufficient, making it difficult to meet the real-time requirements of continuous analysis of nuclear power plant video streams. (2) Real-time detection methods based on Transformer architecture: Transformer detection frameworks represented by DETR and RT-DETR utilize the global modeling capability of the self-attention mechanism to integrate target and background information in a larger range, enhancing the feature expression in complex scenes. RT-DETR (Real-Time Detection Transformer), as a real-time detection model that balances accuracy and speed, achieves strong multi-scale feature fusion and efficient target query initialization through a hybrid encoder and query selection mechanism, showing good application potential in complex scene detection tasks. However, in low-light scenarios at nuclear power plants, RT-DETR's ability to represent small-scale safety targets and fine-grained targets still needs improvement, and its ability to focus on key areas under occlusion interference and low contrast conditions is insufficient. Furthermore, as the scale of model training and experimental complexity increase, resource consumption during the training phase becomes a significant factor affecting the efficiency of method optimization. Summary of the Invention
[0005] The purpose of this invention is to provide a method for constructing a safety target detection model for low-light environments, which effectively solves the problems of difficulty in detecting small targets, significant interference from complex backgrounds, and high training resource costs that are common in nuclear power plant scenarios.
[0006] To solve the above technical problems, the technical solution adopted by this invention is: a method for constructing a safe target detection model for low-light environments, comprising the following steps: S1, building a safe target detection model based on the RT-DETR model, including a backbone network, a hybrid encoder, a query selection mechanism, and a Transformer decoder; the backbone network is constructed using a hybrid of standard convolution and fine-grained feature enhancement modules, used for multi-scale feature extraction of the model input; the hybrid encoder includes a dual attention module, which is used to perform dual adaptive weighting of the channel dimension and spatial dimension on the fused intermediate feature map; S2, ... The security target detection model built in step S1 is trained. During training, a training efficiency optimization module is used for global optimization, and a joint loss function is used for supervised optimization. The training efficiency optimization module operates on all qualified sequential convolutional structures and parallel convolutional branch structures in the backbone network, and merges multi-branch topologies into a single-path convolutional kernel through online kernel-level reparameterization. The joint loss function consists of classification loss and bounding box regression loss. The classification loss uses focus loss to solve the problem of imbalance between positive and negative samples. The bounding box regression loss uses generalized intersection-union loss to measure the localization accuracy between the predicted bounding box and the true bounding box.
[0007] Furthermore, in step S1, the fine-grained feature enhancement module adopts a dual-branch parallel structure of group convolutional branch and full-channel point convolutional branch. The group convolutional branch is used to extract edge, texture and shape features in the local spatial neighborhood, while the full-channel point convolutional branch is used to retain and pass on the original full-channel information of the input features.
[0008] Let the input feature map be ,in, Represents the real number field. Input the number of channels. and Here, represents the height and width of the input feature map, and the number of channels in the output feature map is... The fine-grained feature enhancement module divides the output channel into There are several convolutional groups. Within each convolutional group, two parallel first and second convolutional paths are constructed: the first convolutional path is a group convolutional branch, which adopts a grouped convolutional form with a kernel size of 3×3. Each convolutional group contains... Each channel and Each of the three 3×3 convolutional kernels processes only the data within its corresponding group. The first input channel; the second convolution path is a full-channel point convolution branch, which uses a standard 1×1 convolution with a kernel size of 1×1. Each kernel of the full-channel point convolution branch performs only a single-point operation in spatial location, but performs a fully connected linear mapping on all input channels in the channel dimension.
[0009] The outputs of the group convolution branch and the full-channel point convolution branch are added element-wise along the channel dimension to form the output feature map of the fine-grained feature enhancement module.
[0010] Furthermore, in step S1, the dual attention module forms a dual synergistic attention enhancement mechanism by sequentially cascading channel attention and spatial attention.
[0011] Furthermore, for the intermediate feature maps input to the dual attention module... Channel attention first performs global average pooling and global max pooling in the spatial dimension, compressing the spatial information of each channel into a scalar, resulting in two complementary channel descriptors:
[0012] ;
[0013] in, This represents the channel descriptor obtained from global average pooling. This represents the channel descriptor obtained from global max pooling. This indicates the number of channels in the intermediate feature map.
[0014] Then and Each input feature map is fed into a shared-weight multilayer perceptron for nonlinear mapping to obtain a channel attention map. The intermediate feature maps are then weighted channel-wise using these channel attention maps to obtain a channel-weighted feature map. The multilayer perceptron consists of a first fully connected layer, a second fully connected layer, and a ReLU activation function.
[0015] ;
[0016] ;
[0017] ;
[0018] ;
[0019] in, This represents a channel attention map. Represents the ReLU activation function. This represents the Sigmoid activation function. and These represent the weight matrices of the first and second fully connected layers, respectively. Indicates the channel compression ratio. This represents the channel-weighted feature map. This indicates element-wise multiplication.
[0020] For the channel-weighted feature map, spatial attention is applied along the channel dimension using average pooling and max pooling respectively, to weight the features at each spatial location. The 3D channel vector is compressed into a single scalar, resulting in two complementary spatial description graphs:
[0021] ;
[0022] in, This represents the average pooling space description graph. This represents a description graph of the max pooling space.
[0023] Then and The two channels are concatenated to obtain a two-channel spatial description tensor. This tensor is then convolved with a 7×7 convolutional layer to generate a single-channel spatial attention map. Finally, the spatial attention weights are normalized to the [0,1] interval using a sigmoid activation function.
[0024] ;
[0025] in, This indicates a convolution operation with a kernel size of 7×7. This indicates a concatenation operation along the channel dimension. Represents a spatial attention map.
[0026] Spatial location weighting is performed on the channel-weighted feature map using spatial attention map:
[0027] ;
[0028] in, This represents the output feature map after being weighted by both channel attention and spatial attention.
[0029] Furthermore, in step S2, the training efficiency optimization module defines the equivalent folding principle of sequential convolutional structures as follows: For a sequence of sequentially stacked convolutional layers in the network, let the th... Layer convolution kernel is ,in, and The first The number of output channels and input channels of the layer and The first The height and width of the convolution kernel.
[0030] for The overall transformation of a convolutional structure with layers stacked sequentially is represented as:
[0031] ;
[0032] in, , , , These represent the convolution kernel tensors of the 1st, 2nd, (L-1)th, and Lth layers in a sequentially stacked convolutional layer sequence, respectively. The input feature map tensor; To output the feature map tensor; and These represent the height and width of the output feature map tensor, respectively. Represents the convolution operation, and satisfies , ; This indicates the number of output channels for layer 0. This represents the total number of input channels in the entire sequential convolutional structure. This represents the total number of output channels in the entire sequential convolutional structure. This represents the number of output channels in the Lth convolutional layer.
[0033] ;
[0034] in, This is the equivalent convolution kernel obtained by sequentially combining and folding kernels in the convolution kernel space.
[0035] Furthermore, in step S2, the equivalent merging principle of the training efficiency optimization module for parallel convolutional branch structures is as follows: For the parallel convolutional branch structures in the network, let the first... The convolution kernel for each branch is Each branch independently modulates the input feature map tensor. After performing convolution operations, the outputs of each branch are added element-wise and then merged to obtain the final output:
[0036] ;
[0037] in, This represents the total number of parallel branches. This represents the output of the parallel convolution branch structure.
[0038] Furthermore, in step S2, the joint loss function :
[0039] ;
[0040] in, For the focus of loss, For generalized intersection and comparison of losses, and These are the weighting coefficients for the focus loss and the generalized intersection-union loss, respectively.
[0041] Focus loss :
[0042] ;
[0043] Suppose that the probability predicted by the security target detection model for a certain target category is... ,definition for:
[0044] ;
[0045] ;
[0046] in, Indicates the focus parameter, ; Represents the category weight factor. ; This represents the standard cross-entropy loss; This represents the true label in a binary classification task.
[0047] Generalized intersection and comparison loss :
[0048] ;
[0049] ;
[0050] ;
[0051] in, Indicates the predicted bounding box. Represents the true bounding box. Indicates simultaneous inclusion and The smallest rectangular box.
[0052] Compared with the prior art, the beneficial technical effects of the present invention are: (1) Improve the detection capability of small targets: By using the fine-grained feature enhancement module to fuse 3×3 group convolution and 1×1 full-channel point convolution in parallel, while preserving the original information of the full channel, the local spatial details are enhanced, and the model’s feature representation of small targets such as safety helmets and dosimeters is strengthened.
[0053] (2) Enhance the feature selection and anti-interference ability of the model under complex backgrounds: By using the dual attention module with the serial attention mechanism of "channel first and space later", the model is guided to adaptively focus on key semantic regions such as personnel and protective equipment, effectively suppressing the interference caused by pipeline and valve background, local reflection and equipment occlusion.
[0054] (3) Optimize training efficiency and reduce resource overhead: The training efficiency optimization module performs online kernel-level reparameterization of the convolutional structure during the training stage, folds the multi-branch calculation into an equivalent convolutional kernel, significantly reduces the amount of training computation and memory usage, and improves the efficiency of model tuning and experimental iteration.
[0055] (4) Alleviate the imbalance between positive and negative samples and improve the ability to distinguish difficult targets: By introducing a joint loss function and using focus loss as the classification loss function, by adjusting the focus parameters and class weight factors, the loss contribution of a large number of easily classifiable background samples in the nuclear power plant monitoring images is reduced, so that the model training focuses on difficult-to-classify samples such as small-scale safety targets under low illumination occlusion conditions, effectively alleviating the serious imbalance between positive and negative samples and significantly improving the model's ability to distinguish key protective equipment such as safety helmets and dosimeters in nuclear power plants.
[0056] (5) While ensuring real-time performance, comprehensively improve the detection accuracy and robustness of nuclear power plants in low-light environments: Through the organic synergy of fine-grained feature enhancement module, dual attention module, training efficiency optimization module and joint loss function, the model can significantly improve the average detection accuracy with only a minimal inference speed cost, especially in terms of strict positioning index mAP@0.5:0.95, better meeting the actual application needs of intelligent safety monitoring of nuclear power plants. Attached Figure Description
[0057] Figure 1 This is the trend of the training loss function of the security target detection model constructed in Example 1 changing with the training rounds.
[0058] Figure 2 The training process of the security target detection model constructed in Example 1 verifies the trend of the loss function changing with the training rounds.
[0059] Figure 3 This is the trend of the mAP@0.5 index of the security target detection model constructed in Example 1 changing with the training rounds.
[0060] Figure 4 This is the trend of the mAP@0.5:0.95 index of the security target detection model constructed in Example 1 changing with the training rounds. Detailed Implementation
[0061] Example 1: This example provides a method for constructing a safety target detection model for low-light environments (ambient light intensity below 50 lux). Using the RT-DETR model as the baseline model, a fine-grained feature enhancement module, a dual attention module, a training efficiency optimization module, and a joint loss function are introduced. The baseline network is structurally improved from four dimensions: fine-grained multi-scale feature extraction, channel-space dual attention enhancement, online convolutional kernel-level reparameterization, and focus loss optimization.
[0062] The steps include: S1. Building a security target detection model based on the RT-DETR model as the baseline model, including a backbone network, a hybrid encoder, a query selection mechanism, and a Transformer decoder.
[0063] (1) The backbone network is constructed using a hybrid of standard convolution and fine-grained feature enhancement modules to extract multi-scale features from the model input. Standard convolution is retained in the shallow layers to capture basic edge and texture information, while fine-grained feature enhancement modules are introduced in the deep layers to enhance the perception of local details and the preservation of full-channel information for small and fine-grained targets. The backbone network output contains multi-scale feature maps of different resolutions, corresponding to the edge contours, local textures, and high-level semantic information of the target, respectively.
[0064] (2) The hybrid encoder incorporates a dual attention module, which performs dual adaptive weighting of the channel and spatial dimensions on the fused intermediate feature map. Multi-scale feature maps enter the hybrid encoder, which combines the local perception capability of convolution with the global modeling capability of Transformer self-attention to facilitate interactive transmission and deep fusion of information between features of different scales. After the key feature fusion node of the hybrid encoder, a dual attention module is embedded to perform dual adaptive weighting of the channel and spatial dimensions on the fused intermediate feature map. The channel attention mechanism filters semantic channels highly relevant to safety targets such as personnel, safety helmets, dosimeters, and protective gloves, while the spatial attention mechanism locates the key spatial regions where the targets are located. Together, they suppress the effects of complex background textures in nuclear power plants, interference from pipes and valves, and strong local reflections.
[0065] (3) Query selection mechanism initializes target query. The feature map enhanced by the hybrid encoder is passed to the query selection mechanism. The query selection mechanism evaluates the target discriminativeness of each position in the feature map and selects candidate regions with high response values as the initial target query, providing more discriminative prior information for the subsequent decoder, accelerating model training convergence and improving the coverage of potential target regions.
[0066] (4) Transformer decoder target parsing and detection output. Based on the filtered target query, the decoder uses a cross-attention mechanism to perform step-by-step parsing on the enhanced feature map. Through multi-layer decoding iteration, the target query is refined. Finally, the detection head outputs the target category prediction and bounding box regression results simultaneously, completing end-to-end safe target detection.
[0067] S2. Train the safety target detection model built in step S1. During the training process, use the training efficiency optimization module for global optimization and the joint loss function for supervised optimization.
[0068] The training efficiency optimization module operates on all sequential and parallel convolutional branch structures in the backbone network that meet the conditions (meaning they can be mathematically equivalently combined without compromising the integrity of the network's inference). Through online kernel-level reparameterization ("online" means that the reparameterization operation occurs in every iteration step of model training; "kernel-level" means that the object of the reparameterization operation is the convolutional kernel tensor itself), it effectively merges multi-branch topologies into a single-path convolutional kernel. This significantly reduces the computational load, intermediate feature storage, and GPU memory usage during the training phase without changing the inference model structure or losing representational capabilities, thereby improving the efficiency of model tuning and multiple rounds of experimental iterations.
[0069] The joint loss function consists of classification loss and bounding box regression loss. The classification loss uses focal loss to address the severe imbalance between positive and negative samples in nuclear power plant monitoring scenarios. The bounding box regression loss uses generalized intersection-union (GIoU) loss to measure the localization accuracy between the predicted and ground truth bounding boxes. In low-light monitoring images of nuclear power plants, most areas consist of background elements such as pipes, valves, and walls, which are easily classified negative samples, far exceeding the number of positive samples representing safety targets. Meanwhile, small-scale protective equipment that is occluded or located in dark areas represents difficult-to-classify positive samples. Standard cross-entropy loss assigns equal weights to all samples, making the model prone to being dominated by a large number of easily classified negative samples, resulting in insufficient ability to discriminate difficult-to-classify small targets.
[0070] The following sections detail the design and working principles of the fine-grained feature enhancement module, the dual attention module, the training efficiency optimization module, and the joint loss function.
[0071] (a) Fine-grained feature enhancement module.
[0072] The fine-grained feature enhancement module employs a dual-branch parallel structure consisting of group convolutional branches and full-channel point convolutional branches. This effectively controls computational complexity while preserving both local spatial detail perception and original full-channel information, resulting in a significant enhancement in the ability to represent fine-grained targets. The group convolutional branches extract edge, texture, and shape features within the local spatial neighborhood, while the full-channel point convolutional branches preserve and transmit the original full-channel information of the input features.
[0073] Let the input feature map be ,in, Represents the real number field. Input the number of channels. and Here, represents the height and width of the input feature map, and the number of channels in the output feature map is... The fine-grained feature enhancement module divides the output channel into There are several convolutional groups, and within each convolutional group, two parallel first convolutional paths and second convolutional paths are constructed: (1) The first convolutional path is a group convolutional branch, which adopts a grouped convolutional form with a kernel size of 3×3. Each convolutional group contains Each channel and Each of the three 3×3 convolutional kernels processes only the data within its corresponding group. One input channel. The group convolution branch is responsible for extracting detailed features such as edges, textures and shapes in the local spatial neighborhood, and has a good ability to capture fine-grained information such as the edge contour of the safety helmet and the surface texture of the protective gloves under low light conditions. Through the grouping mechanism, the computational cost of the group convolution branch is significantly reduced compared with the standard convolution. (2) The second convolution path is the full-channel point convolution branch. The full-channel point convolution branch adopts the standard 1×1 convolution, and the convolution kernel size is 1×1. Unlike the 3×3 group convolution branch, the 1×1 full-channel point convolution branch acts on all Each input channel, specifically each kernel in the full-channel point convolution branch, performs only a single-point operation in spatial location, but provides a fully connected linear mapping across all input channels in the channel dimension. The core function of the full-channel point convolution branch is to preserve and transmit the original full-channel information of the input features, compensating for the insufficient cross-group information flow caused by each convolution kernel in group convolution only seeing a portion of the input channels. This ensures that deep networks can continue to obtain complete input information references even after repeatedly stacking fine-grained feature enhancement modules.
[0074] The outputs of the group convolutional branches and the full-channel point convolutional branches are added element-wise along the channel dimension to form the output feature map of the fine-grained feature enhancement module. This parallel fusion strategy enables the output features to simultaneously contain local spatial detail information enhanced by the 3×3 group convolutional branches and complete channel context information preserved by the 1×1 full-channel point convolutional branches, achieving an organic unity of local perception and global information preservation.
[0075] The fine-grained feature enhancement module is designed to improve representation capabilities while maintaining computational efficiency. Let the output feature map size be... The computational complexity of standard convolution, measured in floating-point operations (FLOPs), is:
[0076] ;
[0077] For the fine-grained feature enhancement module, its total computational cost consists of two parts: a 3×3 group convolutional branch and a 1×1 full-channel point convolutional branch acting simultaneously. The FLOPs for each input channel are:
[0078] ;
[0079] The remaining portion contains only 1×1 full-channel point convolution branches. The FLOPs of the output portion corresponding to each input channel are:
[0080] ;
[0081] Therefore, the total computational cost of the fine-grained feature enhancement module is:
[0082] ;
[0083] The computational complexity ratio of fine-grained feature enhancement modules to standard convolution :
[0084] ;
[0085] in, This represents the number of floating-point operations in a standard convolution. This represents the number of floating-point operations performed jointly by the 3×3 convolution branches and the 1×1 full-channel point convolution branch. Indicates the remainder The number of floating-point operations generated by processing each input channel with only a 1×1 full-channel point convolution branch. This represents the total number of floating-point operations performed by the fine-grained feature enhancement module. This indicates the spatial dimensions of the output feature map. This indicates the spatial size of the convolution kernel.
[0086] For commonly used Convolutional kernels, in theory, fine-grained feature enhancement modules can significantly reduce computational cost while maintaining strong feature representation capabilities. Especially... When the value is appropriate, this structure can effectively improve the model's ability to model features of small and fine-grained targets with almost no increase in overall computational burden.
[0087] Compared to depthwise separable convolution, the fine-grained feature enhancement module differs in that depthwise separable convolution completely decouples spatial convolution from channel convolution, which may limit the interaction between spatial features and channel information; while the fine-grained feature enhancement module introduces 1×1 convolution branches on all input channels, enabling deep convolutional layers to continuously obtain the original full-channel information from the input side, increasing the pathway for cross-channel information propagation.
[0088] Compared to heterogeneous convolution (HetConv), the fine-grained feature enhancement module has the advantage of not using an interleaved arrangement of 3×3 and 1×1 convolution kernels, thus avoiding the disruption of channel continuity and being more conducive to the preservation and transmission of complete input information.
[0089] Compared with standard group convolution, the fine-grained feature enhancement module makes up for the lack of cross-group information exchange in group convolution branches by using 1×1 full-channel point convolution branches, and achieves more sufficient cross-channel interaction without relying on additional channel shuffling operations.
[0090] In the safety target detection model constructed in this embodiment, the fine-grained feature enhancement module is mainly used to replace some standard convolutional layers in the deep layers of the backbone network. The reason for choosing deep embedding is that shallow feature maps have higher resolution, mainly extracting basic edge and corner information, which can be satisfied by standard convolution; while deep feature maps have lower resolution and more abstract semantic information. Introducing the fine-grained feature enhancement module can effectively enhance the capture of local details of small and fine-grained targets. At the same time, the 1×1 full-channel point convolution branch ensures that deep features do not lose original channel information due to the continuous expansion of the receptive field. The introduction of the fine-grained feature enhancement module significantly improves the detection capability of the constructed safety target detection model for small-scale protective equipment such as safety helmets and dosimeters in low-light scenarios in nuclear power plants, especially under the mAP@0.5:0.95 evaluation index, which requires strict positioning accuracy.
[0091] (ii) Dual attention module.
[0092] The dual attention module forms a dual-cooperative attention enhancement mechanism by sequentially cascading channel attention and spatial attention. It adaptively recalibrates intermediate feature maps, enabling the backbone network to focus more on discriminative semantic information and key spatial regions relevant to the detection task, thereby improving detection stability and robustness in the complex environment of nuclear power plants. Channel attention aggregates information across the entire spatial range to evaluate the overall importance of each channel, while spatial attention aggregates information across the entire channel range to evaluate the criticality of each spatial location. Channel attention provides spatial attention with semantically filtered and enhanced feature maps as input, enabling spatial attention to perform spatial localization in a clearer semantic context. Spatial attention, in turn, assigns precise spatial location weights to the semantic features selected by channel attention, making the utilization of semantic information more efficient.
[0093] The input to the dual attention module is an intermediate feature map. ,in, This represents the number of channels in the intermediate feature map. The dual attention module processes data in the order of "channel attention first, then spatial attention," and the overall process can be represented as follows:
[0094] ;
[0095] ;
[0096] in, Representing a spatial attention map, This represents a channel attention map. This represents the channel-weighted feature map. This represents the output feature map after being weighted by both channel attention and spatial attention. This indicates element-wise multiplication.
[0097] Channel attention performs a global evaluation and recalibration of the overall response of each channel along the spatial dimension, highlighting "which features are more important"; spatial attention evaluates and weights the response of each spatial location along the channel dimension, emphasizing "where is more important". Through the synergistic effect of the two levels of attention, the final output feature map is adaptively enhanced in both channel semantics and spatial localization dimensions.
[0098] The dual attention module provided in this embodiment chooses a "channel-first, spatial-second" approach, rather than a "spatial-first, channel-second" or "parallel" arrangement, because the characteristics of the low-light target detection task in nuclear power plants dictate that discriminative semantic features related to safety targets must first be screened in the channel dimension, and then the locations of these key semantic features in the spatial dimension must be identified. The sequential structure of "channel-first, spatial-second" better aligns with the cognitive logic of moving from "what to identify" to "where to locate," and also facilitates that channel attention and spatial attention focus on their respective optimization objectives during training.
[0099] The goal of channel attention is to explicitly model the interdependencies between different feature channels. By learning the importance of each channel to the current detection task, it enhances the response of useful channels and suppresses interference from useless or redundant channels. This is applied to the intermediate feature maps input to the dual attention module. Channel attention first performs global average pooling and global max pooling in the spatial dimension, compressing the spatial information of each channel into a scalar, resulting in two complementary channel descriptors:
[0100] ;
[0101] in, This represents the channel descriptor obtained from global average pooling. This represents the channel descriptor obtained from global max pooling. Global average pooling reflects the overall semantic response strength of each channel across the entire spatial range, providing good generalization of global contextual information; global max pooling, on the other hand, tends to retain the most significant local response features of each channel, making it more sensitive to prominent information in the scene, such as strong local reflections and local textures of the target. The two descriptors characterize the importance of the channels from different perspectives and complement each other.
[0102] Then and Each channel is fed into a shared-weight multilayer perceptron (MLP) for nonlinear mapping to obtain a channel attention map. The intermediate feature maps are then weighted channel-wise using these channel attention maps to obtain a channel-weighted feature map. The MLP consists of a first fully connected layer, a second fully connected layer, and a ReLU activation function. Its structure is as follows: the first fully connected layer increases the number of channels in the intermediate feature map from... Compress to ; The channel compression ratio is used to control the parameter amount; the second fully connected layer reduces the number of channels from... Restore to The weight matrix of the first fully connected layer. Followed by the ReLU activation function. and The results after MLP mapping are summed element-wise, and the output is normalized to the [0,1] interval using the Sigmoid activation function to obtain the final channel attention map. The complete calculation process is as follows:
[0103] ;
[0104] ;
[0105] ;
[0106] in, Represents the ReLU activation function. This represents the Sigmoid activation function. and These represent the weight matrices of the first and second fully connected layers, respectively. Channel compression ratio. The introduction of channel attention maps keeps the number of parameters in the MLP within a controllable range, enhancing channel modeling capabilities while avoiding significant additional computational burden. For the original intermediate feature map By performing channel-by-channel weighting, the backbone network can adaptively enhance semantic feature channels related to safety targets such as personnel, safety helmets, dosimeters, and protective gloves at the channel level, while suppressing redundant channel responses related to irrelevant information such as the background of nuclear power plant pipelines and valves, and the texture of instruments and equipment.
[0107] After completing the adaptive recalibration of the channel dimension, spatial attention is applied to the channel-weighted feature map. Further filtering and enhancement are performed in the spatial dimension. Unlike channel attention, which focuses on "which features," spatial attention focuses on "where" these features appear. By assigning different importance weights to different spatial locations of the feature map, the security target detection model is guided to focus on the potential region where the target is located.
[0108] Specifically, the channel weighted feature map Spatial attention is performed along the channel dimension using average pooling and max pooling respectively, to pool the attention at each spatial location. The 3D channel vector is compressed into a single scalar, resulting in two complementary spatial description graphs:
[0109] ;
[0110] in, This represents the average pooling space description graph. This represents a spatial description of max pooling. Average pooling along the channel dimension reflects the average response intensity of all channels at each spatial location, while max pooling highlights the channel characteristics with the strongest response at each spatial location. Both characterize the importance of the spatial region from the perspectives of overall activation and maximum response, respectively.
[0111] Then and A two-channel spatial description tensor is obtained by concatenating the data along the channel dimension. This tensor is then convolved with a 7×7 convolutional kernel to generate a single-channel spatial attention map. The 7×7 kernel is chosen because, in security target detection tasks, target regions often possess spatial continuity and contextual relevance; a larger receptive field helps to comprehensively consider the surrounding background information, thus more accurately locating the target region boundary. Finally, the spatial attention weights are normalized to the [0,1] interval using the Sigmoid activation function, calculated as follows:
[0112] ;
[0113] in, This indicates a convolution operation with a kernel size of 7×7. This represents the concatenation operation along the channel dimension. By weighting the channel-weighted feature maps spatially using a spatial attention map, the backbone network can enhance the response intensity of the target region in the spatial dimension, while reducing the adverse effects of complex backgrounds, locally highly reflective areas, and occluded areas on the detection results.
[0114] The dual attention module forms a dual, synergistic attention enhancement mechanism through the sequential cascading of channel attention and spatial attention. Channel attention aggregates information across the entire spatial range to evaluate the overall importance of each channel, answering the question, "What semantic features are more valuable for the detection task?" Spatial attention, on the other hand, aggregates information across the entire channel range to evaluate the criticality of each spatial location, answering the question, "Where do these valuable semantic features appear in the image?" The two complement each other: channel attention provides spatial attention with semantically filtered and enhanced feature maps as input, enabling spatial attention to perform spatial localization in a clearer semantic context; spatial attention, in turn, assigns precise spatial location weights to the important semantic features selected by channel attention, making the utilization of this semantic information more efficient.
[0115] For safety target detection tasks in low-light nuclear power plant scenarios, this dual-cooperative mechanism demonstrates clear targeting and adaptability: Channel attention focuses the safety target detection model's resources on semantic channels directly related to safety targets, such as personnel morphological features, helmet color and outline, and dosimeter shape and wearing position, while suppressing channels related to background structures like nuclear power plant pipes, valves, instruments, and cable trays; Spatial attention further guides the safety target detection model to focus on the actual spatial location of targets in the image, reducing response weights in complex background areas and equipment occlusion areas. The synergistic effect of these two mechanisms effectively improves the stability and robustness of the safety target detection model under low-light, complex background, and occlusion conditions in nuclear power plants.
[0116] In the security target detection model constructed in this embodiment, the dual attention module is embedded after the key feature fusion node of the hybrid encoder. Since the hybrid encoder has completed the initial interactive fusion of multi-scale features of the backbone network, the feature map at this point simultaneously contains low-level texture information and high-level semantic information. The dual attention module performs dual attention reweighting on the fused features at this node, which can most effectively influence the subsequent query selection and decoding process, thereby maximizing the benefits of attention enhancement. Because the dual attention module itself has a small computational cost, its introduction has minimal impact on the overall inference speed of the security target detection model, significantly improving detection accuracy while ensuring real-time performance.
[0117] (III) Training efficiency optimization module.
[0118] The training efficiency optimization module shifts the object of reparameterization from the "feature map" to the "convolution kernel." Specifically, leveraging the linear composability (including additivity and associativity) of convolution operations, it directly performs equivalent combination and folding of the convolution kernel tensor during training, thereby constructing a simplified structure that is mathematically rigorously equivalent to the original complex topology. Because this transformation occurs in the convolution kernel space, which is much smaller than the feature map, its additional computational and storage overhead is decoupled from the resolution of the feature map, greatly reducing resource consumption during training.
[0119] For a sequence of convolutional layers stacked sequentially in a network, let the th... Layer convolution kernel is ,in, and The first The number of output channels and input channels of the layer and The first The height and width of the convolutional kernel. For The overall transformation of a convolutional structure with layers stacked sequentially is represented as:
[0120] ;
[0121] in, , , , These represent the convolution kernel tensors of the 1st, 2nd, (L-1)th, and Lth layers in a sequentially stacked convolutional layer sequence, respectively. The input feature map tensor; To output the feature map tensor; and These represent the height and width of the output feature map tensor, respectively. Represents the convolution operation, and satisfies , ; This indicates the number of output channels for layer 0. This represents the total number of input channels in the entire sequential convolutional structure. This represents the total number of output channels in the entire sequential convolutional structure. This represents the number of output channels in the Lth convolutional layer. Based on the associative property of convolution operations, this... Layer-by-layer convolution can be first equivalently merged in the kernel space to obtain an equivalent convolution kernel. Then, the equivalent convolution kernel is applied to the input feature map tensor, that is:
[0122] ;
[0123] in, To be , ... The equivalent convolutional kernel is obtained by sequentially combining and folding kernels in the kernel space. The specific merging method follows the rules for convolutional kernel synthesis: first, ... and Perform inter-kernel convolution to obtain an intermediate equivalent kernel, and then combine the intermediate equivalent kernel with the convolution kernel tensor of the third layer in a sequence of stacked convolutional layers. Continue merging, and so on, until the final equivalent convolution kernel is obtained. The key significance of this equivalent transformation lies in the fact that the original requirement of L convolutions applied layer by layer to the feature map, followed by forward propagation and storage of the corresponding backward propagation intermediate results, is simplified to a single equivalent convolution forward-backward propagation process. This avoids the need for L-1 sets of intermediate feature maps (of size L). The generation, storage, and gradient calculation of gradients save a significant amount of computing and video memory resources.
[0124] For parallel convolutional branch structures in a network, let the first... The convolution kernel for each branch is Each branch independently modulates the input feature map tensor. After performing a convolution operation, the outputs of each branch are added element-wise and then fused to obtain the final output, which is represented as:
[0125] ;
[0126] in, This represents the total number of parallel branches. This represents the output of the parallel convolutional branch structure. According to the distributive law of convolution operations on addition, the above multiple parallel convolutional branches can be equivalently represented by first weighting and summing the convolutional kernels of all branches in the kernel space to form a unified equivalent convolutional kernel. This equivalent convolutional kernel is then applied to the input feature map. It is important to note that when parallel branches use convolutional kernels of different sizes, for example, one branch uses a 3×3 convolution and another uses a 1×1 convolution, all convolutional kernels need to be aligned to the largest kernel size before direct addition. Specifically, the center of the smaller kernel is used as the alignment reference, and its periphery is zero-padded to expand it to a standard spatial size before addition. For example, zero-padding a 1×1 convolutional kernel around its periphery transforms it into a spatial tensor with the same size as a 3×3 convolutional kernel. The padded 1×1 convolutional kernel is equivalent to a 3×3 convolutional kernel with a non-zero value only at the center and zero values at the rest. Then, element-wise addition and merging are performed.
[0127] The core difference between the training efficiency optimization module and traditional reparameterization methods lies in the fact that the equivalent folding and merging operations of the training efficiency optimization module are all performed in the convolutional kernel parameter space, rather than in the feature map space. For typical high-resolution inputs (such as 640×640) and small-sized feature maps in deep networks, (Usually 3×3=9) is much smaller than Therefore, it is possible to achieve an order-of-magnitude improvement in training efficiency. and These represent the height and width of the convolution kernel, respectively.
[0128] In the training phase of the security target detection model in this embodiment, the training efficiency optimization module, as a global optimization component, automatically identifies and applies to all qualified sequential convolutional structures and parallel convolutional branch structures in the backbone network, completing equivalent folding and merging at the convolutional kernel level online. Experiments have verified that, under the same experimental settings, introducing the training efficiency optimization module reduces the single-round training time from 650s to 550s and the GPU memory usage from 18.6GB to 14.8GB, significantly reducing training resource overhead. Furthermore, since the equivalent transformation of the training efficiency optimization module is strictly mathematically equivalent, the model structure, number of parameters, and computational load in the inference phase are completely consistent with the standard training method without the training efficiency optimization module. Therefore, inference speed and accuracy are not negatively affected, achieving "optimization on the training side, lossless inference on the inference side."
[0129] (iv) Joint loss function.
[0130] The joint loss function is designed to address the problem of insufficient discrimination ability of safety target detection models for small, difficult-to-classify targets due to severe imbalance between positive and negative samples and uneven distribution of easy and difficult samples in low-light monitoring scenarios of nuclear power plants. :
[0131] ;
[0132] in, Loss of focus; For generalized intersection and comparison of losses; and These are the weighting coefficients for the focal loss and the generalized intersection-union (IUU) loss, used to balance the order of magnitude and convergence rate of the two types of losses. In the nuclear power plant safety target detection task of this embodiment, The value is usually taken as 1.0. The value is set to 1.0 to ensure that the two types of losses are on the same order of magnitude, thus guaranteeing a balanced optimization of classification and localization capabilities during the training process of the safe target detection model.
[0133] Focus loss By introducing focusing parameters and category weight factor Standard cross-entropy loss Improvements are made to achieve a balance between easy and difficult samples and positive and negative samples. Let the prediction probability of the security target detection model for a certain target category be... ,definition for:
[0134] ;
[0135] ;
[0136] ;
[0137] in, ; ; This represents the true label in a binary classification task. The mechanism of each parameter is as follows: (1) Focusing parameter The role of modulation factor. Used to control the degree of loss decay for easy and difficult samples. When At that time, the focus loss degenerates into the weighted standard cross-entropy loss. .when At that time, for easily classified samples, such as well-lit areas with clear backgrounds in nuclear power plants, the prediction probability of the safety target detection model is relatively high. As the value approaches zero, the loss contribution of this sample is significantly reduced; for hard-to-classify samples such as small-scale safety helmets and dosimeters under low-light conditions in nuclear power plants, the prediction probability of the safety target detection model is low. By maintaining a relatively large value, the loss contribution of this sample is preserved. (2) Class weight factor Function: The loss weights used to balance the proportions of positive and negative samples. For positive samples, For negative samples, . This indicates the assignment of category weight factors. It is done by setting... This allows for assigning higher loss weights to a smaller number of positive samples, compensating for gradient imbalance caused by the difference in the number of positive and negative samples. In the nuclear power plant safety target detection task of this embodiment, The value is usually set to 0.75, so that the loss weight of positive samples is 0.75 and the loss weight of negative samples is 0.25, which effectively alleviates the training bias caused by the fact that the number of negative samples in the background area is much greater than the number of positive samples in the safe target.
[0138] Generalized intersection and comparison loss :
[0139] ;
[0140] Loss in traditional intersection and combination loss Based on this, a minimum bounding box penalty term is introduced to address the issue of non-overlapping predicted bounding boxes with ground truth bounding boxes. The problem of gradient vanishing occurs when the gradient is zero.
[0141] ;
[0142] ;
[0143] in, Indicates the predicted bounding box. Represents the true bounding box. Indicates simultaneous inclusion and The smallest rectangular box. The value range is [-1, 1]. It takes a minimum of 0 (loss is 0) when the predicted bounding box completely overlaps with the ground truth bounding box, and a maximum of 2 (loss is 2) when the two are infinitely far apart. Compared to... loss, The loss function can still provide effective gradient information when there is no overlap between the predicted bounding box and the true bounding box, which helps the safety target detection model to more accurately regress the target bounding box position under the low light shading conditions of nuclear power plants.
[0144] The joint loss function, fine-grained feature enhancement module, and dual attention module complement each other functionally, jointly improving the detection capability of small-scale safety targets in low-light scenarios at nuclear power plants. The fine-grained feature enhancement module enhances the backbone network's ability to perceive local spatial details and retain full-channel information for small and fine-grained targets at the model structure level, providing richer feature representations for difficult-to-classify targets in subsequent detection heads. The dual attention module, through a dual channel and spatial attention mechanism, guides the safety target detection model to focus on the discriminative semantic channels and key spatial regions where safety targets are located under low-light occlusion conditions, improving the feature response intensity of difficult-to-classify targets. The joint loss function, through adjusting the loss weight allocation between easy and difficult samples at the training optimization level, forces the safety target detection model to prioritize learning difficult-to-classify small targets during training, ensuring that the features of difficult-to-classify targets extracted by the fine-grained feature enhancement module and the dual attention module receive sufficient gradient updates and optimization.
[0145] The joint loss function, fine-grained feature enhancement module, and dual attention module form a complete optimization chain of "feature enhancement - feature focusing - loss focusing": the fine-grained feature enhancement module provides a high-quality feature base for difficult-to-classify targets, the dual attention module achieves accurate spatial and semantic focusing on these features, and the joint loss function ensures that the training of the safety target detection model is not dominated by a large number of easily classified background samples, concentrating gradient resources on optimizing the detection capability of difficult-to-classify targets. This collaborative mechanism significantly improves the detection accuracy of the constructed safety target detection model for small-scale protective equipment such as safety helmets and dosimeters in the complex low-light environment of a nuclear power plant.
[0146] The fine-grained feature enhancement module, dual attention module, training efficiency optimization module, and joint loss function in the safety target detection model constructed in this embodiment are not simply stacked or work independently, but form a highly complementary synergistic mechanism at the functional level, together constituting a complete safety target detection solution for complex low-light scenarios in nuclear power plants.
[0147] (1) Collaborative Logic in the Forward Inference Path: From the perspective of the forward inference path of the safety target detection model, the fine-grained feature enhancement module and the dual attention module form a serial collaborative link of "feature enhancement - feature focusing" at the structural level. The fine-grained feature enhancement module is located in the deep convolutional layer of the backbone network at the front end of the model. It is responsible for extracting richer and more refined multi-scale features from the original monitoring images of the nuclear power plant. In particular, through the parallel 3×3 group convolution and 1×1 full-channel point convolution dual-branch structure, it enhances the ability to perceive local spatial details and retain full-channel information for small targets such as safety helmets, dosimeters, and protective gloves, as well as targets with weak textures. It provides high-quality basic feature maps for subsequent feature fusion and attention enhancement links, and improves the problem of insufficient feature extraction of small-scale protective equipment under low-light conditions in nuclear power plants from the source.
[0148] The dual attention module, located after the feature fusion node of the hybrid encoder in the middle of the model, receives multi-scale fusion features from the backbone network enhanced by the fine-grained feature enhancement module. Through a sequential attention mechanism of "channel first, space later," it first filters discriminative semantic features related to nuclear power plant safety targets such as personnel, safety helmets, and dosimeters in the channel dimension, suppressing responses from complex background channels such as pipes, valves, and instruments. Then, in the spatial dimension, it locates the key areas containing this semantic information, effectively addressing interference from dense obstructions and local dark areas caused by nuclear power plant equipment. The dual attention module adaptively recalibrates and focuses the rich features provided by the fine-grained feature enhancement module, improving the discriminative purity of the features, enabling subsequent query selection and decoding processes to complete target parsing based on clearer and more accurate features.
[0149] (2) Collaborative Logic in the Training Optimization Path: From the perspective of the model training optimization path, the training efficiency optimization module and the joint loss function form a parallel collaborative mechanism of "resource optimization - loss focusing" at the training level. The training efficiency optimization module does not participate in the forward inference path, but performs global optimization on the complete network topology containing the fine-grained feature enhancement module and the dual attention module throughout the entire training phase. Through online kernel-level reparameterization, the dual-branch structure inside the fine-grained feature enhancement module, the sequential convolutional sequences in the backbone network and encoder, and other possible parallel branch structures are equivalently folded and simplified, reducing the additional computational complexity of reparameterization from being related to the feature map size to being related only to the convolution kernel size, significantly reducing the training computation and memory usage, and accelerating the model tuning process. The training efficiency optimization module ensures that the enhanced model containing fine-grained feature enhancement and dual attention mechanisms can still be trained efficiently and iterated multiple times with low resource costs.
[0150] The joint loss function also operates during the training phase, but unlike the hardware resource optimization of the training efficiency optimization module, it guides the model optimization direction from the perspective of training signal quality. The joint loss function uses focus loss as the classification loss and generalized intersection-union (CIU) loss as the bounding box regression loss. Focus loss, by introducing focus parameters and class weight factors, automatically identifies and reduces the loss contribution of numerous easily classifiable background regions in nuclear power plant monitoring images, concentrating the model's gradient resources on difficult-to-classify small targets such as safety helmets and dosimeters under low-light occlusion conditions. CIU loss provides effective gradient information even when the predicted bounding box does not overlap with the true bounding box, helping the model to more accurately regress the target bounding box position under nuclear power plant occlusion conditions. The combined effect of both ensures that each parameter update of the model focuses to the most critical and difficult-to-detect protective equipment targets in nuclear power plant safety monitoring.
[0151] (3) Cross-layer synergy between structural improvement and loss optimization: Furthermore, the structural improvement in the forward inference path and the loss function design in the training optimization path form a cross-layer synergy relationship of "structural enhancement - loss focusing".
[0152] The fine-grained feature enhancement module and the dual attention module enhance the feature representation capability of difficult-to-classify small targets and the feature focusing capability of key regions at the model structure level, respectively, enabling the detection head to receive richer and more accurate features of difficult-to-classify targets. The joint loss function forces the model to prioritize these difficult-to-classify targets during training, ensuring that the structurally enhanced features of difficult-to-classify targets receive sufficient and effective gradient updates and parameter optimization. The two form a positive feedback loop: structural improvement provides a high-quality feature foundation for loss focusing, and loss focusing provides the correct training guidance for the effectiveness of structural improvement. If there is only structural improvement without focusing loss, the model training may still be dominated by a large number of easily classified samples, and the benefits of structural enhancement cannot be fully realized; if there is only focusing loss without structural improvement, although the model is willing to focus on difficult-to-classify targets, it is limited by the upper limit of feature extraction capability, and the room for improvement in detection accuracy is limited.
[0153] (4) The fine-grained feature enhancement module solves the problem of “insufficient feature extraction capability”, especially the characterization problem of small targets and fine-grained protective equipment such as safety helmets and dosimeters in nuclear power plants; the dual attention module solves the problem of “background interference and difficulty in feature focusing”, especially the problem of attention guidance under conditions of dense pipelines and valves, equipment obstruction and low light in nuclear power plants; the training efficiency optimization module solves the engineering problem of “high consumption of training resources and low experimental iteration efficiency”, especially the need for rapid iteration of complex models in multiple parameter tuning and multiple sets of comparative experiments; the joint loss function solves the problem of “imbalance between positive and negative samples and easy and difficult samples”, especially the problem of insufficient discrimination capability of small targets that are difficult to classify due to the large number of background samples dominating training in nuclear power plant monitoring images.
[0154] The four components are functionally independent but positively cumulative in effect: the fine-grained feature enhancement module provides a more refined multi-scale and fine-grained feature foundation; the dual attention module performs more accurate adaptive weighted focusing on these high-quality features; the joint loss function directs the optimization focus towards small, difficult-to-classify targets during training, allowing the enhancement effects of the first two modules to be fully learned; and the training efficiency optimization module ensures that the complex model composed of the above three enhancement components can complete efficient training within a reasonable resource and time frame. The synergistic effect of these four components enables the constructed model to achieve optimal detection accuracy on the low-light dataset of a nuclear power plant while maintaining real-time inference speed, achieving an optimized balance between safety target detection accuracy, real-time performance, and training efficiency in the complex low-light scenario of a nuclear power plant.
[0155] Test Example 1: Compared with the best-performing baseline model RT-DETR in the prior art, the safety target detection model constructed in Example 1 has the following significant advantages under special working conditions such as low light intensity, dense equipment and pipelines, and severe obstruction in nuclear power plants.
[0156] (1) The detection accuracy of small-scale protective equipment in nuclear power plants has been significantly improved.
[0157] Existing RT-DETR models are insufficient for extracting features from small targets and fine-grained protective equipment in nuclear power plants, such as safety helmets and dosimeters, resulting in a high false negative rate under low illumination and equipment occlusion. The safety target detection model constructed in Example 1 introduces a fine-grained feature enhancement module, building a parallel 3×3 group convolution and 1×1 full-channel point convolution dual-branch structure deep within the backbone network. This enhances the local edge details of weakly textured targets in nuclear power plants while fully preserving full-channel information, compensating for the loss of target features caused by decreased contrast in dark areas of nuclear power plants and equipment occlusion.
[0158] To further verify the superiority of the fine-grained feature enhancement module, it was compared with three similar lightweight feature enhancement structures—depth-separable convolution (DSConv), standard group convolution (GroupConv), and heterogeneous convolution (HetConv)—under the same experimental conditions. The results are shown in Table 1.
[0159] Table 1 Performance Comparison of Fine-Grained Feature Enhancement Module with Similar Modules
[0160]
[0161] As shown in Table 1, DSConv decouples spatial convolution from channel convolution, limiting cross-channel information interaction, resulting in only a 2.3% improvement in mAP@0.5:0.95; GroupConv, due to insufficient cross-group information exchange, only improves the strict positioning index mAP@0.5:0.95 by 1.2%; HetConv's staggered arrangement disrupts channel continuity, resulting in limited performance improvement; the fine-grained feature enhancement module improves mAP@0.5:0.95 by 5.4%, significantly outperforming other similar modules, demonstrating the unique advantages of the fine-grained feature enhancement module in fine-grained feature extraction for small-scale protective equipment in nuclear power plants.
[0162] (2) The anti-interference capability of nuclear power plants under complex background and shielding conditions is significantly enhanced.
[0163] Existing RT-DETR models lack attention guidance for key target areas, making them prone to false detections and inaccurate localization under the interference of complex background textures such as pipelines, valves, instruments, and cable trays in nuclear power plants, as well as dense equipment obstruction. The safety target detection model constructed in Example 1 embeds a dual attention module and uses a "channel-first, space-second" serial attention mechanism. First, it filters semantic features related to nuclear power plant safety targets and suppresses background interference from equipment and pipelines in the channel dimension, and then locates the actual position of targets in dark areas and obstructions in the spatial dimension.
[0164] To verify the superiority of the dual attention module provided in Example 1 in resisting interference in complex backgrounds, the dual attention module was compared with SE attention (SE), ECA attention (ECA), and channel-only attention (CA) under the same experimental conditions. The results are shown in Table 2.
[0165] Table 2 Performance Comparison of Dual Attention Module with Similar Attention Mechanisms
[0166]
[0167] As shown in Table 2, the single-dimensional attention mechanism can only perform feature recalibration in a single dimension, either channel or space, and its overall suppression effect on the complex background of nuclear power plants is limited. The dual attention module in Example 1 adopts a "channel first, space later" serial structure, which enables spatial attention to perform spatial localization based on features with optimized channel semantics. This improves the performance by 3.3% on mAP@0.5:0.95, outperforming similar attention mechanisms, while maintaining an inference speed of 106 FPS, thus balancing anti-interference capability and real-time performance.
[0168] (3) The training resource overhead is significantly reduced, and the iteration efficiency of the nuclear power plant scenario model is improved.
[0169] Existing RT-DETR suffers from high computational overhead and memory consumption when conducting multiple ablation experiments and long training cycles on nuclear power plant datasets, resulting in low efficiency for engineering optimization. The safety target detection model constructed in Example 1 introduces a training efficiency optimization module, migrating the reparameterization operation from the feature map space to the convolution kernel space, significantly reducing training resource consumption without altering the inference model structure and detection accuracy.
[0170] To verify the superiority of the training efficiency optimization module in Example 1 in terms of training efficiency optimization, it was compared with three similar methods, RepVGG style reparameterization, mixed precision training (FP16) and knowledge distillation, under the same experimental conditions. The results are shown in Table 3.
[0171] Table 3 Performance Comparison of Training Efficiency Optimization Module with Similar Training Optimization Methods
[0172]
[0173] As shown in Table 3, the RepVGG style reparameterization transformation occurs in the feature map space, and the additional overhead is still proportional to the feature map size, with memory usage only reduced to 17.8GB. While FP16 reduces memory usage to 16.2GB, there is a risk of accuracy loss, with mAP@0.5 decreasing by 0.1%. Knowledge distillation requires additional training of the teacher model, increasing the total training time to 680s. The training efficiency optimization module provided in Example 1 migrates the reparameterization operation from the feature map space to the convolution kernel space, with additional overhead only related to the convolution kernel size, achieving optimal training efficiency: single-round training time is reduced to 550s, memory usage is reduced to 14.8GB, and detection accuracy remains stable. The equivalent transformation of the training efficiency optimization module provided in Example 1 is strictly mathematically equivalent, with no loss of model structure or accuracy during the inference stage.
[0174] (4) The joint loss function effectively alleviates sample imbalance and improves the detection capability of difficult-to-classify targets.
[0175] In low-light monitoring images of nuclear power plants, the background area accounts for a large proportion, while safety target samples are scarce. Furthermore, small-scale protective equipment that is obscured or located in dark areas is difficult to classify. Existing models use the standard cross-entropy loss function, which is easily dominated by a large number of easily classifiable background samples during training, resulting in insufficient ability to distinguish difficult-to-classify targets. The safety target detection model constructed in Example 1 introduces a joint loss function, using focus loss as the classification loss. By using focus parameters and class weight factors, it reduces the loss contribution of easily classifiable background samples, enabling the model training to focus on small-scale safety targets under low-light occlusion conditions.
[0176] To verify the superiority of focus loss in nuclear power plant safety target detection, a three-module collaborative model including a fine-grained feature enhancement module, a dual attention module, and a training efficiency optimization module was used as the basis. Standard cross-entropy loss (CE Loss), weighted cross-entropy loss (Weighted CE), and Focal Loss were employed respectively. =2) and FocalLoss ( =2, The results of the comparison with 0.75 are shown in Table 4.
[0177] Table 4. Performance Comparison of Different Classification Loss Functions Based on the Three-Module Collaborative Model
[0178]
[0179] Table 4 shows that the standard cross-entropy loss (CE Loss) achieves a small objective AP@0.5:0.95 of only 38.5%. Introducing a weighted cross-entropy loss (Weighted CE Loss)... After setting the value to 0.75, the indicator improved slightly, but it could not distinguish between easy and difficult samples, resulting in limited improvement. Focal Loss was then introduced. After setting the model training focus to 2), the accuracy for small targets improved to 40.5%, indicating that the imbalance between easy and difficult samples has a more significant impact on performance. Simultaneously, a focus loss (Focal Loss) was introduced, incorporating both class weighting factors and focusing parameters. =2, After setting the value to 0.75, the model effectively mitigated the imbalance between positive and negative samples and between easy and difficult samples, achieving optimal results for all metrics: mAP@0.5 was 88.8%, mAP@0.5:0.95 was 48.6%, small target AP@0.5:0.95 was 41.8%, and recall was 88.0%. These data demonstrate that the focus loss, through the synergistic effect of the focus parameter and the class weight factor, effectively alleviates the dual dilemma of sample imbalance in low-light nuclear power plant scenarios, significantly improving the detection capability of small-scale, difficult-to-classify protective equipment.
[0180] (5) The training process is stable and converges, and the model has strong generalization ability.
[0181] To verify the training stability and convergence performance of the safety target detection model constructed in Example 1 on the low-light dataset of a nuclear power plant, Figure 1 and Figure 2 It shows the trend of the loss function changing with the training rounds during the model training process.
[0182] like Figure 1 and Figure 2As shown, the training loss curve continuously decreases and stabilizes with increasing training epochs, indicating that the model can effectively learn the feature representation of safety targets on the low-light dataset of nuclear power plants, and the gradient update direction is correct and stable. The validation loss curve follows the same trend as the training loss, with no significant difference between them. There is no divergence phenomenon where the validation loss increases while the training loss continues to decrease, indicating that the model has good generalization ability and does not overfit the training set. The slight fluctuations that may occur in the middle of training are due to gradient perturbations from difficult samples such as low-light and severe occlusion in nuclear power plants, but the overall downward trend is stable and does not affect the model's convergence to the optimal solution.
[0183] To further verify the effect of the security target detection model constructed in Example 1 on improving detection accuracy, Figure 3 and Figure 4 The results show the changing trends of two core accuracy metrics, mAP@0.5 and mAP@0.5:0.95, with the number of training rounds during model training.
[0184] like Figure 3 and Figure 4 As shown, the mAP@0.5 curve steadily increases with each training round and then plateaus, indicating that the model's overall detection accuracy for safety targets in low-light conditions at nuclear power plants continues to improve. The mAP@0.5:0.95 curve rises synchronously and then stabilizes; this indicator... Within the threshold range of 0.5 to 0.95, the requirements for bounding box localization accuracy are more stringent. The simultaneous improvement in this range indicates that the model can not only correctly identify the target category, but also that the bounding box regression accuracy is continuously improving, with localization quality and classification ability being optimized simultaneously. A significant perturbation in the two accuracy metric curves during the mid-to-late stages is more related to the distribution of hard samples and parameter update changes during the cosine annealing learning rate scheduling stage, and does not alter the overall convergence trend. Both metrics reach a stable plateau in the later stages of training, indicating that the model training has fully converged and the training epochs are reasonably set.
[0185] In summary, the changing trends of training loss and validation loss verify that the safety target detection model constructed in Example 1 has good training stability and generalization ability on the low-light dataset of nuclear power plants, and no overfitting phenomenon occurs; the synchronous improvement of mAP@0.5 and mAP@0.5:0.95 fully demonstrates the continuous improvement of model detection accuracy and localization quality.
[0186] (6) Comparative experiment: In order to further verify the overall advancement of the security target detection model constructed in Example 1, it was compared with the baseline RT-DETR and the existing mainstream models YOLOv10L, YOLOv11L and RT-DETRv2-L. The results are shown in Table 5.
[0187] Table 5. Comparison of the overall performance of the security target detection model constructed in Example 1 with existing mainstream models.
[0188]
[0189] As shown in Table 5, although YOLOv10L and YOLOv11L have smaller parameter counts and higher inference speeds, their detection accuracy is insufficient in complex low-light scenarios at nuclear power plants, with mAP@0.5:0.95 at only 39.4% and 42.4%, respectively. RT-DETRv2-L improves accuracy, but its training resource overhead is comparable to the baseline RT-DETR. The safety target detection model constructed in Example 1 achieves optimal results in both mAP@0.5 and mAP@0.5:0.95 (88.8% and 48.6%), representing improvements of 3.3% and 7.4% respectively compared to the baseline RT-DETR. The inference speed remains at a real-time level of 104 FPS, while the single-round training time is reduced to 550s and the GPU memory usage is reduced to 14.8GB. This achieves the optimal balance between detection accuracy, real-time performance, and training efficiency in complex low-light scenarios at nuclear power plants, making it more suitable for actual engineering deployments in nuclear power plants.
[0190] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A method for constructing a safety target detection model for low-light environments, characterized in that, Includes the following steps: S1. A security target detection model is built based on the RT-DETR model, including a backbone network, a hybrid encoder, a query selection mechanism, and a Transformer decoder. The backbone network is constructed using a hybrid of standard convolution and fine-grained feature enhancement modules to extract multi-scale features from the model input; The hybrid encoder includes a dual attention module, which is used to perform dual adaptive weighting of the channel dimension and spatial dimension on the fused intermediate feature map. S2. Train the safety target detection model built in step S1. During the training process, the training efficiency optimization module is used for global optimization and the joint loss function is used for supervised optimization. The training efficiency optimization module applies to all qualified sequential convolutional structures and parallel convolutional branch structures in the backbone network, and merges multi-branch topologies into a single-path convolutional kernel through online kernel-level reparameterization. The joint loss function consists of classification loss and bounding box regression loss. The classification loss uses focus loss to address the imbalance between positive and negative samples. The bounding box regression loss uses generalized intersection-union loss to measure the localization accuracy between the predicted bounding box and the true bounding box.
2. The method for constructing a safety target detection model for low-light environments according to claim 1, characterized in that, In step S1, the fine-grained feature enhancement module adopts a dual-branch parallel structure of group convolution branch and full-channel point convolution branch. The group convolution branch is used to extract edge, texture and shape features in the local spatial neighborhood, and the full-channel point convolution branch is used to retain and pass the original full-channel information of the input features. Let the input feature map be ,in, Real number field, Input the number of channels. and Here, represents the height and width of the input feature map, and the number of channels in the output feature map is... The fine-grained feature enhancement module divides the output channel into Each convolutional group constructs two parallel first and second convolutional paths within each group: The first convolutional path is a group convolution branch, which uses a grouped convolutional form with a kernel size of 3×3. Each convolutional group contains... Each channel and Each of the three 3×3 convolutional kernels processes only the data within its corresponding group. One input channel; The second convolution path is a full-channel point convolution branch. The full-channel point convolution branch uses a standard 1×1 convolution with a kernel size of 1×1. Each kernel of the full-channel point convolution branch performs only a single-point operation in spatial location, but performs a fully connected linear mapping on all input channels in the channel dimension. The outputs of the group convolution branch and the full-channel point convolution branch are added element-wise along the channel dimension to form the output feature map of the fine-grained feature enhancement module.
3. The method for constructing a safety target detection model for low-light environments according to claim 2, characterized in that, In step S1, the dual attention module forms a dual synergistic attention enhancement mechanism by sequentially cascading channel attention and spatial attention.
4. The method for constructing a safety target detection model for low-light environments according to claim 3, characterized in that, For the intermediate feature map of the input dual attention module Channel attention first performs global average pooling and global max pooling in the spatial dimension, compressing the spatial information of each channel into a scalar, resulting in two complementary channel descriptors: ; in, This represents the channel descriptor obtained from global average pooling. This represents the channel descriptor obtained from global max pooling. This indicates the number of channels in the intermediate feature map; Then and Each input feature map is fed into a shared-weight multilayer perceptron for nonlinear mapping to obtain a channel attention map. The intermediate feature maps are then weighted channel-wise using these channel attention maps to obtain a channel-weighted feature map. The multilayer perceptron consists of a first fully connected layer, a second fully connected layer, and a ReLU activation function. ; ; ; ; in, This represents a channel attention map. Represents the ReLU activation function. This represents the Sigmoid activation function. and These represent the weight matrices of the first and second fully connected layers, respectively. Indicates the channel compression ratio. This represents the channel-weighted feature map. This represents element-wise multiplication; For the channel-weighted feature map, spatial attention is applied along the channel dimension using average pooling and max pooling respectively, to weight the features at each spatial location. The 3D channel vector is compressed into a single scalar, resulting in two complementary spatial description graphs: ; in, This represents the average pooling space description graph. Represents the max pooling space description graph; Then and The two channels are concatenated to obtain a two-channel spatial description tensor. This tensor is then convolved with a 7×7 convolutional layer to generate a single-channel spatial attention map. Finally, the spatial attention weights are normalized to the [0,1] interval using a sigmoid activation function. ; in, This indicates a convolution operation with a kernel size of 7×7. This indicates a concatenation operation along the channel dimension. Represents a spatial attention map; Spatial location weighting is performed on the channel-weighted feature map using spatial attention map: ; in, This represents the output feature map after being weighted by both channel attention and spatial attention.
5. The method for constructing a safety target detection model for low-light environments according to claim 4, characterized in that, In step S2, the equivalent folding principle of the training efficiency optimization module for sequential convolutional structures is as follows: For a sequence of convolutional layers stacked sequentially in a network, let the th... Layer convolution kernel is ,in, and The first The number of output channels and input channels of the layer and The first The height and width of the convolutional kernel; for The overall transformation of a convolutional structure with layers stacked sequentially is represented as: ; in, , , , These represent the convolution kernel tensors of the 1st, 2nd, Lth, and L-1th layers in a sequentially stacked convolutional layer sequence, respectively. The input feature map tensor; To output the feature map tensor; and These represent the height and width of the output feature map tensor, respectively. Represents the convolution operation, and satisfies , ; This indicates the number of output channels for layer 0. This represents the total number of input channels in the entire sequential convolutional structure. This represents the total number of output channels in the entire sequential convolutional structure. This represents the number of output channels of the Lth convolutional layer; ; in, This is the equivalent convolution kernel obtained by sequentially combining and folding kernels in the convolution kernel space.
6. The method for constructing a safety target detection model for low-light environments according to claim 5, characterized in that, In step S2, the equivalent merging principle of the training efficiency optimization module for parallel convolutional branch structures is as follows: For parallel convolutional branch structures in a network, let the first... The convolution kernel for each branch is Each branch operates independently on the input feature map tensor. After performing convolution operations, the outputs of each branch are added element-wise and then merged to obtain the final output: ; in, This represents the total number of parallel branches. This represents the output of the parallel convolution branch structure.
7. The method for constructing a safety target detection model for low-light environments according to claim 6, characterized in that, In step S2, the joint loss function : ; in, For the focus of loss, For generalized intersection and comparison of losses, and These are the weighting coefficients for the focus loss and the generalized intersection-union loss, respectively. Focus loss : ; Suppose that the probability predicted by the security target detection model for a certain target category is... ,definition for: ; ; in, Indicates the focus parameter, ; Represents the category weight factor. ; This represents the standard cross-entropy loss; This represents the true label in a binary classification task; Generalized intersection and comparison loss : ; ; ; in, Indicates the predicted bounding box. Represents the true bounding box. Indicates simultaneous inclusion and The smallest rectangular box.