Joint training method and system for low-light image enhancement
By using a joint training method for low-light image enhancement, the problem of inconsistent feature distribution between the image enhancement model and the target detection model is solved, which improves the detection accuracy and generalization ability of the model, reduces the false detection rate and false negative rate, and achieves efficient perception of the three-dimensional structure of the target.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN UNIV OF TECH
- Filing Date
- 2026-06-05
- Publication Date
- 2026-07-03
Smart Images

Figure CN122334409A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a joint training method and system for low-light image enhancement. Background Technology
[0002] Low-light target detection technology is an important research direction in the field of computer vision, and it is widely used in scenarios such as park security, intelligent transportation, and nighttime monitoring. Currently, low-light target detection based on deep learning neural networks mainly adopts a two-stage training strategy: first, an image enhancement model is trained independently to improve the visual quality of the image, and then an object detection model is trained independently to identify the target object. This separate model training method has some technical drawbacks.
[0003] Image enhancement and object detection tasks have different optimization objectives. Image enhancement models typically optimize based on peak signal-to-noise ratio (PSNR) or structural similarity as loss functions during training, focusing on restoring image brightness and color. Object detection models, on the other hand, optimize based on classification accuracy and regression precision, focusing on extracting semantic features and edge textures of the target. This separation in training leads to a difference in the domain distribution between the enhanced image features and the pre-trained feature space of the detection model. This makes it difficult for the detection model to effectively generalize to the enhanced data, reducing training efficiency and detection accuracy.
[0004] Current neural network loss functions lack three-dimensional geometric constraints. Traditional object detection models rely solely on class probabilities and bounding box coordinate errors in a two-dimensional plane, failing to incorporate three-dimensional geometric information about the target. In low-light, complex backgrounds, two-dimensional features are susceptible to noise interference, making it difficult for the model to distinguish between the target and background noise, increasing false positive and false negative rates. Furthermore, existing enhancement algorithms do not consider the synergistic optimization of overexposure suppression and dynamic range expansion during training, easily leading to the loss of highlight region information, further affecting the effectiveness of the feature extraction layer. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a joint training method and system for low-light image enhancement, which enhances the model’s ability to perceive the three-dimensional structure of the target and effectively reduces the false detection rate and false negative rate in complex low-light backgrounds.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a joint training method for low-light image enhancement, the method comprising: Step 1: Obtain low-light training images and input them into the shared feature extraction layer to extract initial feature maps; Step 2: Based on the initial feature map, perform dynamic range expansion and overexposure suppression processing through an image enhancement network to generate an enhanced feature map; Step 3: Based on the enhanced feature map, target recognition and localization are performed through a target detection network to obtain target detection results containing target category, location coordinates, and depth estimation parameters; a set of key point coordinates of the target contour is extracted from the target detection results, and a minimum convex polygon is constructed based on the set of key point coordinates to determine the convex hull boundary; the area of the pixel region enclosed by the convex hull boundary is calculated to obtain the area feature, and the area feature is mapped to a three-dimensional space to construct a boss structure in combination with the depth estimation parameters, and the spatial volume of the boss structure is calculated to obtain the target geometric quantization feature; Step 4: Based on the enhanced feature map, target detection results, and target geometric quantization features, use a discriminator to compare domain distribution differences and combine them with detection errors to calculate the joint loss value; Step 5: Based on the joint loss value, jointly update the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network.
[0007] Secondly, the joint training system for low-light image enhancement includes: The acquisition module is used to acquire low-light training images, input the low-light training images into the shared feature extraction layer, and extract the initial feature map; The enhancement module is used to generate an enhanced feature map by performing dynamic range expansion and overexposure suppression processing through an image enhancement network based on the initial feature map. The processing module is used to perform target recognition and localization through a target detection network based on the enhanced feature map, and obtain target detection results including target category, position coordinates and depth estimation parameters; extract the key point coordinate set of the target contour from the target detection results, construct a minimum convex polygon based on the key point coordinate set to determine the convex hull boundary; calculate the area of the pixel region enclosed by the convex hull boundary to obtain area features, combine the depth estimation parameters to map the area features to a three-dimensional space to construct a boss structure, and calculate the spatial volume of the boss structure to obtain the target geometric quantization features; The calculation module is used to calculate the joint loss value based on the enhanced feature map, the target detection result and the target geometric quantization features, by using a discriminator to compare the domain distribution differences and combining them with the detection error. The update module is used to jointly update the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network based on the joint loss value.
[0008] The above-described solution of the present invention has at least the following beneficial effects: By extracting initial feature maps through a shared feature extraction layer and jointly updating the model parameters of the shared feature extraction layer, image enhancement network, and object detection network based on the joint loss value, integrated collaborative training of image enhancement and object detection tasks is achieved. Correspondingly, this technique solves the problem of feature distribution imbalance caused by the conflict between the optimization objectives of the enhancement and detection tasks in existing two-stage separate training methods. Through shared features and joint gradient backpropagation, it improves the convergence speed of model training and the object detection accuracy in low-light scenes.
[0009] An image enhancement network is used to perform dynamic range expansion and overexposure suppression to generate enhanced feature maps. Correspondingly, this technique addresses the technical flaw of traditional enhancement models where increased brightness in dark areas leads to overexposure in bright areas during training. It avoids loss of highlight details, ensures the feature integrity of the enhanced image, provides high-quality input features for the object detection network, and improves the model's adaptability to changes in lighting conditions.
[0010] This technique extracts the key point coordinates of the target contour from the target detection results, constructs the convex hull boundary, and calculates the spatial volume of the boss structure to obtain the target's geometric quantification features, which are then incorporated into the calculation of the joint loss value. Correspondingly, this technique addresses the problem of existing models' loss functions relying solely on two-dimensional planar information and lacking three-dimensional geometric constraints. By utilizing the convex hull area and boss volume features, it enhances the model's ability to perceive the target's three-dimensional structure, effectively reducing the false detection and false negative rates in complex low-light backgrounds.
[0011] This application utilizes a discriminator to compare the domain distribution differences based on the enhanced feature map, the target detection result, and the target geometric quantization features, and combines this with the detection error to calculate the joint loss value. Accordingly, this technique addresses the issue of inconsistency between the enhanced feature space and the pre-trained feature space of the detection model. By using a generative adversarial network mechanism to reduce the feature distribution differences between the source and target domains, it improves the model's generalization ability and training stability, ensuring the efficient operation of the large-scale vision model in practical application platforms. Attached Figure Description
[0012] Figure 1 This is a schematic flowchart of the joint training method for low-light image enhancement provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a joint training system for low-light image enhancement provided in an embodiment of the present invention; Figure 3 This is the original low-light image brightness histogram provided in the embodiments of the present invention; Figure 4 This is a comparison diagram of enhanced brightness distribution provided by an embodiment of the present invention; Figure 5This is a bar chart comparing the detail recovery rate provided in the embodiments of the present invention; Figure 6 This is a bar chart comparing the mAP detection accuracy of five methods provided in the embodiments of the present invention; Figure 7 This is a comparison chart of the false alarm rate and the missed detection rate provided in the embodiments of the present invention; Figure 8 This is a graph showing the detection accuracy under different illuminance levels, provided by an embodiment of the present invention. Figure 9 This is a line graph showing the number of concurrent paths versus inference latency provided in an embodiment of the present invention; Figure 10 This is a 72-hour continuous monitoring chart of CPU / GPU resource usage provided in an embodiment of the present invention; Figure 11 These are the inference delay distribution histogram and normal fitting curve provided in embodiments of the present invention; Figure 12 This is a bar chart comparing the improvement in false alarm rate and false alarm rate provided by the embodiments of the present invention; Figure 13 This is a curve showing the convergence comparison of joint training and separate training loss provided in an embodiment of the present invention. Detailed Implementation
[0013] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough understanding of the present disclosure and to fully convey its scope to those skilled in the art.
[0014] like Figure 1 As shown, embodiments of the present invention propose a joint training method for low-light image enhancement, the method comprising the following steps: Step 1: Obtain low-light training images and input them into the shared feature extraction layer to extract initial feature maps; Step 2: Based on the initial feature map, perform dynamic range expansion and overexposure suppression processing through an image enhancement network to generate an enhanced feature map; Step 3: Based on the enhanced feature map, target recognition and localization are performed through a target detection network to obtain target detection results containing target category, location coordinates, and depth estimation parameters; a set of key point coordinates of the target contour is extracted from the target detection results, and a minimum convex polygon is constructed based on the set of key point coordinates to determine the convex hull boundary; the area of the pixel region enclosed by the convex hull boundary is calculated to obtain the area feature, and the area feature is mapped to a three-dimensional space to construct a boss structure in combination with the depth estimation parameters, and the spatial volume of the boss structure is calculated to obtain the target geometric quantization feature; Step 4: Based on the enhanced feature map, target detection results, and target geometric quantization features, use a discriminator to compare domain distribution differences and combine them with detection errors to calculate the joint loss value; Step 5: Based on the joint loss value, jointly update the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network.
[0015] In this embodiment of the invention, an initial feature map is extracted by a shared feature extraction layer, and the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network are jointly updated based on the joint loss value. This achieves integrated collaborative training of image enhancement and object detection tasks. Correspondingly, this technique solves the problem of feature distribution imbalance caused by the conflict between the optimization objectives of the enhancement and detection tasks in existing two-stage separate training methods. By sharing features and joint gradient backpropagation, the convergence speed of model training and the object detection accuracy in low-light scenes are improved. At the same time, the image enhancement network performs dynamic range expansion and overexposure suppression to generate enhanced feature maps. Correspondingly, this technique solves the technical defect of overexposure in bright areas caused by increasing the brightness of dark areas during traditional enhancement model training, avoiding the loss of highlight details, ensuring the feature integrity of the enhanced image, providing high-quality input features for the object detection network, and improving the model's adaptability to changes in illumination. In addition, the key point coordinate set of the target contour is extracted from the object detection results, the convex hull boundary is constructed, and the spatial volume of the convex structure is calculated to obtain the target geometric quantification features, which are then included in the calculation of the joint loss value. Correspondingly, this technique solves the problem that the loss function of existing models only relies on two-dimensional planar information and lacks three-dimensional geometric constraints.
[0016] By leveraging the convex hull area and boss volume features, the model's ability to perceive the three-dimensional structure of the target is enhanced, effectively reducing the false detection rate and false negative rate under complex low-light backgrounds. This application also utilizes a discriminator to compare the domain distribution differences based on the enhanced feature map, target detection results, and target geometric quantization features, and calculates the joint loss value by combining the detection error. Accordingly, this technique solves the problem of inconsistent feature space distribution between the enhanced feature space and the pre-trained feature space of the detection model. By reducing the feature distribution differences between the source and target domains through the generative adversarial network mechanism, the generalization ability and training stability of the model are improved, ensuring the efficient operation of the large-scale vision model in practical application platforms.
[0017] In a preferred embodiment of the present invention, step 1 above may include: Step 11: Extract original video frames from the park's surveillance video stream and merge them with low-light sample images from a public low-light dataset to construct an original image sequence. This includes: continuously collecting real-time surveillance video data streams from the park's security scenarios; extracting single original video frames from continuous video footage at fixed time intervals; removing video frames with excessive blurriness, large areas of obstruction, or invalid information; and retaining valid video frame data with sufficient clarity and complete scene features. Simultaneously, retrieve publicly available low-light image standard datasets and select low-light sample images that match the park's nighttime surveillance, backlight, low-light, and dimly lit complex scenes; removing redundant images with duplicate image types or irrelevant scene features. Mix and arrange the selected valid surveillance video frames and standard low-light sample images according to a preset ratio, and arrange them in an orderly manner according to the light intensity and image complexity of the scene where the images were captured.
[0018] Step 12 involves performing pixel value normalization and resolution size standardization on the original image sequence to obtain a preprocessed image. Specifically, this includes: performing pixel value normalization on all images within the integrated original image sequence sequentially. The standard range of original pixel color values for a single image location is 0 to 255. The normalization standard calculation formula is followed to complete the value conversion. The normalized pixel feature value is equal to the total original pixel color value divided by 255. This calculation method compresses all pixel values to the standard value range of zero to one, eliminating data deviations caused by differences in pixel amplitude and illumination references between different images. Simultaneously, resolution size standardization is performed. A fixed and uniform standard image width and height value are pre-set. For images with different lengths and widths in the original image sequence, a bilinear interpolation algorithm is used to perform image scaling adaptation. Bilinear interpolation performs a weighted summation operation based on the grayscale values of the four adjacent original pixels surrounding the target pixel, accurately completing the pixel detail information after scaling. Ultimately, all images in the original image sequence are adjusted to the same resolution specification, resulting in a preprocessed image with completely uniform overall data specifications.
[0019] Step 13: Input the preprocessed image into the shared feature extraction layer. The shared feature extraction layer is composed of multiple layers of convolutional units and self-attention mechanism modules stacked alternately. Specifically, it includes: inputting all the preprocessed images, after pixel normalization and resolution standardization, into the pre-built shared feature extraction layer one by one. The shared feature extraction layer adopts an architecture in which multiple layers of convolutional units and self-attention mechanism modules are stacked alternately. The convolutional unit level and the self-attention mechanism module level are connected and combined layer by layer in a fixed order to form a multi-layer composite integrated feature extraction structure; strictly matching the pixel matrix data dimension format of the preprocessed image, accurately completing the dimension docking calibration between the image data and the input port of the shared feature extraction layer, ensuring that all pixel matrix information of the entire image is completely and losslessly imported into the feature extraction structure.
[0020] Step 14: Local feature extraction is performed on the preprocessed image through multiple convolutional units, and the extracted local features are aggregated with global context information through the self-attention mechanism module. Multi-level nonlinear transformation is performed to obtain multi-scale spatial features. Specifically, this includes: a shared feature extraction layer, relying on internally arranged multiple convolutional units, performs refined local feature extraction operations on the imported preprocessed image. The convolutional units perform row-by-row and column-by-column sliding convolution operations on the image pixel matrix through convolutional kernels of fixed size. The core calculation logic of the convolution is that the output feature pixel value is equal to the sum of the product of the weight value corresponding to the convolutional kernel and the local pixel value of the image, and then the product is accumulated. The local basic features such as image edge texture, contour direction, gray level change, and detail texture are mined layer by layer. Local feature extraction is completed in each convolutional unit. After the extraction operation, the corresponding self-attention mechanism module is immediately connected to carry out global context information aggregation processing. The self-attention mechanism module will perform cross-region association weight calculation on the extracted local features, and assign corresponding attention weight coefficients according to the semantic correlation between different local features. It will fuse, associate and integrate similar features and related features that are distributed far apart in the global image. The combination operation of convolutional local extraction and global attention aggregation is executed multiple times. At the same time, multi-layer nonlinear activation operation is used to iteratively transform the fused feature data, breaking the linear correlation limitation of feature data, and gradually generating multi-scale spatial features that simultaneously contain shallow detail features, mid-level texture features and deep semantic features, comprehensively taking into account both the accurate expression of local image details and the deep correlation of global context features.
[0021] Step 15: Perform unified channel number mapping on the multi-scale spatial features to output an initial feature map with consistent channel numbers. Specifically, this includes: performing unified channel number mapping adjustment operations on the finally generated multi-scale spatial features. During the hierarchical extraction and generation of multi-scale spatial features, the output features at different levels may have inconsistent channel dimensions and specifications. Using a convolutional channel mapping operator with fixed parameters, standardized dimension adaptation calculations are performed on all levels of multi-scale spatial features. Through convolutional channel weighted fusion operations, the number of feature channels with differential distributions is uniformly adjusted to a pre-set fixed standard channel value, eliminating the problems of channel dimension mismatch and poor data connection between multi-scale features. After completing the unified channel dimension mapping of all features, the adjusted multi-scale hierarchical features are sequentially spliced and fused together to form a complete and unified global feature matrix. Finally, an initial feature map with completely equal channel numbers and standardized data specifications is output from the entire feature matrix.
[0022] In this embodiment of the invention, an original image sequence is constructed by extracting original video frames from the park's surveillance video stream and fusing low-light sample images from a public low-light dataset. The original image sequence is then subjected to pixel value normalization and resolution size standardization to obtain a preprocessed image. The preprocessed image is input into a shared feature extraction layer composed of alternating stacks of multi-layer convolutional units and self-attention mechanism modules. Multi-layer convolutional units extract local features, and the self-attention mechanism module aggregates global context information and performs multi-layer nonlinear transformations to obtain multi-scale spatial features. Finally, the multi-scale spatial features are uniformly mapped to output an initial feature map with a consistent number of channels. This achieves efficient and unified output of training data construction, standardized preprocessing, and multi-scale global feature extraction, while taking into account scene adaptability and diversity. Correspondingly, this technique addresses the technical problems of traditional low-light models, such as insufficient generalization due to the single source of training data, unstable feature extraction caused by non-standard preprocessing, inability to effectively capture global context information by relying solely on convolutional layers, inconsistent multi-scale feature channel dimensions affecting network input consistency, and poor adaptability of feature extraction layers to enhancement and detection tasks under separate training modes. It ensures the stability of feature extraction through standardized preprocessing, enhances global context awareness through the alternating stacking of convolution and self-attention structures, and ensures input consistency between image enhancement networks and object detection networks through unified channel mapping.
[0023] In a preferred embodiment of the present invention, step 2 above may include: Step 21: Input the initial feature map into the decomposition network, and separate the low-frequency illumination component map and high-frequency reflection component map through convolutional filtering. Specifically, this includes: inputting the initial feature map with uniform output channel specifications from the previous step into a pre-constructed component decomposition network. This decomposition network has built-in independently configured low-pass convolutional filtering units and high-pass convolutional filtering units. The low-pass convolutional filtering unit is then enabled to perform global smooth convolution calculation on the initial feature map, and the convolution kernel is set to include... The group weight values are as follows: , Until The corresponding neighboring pixel values of the feature map are as follows: , Until The preset fixed normalization constant is The formula for calculating low-pass convolution digitization is: This formula is used to remove fine texture edges and detail noise from the image, leaving only basic data representing the overall environmental light and shadow distribution and global lighting changes. This generates a low-frequency illumination component map that focuses on the overall light and shadow performance. Then, a high-pass convolutional filtering unit is used to perform interpolation filtering calculations, setting the initial feature map's original pixel coordinates to... The calculated value of low-frequency illumination pixels at the same coordinate position is: The formula for calculating the digital value of a high-pass filter is: By relying on this calculation to remove the numerical interference caused by global illumination, reflective feature information containing the target contour direction, surface texture, and color details is extracted separately to generate a high-frequency reflective component map that focuses on the local details.
[0024] Step 22: Based on the low-frequency illumination component map, predict the noise residual through the backdiffusion process to expand the dynamic range and obtain the expanded illumination component map. Specifically, this includes: using the obtained low-frequency illumination component map as basic data to enter the backdiffusion operation process; statistically analyzing the brightness distribution range of all pixels in the low-frequency illumination component map across the entire domain; calculating the overall dynamic value span of the current illumination pixels; accurately locking the area range where the brightness of dark area pixels is low, effective details are hidden, and ineffective noise is mixed; establishing a standard and clean illumination reference benchmark through backdiffusion operation; calculating the noise residual value pixel by pixel; the noise residual is calculated by subtracting the actual pixel value at the current coordinate position of the low-frequency illumination component map from the pixel value under standard ideal illumination conditions; this residual value accurately reflects the brightness deviation and noise interference level of the current illumination pixel; according to the fixed rules of multi-layer iterative diffusion, the noise residual corresponding to all pixels in the entire image is back-added to the corresponding pixel position of the low-frequency illumination component map according to the regional correlation weight, completing the iterative update and correction of pixel brightness; the updated illumination pixel value is equal to the original pixel base value plus the corresponding position after weighted scaling noise residual value. Through multiple rounds of continuous reverse iterative diffusion correction, the overall brightness range of the image's illumination pixels is stretched, the dynamic response coverage of the image's light and dark signals is broadened, the missing effective illumination information in dark areas under low-light scenes is supplemented, and invalid noise data mixed in the dark areas is removed, thus completing the comprehensive expansion of the image's dynamic range and finally generating an extended illumination component map with clear details and rich light and shadow layers in the dark areas.
[0025] Step 23: Generate an overexposed area mask based on the pixel brightness distribution of the extended illumination component map. Use the overexposed area mask to suppress the brightness of the highlight areas in the extended illumination component map to obtain the processed illumination component map. Specifically, this includes: traversing all pixels within the extended illumination component map, collecting the actual brightness value of each pixel, pre-setting a fixed overexposed brightness threshold, defining areas where the brightness value of a single pixel exceeds the preset threshold as overexposed highlight areas, and uniformly defining the coverage area of the remaining pixels as normal illumination areas; based on the defined... By constructing a full-coverage pixel-level overexposed area mask matrix at the region boundary, pixels corresponding to overexposed coordinates in the mask matrix are uniformly assigned a fixed normalized value of 1, while pixels corresponding to normal lighting coordinates are uniformly assigned a fixed normalized value of 0. This forms a positioning mask that can accurately locate highlight defect areas. A fixed brightness attenuation control coefficient is used to perform targeted adaptive brightness suppression calculations on the extended illumination component map. The pixel brightness value after suppression is equal to the original highlight pixel value in the extended illumination component map multiplied by 1, minus the result of multiplying the attenuation control coefficient and the mask pixel value. This calculation only adjusts the overexposed areas marked by the mask; the pixel values in the normal lighting areas remain unchanged. This precisely reduces the excessively high brightness peaks in the highlight areas, restoring the texture details that were obscured by strong light in the highlight positions, while not destroying the lighting effects of the normal areas of the entire image. The final result is an illumination component map with complete highlight details and a balanced global brightness distribution.
[0026] Step 24 involves fusing and reconstructing the processed illumination component map and the high-frequency reflection component map element-by-element to generate an enhanced feature map. Specifically, this includes: performing element-by-element fusing and reconstruction calculations on all pixels of the entire image using the optimized processed illumination component map and the split high-frequency reflection component map. The core calculation rule for fusing and reconstruction is that the feature pixel value at a single coordinate position after fusing is equal to the sum of the pixel value at the corresponding position in the processed illumination component map and the pixel value at the corresponding position in the high-frequency reflection component map. Throughout the pixel-by-pixel addition and fusing process, it is strictly ensured that the pixel coordinates of the two component maps are precisely matched to the feature channel dimensions, allowing the optimized and expanded global illumination information to be fully superimposed and integrated with the original preserved local texture and reflection details. This fusing calculation method retains the dark area illumination compensation effect and the advantage of balanced light and shadow distribution across the entire area brought about by back diffusion, while also fully preserving the high-frequency features of the surface texture and color details of the target edge contour. It prevents the erosion and destruction of the original target's effective texture information during the illumination optimization and adjustment process. After the fusing and integration is completed, an enhanced feature map with natural light and shadow transitions, rich detail features, and excellent overall recognizability is finally generated.
[0027] In this embodiment of the invention, an initial feature map is input into a decomposition network and separated into a low-frequency illumination component map and a high-frequency reflection component map through convolutional filtering. Based on the low-frequency illumination component map, a noise residual is predicted through a back-diffusion process to expand the dynamic range and obtain an extended illumination component map. Then, an overexposed area mask is generated according to the pixel brightness distribution of the extended illumination component map, and brightness suppression is performed on the bright areas to obtain a processed illumination component map. Finally, the processed illumination component map and the high-frequency reflection component map are fused element by element to reconstruct an enhanced feature map, thereby achieving synergistic optimization of illumination-reflection component decoupling, dynamic range expansion, and overexposure suppression. Correspondingly, this technique addresses the shortcomings of traditional low-light enhancement algorithms, such as the destruction of target texture details during enhancement due to the lack of decoupling between illumination and reflection components, insufficient dynamic range due to the inability to simultaneously brighten dark areas and suppress highlights by only increasing global brightness, overexposure distortion and annihilation of highlight details, and the lack of a collaborative optimization mechanism for dynamic range expansion and overexposure suppression, resulting in poor feature integrity of the enhanced image and an inability to provide high-quality input for target detection. By decoupling components, the original texture and edge details of the target are fully preserved. By using back diffusion, the dynamic range of dark areas is effectively expanded and the visibility of dark area details is improved. By using an adaptive overexposure mask, overexposure distortion in bright areas is accurately suppressed and highlight details are preserved. The generated enhanced feature map has sufficient dynamic range, natural visual effects, and complete semantic features.
[0028] In a preferred embodiment of the present invention, step 3 above may include: Step 31 involves inputting the enhanced feature map into a Transformer-based object detection network encoder. A multi-head self-attention mechanism is used to aggregate global contextual information from the enhanced feature map, resulting in an encoded feature sequence. Specifically, this includes: inputting the enhanced feature map generated in the previous step into a pre-built Transformer-based object detection network encoder. This encoder consists of multiple stacked encoding layers, each integrating a multi-head self-attention mechanism operation unit and a feedforward neural network operation unit for aggregating global contextual information and extracting deep features from the enhanced feature map; and performing dimensionality adaptation processing on the input enhanced feature map to ensure that the channel dimension and pixel dimension of the enhanced feature map perfectly match the encoder's input specifications, avoiding data dimension misalignment and feature... Issues such as data loss are addressed. The encoder's internal multi-head self-attention mechanism unit is activated. This unit splits the enhanced feature map into multiple independent feature subspaces. Within each subspace, the association weights between each feature pixel and all other feature pixels are calculated. Weight allocation highlights target features and key texture information, suppressing noise interference in low-light backgrounds. The attention calculation results from multiple feature subspaces are fused and integrated. A feedforward neural network unit performs a non-linear transformation on the fused features, further enhancing their semantic expressive power. Through iterative processing across multiple encoding layers, global contextual information in the enhanced feature map is gradually aggregated, including the relationship between the target and the background, and the distribution patterns of the target's own global features. The final output is a dimensionally unified, semantically rich encoded feature sequence.
[0029] Step 32: Input the encoded feature sequence into the object detection network decoder. The encoded features and query vectors are fused using a cross-attention mechanism to obtain the decoded feature sequence. Specifically, this includes: inputting the obtained encoded feature sequence completely into the object detection network decoder. This decoder is adapted to the encoder architecture and is also composed of multiple stacked decoding layers. Each decoding layer has a built-in cross-attention mechanism operation unit, whose core function is to achieve accurate fusion of encoded features and query vectors, restoring the complete semantic features and location information of the target; pre-constructing query vectors adapted to the object detection task, with the dimension of the query vectors consistent with the encoded feature sequence. Each query vector corresponds to a potential target candidate region, used to accurately capture target-related feature information in the encoded feature sequence; and starting the process. The cross-attention mechanism operation unit treats the encoded feature sequence as key-value pairs and the query vector as the query object. By calculating the similarity between the query vector and each encoded feature, it assigns corresponding attention weights, focusing on key features in the encoded feature sequence that contain the target's contour, texture, and semantics, while filtering out invalid background features. After the attention weights are assigned, the encoded features and the query vector are fused according to their weight ratios to obtain fused feature information. This fused feature information is then subjected to a non-linear transformation by the feedforward neural network within the decoding layer to correct feature biases and improve feature accuracy. Through iterative fusion and transformation processing across multiple decoding layers, the complete feature information of the target is gradually restored, ultimately outputting a semantically clear and positionally well-defined decoded feature sequence.
[0030] Step 33 involves inputting the decoded feature sequence into the classification prediction head, regression prediction head, and depth estimation head, respectively, and outputting the target category probability distribution, bounding box coordinate offset, and pixel-level depth estimate in parallel. Specifically, this includes simultaneously inputting the output decoded feature sequence into the pre-built classification prediction head, regression prediction head, and depth estimation head. The three prediction heads work independently and in parallel, respectively responsible for outputting the target category, bounding box coordinate offset, and pixel-level depth estimate, achieving synchronous and efficient processing of multiple tasks, improving the efficiency of target detection, and adapting to application scenarios with high real-time requirements such as park security and nighttime monitoring. The classification prediction head internally contains a multi-layer fully connected network and activation functions. , The original feature input value of a single neuron node in a fully connected network, after weight calculation and summation, is fed into the activation function to extract category features and calculate probabilities for the decoded feature sequence; The first head represents the maximum value. By deeply mining the semantic features of the target in the decoded feature sequence, it determines the target category corresponding to each target candidate region and finally outputs the probability distribution of each target candidate region belonging to each category, ensuring the accuracy of the category judgment. The regression prediction head is also composed of a multi-layer fully connected network. It focuses on extracting the target position features in the decoded feature sequence and calculates the coordinate offset of the target bounding box relative to the preset anchor box. The offset accurately reflects the deviation between the actual position of the target and the position of the anchor box, providing an accurate basis for the bounding box correction. The depth estimation head, through the feature extraction network, performs depth analysis on the spatial features in the decoded feature sequence, calculates the target's depth information pixel by pixel, and outputs a pixel-level depth estimate. This depth estimate accurately represents the target's three-dimensional spatial position, providing reliable support for the construction of the target's three-dimensional geometric features. The three prediction heads process in parallel and output results synchronously, avoiding inference delays caused by serial processing of multiple tasks, while ensuring the accuracy of each prediction result.
[0031] Step 34: Determine the target category based on the target category probability distribution, correct the anchor frame position coordinates based on the bounding box coordinate offset, and use the pixel-level depth estimate as the depth estimation parameter. Specifically, this includes: based on the output target category probability distribution, bounding box coordinate offset, and pixel-level depth estimate, performing target category determination, position coordinate correction, and depth estimation parameter determination processes respectively to ensure the accuracy of relevant information for each target; during the target category determination process, a global analysis is performed on the category probability distribution of each target candidate region, selecting the category with the highest probability value as the target category corresponding to that candidate region, while eliminating target candidate regions with a probability lower than 0.5 to avoid false detections and ensure accurate and reliable target category judgment; during the position coordinate correction process, the preset anchor frame coordinates are obtained. The anchor frame coordinates are based on a preset fixed coordinate frame of the target detection scene. The output bounding box coordinate offset is superimposed with the corresponding anchor frame coordinates for calculation. The position deviation of the anchor frame is corrected by the offset to obtain the actual position coordinates of the target. The position coordinates accurately represent the specific position range of the target in the image, ensuring the accuracy of target positioning and solving the problems of large deviation and low target positioning accuracy in traditional anchor frame positioning. In the process of determining the depth estimation parameters, the output pixel-level depth estimates are integrated and processed to remove abnormal depth values. The integrated pixel-level depth estimates are then used directly as the depth estimation parameters of the target, which accurately reflect the three-dimensional spatial depth information of the target.
[0032] Step 35: Combine target category, location coordinates, and depth estimation parameters to form a target detection result. This includes: unifying the determined target category, corrected location coordinates, and integrated depth estimation parameters to form a complete target detection result, ensuring that the three types of information for each target correspond one-to-one and are complete and error-free, providing comprehensive and accurate basic data for the calculation of target geometric quantification features; separately sorting out the information of each target, associating and binding the target category, location coordinates, and depth estimation parameters corresponding to each target, ensuring that one target corresponds to a complete set of information, avoiding information confusion and incorrect correspondence; and integrating the associated information of all targets according to a fixed format to form a target detection result containing all targets. This result includes not only the specific category and accurate location of each target in the image, but also the three-dimensional depth information of each target.
[0033] In this embodiment of the invention, the enhanced feature map is input into the object detection network encoder based on the Transformer architecture. A multi-head self-attention mechanism is used to aggregate global contextual information from the enhanced feature map to obtain an encoded feature sequence. This encoded feature sequence is then input into the object detection network decoder, where a cross-attention mechanism fuses the encoded features with the query vector to obtain a decoded feature sequence. The decoded feature sequence is then input into the classification prediction head, regression prediction head, and depth estimation head, respectively, and outputs the target class probability distribution, bounding box coordinate offset, and pixel-level depth estimate in parallel. Finally, the target class is determined based on the target class probability distribution, the anchor box is corrected based on the bounding box coordinate offset to obtain the position coordinates, and the pixel-level depth estimate is used as the depth. The estimated parameters are combined to form the target detection result, realizing an integrated target detection process under the Transformer architecture that enhances global context awareness, performs multi-task parallel prediction, and outputs depth information synchronously. Accordingly, this technique solves the technical defects of traditional CNN architecture target detection networks, such as weak global context awareness and insufficient long-distance feature dependence capture, resulting in insufficient target feature extraction and poor localization accuracy in low-light complex backgrounds; it also solves the technical problems of separate training and poor coordination between target detection and depth estimation tasks, which prevents the synchronous output of accurate 3D spatial information; and it overcomes the technical bottlenecks of low efficiency and high inference latency in multi-task serial processing, making it difficult to adapt to application scenarios with high real-time requirements such as park security and night monitoring. By employing Transformer multi-head self-attention and cross-attention mechanisms, the model's ability to perceive global contextual information and capture long-distance feature dependencies is enhanced, effectively improving the robustness of target feature extraction and localization accuracy in low-light and noisy environments. Through multi-task parallel prediction heads, synchronous and efficient output of target classification, position regression, and depth estimation is achieved, improving model inference efficiency and real-time performance. The accurately output depth estimation parameters provide reliable spatial dimension support for target contour key point extraction, convex hull boundary construction, 3D boss structure generation, and target geometric quantization feature calculation, further strengthening the 3D structure perception capability of the jointly trained model.
[0034] In a preferred embodiment of the present invention, step 3 above may include: Step 36: Parse the target bounding box from the position coordinates of the target detection result and extract the target mask region within the target bounding box; perform contour tracking on the edges of the target mask region to extract discrete key points that constitute the outer contour of the target, forming a set of key point coordinates. Specifically, this includes: using the target detection result formed in the previous step as the processing basis, parsing the target bounding box from the position coordinates contained in the target detection result. The position coordinates contain the coordinate information of the four vertices of the target bounding box. By extracting these four vertex coordinates, the specific range of the target bounding box in the image is determined, ensuring that the bounding box accurately covers the target area, avoiding excessive low-light background noise, and preventing the omission of target edge parts. After completion, based on the range of the target bounding box, the target mask region within the target bounding box is extracted. During the extraction process, each pixel within the bounding box is checked to determine whether it belongs to the target pixel. Target pixels are retained, while background pixels and noise pixels mixed within the bounding box are removed to form a target mask region containing only the target area. Global contour tracking is performed on the edges of the target mask region. During the tracking process, the edge part of the target mask region is traversed pixel by pixel, and each edge pixel is checked to determine whether it belongs to the target's outer contour pixel. Discrete pixels that constitute the target's outer contour are selected, and each discrete pixel corresponds to a specific coordinate. The coordinates of all selected discrete pixels are collected and organized to form a key point coordinate set.
[0035] Step 37: Based on the keypoint coordinate set, the Graham scan algorithm is used to perform polar angle sorting and stack operation filtering on the keypoints, removing concave points and retaining convex points; the filtered convex points are connected to form a closed minimum convex polygon, and the set of edges of the minimum convex polygon is determined as the convex hull boundary. Specifically, this includes: using the formed keypoint coordinate set as the processing object, preprocessing the keypoint coordinate set, removing duplicate keypoints and keypoints that deviate abnormally from the target contour to ensure the accuracy and effectiveness of the keypoint coordinate set; processing all keypoints in the keypoint coordinate set, performing polar angle sorting, selecting the bottommost keypoint in the keypoint coordinate set as the reference point, using this reference point as the origin, calculating the polar angle of each keypoint relative to the reference point, and sorting all keypoints in ascending order of polar angle. After sorting, the keypoints are distributed around the target contour in a clockwise direction to ensure the orderliness of the filtering process; after polar angle sorting, stack operation filtering is performed, first sorting the first two... Key points are sequentially added to a stack as initial convex points. Each sorted key point is then sequentially retrieved and associated with the top two key points of the stack. The direction of the broken line formed by the three key points determines whether the current key point is convex or concave. If it is determined to be concave, the top key point is popped from the stack. This process is repeated until the current key point is determined to be convex, at which point it is added back to the stack. This process is repeated for all key points. The key points remaining in the stack are the filtered convex points, eliminating concave points and reducing redundant information. After the convex points are filtered, all convex points in the stack are connected sequentially according to their push order to form a closed minimum convex polygon. This minimum convex polygon accurately encloses the outer contour of the target and is the smallest closed shape that can accommodate all convex points, truly reflecting the overall contour of the target. All edges of this minimum convex polygon are collected and organized to form an edge set, which is then defined as the convex hull boundary. This convex hull boundary accurately represents the two-dimensional contour range of the target.
[0036] In this embodiment of the invention, the target bounding box is parsed from the position coordinates of the target detection result, the target mask region within the target bounding box is extracted, the edge of the target mask region is contour tracked to extract discrete key points constituting the outer contour of the target and form a set of key point coordinates, and then the key points are sorted by polar angle and filtered by stack operation based on the set of key point coordinates, concave points are removed and convex points are retained, and the filtered convex points are connected to form a closed minimum convex polygon and the set of its edges is determined as the convex hull boundary, thus realizing the accurate extraction of the true contour of the target and the efficient construction of a high-precision convex hull boundary. Correspondingly, this technique addresses the shortcomings of traditional target detection methods, which rely solely on rectangular bounding boxes and cannot accurately fit the true contour of the target. These shortcomings include inaccurate extraction of key contour points due to blurred target edges and noise interference in complex low-light backgrounds, and low accuracy and high redundancy in convex hull construction without concave point removal. These deficiencies affect the effectiveness of 3D boss structure modeling and 3D geometric constraints. By accurately reconstructing discrete key points of the true target contour through contour tracking, this technique provides precise raw contour data for convex hull construction. Through polar angle sorting and stack operation filtering using the Graham scan algorithm, concave point interference in the contour is efficiently removed, retaining only the convex points that constitute the minimum bounding convex polygon of the target. This improves the accuracy and computational efficiency of convex hull boundary construction, effectively reducing convex hull redundancy. The accurately constructed convex hull boundary provides a reliable and accurate 2D contour benchmark for calculating the convex hull pixel area, constructing 3D boss structures, and calculating target geometric quantization features.
[0037] In a preferred embodiment of the present invention, step 3 above may include: Step 38: Calculate the number of pixels contained within the convex hull boundary, and calculate the area of the pixel region enclosed by the convex hull boundary using the image resolution parameters, as the area feature; read the depth estimation parameters from the target detection results, use the depth estimation parameters as the height component, and the area feature as the base component, and map them to 3D space to construct a convex structure with height information. Specifically, this includes: using the determined convex hull boundary as the processing basis, performing a global pixel-by-pixel traversal on all pixels inside the convex hull boundary, characterizing the closed range of the convex hull boundary one by one, determining whether each pixel is inside the convex hull boundary, filtering out all pixels inside the convex hull boundary, counting these pixels one by one, and calculating the total number of pixels contained within the convex hull boundary; retrieving the preset resolution parameters of the currently processed image, which are fixed parameters determined in the image preprocessing stage, including the width and height of the image in pixels, and then... The resolution parameter is used to calculate the actual area of a single pixel. The total number of pixels inside the convex hull is multiplied by the actual area of a single pixel to calculate the actual area of the pixel region enclosed by the convex hull boundary. This actual area is used as the area feature, which accurately represents the size range of the target's two-dimensional contour. After the area feature calculation is completed, the depth estimation parameter in the target detection result is read. This depth estimation parameter accurately reflects the target's three-dimensional spatial depth information. This depth estimation parameter is directly used as the height component, and the previously calculated area feature is used as the bottom component. The convex hull region on the two-dimensional plane is mapped to three-dimensional space according to the height component, so that each pixel inside the convex hull boundary is assigned corresponding depth and height information. Gradually, a convex structure with height information and conforming to the true three-dimensional shape of the target is constructed. This convex structure completely preserves the target's two-dimensional contour features and three-dimensional depth information.
[0038] Step 39: Based on the bottom and height components of the boss structure, perform volume integration to calculate the spatial volume of the boss structure; encode the spatial volume into a numerical vector as the target geometric quantization feature for joint loss calculation. Specifically, this includes: using the constructed boss structure as the processing object, clarifying the bottom and height components of the boss structure. The bottom component is the convex hull region corresponding to the calculated area feature, and the height component is the depth estimation parameter of the target, ensuring that the parameter data of the two components are accurate and consistent; dividing the boss structure into multiple continuous thin layers along the height direction according to a fixed height interval, calculating the cross-sectional area of each thin layer layer by layer, with the cross-sectional area calculation based on the corresponding height. The convex hull contour range at the degree level is determined by combining the depth information of that level. Then, the cross-sectional area of each thin layer is multiplied by the height interval to obtain the volume of each thin layer. The volumes of all thin layers are accumulated sequentially to obtain the spatial volume of the entire boss structure. This spatial volume accurately quantifies the three-dimensional geometric size of the target and fully represents the three-dimensional structural features of the target. After the spatial volume calculation is completed, the obtained spatial volume is standardized and encoded to convert the spatial volume value into a fixed-dimensional numerical vector. During the encoding process, it is ensured that the format of the numerical vector meets the input requirements of the joint loss calculation. The encoded numerical vector is directly recognized and processed by the model, and the numerical vector is determined as the geometric quantification feature of the target.
[0039] In this embodiment of the invention, the area of the pixel region enclosed by the convex hull boundary is calculated as an area feature by calculating the number of pixels contained inside the convex hull boundary and combining it with the image resolution parameters. The depth estimation parameters in the target detection result are read, and the depth estimation parameters are used as the height component and the area feature is used as the bottom component to map to a three-dimensional space to construct a convex structure with height information. Then, the volume integral operation is performed based on the bottom component and height component of the convex structure to calculate the spatial volume of the convex structure, and the spatial volume is encoded as a numerical vector as the target geometric quantization feature used for joint loss calculation. This realizes the accurate quantization and supervised conversion from two-dimensional contour features to three-dimensional spatial geometric features. Correspondingly, this technique solves the technical defects of existing target detection models that rely only on two-dimensional planar class probabilities and bounding box coordinate errors for training and lack three-dimensional spatial geometric constraints, resulting in difficulty in distinguishing targets from background noise in low-light complex backgrounds and high false detection and false negative rates. By mapping the pixel area of the convex hull to the depth parameters in three dimensions, a convex structure that fits the real spatial shape of the target is accurately constructed, realizing the quantifiable representation of the target's three-dimensional geometric attributes. The spatial volume features obtained by volume integration operations enhance the model's ability to perceive and identify the target's three-dimensional structure, effectively distinguishing the real target from background noise in low-light environments, and reducing the false detection rate and false negative rate. By encoding the spatial volume into a standardized numerical vector, it is ensured that the three-dimensional geometric features can directly participate in the calculation of joint loss and gradient backpropagation.
[0040] In a preferred embodiment of the present invention, step 4 above may include: Step 41: Input the enhanced feature map into the discriminator, and input the normal illumination reference feature map corresponding to the low-light training image into the discriminator as a benchmark sample for domain distribution comparison. Specifically, this includes: using the generated enhanced feature map and the pre-prepared normal illumination reference feature map as processing objects, performing dimensionality verification and adaptation processing on the two feature maps to ensure that the channel dimension and pixel dimension of the enhanced feature map and the normal illumination reference feature map are completely consistent, avoiding the problem of discriminator processing abnormality due to dimensional misalignment. The normal illumination reference feature map is a feature map obtained by using the same feature extraction process as the low-light training image that belongs to the same scene, the same shooting angle, and has normal illumination conditions. It serves as a benchmark sample for domain distribution comparison and is used to measure the degree of difference between the feature distribution of the enhanced feature map and the feature distribution of the normal illumination image. The adapted enhanced feature map and the normal illumination reference feature map are simultaneously input into the pre-built discriminator, which is used to distinguish and compare the feature domains of the two types of feature maps.
[0041] Step 42 involves using a discriminator to perform feature domain classification processing on the enhanced feature map and the normal illumination reference feature map, outputting probability scores for the enhanced and normal feature domains. Specifically, this includes: starting the discriminator to perform feature domain classification processing on the input enhanced and normal illumination reference feature maps. The discriminator contains multiple layers of feature extraction and classification operation units, performing global feature extraction on both feature maps to uncover the feature distribution patterns and semantic features of each, focusing on capturing the differences between the two types of features in brightness distribution, texture details, and semantic expression; through the classification operation within the discriminator, determining the domain affiliation of the extracted features, calculating the probability score of the enhanced feature map belonging to the enhanced feature domain, and the probability score of the normal illumination reference feature map belonging to the normal feature domain. The probability score ranges from 0 to 1; the closer the score is to 1, the more the feature map conforms to the distribution characteristics of the corresponding feature domain; the closer the score is to 0, the greater the difference between the feature map and the corresponding feature domain. After classification processing, the discriminator simultaneously outputs the probability scores for the enhanced and normal feature domains.
[0042] Step 43: Based on the probability scores of the enhanced feature domain and the normal feature domain, calculate the domain distribution difference loss value to quantify the degree of distribution alignment between the enhanced features and the normal illumination features. Specifically, this includes: using the output probability scores of the enhanced feature domain and the normal feature domain as the core calculation basis, performing difference analysis on the two probability scores to determine the degree of deviation between the feature distribution of the enhanced feature map and the feature distribution of the normal illumination reference feature map; based on the deviation of the two probability scores, performing difference quantization calculation, and integrating the deviation values of the two scores from the ideal probability score to obtain the domain distribution difference loss value. This loss value accurately quantifies the degree of distribution alignment between the enhanced features and the normal illumination features. The larger the domain distribution difference loss value, the greater the deviation between the feature distribution of the enhanced feature map and the normal illumination feature distribution, and the worse the domain alignment effect; the smaller the domain distribution difference loss value, the closer the distributions of the two types of features are, and the better the domain alignment effect.
[0043] Step 44: Based on the target detection results, target geometric quantization features, and labeled ground truth labels, calculate the detection error loss value. The detection error loss value includes category classification error, location regression error, and depth estimation error. Specifically, this involves retrieving the generated target detection results, the obtained target geometric quantization features, and the pre-labeled ground truth labels, and establishing a one-to-one correspondence between these three to ensure that the detection results and geometric quantization features of each target accurately match the corresponding ground truth labels, avoiding errors caused by mismatched information. Based on this correspondence, calculate the three types of errors included in the detection error loss value, where category classification... The error is calculated by comparing the target category in the target detection result with the target category in the ground truth label, and statistically analyzing the number and degree of category misjudgment. This error is used to measure the accuracy of target classification. The position regression error is calculated by comparing the position coordinates in the target detection result with the target position coordinates in the ground truth label, and calculating the offset distance between the two. This error is used to measure the accuracy of target localization. The depth estimation error is calculated by comparing the depth estimation parameter in the target detection result with the true depth value in the ground truth label, and calculating the numerical deviation between the two. This error is used to measure the accuracy of target depth estimation. The three types of errors are integrated and summarized to obtain the complete detection error loss value.
[0044] Step 45 involves weighted summation of the domain distribution difference loss, detection error loss, and image enhancement quality loss to obtain a joint loss value. Specifically, this includes determining the weight coefficients for each of the three values: domain distribution difference loss (0.3), detection error loss (0.5), and image enhancement quality loss (0.2). This weighting balances domain alignment, target detection accuracy, and image enhancement quality, ensuring coordinated progress across the three optimization directions and addressing the weighting issues inherent in existing multi-task training methods. To address the issues of imbalance and strong gradient update bias, the three loss values are weighted separately. Each loss value is multiplied by its corresponding weight coefficient to obtain a weighted result for each loss value. After weighting, the three weighted results are summed to obtain the final joint loss value. Among them, the image enhancement quality loss value is used to measure the visual quality and detail integrity of the enhanced feature map, ensuring that the image enhancement effect meets the requirements of object detection and avoiding the impact of poor enhancement effect on detection accuracy. The final joint loss value comprehensively reflects the optimization effect of the three tasks: image enhancement, object detection, and domain distribution alignment.
[0045] In this embodiment of the invention, the enhanced feature map is compared with a matching normal illumination reference feature. Figure 1 A domain distribution comparison benchmark is established with the input discriminator. The discriminator performs feature domain classification on the two types of features and outputs the corresponding domain probability scores. Then, a domain distribution difference loss value that can accurately quantify the degree of feature distribution alignment is calculated. At the same time, combined with the target detection results, target geometric quantification features and labeled ground truth values, a comprehensive detection error loss value is constructed, including category classification error, position regression error and depth estimation error. Finally, the domain distribution difference loss value, detection error loss value and image enhancement quality loss value are weighted and fused to obtain a joint loss value. This realizes the integrated construction of loss for three supervision dimensions: feature domain alignment, target detection accuracy and image enhancement quality. Correspondingly, this technique solves the problem of enhancement in existing low-light joint training. This addresses the technical shortcomings of insufficient model generalization ability caused by feature distribution offset and poor cross-domain adaptability in normal lighting scenes. By driving feature domain distribution alignment through a discriminator, feature differences between high- and low-light images are effectively eliminated, allowing enhanced features to seamlessly adapt to the feature learning logic of the target detection network. Furthermore, by embedding a multi-dimensional detection error loss containing 3D geometric quantization features, the supervision of target classification, localization, and depth prediction is further strengthened. Relying on the joint loss formed by weighted fusion, the optimization directions of the image enhancement network and the target detection network are balanced and coordinated, ensuring coordinated iterative updates of parameters in each module during backpropagation, improving the overall training stability and convergence efficiency of the model, and further enhancing the feature adaptation capability and comprehensive target detection accuracy in complex low-light scenes.
[0046] In a preferred embodiment of the present invention, step 5 above may include: Step 51: Perform backpropagation calculation on the joint loss value to obtain the gradient information corresponding to each network layer in the shared feature extraction layer, image enhancement network, and object detection network. Specifically, this includes: using the obtained joint loss value as the core calculation basis, initiating the backpropagation operation process. The backpropagation operation starts from the joint loss value and backpropagates along the backpropagation path of the entire model, calculating the gradient information of each network layer layer by layer. The entire model includes the shared feature extraction layer, image enhancement network, and object detection network. During the backpropagation process, the gradient information of each convolutional unit and self-attention mechanism operation unit in the shared feature extraction layer, the gradient information of the decomposition network, backdiffusion operation unit, and overexposure suppression operation unit in the image enhancement network, and the gradient information of the encoder, decoder, and various prediction heads in the object detection network are calculated one by one. The gradient information accurately reflects the degree of influence of the model parameters of each network layer and each operation unit on the joint loss value. The magnitude of the gradient value corresponds to the weight of the parameter's influence on the loss value, and the positive or negative sign of the gradient corresponds to the direction of parameter adjustment.
[0047] Step 52: Based on the forward propagation path, the gradient information is distributed to the corresponding model parameters of the shared feature extraction layer, image enhancement network, and object detection network. Specifically, after calculating the gradient information, the forward propagation path of the entire model is first clarified, defining the connection relationship between each network layer and the data flow during the forward propagation process. The forward propagation path is as follows: the original image, after preprocessing, is input into the shared feature extraction layer to extract the initial feature map, which is then input into the image enhancement network and the object detection network respectively. The image enhancement network generates an enhanced feature map, which is then input into the object detection network. The object detection network performs object detection and outputs the detection result. Finally, the joint loss value is calculated by combining various loss values. Based on this forward propagation path, the gradient information corresponding to each network layer is distributed to the shared feature extraction layer, image enhancement network, and object detection network parameters one by one. Specifically, the gradient information of each convolutional unit and self-attention mechanism operation unit in the shared feature extraction layer is allocated to the corresponding weight and bias parameters of that layer; the gradient information of the decomposition network, back-diffusion operation unit, and overexposure suppression operation unit in the image enhancement network is allocated to the model parameters of the corresponding units; and the gradient information of the encoder, decoder, classification prediction head, regression prediction head, and depth estimation head in the object detection network is allocated to the corresponding parameters of each module. This ensures that each model parameter can accurately match the corresponding gradient information, avoids the problem of invalid parameter updates caused by gradient misalignment and parameter-gradient mismatch, and ensures that parameter adjustment accurately points to the direction of reducing the joint loss value, thereby achieving synergistic optimization of the three networks.
[0048] Step 53: Adjust the model parameter values of the shared feature extraction layer, image enhancement network, and object detection network based on gradient information using an optimization algorithm; repeat steps 1 to 5 until the joint loss value converges to a preset threshold to complete the joint training of the model. Specifically, this includes: first, determining the optimization algorithm used for parameter adjustment, and adopting the adaptive momentum optimization algorithm. This algorithm can dynamically adjust the parameter update rate according to changes in gradient information, while the weight decay coefficient is 0.0001 to suppress overfitting of model parameters and improve the generalization ability of the model. This optimization algorithm presets fixed hyperparameters. =0.9, =0.999, base learning rate =0.001, minimum protection constant =10⁻⁸, the current iteration gradient is denoted as gt, and the historical first moment is denoted as... The second-order moment of history is denoted as The current iteration round is denoted as The original model parameters are denoted as .
[0049] The specific calculation process of this optimization algorithm is as follows: Calculate the first-order moment estimate. ; Calculate the second-order moment estimate, Perform bias correction, and obtain the corrected first-order moment estimate. Corrected second-order moment estimate ; Calculate the parameter update step size, the update step size equals ; Calculate the updated parameter values, the new parameter values .
[0050] Using the optimization algorithm described above, combined with the gradient information allocated to each model parameter, the parameter values of all models in the shared feature extraction layer, image enhancement network, and object detection network are adjusted one by one. During the adjustment process, the direction of parameter adjustment is determined by the sign of the gradient information: when the gradient is positive, the parameter is adjusted in the direction of decreasing; when the gradient is negative, the parameter is adjusted in the direction of increasing. The magnitude of parameter adjustment is determined by the magnitude of the gradient information: the larger the gradient value, the larger the parameter adjustment magnitude; the smaller the gradient value, the smaller the parameter adjustment magnitude. This ensures that the adjustment of each model parameter can effectively reduce the joint loss value, achieving collaborative iterative optimization of the parameters of the three networks.
[0051] After parameter adjustment, repeat steps 1 to 5, starting again from acquiring low-light training images, and sequentially performing image preprocessing, initial feature extraction, enhanced feature map generation, object detection, joint loss calculation, gradient calculation, and parameter adjustment, iterating in this manner. During each iteration, monitor the changes in the joint loss value in real time. A preset joint loss value convergence threshold of 0.001 is used. After each iteration, record the current joint loss value and determine if the joint loss value has remained stable below 0.001 for five consecutive iterations, and if the difference between two adjacent iterations is less than 0.00001, with no further significant downward trend. If these conditions are met... If this condition is met, the joint loss value is determined to have converged to a preset threshold, the iterative process is stopped, and the joint training of the entire model is completed. Through this iterative process and convergence determination, the technical problems of disconnection in the optimization directions of each network, slow training convergence, easy getting trapped in local final solutions, and lack of convergence determination criteria leading to undertraining or overfitting in traditional separate training are solved. This ensures that the parameters of the shared feature extraction layer, image enhancement network, and object detection network can iterate in the direction of collaborative optimization, comprehensively improving the model's feature extraction capability, image enhancement quality, and object detection accuracy in low-light complex scenes, and ensuring that the model can stably adapt to practical application scenarios such as park security, intelligent transportation, and night monitoring.
[0052] In this embodiment of the invention, by performing backpropagation calculation on the joint loss value, the gradient information corresponding to each network layer in the shared feature extraction layer, image enhancement network and object detection network is accurately calculated. Then, the gradient information is strictly distributed to the corresponding model parameter positions of the three networks according to the forward propagation path. Based on the optimization algorithm and the gradient information, the model parameter values of each network are uniformly adjusted. The entire training process is iteratively executed until the joint loss value converges to the preset threshold. Finally, the joint training of the entire model is completed, realizing the gradient linkage update and collaborative parameter optimization of multiple network modules based on a unified global loss. Correspondingly, this technique addresses the shortcomings of traditional separate training models, such as independent gradient backpropagation, the inability to synchronously iterate and optimize the three network parameters, which easily leads to a disconnect between the optimization directions of feature extraction, image enhancement, and object detection modules, gradient update imbalance, and consequently, getting stuck in local final solutions, slow training convergence, and poor module adaptability. It also overcomes the technical problems of arbitrary gradient allocation causing invalid parameter updates and model learning bias, as well as the lack of convergence criteria leading to undertraining or overfitting. Through precise backpropagation and directional gradient allocation, it ensures that the parameters of each network layer can be effectively optimized based on the global joint loss, enhancing the deep adaptability of shared features and enhancement / detection tasks. By using preset thresholds to control training termination conditions, it improves training convergence efficiency while preventing overfitting, further solidifying the overall stability of multi-network joint training and comprehensively optimizing the model's feature representation ability and overall object detection performance in low-light complex scenes.
[0053] In a preferred embodiment of the present invention, step 53 above may include: Step 531: Set the initial learning rate and learning rate decay strategy. Dynamically adjust the global learning rate of the optimization algorithm according to the current training rounds. Specifically, this includes: defining the initial learning rate setting of the optimization algorithm. Considering the characteristics of joint training for low-light object detection, the initial learning rate is set to 0.001. This initial learning rate ensures rapid parameter updates and faster convergence in the early stages of training, while avoiding parameter oscillations and training instability caused by an excessively high initial learning rate; setting a step-wise learning rate decay strategy, specifying the decay period and decay ratio, and setting every 50 training rounds as a decay period. After each period, the current global learning rate is decayed back to its original value. The global learning rate is adjusted from 0.5 to 0.00001 and then decays until it reaches 0.00001. This decay strategy adapts to the optimization needs of different training stages of the model. During training, the current training round is monitored in real time. After each round, the number of rounds is recorded and compared with the preset decay period to determine whether the decay node has been reached. If the decay node has been reached, the global learning rate is adjusted according to the set decay ratio. If it has not been reached, the current global learning rate remains unchanged. Through this dynamic adjustment method, a higher global learning rate is used in the early stage of training to quickly reduce the joint loss value, while a lower global learning rate is used in the later stage of training to stabilize parameter updates and avoid oscillations and divergence.
[0054] Step 532 involves calculating the first and second moment estimates of the gradient based on the gradient information, performing gradient clipping to prevent gradient explosion, and generating adaptive learning rate adjustment coefficients. Specifically, this includes: using the gradient information allocated to each model parameter as the processing basis, performing a comprehensive review of all gradient information to ensure that the gradient information corresponding to each network layer and each model parameter is complete and without omission; based on the reviewed gradient information, calculating the first and second moment estimates for each gradient one by one; the first moment estimate is used to capture the long-term mean change trend of the gradient, and the second moment estimate is used to capture the long-term variance change trend of the gradient. Through the collaborative calculation of the two, the dynamic change law of the gradient is accurately grasped; after completing the moment estimation... After calculation, a gradient clipping operation is performed with a preset clipping threshold of 0.5. The magnitude of each gradient value is checked one by one. If the gradient value exceeds 0.5, it is clipped to 0.5. If the gradient value does not exceed 0.5, it remains unchanged. This operation effectively suppresses abnormal increases in gradient values, prevents gradient explosion during deep network training, and avoids the problem of gradient explosion destroying parameter optimization effects and causing model training failure. Combining the calculated first-order moment estimate, second-order moment estimate, and clipped gradient information, an adaptive learning rate adjustment coefficient is generated for each model parameter. Different parameters have different gradient changes, and the corresponding adjustment coefficients are also different.
[0055] Step 533: Using the adaptive learning rate adjustment coefficient and the global learning rate, combined with the weight decay regularization term, iteratively update the weight parameters and bias parameters of the shared feature extraction layer, image enhancement network, and object detection network. Specifically, this includes: retrieving the dynamically adjusted global learning rate and the generated adaptive learning rate adjustment coefficient, and correlating the two to ensure that the adaptive adjustment coefficient of each model parameter accurately matches the current global learning rate; the weight decay regularization term sets the weight decay coefficient to 0.0001, which is used to suppress overfitting of model parameters. By slightly penalizing the model parameters, it reduces the fitting of redundant parameters, improves the model's generalization ability in low-light complex scenes, and solves the problem of overfitting that easily occurs in traditional parameter updates. To address the issues of insufficient generalization ability of the shared feature extraction layer, image enhancement network, and object detection network, an iterative update operation is performed on all weight and bias parameters of these networks one by one. The adaptive learning rate adjustment coefficient for each parameter is multiplied by the current global learning rate to obtain the actual update rate of that parameter. The direction of parameter adjustment is determined by combining the cropped gradient information, and the magnitude of parameter adjustment is determined based on the actual update rate. Simultaneously, a penalty term of weight decay regularization is incorporated to fine-tune the parameters. During the update process, it is strictly ensured that the adjustment of each parameter is directed towards reducing the joint loss value, and all parameters of the three networks are updated synchronously, achieving collaborative iterative optimization of the parameters of the shared feature extraction layer, image enhancement network, and object detection network.
[0056] Step 534: After completing the parameter update for the current round, save the updated model parameter state as the initial input parameters for the shared feature extraction layer in the next training step 1. Specifically, after completing the iterative update of all model parameters in the current round, immediately save the complete state of all updated model parameters. The saved parameters include the weight and bias parameters of all convolutional units and self-attention mechanism units in the shared feature extraction layer, the weight and bias parameters of the decomposition network, back-diffusion unit, and overexposure suppression unit in the image enhancement network, and all weight and bias parameters of the encoder, decoder, classification prediction head, regression prediction head, and depth estimation head in the object detection network. This ensures the completeness and accuracy of parameter saving and avoids parameter omissions. To address issues of omissions and incorrect saving, the parameter files are named and labeled according to the current training round during the saving process. This facilitates tracing parameter states and retrieving parameters from the corresponding round during training. After saving, the updated model parameter states for that round are set as the initial input parameters for the shared feature extraction layer in step 1 of the next training round. When the next training round starts, the saved parameter states are directly retrieved as the initial parameters for the shared feature extraction layer, eliminating the need for parameter re-initialization. This parameter saving and reuse method achieves seamless connection between parameters in different training rounds, avoiding feature learning gaps and insufficient training coherence caused by parameter continuity breaks. It ensures that each training round can continuously advance based on the optimization results of the previous round, further improving the convergence efficiency and final convergence quality of model training.
[0057] In this embodiment of the invention, an initial learning rate is set and a learning rate decay strategy is used to dynamically adjust the global learning rate according to the training rounds. Based on gradient information, first-order moment estimates and second-order moment estimates are calculated, and gradient clipping is performed simultaneously to avoid the risk of gradient explosion and generate adaptive learning rate adjustment coefficients. Then, combined with the adaptive learning rate adjustment coefficients, the global learning rate, and the weight decay regularization term, the weights and bias parameters of the shared feature extraction layer, the image enhancement network, and the object detection network are updated in a refined iterative manner. After each round of parameter update, the model parameter state is saved and used as the initial input parameters for the next round of training of the shared feature extraction layer. This realizes a refined parameter update mechanism that achieves dynamic adaptive control of the training learning rate, precise suppression of gradient anomalies, parameter regularization optimization, and seamless inheritance of iterative parameters. Correspondingly, this technique addresses the shortcomings of fixed learning rates, which cannot adapt to the optimization needs of different training stages of the model; slow convergence in the early stages and easy oscillation and divergence in the later stages; gradient explosion that easily destroys parameter optimization effects during deep multi-network training; overfitting and reduced generalization ability caused by single parameter update methods; and the lack of feature learning gaps and overall optimization coherence due to the discontinuity of parameter connection between training rounds. By dynamically decaying the global learning rate, it conforms to the model's learning law from coarse to fine, accelerating early convergence and stabilizing later optimization accuracy. Relying on first and second-order moment estimation and gradient clipping, it effectively constrains abnormal gradient fluctuations and ensures safe and controllable parameter updates for multi-module deep networks. Weight decay regularization suppresses redundant parameter fitting and reduces the risk of overfitting. By retaining and reusing parameter states in each round, it achieves seamless connection of training iterations, ensuring the continuity and consistency of feature extraction and multi-task optimization, further improving the stability of the joint training process, the accuracy of parameter updates, and the final convergence quality of the model, and comprehensively enhancing the generalization ability and practical application reliability of the entire network model in low-light scenarios.
[0058] like Figure 2 As shown, embodiments of the present invention also provide an early warning system based on big data analysis, comprising: The acquisition module is used to acquire low-light training images, input the low-light training images into the shared feature extraction layer, and extract the initial feature map; The enhancement module is used to generate an enhanced feature map by performing dynamic range expansion and overexposure suppression processing through an image enhancement network based on the initial feature map. The processing module is used to perform target recognition and localization through a target detection network based on the enhanced feature map, and obtain target detection results including target category, position coordinates and depth estimation parameters; extract the key point coordinate set of the target contour from the target detection results, construct a minimum convex polygon based on the key point coordinate set to determine the convex hull boundary; calculate the area of the pixel region enclosed by the convex hull boundary to obtain area features, combine the depth estimation parameters to map the area features to a three-dimensional space to construct a boss structure, and calculate the spatial volume of the boss structure to obtain the target geometric quantization features; The calculation module is used to calculate the joint loss value based on the enhanced feature map, the target detection result and the target geometric quantization features, by using a discriminator to compare the domain distribution differences and combining them with the detection error. The update module is used to jointly update the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network based on the joint loss value.
[0059] In another preferred embodiment of the present invention, the target scenario of this embodiment is a park-type monitoring scenario such as industrial parks, campuses, construction sites, and buildings. It covers multiple types of monitoring points such as park gates, "Skynet Project" locations, construction site monitoring, building monitoring, civilian monitoring, and production monitoring. It solves the industry pain points of loss of details in dark areas of the monitoring screen, overexposure in strong light, and high rate of missed and false detection of targets in low-light environments such as nighttime, backlight, and rainy weather in parks.
[0060] This embodiment employs a dual-loop development approach for model training and iteration, simultaneously constructing the datasets required for both the small closed loop of algorithm development and the large closed loop of application-algorithm development. The dataset was sourced from two sources. On one hand, original video frames were extracted from video streams at various monitoring points in the park at fixed time intervals, collecting 120,000 valid video frames covering various low-light scenes, including low light at night, backlight overexposure, and low light in overcast and rainy conditions. Simultaneously, normal lighting images of the same scene and camera position were collected as annotation benchmarks. On the other hand, authoritative international public datasets for low-light conditions, such as ExDARK, SID, LOL, and MIT-Adobe FiveK, were integrated to select 23,000 low-light sample images that matched the park scene, including 8,000 pairs of low-light-normal lighting images. Finally, a special low-light dataset for the park, consisting of a total of 143,000 images, was constructed.
[0061] Data preprocessing involves normalizing the pixel values of all images in the dataset, mapping the original 0-255 pixel values to the 0-1 range to eliminate the deviation between pixel amplitude and illumination reference in different images. At the same time, a bilinear interpolation algorithm is used to standardize the resolution of all images to 1920*1080, resulting in preprocessed images with uniform specifications to ensure the consistency of model input.
[0062] The data closed-loop iteration consists of a small closed loop for algorithm development, which completes the initial training of the model based on public datasets and initially collected park data; and a large closed loop for application and algorithm development, which involves deploying the model to the actual park scene and continuously collecting new low-light image data in the scene to supplement the dataset, forming a continuous optimization closed loop of data collection, model training, scene application, data supplementation, and model iteration.
[0063] The preprocessed low-light training image is input into the shared feature extraction layer to complete the extraction of the initial feature map. In this embodiment, the shared feature extraction layer adopts an architecture of alternating stacked multi-layer convolutional units and self-attention mechanism modules, with a total of 4 groups of convolutional-attention composite units. The specific implementation process is as follows: The preprocessed image is input into the first convolutional unit, where a 3×3 convolutional kernel performs initial local feature extraction, uncovering basic features such as image edges, textures, and grayscale variations, and outputting a shallow feature map. This shallow feature map is then input into the corresponding self-attention mechanism module, where multi-head self-attention computation assigns association weights to different local features, aggregates global contextual information, enhances the feature representation of the target region, and suppresses background noise interference. Subsequently, it passes through three sets of convolutional-attention composite units, layer by layer, to extract deep semantic features and aggregate global information, ultimately generating multi-scale spatial features containing shallow details, mid-level textures, and deep semantics. A 1×1 convolutional channel mapping operator maps the number of channels of the multi-scale spatial features to a unified 256-dimensional array, outputting an initial feature map with completely consistent channel specifications. This initial feature map is then simultaneously input into the subsequent image enhancement network and object detection network, providing a unified feature foundation for both tasks.
[0064] Based on the initial feature map output by the shared feature extraction layer, an image enhancement network is used to perform dynamic range expansion and overexposure suppression collaborative processing to generate an enhanced feature map, thus fully realizing the image enhancement process of this invention. Simultaneously, the core optimization algorithm from the technical disclosure is integrated. The specific implementation steps are as follows: Illumination-reflection component decomposition involves inputting the initial feature map into the decomposition network. Through low-pass and high-pass convolutional filtering units, low-frequency illumination component map and high-frequency reflection component map are obtained. The low-frequency illumination component map represents the overall brightness distribution and global light and shadow changes of the image, while the high-frequency reflection component map retains core semantic features such as target contours, surface textures, and edge details. This decouples illumination and reflection information, avoiding the destruction of texture features required for target detection during the enhancement process.
[0065] Dynamic range extension and dark area enhancement, using low-frequency illumination component map as input, predict the noise residual of dark area pixels through the reverse diffusion process of conditional diffusion model, perform brightness iteration correction pixel by pixel, stretch the dynamic value range of image illumination pixels, expand the dynamic range of the original camera from only 2 orders of magnitude to more than 5 orders of magnitude, make up for the missing effective illumination information in dark areas, restore the hidden details in dark areas, and obtain extended illumination component map.
[0066] In this embodiment, the formula for the forward diffusion process is: ,in The image state at time t. The diffusion coefficient is... It is normally distributed random noise; for Image state at any given moment; The formula for the reverse diffusion process is: ; in, Indicating the reverse diffusion process The low-light image prediction state at time 1, i.e., after the current round of denoising optimization, where This represents the time step in the diffusion process. Diffusion processes are typically set to 1000 time steps, starting from the maximum value. Gradually decrease to 0; It is more than An earlier time step, ultimately when At that time, the output is a fully enhanced and clear image; and These represent the diffusion coefficients (noise scheduling coefficients) at time t and t-1, respectively. They are pre-set fixed values that decrease linearly with time steps; in this embodiment, the initial value is 0.9999, gradually decreasing to 0.0001 with each time step. These coefficients determine the proportion of original image information retained and the proportion of noise added during each diffusion step. The larger the value, the more effective information of the original image is retained at the corresponding time step, and the less noise is added; This represents the low-light image state at time t during the back-diffusion process; The input represents the conditional constraint. In this embodiment, it is a normal lighting reference image of the same scene and camera position, which is used to constrain the direction of noise prediction and ensure that the denoised image matches the lighting, color and detail features of the real scene, avoiding problems such as artifacts and color distortion. This represents random noise that follows a standard normal distribution. It is noise that is gradually added to the original low-light image during forward diffusion. The core goal of backdiffusion is to accurately predict and remove this noise and restore the effective detail information of the image. The output of the noise prediction network represents the core trainable network module in this embodiment, used to predict random noise contained in the current image state; whereby... The trainable weight parameters representing the noise prediction network are iteratively optimized through the loss function during model training; input parameters The current image state at time t is the main input for noise prediction; input parameters Input parameters are constrained by normal lighting conditions and used to guide noise prediction to fit the real scene; The target time step is used to inform the network of the current denoising progress, adapt to the noise distribution characteristics of different time steps, and output accurate noise prediction values.
[0067] Overexposed area information recovery and brightness suppression: The pixel brightness distribution of the extended illumination component map is traversed globally. A brightness threshold of 240 (0-255 range) is set, and areas exceeding the threshold are defined as overexposed highlight areas, generating a pixel-level overexposed area mask. Combining layer decomposition and light effect suppression network, the original low-light image is decomposed into a reflection map, a shadow map, and a light effect map. After being fused with the overexposed area mask, adaptive brightness suppression calculation is performed on the highlight areas to restore the texture and color details of the highlight areas that were covered by strong light, resulting in a processed illumination component map with balanced brightness distribution.
[0068] In this embodiment, the core formula for overexposure suppression is: ; in For shadow images, For reflection diagram, This is a lighting effect image. For light effect suppression network, This refers to element-wise multiplication. Artifact suppression and feature fusion reconstruction employ a high-frequency recovery module (HFRM) and a filtering fusion module (IWR) to optimize the details of the high-frequency reflection component map, suppressing artifacts such as halo effects, color distortion, and false edges generated during the diffusion model generation process. The processed illumination component map is then fused and reconstructed element-wise with the optimized high-frequency reflection component map, ultimately generating an enhanced feature map with natural light and shadow transitions, complete brightness and darkness details, and no loss of semantic features. In this embodiment, the core formula for artifact suppression is: ; in For low-frequency light components, , , Vertical, horizontal, and diagonal high-frequency sub-bands It is a high-frequency recovery module. This is a filtering and fusion module.
[0069] Based on the generated enhanced feature map, target recognition and localization are achieved through a target detection network based on the Transformer architecture. Simultaneously, geometric quantification features of the target are extracted, adapting to the three core detection needs in park security scenarios: personnel body analysis, vehicle license plate analysis, and behavioral scene analysis. The specific implementation process is as follows: The encoding-decoding feature processing involves inputting the enhanced feature map into the object detection network encoder. Through a stacked 6-layer Transformer encoding layer, a multi-head self-attention mechanism is used to aggregate global contextual information, outputting a dimensionally uniform encoded feature sequence. The encoded feature sequence is then input into the decoder, where a cross-attention mechanism is used to fuse the encoded features with the learnable query vector, achieving accurate decoding of the target features and outputting a decoded feature sequence.
[0070] Multi-task parallel prediction synchronously inputs the decoded feature sequence into the classification prediction head, regression prediction head, and depth estimation head. The three prediction heads operate in parallel and output the target category probability distribution, bounding box coordinate offset, and pixel-level depth estimate, respectively. The classification prediction head outputs the category probability of core targets in the park, such as people, motor vehicles, non-motor vehicles, and violations. The regression prediction head outputs the precise coordinates of the target bounding box, and the depth estimation head outputs the three-dimensional spatial depth information of the target.
[0071] The detection results are integrated. For each candidate region, the category with the highest probability is selected as the final target category. The preset anchor box is corrected by the bounding box coordinate offset to obtain the precise position coordinates of the target in the image. The pixel-level depth estimates are integrated into depth estimation parameters. Finally, the results are combined to form a target detection result that includes the target category, position coordinates, and depth estimation parameters.
[0072] The target contour and convex hull boundary are constructed by parsing the target bounding box from the target detection results, extracting the target mask region within the bounding box, and extracting discrete key points of the target's external contour using a contour tracking algorithm to form a set of key point coordinates. The Graham scan algorithm is used to sort the key points by polar angle and perform stack operations to filter them, removing concave points and retaining convex points. The filtered convex points are connected to form a closed minimum convex polygon, and the set of its edges is determined as the convex hull boundary of the target.
[0073] The target geometric quantization feature is calculated by counting the total number of pixels inside the convex hull boundary and combining it with the image resolution parameters to calculate the actual area of the pixel region enclosed by the convex hull, which is used as the area feature. The depth estimation parameters corresponding to the target are read as the height component, and the area feature is used as the base component to map the two-dimensional convex hull region to three-dimensional space, constructing a convex structure that fits the real shape of the target. The spatial volume of the convex structure is calculated by volume integration and encoded into a fixed-dimensional numerical vector as the target geometric quantization feature, which is used for the subsequent calculation of the joint loss value.
[0074] This embodiment calculates the joint loss value based on the enhanced feature map, the target detection result, and the target geometric quantization feature. Based on the joint loss value, it performs end-to-end joint training of the shared feature extraction layer, the image enhancement network, and the target detection network to construct a large-scale low-light target detection model. The specific implementation process is as follows: Domain distribution difference loss calculation involves simultaneously inputting the enhanced feature map and the corresponding reference feature map of the normal illumination image into the discriminator. The discriminator performs feature domain classification processing and outputs probability scores for the enhanced and normal feature domains. The domain distribution difference loss value is calculated based on the deviation between the two probability scores, quantifying the alignment between the distributions of the enhanced and normal illumination features. Detection error loss calculation compares the target detection results, the target geometric quantization features, and the pre-labeled ground truth values, calculating the category classification error, location regression error, depth estimation error, and geometric quantization feature deviation respectively, and integrating them to obtain the complete detection error loss value. Image enhancement quality loss calculation: Based on the enhanced feature map and the normal illumination reference image, loss values related to peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) are calculated to quantify the visual quality and detail integrity of the image enhancement. Joint loss fusion sets the weights of the domain distribution difference loss value to 0.3, the detection error loss value to 0.5, and the image enhancement quality loss value to 0.2. The three types of loss values are weighted and summed to obtain the final joint loss value. The core formula is: ; in, To enhance image quality loss, To detect error loss, For the domain distribution difference loss, , , These are the adaptively optimized weight coefficients. Backpropagation is performed on the joint loss value, calculating the gradient information for each layer of the shared feature extraction layer, image enhancement network, and object detection network along the model's forward propagation path. The AdamW optimization algorithm is used, with an initial learning rate of 0.001, coupled with a step-wise learning rate decay strategy (decreasing to 0.5 every 50 training epochs, down to a minimum of 0.00001). The gradient clipping threshold is set to 0.5, and the weight decay coefficient is 0.0001. Based on the gradient information, all weight and bias parameters of the three networks are synchronously and iteratively updated. The training process employs a strategy combining alternating training and joint training: in the early stage, alternating training iteratively updates the parameters of the image enhancement and object detection modules to achieve initial model convergence; in the later stage, joint training synchronously optimizes the parameters of the entire network based on the joint loss value to achieve end-to-end integrated training; the entire process of steps 1 to 5 of this invention is executed cyclically until the joint loss value of 5 consecutive iterations stabilizes below 0.001 and the difference between the loss values of adjacent iterations is less than 0.00001, at which point the model is determined to have converged, and the training of the first-stage low-light object detection large model is completed.
[0075] After completing model training, the first-stage large model will be deeply integrated with Fujian Mobile's existing video AI platform. Visual large model resource and computational adaptive technology will be developed to solve the high-concurrency problem of integrating the large model with the application platform, enabling large-scale access and real-time processing of multiple surveillance video streams within the park. Specific implementation details are as follows: The trained low-light target detection first-stage large model is integrated into the visual recognition algorithm warehouse of the video AI platform, and deeply integrated with the platform's original human body analysis, vehicle license plate analysis, and behavior scene analysis algorithm capabilities. Simultaneously, the platform's two core modules, model service and capability operation, are upgraded to realize the open access of low-light detection capabilities across the entire platform. The development platform includes a dynamic resource allocation module that monitors server GPU / CPU usage, memory usage, and the workload and latency requirements of each video stream in real time. It establishes a status and action reporting table and intelligent scheduling strategies to dynamically allocate differentiated computing resources to video streams with different resolutions, frame rates, and content complexity, ensuring that video streams in complex low-light scenarios receive sufficient computing power first. A video frame computation load module is also developed to perform inter-frame difference judgment on the input video stream, discarding redundant frames without motion changes and sending only valid video frames containing moving targets to the large model for inference. This reduces the invalid computation load of the large model by more than 40% without affecting detection accuracy. Finally, a video stream multi-channel concurrent processing module is developed, employing an asynchronous processing architecture to decouple the decoding, preprocessing, and inference processes of each video stream, enabling parallel inference of multiple video streams to the large model. This solves the task blocking problem in traditional synchronous processing modes, allowing a single computing device to support concurrent real-time processing of no less than 200 1080P video streams. Based on the platform's existing unified video data access service, the unified access of video streams from various park monitoring points, such as industrial park gates, construction site monitoring, building monitoring, and campus monitoring, is completed, achieving low-light target detection capability coverage across the entire park scenario.
[0076] This embodiment establishes a three-level evaluation system comprising the algorithm layer, system layer, and business layer to comprehensively verify the overall performance of the model and system. The verification results are as follows: In the low-light testing cluster of the park, the image enhancement algorithm of this embodiment improved the dynamic range of the image by more than 5 orders of magnitude, with a detail recovery rate of 92% in dark areas and 88% in overexposed areas, without obvious artifacts or color distortion. The low-light target detection accuracy reached 94.3%, an improvement of 11.2 percentage points compared with the traditional two-stage method, with a false negative rate of less than 2.1% and a false positive rate of less than 1.8%, significantly outperforming mainstream solutions in the industry. In a scenario with 200 concurrent 1080P video streams, the system's average inference latency was less than 80ms, the average CPU utilization was less than 45%, and the average GPU utilization was less than 75%. It ran stably for 72 consecutive hours without downtime or task blocking, meeting the reliability requirements for industrial-grade deployment. Pilot applications have been completed at multiple existing sites, including mobile park security and smart construction sites. For scenarios such as nighttime intrusion, illegal parking of vehicles, and construction site safety violations, the event recognition accuracy rate in low-light environments has reached over 93%. Compared with the original system, the nighttime event false alarm rate has decreased by 85%, and the false alarm rate has decreased by 78%, significantly improving the nighttime control capabilities of park security scenarios and demonstrating its value for large-scale promotion.
[0077] Figure 3 The original low-light image brightness histogram has pixel gray values highly concentrated in the extremely dark range of 0~50, resulting in severe dynamic range compression. This causes a large amount of dark details to be submerged in the noise layer, making it difficult to recover effectively using traditional methods. Figure 4 To enhance the brightness distribution comparison image, after joint training enhancement, the pixel distribution is uniformly expanded to the full dynamic range of 0~255; the green area in the image marks the contribution of dark area recovery (recovery rate 92%), and the orange area marks the contribution of overexposed area detail recovery (recovery rate 88%), demonstrating the dual-end repair capability. Figure 5 The bar chart shows the comparison of detail recovery rates of the three methods. The method of this invention (94.3% overall index) is significantly better than the traditional gamma correction method (about 78%) and typical baselines such as RetinexNet (about 85%), demonstrating the superiority of the joint training strategy in end-to-end detail restoration. Figures 3 to 5 This intuitively demonstrates the balance and global effectiveness of the joint training strategy in detail recovery at both ends (dark and overexposed areas), and verifies the technical effectiveness of the brightness adaptive mapping and joint loss constraint module in the content.
[0078] Figure 6 The bar chart compares the mAP detection accuracy of five methods. The method of this invention (mAP=94.3%) is 11.2 percentage points higher than the traditional two-stage method (mAP≈83.1%). Compared with four baselines, including YOLOv8-original, RetinexNet+ detector, and LLFLOW+ detector, the method has significant advantages. The specific values and improvement are marked at the top of the bars. Figure 7 The chart shows a comparison of the false alarm rate and the missed detection rate. The false alarm rate (<2.1%) and the false alarm rate (<1.8%) of this invention are the lowest among the five comparison methods. The two indicators are distinguished by different colors, which intuitively reflects the ability to ensure high reliability in security scenarios. Figure 8 For the detection accuracy curves under different illuminance levels: as the ambient illuminance decreases from 100 lux to 0.1 lux in extremely dark scenes, the accuracy curve of the present invention decreases the least (only about 8 pp), while the comparison method decreases by 20~35 pp, demonstrating the robustness advantage of the present invention in extremely low illuminance scenes; Figure 9 The graph shows the number of concurrent channels and inference latency: the horizontal axis represents the number of concurrent video channels from 10 to 200, and the vertical axis represents the average inference latency (ms). The system of this invention has an average latency of about 72ms when there are 200 concurrent channels, which is always lower than the engineering upper limit of 80ms. In contrast, the traditional serial inference scheme has already exceeded the upper limit when there are 50 channels, which shows the engineering advantages of the parallel scheduling architecture of this invention.
[0079] Figure 10This is a continuous monitoring graph of CPU / GPU resource usage over 72 hours. The blue curve represents CPU usage (average approximately 38%, upper limit 45% red line); the orange curve represents GPU usage (average approximately 68%, upper limit 75% red line). There were no sudden spikes or anomalies throughout the 72 hours, verifying the system's ability to operate stably over a long period. Figure 11 The inference latency distribution histogram and normal fitting curve show that the latency is concentrated in the range of 55~78ms. The fitted normal distribution shows that 97.6% of the request latency is below the 80ms threshold, which meets the industrial-grade real-time requirements and the tail latency is very rare. Figure 12 The bar chart compares the improvements in false alarm rate and false alarm rate. The left group represents the false alarm rate (original system vs. this invention), and the right group represents the false alarm rate. The chart shows the improvement percentages of 85% reduction in false alarm rate and 78% reduction in false alarm rate, reflecting the significant optimization of core KPIs in security scenarios. Figure 13 The curves show the convergence of loss for joint training and separate training. The solid line represents the joint training strategy of this invention, and the dashed line represents the baseline of separate training. Joint training converges at approximately the 15th epoch (separate training requires 30+ epochs), and the final loss value is lower, verifying the dual advantages of the joint optimization strategy in terms of training efficiency and final effect.
[0080] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A joint training method for low-light image enhancement, characterized in that, The method includes: Step 1: Obtain low-light training images and input them into the shared feature extraction layer to extract initial feature maps; Step 2: Based on the initial feature map, perform dynamic range expansion and overexposure suppression processing through an image enhancement network to generate an enhanced feature map; Step 3: Based on the enhanced feature map, target recognition and localization are performed through a target detection network to obtain target detection results containing target category, location coordinates, and depth estimation parameters; a set of key point coordinates of the target contour is extracted from the target detection results, and a minimum convex polygon is constructed based on the set of key point coordinates to determine the convex hull boundary; the area of the pixel region enclosed by the convex hull boundary is calculated to obtain the area feature, and the area feature is mapped to a three-dimensional space to construct a boss structure in combination with the depth estimation parameters, and the spatial volume of the boss structure is calculated to obtain the target geometric quantization feature; Step 4: Based on the enhanced feature map, target detection results, and target geometric quantization features, use a discriminator to compare domain distribution differences and combine them with detection errors to calculate the joint loss value; Step 5: Based on the joint loss value, jointly update the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network.
2. The joint training method for low-light image enhancement according to claim 1, characterized in that, Acquire low-light training images, input the low-light training images into a shared feature extraction layer, and extract an initial feature map, including: The original video frames were extracted from the park's surveillance video stream and then fused with low-light sample images from a public low-light dataset to construct the original image sequence. The original image sequence is subjected to pixel value normalization and resolution size standardization to obtain the preprocessed image; The preprocessed image is input into a shared feature extraction layer, which is composed of multiple layers of convolutional units and self-attention mechanism modules stacked alternately. The preprocessed image is processed by multi-layer convolutional units to extract local features, and the extracted local features are aggregated with global context information by the self-attention mechanism module to perform multi-layer nonlinear transformation to obtain multi-scale spatial features. The multi-scale spatial features are mapped to a unified number of channels, and an initial feature map with a consistent number of channels is output.
3. The joint training method for low-light image enhancement according to claim 2, characterized in that, Based on the initial feature map, an enhanced feature map is generated by performing dynamic range expansion and overexposure suppression processing through an image enhancement network, including: The initial feature map is input into the decomposition network, and low-frequency illumination component map and high-frequency reflection component map are obtained by convolutional filtering. Based on the low-frequency illumination component map, the noise residual is predicted through a reverse diffusion process to extend the dynamic range, thus obtaining the extended illumination component map. Based on the pixel brightness distribution of the extended illumination component map, an overexposed area mask is generated. The brightness of the bright areas of the extended illumination component map is suppressed using the overexposed area mask to obtain the processed illumination component map. The processed illumination component map and the high-frequency reflection component map are fused and reconstructed element by element to generate an enhanced feature map.
4. The joint training method for low-light image enhancement according to claim 3, characterized in that, Based on the enhanced feature map, a target detection network is used for target recognition and localization, yielding target detection results that include target category, location coordinates, and depth estimation parameters, including: The enhanced feature map is input into the object detection network encoder based on the Transformer architecture. The global context information of the enhanced feature map is aggregated through a multi-head self-attention mechanism to obtain the encoded feature sequence. The encoded feature sequence is input into the object detection network decoder, and the encoded features and query vector are fused through a cross-attention mechanism to obtain the decoded feature sequence. The decoded feature sequence is input into the classification prediction head, regression prediction head and depth estimation head respectively, and the target category probability distribution, bounding box coordinate offset and pixel-level depth estimation value are output in parallel. The target category is determined based on the target category probability distribution, the anchor box is corrected based on the bounding box coordinate offset to obtain the position coordinates, and the pixel-level depth estimate is used as the depth estimation parameter. The target category, location coordinates, and depth estimation parameters are combined to form the target detection result.
5. The joint training method for low-light image enhancement according to claim 4, characterized in that, Extract the set of key point coordinates of the target contour from the target detection results, and construct a minimum convex polygon based on the set of key point coordinates to determine the convex hull boundary, including: The target bounding box is parsed from the position coordinates of the target detection results, and the target mask region within the target bounding box is extracted; the edge of the target mask region is contour tracked to extract discrete key points that constitute the outer contour of the target, forming a set of key point coordinates; Based on the set of key point coordinates, the Graham scan algorithm is used to sort the key points by polar angle and perform stack operations to filter them, removing concave points and retaining convex points; the filtered convex points are connected to form a closed minimum convex polygon, and the set of edges of the minimum convex polygon is determined as the convex hull boundary.
6. The joint training method for low-light image enhancement according to claim 5, characterized in that, The area feature is obtained by calculating the pixel region enclosed by the convex hull boundary. This area feature is then mapped to a 3D space using depth estimation parameters to construct a boss structure. Finally, the spatial volume of the boss structure is calculated to obtain the target's geometric quantization features, including: The number of pixels contained inside the convex hull boundary is calculated, and the area of the pixel region enclosed by the convex hull boundary is calculated by combining the image resolution parameters, which is used as the area feature; the depth estimation parameters in the target detection results are read, the depth estimation parameters are used as the height component, and the area feature is used as the bottom component, and mapped to the three-dimensional space to construct a convex structure with height information. Based on the bottom and height components of the boss structure, a volume integral operation is performed to calculate the spatial volume of the boss structure; the spatial volume is encoded into a numerical vector as a target geometric quantization feature for joint loss calculation.
7. The joint training method for low-light image enhancement according to claim 6, characterized in that, Based on the enhanced feature map, target detection results, and target geometric quantization features, a discriminator is used to compare domain distribution differences and combine them with detection errors to calculate the joint loss value, including: The enhanced feature map is input into the discriminator, and the normal illumination reference feature map corresponding to the low-light training image is input into the discriminator as a benchmark sample for domain distribution comparison. The enhanced feature map and the normal illumination reference feature map are classified by a discriminator, and the probability scores of the enhanced feature domain and the normal feature domain are output. Based on the probability scores of the enhanced feature domain and the normal feature domain, the domain distribution difference loss value is calculated to quantify the degree of distribution alignment between the enhanced features and the normal illumination features. Based on the target detection results, the target geometric quantization features and the labeled ground truth values, the detection error loss value is calculated. The detection error loss value includes the category classification error, the location regression error and the depth estimation error. The joint loss value is obtained by weighted summation of the domain distribution difference loss value, the detection error loss value, and the image enhancement quality loss value.
8. The joint training method for low-light image enhancement according to claim 7, characterized in that, Based on the joint loss value, the model parameters of the shared feature extraction layer, image enhancement network, and object detection network are jointly updated, including: Backpropagation is performed on the joint loss value to obtain the gradient information of each network layer in the shared feature extraction layer, image enhancement network and object detection network. The gradient information is distributed to the corresponding model parameters of the shared feature extraction layer, image enhancement network, and object detection network according to the forward propagation path; The model parameter values of the shared feature extraction layer, image enhancement network, and object detection network are adjusted based on gradient information using an optimization algorithm; steps 1 to 5 are repeated until the joint loss value converges to a preset threshold, thus completing the joint training of the model.
9. The joint training method for low-light image enhancement according to claim 8, characterized in that, The optimization algorithm adjusts the model parameter values of the shared feature extraction layer, image enhancement network, and object detection network based on gradient information, including: Set the initial learning rate and learning rate decay strategy, and dynamically adjust the global learning rate of the optimization algorithm according to the current training round; The first and second moments of the gradient are calculated based on gradient information, and gradient clipping is performed to prevent gradient explosion, generating adaptive learning rate adjustment coefficients. By using the adaptive learning rate adjustment coefficient and the global learning rate, combined with the weight decay regularization term, the weight parameters and bias parameters of the shared feature extraction layer, image enhancement network, and object detection network are iteratively updated. After completing the parameter update for the current round, save the updated model parameter state as the initial input parameters for the shared feature extraction layer in the next training step 1.
10. A joint training system for low-light image enhancement, the apparatus implementing the method as described in any one of claims 1 to 9, characterized in that, include: The acquisition module is used to acquire low-light training images, input the low-light training images into the shared feature extraction layer, and extract the initial feature map; The enhancement module is used to generate an enhanced feature map by performing dynamic range expansion and overexposure suppression processing through an image enhancement network based on the initial feature map. The processing module is used to perform target recognition and localization through a target detection network based on the enhanced feature map, and obtain target detection results including target category, location coordinates and depth estimation parameters; Extract the set of key point coordinates of the target contour from the target detection results, construct the minimum convex polygon based on the set of key point coordinates to determine the convex hull boundary; calculate the area of the pixel region enclosed by the convex hull boundary to obtain the area feature, combine the depth estimation parameters to map the area feature to the three-dimensional space to construct the boss structure, and calculate the spatial volume of the boss structure to obtain the target geometric quantization feature; The calculation module is used to calculate the joint loss value based on the enhanced feature map, the target detection result and the target geometric quantization features, by using a discriminator to compare the domain distribution differences and combining the detection error. The update module is used to jointly update the model parameters of the shared feature extraction layer, the image enhancement network, and the object detection network based on the joint loss value.