Power image generation method and device based on adaptive component, equipment and medium
By generating illumination and reflection components using an adaptive component generation network (Ada-CGNet) and combining multi-scale feature fusion and gamma correction, the problem of detail recovery in power images under low illumination is solved, improving the visual quality and information usability of power inspection images.
Patent Information
- Application Number
- CN202511837743.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-17
AI Technical Summary
Existing low-light image enhancement technologies are difficult to effectively restore image details in power line inspections, especially under complex lighting conditions, which leads to artifacts and color distortion, affecting the accuracy of equipment defect identification.
An adaptive component generation network (Ada-CGNet) is used, which combines an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network to generate illumination and reflection components. The target power image is generated through gamma correction, and various loss functions are used for iterative optimization.
It achieves effective restoration of brightness and detail in power images, improves visual quality and information availability under low light conditions, and significantly enhances the visual effect of images.
Smart Images

Figure CN121685740A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing, in particular to a power image generation method and device based on adaptive components, equipment and medium. BACKGROUND
[0002] In the power inspection work, the images collected in the low light environment often have problems such as insufficient brightness and blurred details, which affect the accuracy of equipment defect identification. Low light image enhancement technology has become a key support to ensure the quality of inspection.
[0003] The existing low light image enhancement technology mainly includes three types: traditional image enhancement method, deep learning-based image enhancement method and hybrid image enhancement method. Traditional low light image enhancement methods such as histogram equalization, gamma correction, tone mapping and Retinex (an image processing theory) decomposition have limited effect in low light environment. Especially in power inspection images, the background is complex and the details are rich, so the traditional method often cannot effectively restore the details in the image, and is prone to color distortion and noise amplification. With the rapid development of deep learning, low light image enhancement methods based on convolutional neural networks have gradually become a research hotspot. Although these methods have made some progress in low light image enhancement, in the power scene, the existing technology still faces problems such as artifacts and loss of details, especially in complex lighting conditions, it is difficult to accurately restore the details of the image.
[0004] Therefore, how to effectively restore the brightness and details of the power image and improve the visual quality and information availability of the power image under low light conditions is a technical problem to be solved at present. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a power image generation method and device based on adaptive components, which can effectively restore the brightness and details of the power image and improve the visual quality and information availability of the power image under low light conditions. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a power image generation method based on adaptive components, comprising:
[0007] Generating a first illumination component and a reflection component based on an initial power image that meets a preset low light condition, a preset random noise image and a preset adaptive component generation network; the preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network;
[0008] determine a brightness value of the initial power image, and construct a brightness image about the initial power image based on the brightness value, train the first illumination component by using the brightness image, and obtain a second illumination component;
[0009] perform gamma correction on the second illumination component to obtain a third illumination component, and generate a target power image based on the third illumination component and the initial power image.
[0010] Optionally, the first illumination component and the reflection component are generated based on the initial power image satisfying a preset low-light condition, a preset random noise image, and a preset adaptive component generation network, and the method comprises:
[0011] In the preset adaptive component generation network, a first image feature is determined based on the preset random noise image and the initial power image;
[0012] A preset convolution operation is performed on the first image feature to obtain a second image feature;
[0013] The second image feature is processed based on an adaptive spatial reconstruction unit in the adaptive multi-scale residual convolution network to obtain a corresponding third image feature;
[0014] The third image feature is processed based on an adaptive channel reconstruction unit in the adaptive multi-scale residual convolution network to obtain a corresponding fourth image feature;
[0015] A first target feature is determined based on the fourth image feature, a preset activation function, and the first image feature;
[0016] The first target feature is processed based on the multi-scale feature fusion network to obtain the first illumination component and the reflection component.
[0017] Optionally, the second image feature is processed based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolution network to obtain the corresponding third image feature, and the method comprises:
[0018] A spatial feature of the second image feature is determined based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolution network;
[0019] A spatial mask is generated based on a gating network of the adaptive spatial reconstruction unit and the spatial feature;
[0020] In the adaptive spatial reconstruction unit, the spatial feature is divided into feature information representing an image feature and redundant information representing something other than the image feature by using a preset learnable threshold and the spatial mask;
[0021] In the adaptive spatial reconstruction unit, the feature information and the redundant information are fused based on a preset symmetric cross-reconstruction strategy for feature fusion, to obtain a corresponding third image feature.
[0022] Optionally, the third image feature is processed based on an adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network, to obtain a corresponding fourth image feature, including:
[0023] The third image feature is subjected to a preset group convolution operation and a preset point-by-point convolution operation based on an adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network, to obtain a corresponding processed feature.
[0024] In the adaptive channel reconstruction unit, the processed feature is processed using a preset non-local attention mechanism and a preset SE attention mechanism, to obtain a corresponding fourth image feature.
[0025] Optionally, the first target feature is processed based on the multi-scale feature fusion network, to obtain a first illumination component and a reflection component, including:
[0026] The first target feature is subjected to sampling, alignment and matching operations based on the multi-scale feature fusion network, to obtain a second target feature.
[0027] In the multi-scale feature fusion network, the second target feature is weightedly fused using a preset channel attention mechanism, to obtain a corresponding first illumination component and a reflection component.
[0028] Optionally, after the first illumination component and the reflection component are generated based on the initial power image meeting the preset low-light condition, the preset random noise image and the preset adaptive component generation network, the method further includes:
[0029] A weight factor is determined based on gradient information of the reflection component, and a smoothing loss function for smoothing illumination is constructed using the weight factor;
[0030] The first illumination component is trained using the smoothing loss function.
[0031] Optionally, the power image generation method based on adaptive components further includes:
[0032] An mean squared error loss function is constructed based on the first illumination component, the reflection component and the initial power image;
[0033] A reconstructed image corresponding to the initial power image is generated using the mean squared error loss function and based on the first illumination component and the reflection component;
[0034] obtaining a corresponding comparison result by comparing the similarity of the reconstructed image and the initial power image;
[0035] If the comparison result indicates that the similarity does not satisfy a preset similarity condition, the step of generating the first illumination component and the reflection component based on the initial power image satisfying the preset low-light condition, the preset random noise image and the preset adaptive component generation network is re-executed.
[0036] In a second aspect, the present application provides an adaptive component-based power image generation device, comprising:
[0037] A component generation module is configured to generate a first illumination component and a reflection component based on an initial power image satisfying a preset low-light condition, a preset random noise image and a preset adaptive component generation network; the preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolution network and a multi-scale feature fusion network;
[0038] A component training module is configured to determine a brightness value of the initial power image, construct a brightness image about the initial power image based on the brightness value, train the first illumination component using the brightness image, and obtain a second illumination component;
[0039] An image generation module is configured to perform gamma correction on the second illumination component to obtain a third illumination component, and generate a target power image based on the third illumination component and the initial power image.
[0040] In a third aspect, the present application provides an electronic device, comprising:
[0041] A memory is configured to save a computer program;
[0042] A processor is configured to execute the computer program to implement the aforementioned adaptive component-based power image generation method.
[0043] In a fourth aspect, the present application provides a computer readable storage medium configured to save a computer program; wherein the computer program is executed by a processor to implement the aforementioned adaptive component-based power image generation method.
[0044] In the present application, based on the initial power image meeting the preset low light condition, the preset random noise image and the preset adaptive component generation network, the first light component and the reflection component are generated; the preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolution network and a multi-scale feature fusion network; the brightness value of the initial power image is determined, and a brightness image about the initial power image is constructed based on the brightness value, the first light component is trained by using the brightness image, and a second light component is obtained; the second light component is gamma corrected to obtain a third light component, and a target power image is generated based on the third light component and the initial power image. As can be seen from the above, in the present application, according to the initial power image meeting the preset low light condition, the preset random noise image and the preset adaptive component generation network, the first light component and the reflection component are generated; the preset adaptive component generation network is constructed based on an adaptive multi-scale residual convolution network and a multi-scale feature fusion network; first, the brightness value of the initial power image is determined, then a brightness image corresponding to the initial power image is constructed based on the brightness value, the first light component is trained by using the brightness image, and a second light component is obtained; the second light component is gamma corrected to obtain a third light component, and a target power image is generated based on the third light component and the initial power image. In this way, by componentizing the image and adaptive feature processing, the present application can effectively recover the brightness and details of the power image, and improve the visual quality and information availability of the power image under low light conditions. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.
[0046] Figure 1 A flow chart of a power image generation method based on adaptive components disclosed by the present application;
[0047] Figure 2 An algorithm framework diagram of a power image generation method based on adaptive components disclosed by the present application;
[0048] Figure 3 An AMSRConv module structure diagram disclosed by the present application;
[0049] Figure 4 An MCPF module structure diagram disclosed by the present application;
[0050] Figure 5 This is a schematic diagram of the structure of an adaptive component-based power image generation device disclosed in this application;
[0051] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] Currently, traditional low-light image enhancement methods such as histogram equalization, gamma correction, tone mapping, and Retinex decomposition have limited effectiveness in low-light environments, especially in power line inspection images where the background is complex and rich in detail. Traditional methods often struggle to effectively recover image details and are prone to color distortion and noise amplification. With the rapid development of deep learning, low-light image enhancement methods based on convolutional neural networks have gradually become a research hotspot. Although these methods have made some progress in low-light image enhancement, existing technologies still face problems such as artifacts and detail loss in power line scenarios, especially under complex lighting conditions, making it difficult to accurately recover image details. To address this, this application provides a power image generation method, apparatus, device, and medium based on adaptive components, which can effectively recover the brightness and details of power images, improving the visual quality and information usability of power images under low-light conditions.
[0054] See Figure 1 As shown, this embodiment of the invention discloses a method for generating power images based on adaptive components, including:
[0055] Step S11: Generate a first illumination component and a reflection component based on an initial power image that meets preset low illumination conditions, a preset random noise image, and a preset adaptive component generation network; the preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network.
[0056] In this embodiment, an initial power image that meets preset low-light conditions is first acquired. The preset low-light conditions refer to an overall brightness or illuminance in a specific area of the image that is below a threshold condition sufficient to clearly identify the state and structure of power equipment. In actual power inspection scenarios, due to factors such as inspection time (e.g., nighttime), ambient weather, or equipment location, the acquired power equipment images often exhibit problems such as insufficient lighting, low contrast, and blurred details. Such images can be determined to meet the preset low-light conditions. After acquiring the initial power image, it is input together with a preset random noise image into a preset adaptive component generation network for processing. The preset random noise image is typically a noise map generated by a standard Gaussian distribution or a uniform distribution. Its purpose is to introduce a certain degree of randomness and diversity into the network, helping the network avoid getting trapped in local optima during training and inference, and enhancing the adaptability and robustness of the generation model to different low-light degradation modes.
[0057] It should be noted that the preset adaptive component generation network is the core component of this method. Structurally, it integrates an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network, aiming to collaboratively complete the complex task of decoupling and enhancing illumination and reflection information from low-light images.
[0058] Specifically, in the preset adaptive component generation network, a first image feature is determined based on a preset random noise image and an initial power image; a preset convolution operation is performed on the first image feature to obtain a second image feature; the second image feature is processed based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolutional network to obtain a corresponding third image feature. Specifically, the determination process of the third image feature involves: determining the spatial features of the second image feature based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolutional network; generating a spatial mask based on the gating network of the adaptive spatial reconstruction unit and the spatial features; in the adaptive spatial reconstruction unit, using a preset learnable threshold and the spatial mask, dividing the spatial features into feature information representing the image features and redundant information representing information other than the image features; and in the adaptive spatial reconstruction unit, fusing the feature information and the redundant information based on a preset symmetric cross-reconstruction strategy for feature fusion to obtain the corresponding third image feature.
[0059] Furthermore, the third image feature is processed by the adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network to obtain the corresponding fourth image feature. Specifically, the determination of the fourth image feature involves performing a preset group convolution operation and a preset pointwise convolution operation on the third image feature using the adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network to obtain the corresponding processed feature. In the adaptive channel reconstruction unit, the processed feature is processed using a preset non-local attention mechanism and a preset Squeeze-and-Excitation (SE) attention mechanism to obtain the corresponding fourth image feature.
[0060] After obtaining the fourth image feature, a first target feature is determined based on the fourth image feature, a preset activation function, and the first image feature. The first target feature is then processed by the multi-scale feature fusion network to obtain a first illumination component and a reflection component. Specifically, the determination of the first illumination component and reflection component involves sampling, aligning, and matching the first target feature using the multi-scale feature fusion network to obtain a second target feature. Within the multi-scale feature fusion network, a preset channel attention mechanism (CA attention mechanism) is used to weight and fuse the second target feature to obtain the corresponding first illumination component and reflection component. The first illumination component primarily estimates the illumination distribution and intensity information in the image, while the reflection component mainly includes the inherent attribute information of the power equipment itself, such as its material, color, and texture.
[0061] After generating the first illumination component and the reflection component, in order to ensure that the generated first illumination component has physical rationality, in this embodiment, a corresponding weight factor is determined based on the gradient information of the reflection component, and a smoothing loss function for smoothing illumination is constructed using the weight factor; the first illumination component is trained using the smoothing loss function, thereby guiding the network to generate illumination estimates that are more consistent with natural illumination characteristics and well decoupled from reflection details.
[0062] Meanwhile, to ensure that the generated first illumination component and reflection component can accurately reconstruct the original input image and verify the effectiveness of its decoupling, in this embodiment, a mean squared error loss function is constructed based on the first illumination component, the reflection component, and the initial power image; a reconstructed image corresponding to the initial power image is generated using the mean squared error loss function and based on the first illumination component and the reflection component; the similarity between the reconstructed image and the initial power image is compared to obtain the corresponding comparison result; if the comparison result shows that the similarity does not meet the preset similarity condition, the process jumps back to the step of generating the first illumination component and reflection component based on the initial power image that meets the preset low illumination condition, the preset random noise image, and the preset adaptive component generation network, thereby performing a new round of iterative optimization until the generated components can meet the reconstruction accuracy requirements, thereby ensuring that the network learns an effective and reliable feature decoupling representation.
[0063] Step S12: Determine the brightness value of the initial power image, construct a brightness image of the initial power image based on the brightness value, and train the first illumination component using the brightness image to obtain the second illumination component.
[0064] In this embodiment, after obtaining the first illumination component, it needs to be further optimized to make it more closely resemble the actual illumination distribution.
[0065] First, the brightness information of each pixel in the initial power image can be extracted, i.e., the brightness value can be determined. Then, based on these brightness values, a brightness image with the same spatial dimensions as the initial power image is constructed. This image centrally represents the true distribution of light intensity in the original scene. Next, using the brightness image as a supervisory signal, an appropriate loss function is constructed to calculate the difference between the first illumination component and the brightness image. This loss is then used to fine-tune the network parameters generating the first illumination component or directly to the component itself through backpropagation. This training process aims to ensure that the first illumination component, while maintaining its structural smoothness and rationality, approximates the overall distribution and intensity level of the true brightness image, thereby obtaining a more accurate and reliable optimized illumination estimate, i.e., the second illumination component.
[0066] Step S13: Perform gamma correction on the second illumination component to obtain the third illumination component, and generate a target power image based on the third illumination component and the initial power image.
[0067] In this embodiment, after obtaining the second illumination component, in order to more flexibly adjust the visual contrast and brightness of the final image, a gamma correction operation is introduced to perform a nonlinear transformation on it, thereby remapping the intensity distribution of the illumination, highlighting details in dark areas or suppressing overexposed areas, and obtaining an adaptively enhanced third illumination component.
[0068] Finally, a final target power image is generated based on the third illumination component and the initial power image. This image maintains the realism of the device's structural details while achieving a significant improvement in illumination conditions and a comprehensive enhancement in visual quality.
[0069] As can be seen from the above, in this application, a first illumination component and a reflection component are generated based on an initial power image that meets preset low-light conditions, a preset random noise image, and a preset adaptive component generation network. The preset adaptive component generation network is constructed based on an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network. First, the brightness value of the initial power image is determined, and then a brightness image corresponding to the initial power image is constructed based on this brightness value. The first illumination component is trained using the brightness image to obtain a second illumination component. A gamma correction operation is performed on the second illumination component to obtain a third illumination component. Then, the third illumination component and the initial power image are combined to generate a target power image. In this way, by performing fractional generation and adaptive feature processing on the image, this application can effectively restore the brightness and details of the power image, improving the visual quality and information usability of the power image under low-light conditions.
[0070] The following is combined Figure 2 The schematic diagram shown illustrates the technical solution of the embodiments of this application in detail.
[0071] Reference Figure 2 As shown, this application can be broadly divided into two parts: a Retinex decomposition stage based on adaptive component generation and an illumination image enhancement stage. In the first stage, based on the random noise image... and The potential illumination components of the image are generated separately using an Adaptive Component Generation Network (Ada-CGNet). and reflection component The Retinex decomposition is achieved through an iterative optimization process using the loss function. In the second stage, gamma correction is applied to adjust the generated illumination components to obtain the illumination map. Finally, the original image And the adjusted lighting diagram Element-by-element division is performed to obtain the final reflection component as the enhanced output, thereby improving the brightness and restoring the details of the image.
[0072] This application achieves the separation of illumination and reflection components within the Retinex theoretical framework. Unlike traditional methods that rely on constructing explicit mathematical models or large amounts of paired training data for decomposition, this method employs an adaptive component generation network, Ada-CGNet, to directly separate the illumination and reflection components from random noise. and Light components are generated from the input. and reflection component The illumination component generation network and the reflection component generation network use the same basic structure, but the latter has a deeper network because the reflection component network needs to capture the detailed textures and inherent properties in the image, requiring deeper feature representation and detail recovery, hence the higher number of network layers. Finally, during the network iterative optimization process, multiple constraints such as image reconstruction loss, illumination smoothing loss, reflection loss, and illumination consistency loss are jointly introduced to achieve joint optimization of the illumination and reflection components. This ensures that the generated illumination and reflection components are independent and physically consistent in terms of illumination distribution and structural details, thereby achieving high-precision decomposition of low-light images.
[0073] To further improve the generation quality of illumination and reflection components and the network's feature representation capabilities, this invention introduces an Adaptive Multi-Scale Residual Convolution (AMSRConv) module and a Multi-scale Contextual Perception Fusion (MCPF) module into the encoder and decoder structures. The AMSRConv module enhances the network's perception of different feature levels and detailed regions by implementing multi-scale adaptive feature extraction across spatial and channel dimensions. The MCPF module achieves cross-scale feature fusion and perceptual consistency during feature transfer between the encoder and decoder, effectively improving the smoothness of the illumination component and the structural fidelity of the reflection component. Through this design, the network can generate more accurate and natural illumination and reflection components under unsupervised conditions, providing a high-quality input foundation for subsequent illumination enhancement stages.
[0074] To address issues such as uneven illumination distribution and mixing of details and background in low-light images, this application introduces the adaptive multi-scale residual convolution module AMSRConv into the encoding stage of Ada-CGNet. For example... Figure 3As shown, this module includes an Adaptive Spatial Reconstruction Unit (ASRU) and an Adaptive Channel Reconstruction Unit (ACRU). Through the collaborative reconstruction of spatial and channel dimensions, it enhances the network's ability to perceive and integrate features of different brightness levels and detail regions, thereby generating more accurate illumination and reflection components.
[0075] Specifically, ASRU focuses on feature optimization in the spatial dimension. First, it extracts spatial information at different scales through multi-scale convolution and uses a gated network to generate a spatial importance mask of the same size as the input features. Then, combined with a learnable threshold, it adaptively divides feature pixels into information regions (containing key feature information) and redundant regions (containing noise or irrelevant background). Finally, it fuses the features of the two regions through a symmetrical cross-reconstruction strategy, which can retain the core features of the information region and absorb the complementary information of the redundant region, thereby avoiding the loss of details caused by single selection. ACRU, on the other hand, focuses on feature enhancement in the channel dimension. It dynamically allocates channel resources through learnable parameters (the upper path focuses on global semantics, and the lower path retains local details), combines a lightweight global module to capture cross-space channel correlations, and then strengthens key feature channels through channel reweighting. With the help of robust residual connections to adapt to different feature scales, it ultimately achieves efficient utilization of channel resources and improved feature discriminativeness.
[0076] Through the synergistic effect of ASRU and ACRU, the AMSRConv module can adaptively optimize feature representation in both spatial and channel dimensions, resulting in smooth and natural illumination components and rich detail in reflection components, providing a high-quality input foundation for subsequent illumination enhancement stages.
[0077] The Multi-Scale Perception Feature Fusion (MCPF) module is mainly used to integrate cross-scale features and achieve perceptual consistency between the encoder and decoder, thereby enhancing the network's ability to understand global and local information about illumination and reflection components.
[0078] The structure of MCPF is as follows Figure 4As shown, MCPF first performs multi-scale sampling and alignment of feature maps from different coding layers, matching high-level semantic features with low-level detail features in terms of spatial resolution and semantic scale. Then, a channel attention mechanism is used to weightedly fuse features at each scale, enabling the network to adaptively focus on regions more important for illumination distribution and texture details. Furthermore, residual connections and lightweight convolution operations are introduced within the module to effectively preserve original feature information while achieving a smooth transition between cross-scale features. Finally, the features upsampled from the decoder are added to the module, achieving deep coupling between the encoder's multi-scale features and the decoder's current-level features. This allows the decoder to inherit both the encoder's global semantics and local detail information in subsequent processing, while maintaining the continuity and consistency of its own features. This ensures the accurate transmission of the integrated multi-scale perceptual features to the next level, providing a collaboratively enhanced feature foundation for global smooth modeling of the illumination component and fine-detail recovery of the reflection component.
[0079] Furthermore, in order to generate a better target power image, this application constructs a composite loss function, which includes image reconstruction loss, illumination consistency loss, illumination smoothing loss, and reflection loss.
[0080] To ensure that the illumination and reflection components generated by the model accurately reproduce the visual characteristics of the original image, an image reconstruction loss based on mean-square error (MSE) is introduced for image reconstruction loss. The corresponding mean squared error loss function is shown below:
[0081] ;
[0082] In the formula, This represents the lighting components generated by the model; This represents the reflection component generated by the model; Represents the square of the L2 norm; This represents a pixel-wise dot product. Minimizing this term helps to ensure that the reconstructed image is highly consistent with the input image at the pixel level.
[0083] For illumination uniformity loss To ensure that the illumination components generated by the network maintain a structural distribution consistent with the brightness distribution of the original image, the initial brightness is first estimated by using the maximum values of each pixel in the RGB (Red-Green-Blue) channels, thus constructing an initial illumination map for the entire image. , The calculation formula is as follows:
[0084] ;
[0085] In the formula, Represents pixels The initial brightness at that location; Represents pixels in an image The values in the three RGB channels;
[0086] The illumination components generated by the network are subjected to structural consistency constraints with the initial illuminance map. The corresponding illumination consistency loss function is shown below:
[0087] ;
[0088] In the formula, This represents the L1 norm.
[0089] To reduce noise and increase smoothness in the reflection component, a total variational regularization term is introduced as the reflection loss. The formula for the reflection loss function is shown below:
[0090] ;
[0091] In the formula, This represents the first-order gradient operator.
[0092] For illumination smoothing loss, the ideal illumination component should remain smooth over most of the area, changing only at significant edges. Therefore, illumination smoothing loss is introduced. The formula for the illumination smoothing loss function is shown below:
[0093] ;
[0094] In the formula, This is the gradient line weight factor, and The calculation formula is as follows:
[0095] ;
[0096] In the formula, Indicates horizontal and vertical gradients.
[0097] Therefore, the formula for the overall loss function of the model is as follows:
[0098] ;
[0099] In the formula, These are the weighting coefficients for each loss term.
[0100] Furthermore, the generated illumination component only reflects the illumination distribution of the original low-light image and is insufficient for direct enhancement. Gamma correction is required, and the corresponding calculation formula is shown below:
[0101] ;
[0102] In the formula, This indicates the adjusted light component; This represents the correction factor.
[0103] Finally, the input low-light image and corrected illumination components pass The enhanced result, i.e., the target power image, can be obtained by calculating using the formula. Among other things, This represents the RGB color channels of the image.
[0104] As can be seen, this application generates illumination and reflection components from random noise input using the adaptive component generation network Ada-CGNet, and iteratively optimizes this by combining various loss functions to achieve adaptive enhancement of a single low-light image without requiring training on a large number of paired datasets. Furthermore, this application proposes an adaptive multi-scale residual convolution module AMSRConv and a multi-scale perceptual feature fusion module MCPF to achieve adaptive reconstruction of multi-scale features in spatial and channel dimensions and cross-scale feature fusion. This results in a smooth and natural illumination component and rich detail in the reflection component, effectively restoring image texture and structural information in complex power scenes, and significantly improving the detail fidelity and visual quality of the enhanced image.
[0105] Accordingly, see Figure 5 As shown, this application provides an adaptive component-based power image generation apparatus, comprising:
[0106] The component generation module 11 is used to generate a first illumination component and a reflection component based on an initial power image that meets preset low illumination conditions, a preset random noise image, and a preset adaptive component generation network; the preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network.
[0107] The component training module 12 is used to determine the brightness value of the initial power image, construct a brightness image about the initial power image based on the brightness value, and train the first illumination component using the brightness image to obtain the second illumination component.
[0108] The image generation module 13 is used to perform gamma correction on the second illumination component to obtain a third illumination component, and generate a target power image based on the third illumination component and the initial power image.
[0109] In some specific embodiments, the component generation module 11 specifically includes:
[0110] The first feature determination unit is used to determine the first image features based on the preset random noise image and the initial power image in the preset adaptive component generation network;
[0111] The second feature determination unit is used to perform a preset convolution operation on the first image features to obtain the second image features;
[0112] The third feature determination unit is used to process the second image features based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolutional network to obtain the corresponding third image features.
[0113] The fourth feature determination unit is used to process the third image features based on the adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network to obtain the corresponding fourth image features.
[0114] The target feature determination unit is used to determine the first target feature based on the fourth image feature, the preset activation function, and the first image feature;
[0115] The component determination unit is used to process the first target features based on the multi-scale feature fusion network to obtain the first illumination component and the reflection component.
[0116] In some specific embodiments, the third feature determining unit specifically includes:
[0117] The spatial feature determination subunit is used to determine the spatial features of the second image feature based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolutional network.
[0118] A mask generation subunit is used to generate a spatial mask based on the gating network of the adaptive spatial reconstruction unit and the spatial features;
[0119] The feature segmentation subunit is used in the adaptive spatial reconstruction unit to divide the spatial features into feature information representing image features and redundant information representing other than the image features by using a preset learnable threshold and the spatial mask.
[0120] The information fusion subunit is used in the adaptive spatial reconstruction unit to fuse the feature information and the redundant information based on a preset symmetric cross reconstruction strategy for feature fusion to obtain the corresponding third image features.
[0121] In some specific embodiments, the fourth feature determining unit specifically includes:
[0122] The first feature processing subunit is used to perform preset group convolution operation and preset point-by-point convolution operation on the third image features based on the adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network to obtain the corresponding processed features.
[0123] The second feature processing subunit is used in the adaptive channel reconstruction unit to process the processed features using a preset non-local attention mechanism and a preset SE attention mechanism to obtain the corresponding fourth image features.
[0124] In some specific embodiments, the component determination unit specifically includes:
[0125] The third feature processing subunit is used to perform sampling, alignment and matching operations on the first target feature based on the multi-scale feature fusion network to obtain the second target feature;
[0126] The feature fusion subunit is used in the multi-scale feature fusion network to perform weighted fusion of the second target features using a preset channel attention mechanism to obtain the corresponding first illumination component and reflection component.
[0127] In some specific embodiments, the component generation module 11 further includes:
[0128] The first function construction unit is used to determine the corresponding weighting factor based on the gradient information of the reflection component, and to construct a smoothing loss function for smoothing illumination using the weighting factor.
[0129] The component training unit is used to train the first illumination component using the smoothing loss function.
[0130] In some specific embodiments, the adaptive component-based power image generation device further includes:
[0131] The second function construction unit is used to construct a mean squared error loss function based on the first illumination component, the reflection component, and the initial power image.
[0132] An image generation unit is used to generate a reconstructed image corresponding to the initial power image using the mean square error loss function and based on the first illumination component and the reflection component.
[0133] An image comparison unit is used to compare the similarity between the reconstructed image and the initial power image to obtain the corresponding comparison results;
[0134] The step jump unit is used to jump back to the step of generating the first illumination component and reflection component based on the initial power image that meets the preset low illumination conditions, the preset random noise image, and the preset adaptive component generation network if the comparison result shows that the similarity does not meet the preset similarity conditions.
[0135] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the adaptive component-based power image generation method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0136] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0137] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0138] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the adaptive component-based power image generation method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0139] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned adaptive component-based power image generation method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0140] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0141] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0142] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0143] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0144] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for adaptive component-based power image generation, characterized in that, The method comprises the steps of: generating a first illumination component and a reflection component based on an initial power image meeting a preset low-light condition, a preset random noise image, and a preset adaptive component generation network; the preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolutional network and a multi-scale feature fusion network; determining the brightness value of the initial power image, and constructing a brightness image about the initial power image based on the brightness value, training the first illumination component using the brightness image to obtain a second illumination component; gamma correcting the second illumination component to obtain a third illumination component, and generating a target power image based on the third illumination component and the initial power image. 2.The adaptive component-based power image generation method of claim 1, wherein, The method comprises the steps of: in the preset adaptive component generation network, determining a first image feature based on the preset random noise image and the initial power image; performing a preset convolution operation on the first image feature to obtain a second image feature; processing the second image feature based on an adaptive spatial reconstruction unit in the adaptive multi-scale residual convolutional network to obtain a corresponding third image feature; processing the third image feature based on an adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network to obtain a corresponding fourth image feature; determining a first target feature based on the fourth image feature, a preset activation function, and the first image feature; processing the first target feature based on the multi-scale feature fusion network to obtain the first illumination component and the reflection component. 3.The adaptive component-based power image generation method of claim 2, wherein, The method comprises the steps of: determining a spatial feature of the second image feature based on the adaptive spatial reconstruction unit in the adaptive multi-scale residual convolutional network; generating a spatial mask based on a gating network of the adaptive spatial reconstruction unit and the spatial feature; in the adaptive spatial reconstruction unit, dividing the spatial feature into feature information representing image features and redundant information representing features other than the image features using a preset learnable threshold and the spatial mask; in the adaptive spatial reconstruction unit, fusing the feature information and the redundant information based on a preset symmetric cross-reconstruction strategy for feature fusion to obtain a corresponding third image feature. 4.The adaptive component-based power image generation method of claim 2, wherein, The method comprises the steps of: performing a preset group convolution operation and a preset point-by-point convolution operation on the third image feature based on the adaptive channel reconstruction unit in the adaptive multi-scale residual convolutional network to obtain a corresponding processed feature; in the adaptive channel reconstruction unit, processing the processed feature using a preset non-local attention mechanism and a preset SE attention mechanism to obtain a corresponding fourth image feature. 5.The adaptive component-based power image generation method of claim 2, wherein, The first target feature is processed based on the multi-scale feature fusion network to obtain a first illumination component and a reflection component, including: The first target feature is sampled, aligned and matched based on the multi-scale feature fusion network to obtain a second target feature; In the multi-scale feature fusion network, the second target feature is weighted and fused using a preset channel attention mechanism to obtain a corresponding first illumination component and reflection component. 6.The adaptive component-based power image generation method of claim 1, wherein, After the first illumination component and the reflection component are generated based on the initial power image meeting the preset low-light condition, the preset random noise image and the preset adaptive component generation network, the method further includes: A weight factor is determined based on gradient information of the reflection component, and a smoothing loss function for smoothing illumination is constructed using the weight factor; The first illumination component is trained using the smoothing loss function.
7. The adaptive-component-based power image generation method according to any one of claims 1 to 6, characterized by, The method further includes: An mean square error loss function is constructed based on the first illumination component, the reflection component and the initial power image; A reconstructed image corresponding to the initial power image is generated based on the first illumination component and the reflection component using the mean square error loss function; A comparison result is obtained by comparing the similarity of the reconstructed image and the initial power image; If the comparison result indicates that the similarity does not meet a preset similarity condition, the step of generating the first illumination component and the reflection component based on the initial power image meeting the preset low-light condition, the preset random noise image and the preset adaptive component generation network is re-executed.
8. An adaptive component-based power image generation apparatus, characterized by, The method includes: A component generation module is configured to generate a first illumination component and a reflection component based on an initial power image meeting a preset low-light condition, a preset random noise image and a preset adaptive component generation network; The preset adaptive component generation network is a network constructed based on an adaptive multi-scale residual convolution network and a multi-scale feature fusion network; A component training module is configured to determine a brightness value of the initial power image, construct a brightness image about the initial power image based on the brightness value, and train the first illumination component using the brightness image to obtain a second illumination component; An image generation module is configured to perform gamma correction on the second illumination component to obtain a third illumination component, and generate a target power image based on the third illumination component and the initial power image.
9. An electronic device, comprising: The method includes: A memory is configured to save a computer program; A processor is configured to execute the computer program to implement the adaptive component-based power image generation method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A memory is configured to save a computer program; wherein the computer program is executed by a processor to implement the adaptive component-based power image generation method of any one of claims 1 to 7.