A fixed scene-oriented gradient descent scene consistency adjustment method
By using a dual-branch multi-input neural network model and a joint loss function of color difference and texture similarity, the color mapping relationship between the benchmark image and the image to be adjusted is directly fitted, solving the problem of color consistency adjustment in complex fixed scenes and achieving high-precision cross-scene adaptive image color adjustment.
Patent Information
- Application Number
- CN202511308174.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-15
AI Technical Summary
Existing technologies suffer from insufficient color matching accuracy and limited scene adaptability in adjusting image color consistency in complex and fixed scenes.
A dual-branch multi-input neural network model is adopted, which fuses features through stepwise downsampling of the encoder and upsampling of the decoder. Combined with the color difference-texture similarity joint loss function, the gradient descent algorithm is used to optimize the neural network parameters and directly fit the color mapping relationship between the reference image and the image to be adjusted.
It achieves image color consistency adjustment in multiple scene types, avoiding the problem of poor adjustment effect caused by pre-trained models not having seen images of specific scenes. It has wide applicability and can be applied to color difference adjustment of remote sensing images and fixed cameras across scene types.
Smart Images

Figure CN120807333B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of image color processing and computer vision technology, and in particular to a gradient descent scene consistency adjustment method for fixed scenes. Background Technology
[0002] In the field of image acquisition and processing, color consistency adjustment of images in fixed scenes is a key technical requirement. Whether it is remote sensing monitoring or security surveillance, due to differences in shooting equipment (such as different models of sensors and cameras) and shooting conditions (such as light intensity, weather conditions, and shooting time), images of the same scene may exhibit problems such as inconsistent color distribution, blurred or distorted details, which seriously affect the accuracy and reliability of subsequent image analysis.
[0003] Currently, existing technologies for color consistency adjustment in image scenes can be mainly divided into two categories: one is traditional correction methods, including algorithms based on the gray-scale world hypothesis, white balance adjustment, and histogram matching. Their limitation lies in their reliance on manually set empirical parameters, lack of adaptive learning ability, and low color matching accuracy. The other category is neural network-based color adjustment methods, characterized by training on large amounts of data with fixed model weights after training. Their limitation is that they are only adaptable to specific scenes and have poor adaptability to general scenes. If the application scene differs significantly from the training data scene, the adjustment effect may be poor due to the lack of similar image data for training (e.g., remote sensing color adjustment models cannot be used for day / night color adjustment). In summary, existing technologies still face problems of insufficient color matching accuracy and limited scene adaptability in color consistency adjustment under complex and fixed scenes. Summary of the Invention
[0004] Based on this, this application provides a gradient descent scene consistency adjustment method for fixed scenes to address the problems of insufficient color matching accuracy and limited scene adaptability in the existing technology for color consistency adjustment in complex fixed scenes.
[0005] This application provides a gradient descent scenario consistency adjustment method for fixed scenarios, including:
[0006] Acquire image data to obtain a baseline image and an image to be adjusted;
[0007] The reference image and the image to be adjusted are concatenated along the channel dimension to form a dual-input joint feature. The dual-input joint feature is then input into a dual-branch multi-input neural network model. Feature fusion is performed through step-wise downsampling of the encoder and upsampling of the decoder to output a preliminary adjusted image.
[0008] Using the color difference-texture similarity joint loss function, the color difference loss between the preliminary adjusted image and the reference image and the structural similarity loss between the preliminary adjusted image and the image to be adjusted are calculated. The color difference loss and the structural similarity loss are weighted and fused to obtain the total loss value.
[0009] Based on the total loss value, the gradient descent algorithm is used to iteratively optimize the neural network parameters; when the optimization termination condition is met, the final adjusted image is output.
[0010] The acquisition of the reference image includes,
[0011] In a fixed scene, a single high-quality image is used as the baseline image; meanwhile, in the same scene, images obtained by changing the acquisition parameters are used as the images to be adjusted.
[0012] The dual-branch multi-input neural network model includes an encoder and a decoder.
[0013] The encoder performs step-down sampling encoding on the reference image and the image to be adjusted to extract local and global features. During the downsampling process, the global and local features of the reference image and the image to be adjusted are abstracted and encoded, and intermediate features carrying different spatial scales are output through different downsampling levels.
[0014] Based on the feature differences between the base image and the image to be adjusted extracted by encoding, the decoder learns the color mapping relationship from the image to be adjusted to the base image step by step through upsampling and cross-stage feature fusion. Then, using the learned color mapping relationship, the features abstracted by the encoder stage are restored to the color-adjusted image data.
[0015] The color difference-texture similarity joint loss function uses the gradient feedback of the color difference loss to drive the network to adjust the color mapping relationship, so that the overall color distribution of the image to be adjusted approaches that of the reference image. At the same time, the color difference-texture similarity joint loss function, through the constraint of the texture similarity loss, forces the network to retain the structural information of the edge contours and texture details of the original image during color conversion.
[0016] Let the reference image be The image to be adjusted is The adjusted image output after processing by the neural network model is ;
[0017] Color difference loss function The calculations include,
[0018] ;
[0019] Where H represents the height of the image, W represents the width of the image, 3 represents the number of RGB channels, i represents the image number in the height direction, j represents the image number in the width direction, and c represents the numbers of the three RGB color channels.
[0020] The calculation of the texture similarity loss function includes,
[0021] The image to be adjusted and the preliminary adjusted image output after processing by the neural network model are both converted into grayscale images. and The Sobel operator is used to extract texture from grayscale images;
[0022] The Sobel operator in the x-direction is defined as follows:
[0023] ;
[0024] The Sobel operator in the y-direction is defined as follows:
[0025] ;
[0026] Texture map of the grayscale image to be adjusted The extraction includes,
[0027] ;
[0028] Initial adjustment of the grayscale texture map of the image The extraction includes,
[0029] .
[0030] Texture map of the grayscale image to be adjusted Texture map of grayscale image and initial image adjustment Perform global Softmax normalization to compress the texture value range to [0,1];
[0031] ;
[0032] ;
[0033] in, The texture probability map represents the grayscale image of the image to be adjusted for normalization. The texture probability map of the grayscale image represents the initial normalized image, where exp represents the exponential function with the natural constant e as the base, i represents the image height index, and j represents the image width index.
[0034] The difference in normalized texture maps is measured by MSE (Mean Separation Estimate), which constrains the consistency of texture structure between the initially adjusted image and the image to be adjusted, thus yielding the texture similarity loss. ,
[0035] .
[0036] Total loss value The calculations include,
[0037] The color difference loss and texture similarity loss are weighted and fused to obtain the total loss value. ,
[0038] ;
[0039] in, , All of these represent weighting coefficients.
[0040] The conditions for determining the termination of optimization include:
[0041] After each iteration, it is determined whether the optimization termination condition is met. If the number of iterations reaches the maximum set value, the iteration stops; otherwise, the iteration continues to optimize the neural network parameters.
[0042] Beneficial effects: This application directly uses the reference image and the image to be adjusted in a fixed scene to perform iterative optimization of model parameters, directly fitting the specific color mapping relationship between actual data. It does not rely on a pre-trained model, effectively avoiding the problem of poor adjustment effect caused by the pre-trained model not having seen images of a specific scene. It has wide applicability to multiple types of scenes and can be applied to color difference adjustment of remote sensing images and color difference adjustment of fixed cameras across scene types.
[0043] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0044] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein:
[0045] Figure 1 This is based on the overall process diagram provided in this application;
[0046] Figure 2 This is a schematic diagram of the overall structure of the model provided in this application;
[0047] Figure 3 This is a schematic diagram of the encoder structure provided in this application;
[0048] Figure 4 This is a schematic diagram of the decoder structure provided in this application;
[0049] Figure 5The graph shows the gradient descent optimization loss function based on the multi-period remote sensing images provided in this application.
[0050] Figure 6 It is a schematic diagram of the reference image of the multi-phase remote sensing image scene provided in this application;
[0051] Figure 7 It is a schematic diagram of the image to be adjusted based on the multi-phase remote sensing image scene provided in this application;
[0052] Figure 8 It is an image illustration of the adjusted scene based on the multi-period remote sensing imagery provided in this application;
[0053] Figure 9 The graph shows the gradient descent optimization loss function for day and night scenes using a fixed camera, as provided in this application.
[0054] Figure 10 It is a schematic diagram of a reference image of a fixed camera in day and night scenes provided in this application;
[0055] Figure 11 This is a schematic diagram of the image to be adjusted based on the day and night scene of the fixed camera provided in this application;
[0056] Figure 12 This is a schematic diagram of the adjusted day and night scene image provided in this application from a fixed camera. Detailed Implementation
[0057] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0058] like Figure 1 As shown, this application provides a gradient descent scenario consistency adjustment method for fixed scenarios, including:
[0059] S1: Acquire image data to obtain the baseline image and the image to be adjusted. It should be noted that:
[0060] The acquisition of the reference image includes,
[0061] In a fixed scene, a single high-quality image is used as the baseline image. Simultaneously, in the same scene, images obtained by changing acquisition parameters (such as different shooting times, different sensors, and different lighting and weather conditions) are used as images to be adjusted. For example, in a remote sensing scene where multiple images of the same area are acquired, one image is selected as the baseline image, and the rest are used as images to be adjusted; in a fixed camera scene, clear daytime images are used as the baseline image, and low-light nighttime images are used as images to be adjusted.
[0062] S2: The reference image and the image to be adjusted are concatenated along the channel dimension to form a dual-input joint feature. This dual-input joint feature is then input into a two-branch multi-input neural network model. Feature fusion is performed through stepwise downsampling by the encoder and upsampling by the decoder to output a preliminary adjusted image. It should be noted that:
[0063] The dual-branch multi-input neural network model includes an encoder and a decoder.
[0064] The multi-input neural network model for scene image color consistency adjustment proposed in this application adopts an integrated encoding and decoding structure, integrating the feature encoding of dual-input images and the color adjustment decoding depth into the same computational process (the overall model structure is as follows). Figure 2 As shown, it supports the entire process from the input of the reference image and the image to be adjusted to the output image with consistent color. Through the collaboration of feature dimension stitching, convolution and deconvolution operations, it realizes the learning and application of the color mapping relationship of scene image. Specifically, the encoder performs step-down sampling encoding on the dual input images to extract multi-scale features, and the decoder upsamples based on the encoded features and fuses cross-stage information to complete the color consistency adjustment and output the result.
[0065] In this application scenario, the color distribution transformation relationship between the reference image and the image to be adjusted can be abstracted as a continuous function. The encoder extracts and abstracts the joint features of the two input images at multiple scales through multi-layer convolution and non-linear activation (linear rectified function) to explore the potential correlation of color distribution. The decoder, on the other hand, uses operations such as deconvolution and feature concatenation to gradually restore the encoded abstract features to the color-adjusted image. The entire encoding and decoding neural network structure, as a multi-layer feedforward network, can simulate the color distribution transformation function between the reference image and the image to be adjusted. By utilizing the approximation ability of the network, it learns and realizes scene color consistency adjustment, which is in line with the theoretical logic supported by the universal approximation theorem.
[0066] The encoder performs step-down sampling encoding on the reference image and the image to be adjusted to extract local and global features. During the downsampling process, the global and local features of the reference image and the image to be adjusted are abstractly encoded, and intermediate features carrying different spatial scales are output through different downsampling levels. The intermediate features include intermediate feature 1, which retains a relatively complete structural outline, and intermediate feature 2, which mines more abstract semantic and color associations.
[0067] Encoder structure (e.g.) Figure 3 (As shown) The description is as follows:
[0068] Feature Dimension Concatenation ([H,W,6]): The baseline image ([H,W,3]) and the image to be adjusted ([H,W,3]) are concatenated along the channel dimension, fusing the initial color and structural information of the two input images to provide a joint feature basis containing the differences and commonalities between the two images for subsequent encoding.
[0069] Convolution (kernel width 3, stride 2, features 128) -> Linear Rectified Function: Processes the concatenated [H,W,6] features. The 3×3 convolution kernel downsamples the features with a stride of 2 (compressing the spatial dimension from [H,W] to [H / 2,W / 2]), extracting local features and reducing computation. The 128 channels expand the feature dimension. The linear rectified function introduces nonlinearity, enhancing the model's ability to express complex color and structural features.
[0070] Convolution (kernel width 3, stride 1, features 128) -> Linear rectified function: Based on the [H / 2, W / 2, 128] features, the 3×3 convolution kernel with a stride of 1 further extracts local detail features, keeping the spatial dimension unchanged and deepening the feature expression; the linear rectified function continues to inject non-linearity, allowing the features to contain richer color association patterns, and outputting intermediate feature 1 ([H / 2, W / 2, 128]).
[0071] Intermediate Feature 1 ([H / 2,W / 2,128]): Stores the features after two convolutions and activations. As an internal feature transfer node of the encoder, it carries the fusion features of the two images at the [H / 2,W / 2] scale, providing key information for subsequent cross-stage fusion of the encoder and decoder.
[0072] Convolution (kernel width 3, stride 2, feature 128) -> Linear rectified function: The intermediate feature 1 is downsampled again, and the 3×3 convolution kernel stride 2 compresses the spatial dimension to [H / 4, W / 4], focusing on more abstract global features and reducing redundant information; the linear rectified function maintains non-linearity, helping the model to explore the deep color mapping rules of the two images.
[0073] Convolution (kernel width 3, stride 1, feature 128) -> Linear rectified function: On the [H / 4, W / 4, 128] feature, the 3×3 convolution kernel with a stride of 1 finely extracts local features and supplements the details lost in downsampling; the linear rectified function enhances the nonlinear expression and finally outputs intermediate feature 2 ([H / 4, W / 4, 128]), completing the encoder's encoding process from raw to abstract features of the dual input image.
[0074] Intermediate Feature 2 ([H / 4,W / 4,128]): Stores features after multiple convolutions and activations, providing key information for cross-stage fusion in the subsequent decoder.
[0075] Based on the feature differences between the base image and the image to be adjusted extracted by encoding, the decoder learns the color mapping relationship from the image to be adjusted to the base image step by step through upsampling and cross-stage feature fusion. Then, using the learned color mapping relationship, the features abstracted by the encoder stage are restored to the color-adjusted image data.
[0076] Decoder structure (e.g.) Figure 4 (As shown) The description is as follows:
[0077] Deconvolution (kernel width 2, stride 2, feature 128): Receives intermediate feature 2 ([H / 4, W / 4, 128]) from the encoder output. Through deconvolution with kernel width 2 and stride 2, the feature space dimension is upsampled and restored (from [H / 4, W / 4] to [H / 2, W / 2]), while maintaining 128 channels. This achieves preliminary spatial restoration of low-resolution encoded features, preparing for subsequent fusion of richer scale information.
[0078] Intermediate Feature 3 ([H / 2,W / 2,128]): Stores the feature data after deconvolution, serves as the feature transfer node inside the decoder, connects the pre- and post-processing flows, and provides a carrier for fusion with Intermediate Feature 1.
[0079] Feature Dimension Concatenation ([H / 2,W / 2,256]): The intermediate feature 3 ([H / 2,W / 2,128]) and the intermediate feature 1 ([H / 2,W / 2,128]) output by the encoder are concatenated along the channel dimension to integrate feature information from different encoding stages and different spatial scales (intermediate feature 1 retains a relatively more complete structural outline during encoding, while intermediate feature 3 is restored by deconvolution to supplement detailed correlations), enabling the decoder to optimize color mapping learning using multi-scale features.
[0080] Deconvolution (kernel width 2, stride 2, feature 3): Deconvolution with kernel width 2 and stride 2 is performed on the stitched [H / 2, W / 2, 256] features to further restore the spatial dimension to [H, W] and compress the number of channels to 3. This initially constructs a color feature mapping that matches the size of the output image, laying the foundation for restoring the image color.
[0081] Intermediate Feature 4 ([H,W,3]): Temporarily stores the features after deconvolution. At this point, the feature dimension is equal to the output image ([H,W,3]). It serves as a transition node to prepare for the subsequent integration of the original image information to be adjusted.
[0082] Feature Dimension Concatenation ([H,W,6]): The intermediate feature 4 ([H,W,3]) is concatenated with the original image to be adjusted ([H,W,3]) through channels. This introduces the color and structural details of the original image, making up for the original information that may be lost during the encoding-decoding process. It also helps the decoder to learn the color adjustment strategy more accurately and ensures the correlation between the output image and the original scene.
[0083] Convolution (kernel width 1, stride 1, features 3): Perform a 1×1 convolution on the concatenated [H,W,6] features, compress the number of channels back to 3, integrate the fused features through linear transformation, focus on key color adjustment information, and prepare for the final output.
[0084] Normalization exponential function: The Softmax function is used to normalize the features output by the convolution, and the adjusted value range is [0, 1].
[0085] Output Image ([H,W,3]): Output the result after the decoder has processed the entire process. The color value range of the output image is [0, 255]. The output image is color-matched to the reference image and retains complete details.
[0086] S3: Using the color difference-texture similarity joint loss function, calculate the color difference loss between the preliminary adjusted image and the reference image, and the structural similarity loss between the preliminary adjusted image and the image to be adjusted. Then, weightedly fuse the color difference loss and the structural similarity loss to obtain the total loss value. It should be noted that:
[0087] The calculation of color difference loss between the preliminary adjusted image and the reference image is to ensure color consistency, while the calculation of structural similarity loss between the preliminary adjusted image and the original image to be adjusted is to ensure preservation of texture details.
[0088] The color difference-texture similarity joint loss function uses the gradient feedback of the color difference loss to drive the network to adjust the color mapping relationship, so that the overall color distribution of the image to be adjusted approaches that of the reference image. At the same time, the color difference-texture similarity joint loss function, through the constraint of the texture similarity loss, forces the network to retain the structural information of the edge contours and texture details of the original image during color conversion.
[0089] Set the reference image as The image to be adjusted is The adjusted image output after processing by the neural network model is ;
[0090] Color difference loss function The calculations include,
[0091] ;
[0092] Where H represents the height of the image, W represents the width of the image, 3 represents the number of RGB channels, i represents the image number in the height direction, j represents the image number in the width direction, and c represents the numbers of the three RGB color channels.
[0093] The texture similarity loss function preserves details and avoids color interference by constraining edge texture features.
[0094] The calculation of the texture similarity loss function includes,
[0095] The image to be adjusted and the preliminary adjusted image output after processing by the neural network model are both converted into grayscale images. and The Sobel operator is used to extract texture from grayscale images;
[0096] The Sobel operator in the x-direction is defined as follows:
[0097] ;
[0098] The Sobel operator in the y-direction is defined as follows:
[0099] ;
[0100] Texture map of the grayscale image to be adjusted The extraction includes,
[0101] ;
[0102] Initial adjustment of the grayscale texture map of the image The extraction includes,
[0103] .
[0104] Texture map of the grayscale image to be adjusted Texture map of grayscale image and initial image adjustment Perform global Softmax normalization to compress the texture value range to [0,1];
[0105] ;
[0106] ;
[0107] in, The texture probability map represents the grayscale image of the image to be adjusted for normalization. The texture probability map of the grayscale image represents the initial normalized image, where exp represents the exponential function with the natural constant e as the base, i represents the image height index, and j represents the image width index.
[0108] The difference in normalized texture maps is measured by MSE (Mean Separation Estimate), which constrains the consistency of texture structure between the initially adjusted image and the image to be adjusted, thus yielding the texture similarity loss. ,
[0109] .
[0110] S4: Based on the total loss value, the gradient descent algorithm is used to iteratively optimize the neural network parameters; when the optimization termination condition is met, the final adjusted image is output. It should be noted that:
[0111] Total loss value The calculations include,
[0112] The color difference loss and texture similarity loss are weighted and fused to obtain the total loss value. ,
[0113] ;
[0114] in, , All represent weighting coefficients. , A value of 0.5 can be chosen based on experience.
[0115] The conditions for determining the termination of optimization include:
[0116] After each iteration, it is determined whether the optimization termination condition is met. If the number of iterations reaches the maximum set value, the iteration stops; otherwise, the iteration continues to optimize the neural network parameters.
[0117] Once the optimization termination condition is met, the final adjusted image is output. The final adjusted image has the same color as the reference image and retains the edge and texture details of the image to be adjusted, thus achieving image color consistency adjustment in a fixed scene.
[0118] Example 1: Color Consistency Adjustment of Scenes in Multi-Period Remote Sensing Images
[0119] This embodiment uses remote sensing imagery of a certain location as experimental data. The specific data information is as follows:
[0120] Baseline image: An image taken on May 28, 2024, with a size of 45591×39388 pixels, a spatial resolution of 1.8 meters, and a spectral range covering the three channels of RGB. The image was taken during a sunny day with uniform lighting, and the color features of ground features are clear. It was used as a color anchor point.
[0121] Image to be adjusted: An image of the same area taken on December 28, 2024. The image size is 23844×20884 pixels, the spatial resolution is 1.8 meters, and the image was taken on a cloudy day. The overall tone is dark, and the vegetation area appears as a lighter green.
[0122] The two sets of images are standardized by normalizing the pixel values to the range of [0,255], aligning the coordinates of the imaging center point, and cropping the same range before scaling the image size to 2000×2000 pixels. The image to be adjusted and the reference image are then stitched together by channel dimension to form two sets of dual-input features (both with a size of 2000×2000×6).
[0123] The proposed dual-branch multi-input neural network model is used, wherein the encoder contains 4 convolutional layers (kernel width 3, stride 2 / 1 alternating, number of features 128) and the decoder contains 2 deconvolutional layers (kernel width 2, stride 2, number of features 128); the gradient descent algorithm uses the Adam optimizer, the initial learning rate is set to 0.001, and the maximum number of iterations is set to 1000.
[0124] The input features are fed into the neural network model, and the parameter iterative optimization process is initiated with the proposed "color difference-texture similarity" joint loss function as the optimization objective. The network weights are updated in real time to minimize the loss value.
[0125] During the optimization process, the curve showing the change in the total loss function value is recorded as follows: Figure 5 As shown in the figure, the curve indicates that after 40 iterations, the total loss value converged from the initial 0.15 to 0.04 and remained stable thereafter. Compared to the curve of a conventional neural network model, the curve is smoother and shows no obvious oscillations, demonstrating good convergence characteristics.
[0126] like Figures 6 to 8 As shown, before adjustment, the reference image was blue-green, while the image to be adjusted was light green, showing a significant difference in color distribution from the reference image. After adjustment, the colors of both remote sensing images approached the blue-green of the reference image, with a significant improvement in color uniformity. Furthermore, the detail features of the adjusted image remained consistent with those of the image to be adjusted, and the visual consistency of the same ground feature in different time phases was significantly improved.
[0127] Example 2: Color Consistency Adjustment for Day and Night Scenes Using a Fixed Camera
[0128] This embodiment uses day and night images captured by a fixed camera in a seawall scene as experimental data. This scene includes typical elements such as vegetation and mountains. Specific data information is as follows:
[0129] Reference image: The image taken on June 19, 2024 at 11:49:27 was selected. The image size is 1920×1080 pixels and the color mode is RGB. It is used as the color reference benchmark.
[0130] Image to be adjusted: The same scene image was taken by the same camera at 19:34:03 on July 2, 2024 (at night without supplemental lighting). The image size is the same as the baseline image. Due to insufficient lighting, the overall tone is dark, the scene recognition is reduced, and there is a small amount of noise.
[0131] The two sets of images have been spatially registered to ensure that the positions of all objects in the scene correspond perfectly, with only color and brightness deviations caused by differences in day and night lighting.
[0132] The reference image and the image to be adjusted are preprocessed to normalize the pixel values to the range of [0, 255] while keeping the image size of 1920×1080 pixels unchanged; the two are then concatenated in the channel dimension to form a dual-input feature (size 1920×1080×6).
[0133] The proposed dual-branch multi-input neural network model is used, wherein the encoder contains 4 convolutional layers (kernel width 3, stride 2 / 1 alternating, number of features 128) and the decoder contains 2 deconvolutional layers (kernel width 2, stride 2, number of features 128); the gradient descent algorithm uses the Adam optimizer, the initial learning rate is set to 0.001, and the maximum number of iterations is set to 1000.
[0134] The dual-input features are input into the neural network model, and iterative optimization is initiated with the joint loss function as the optimization objective. The network parameters are adjusted in real time through gradient backpropagation, so that the output image gradually approaches the color features of the reference image.
[0135] During the optimization process, record the change curves of the total loss value, color difference loss value, and structural similarity loss value (e.g., Figure 9 As shown in the figure, the initial total loss value is 0.25; after 50 iterations, the loss value fluctuates slightly; after 100 iterations, the total loss value converges to 0.19, and the loss value basically no longer changes during subsequent optimization, satisfying the convergence condition. The curve is smoother than that of a conventional neural network model, with no obvious oscillations, demonstrating good convergence characteristics.
[0136] like Figures 10 to 12As shown, before adjustment, the nighttime image was generally dark and dull, with a significant difference in tone compared to the bright daytime image. After adjustment, the overall brightness and tone of the nighttime image approached those of the daytime image, the sky became brighter, the vegetation regained its green hue, and the overall scene appeared consistent. The adjusted nighttime image is highly consistent with the daytime image in color, while preserving the original structural details of the nighttime scene.
[0137] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions within the technical scope disclosed in the present invention should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A gradient descent scenario consistency adjustment method for fixed scenarios, characterized in that, include: Acquire image data to obtain a baseline image and an image to be adjusted; The reference image and the image to be adjusted are concatenated along the channel dimension to form a dual-input joint feature. The dual-input joint feature is then input into a dual-branch multi-input neural network model. Feature fusion is performed through step-wise downsampling of the encoder and upsampling of the decoder to output a preliminary adjusted image. The dual-branch multi-input neural network model includes an encoder and a decoder; The encoder performs step-downsampling encoding on the reference image and the image to be adjusted to extract local and global features; During the downsampling process, the global and local features of the reference image and the image to be adjusted are abstracted and encoded, and intermediate features carrying different spatial scales are output through different downsampling levels. Using the color difference-texture similarity joint loss function, the color difference loss between the preliminary adjusted image and the reference image and the texture similarity loss between the preliminary adjusted image and the image to be adjusted are calculated. The color difference loss and texture similarity loss are weighted and fused to obtain the total loss value. Based on the total loss value, the gradient descent algorithm is used to iteratively optimize the neural network parameters; when the optimization termination condition is met, the final adjusted image is output. The decoder, based on the feature differences between the base image and the image to be adjusted extracted by encoding, learns the color mapping relationship from the image to be adjusted to the base image through upsampling and cross-stage feature fusion. It then uses the learned color mapping relationship to restore the features abstracted by the encoder stage into color-adjusted image data.
2. The gradient descent scenario consistency adjustment method for fixed scenarios according to claim 1, characterized in that: The acquisition of the reference image includes, In a fixed scene, a single high-quality image is used as the baseline image; Meanwhile, in the same scene, the image obtained by changing the acquisition parameters is used as the image to be adjusted.
3. A gradient descent scenario consistency adjustment method for fixed scenarios according to claim 1 or 2, characterized in that: The color difference-texture similarity joint loss function uses the gradient feedback of the color difference loss to drive the network to adjust the color mapping relationship, so that the overall color distribution of the image to be adjusted approaches that of the reference image. At the same time, the color difference-texture similarity joint loss function, through the constraint of the texture similarity loss, forces the network to retain the structural information of the edge contours and texture details of the original image during color conversion.
4. The gradient descent scenario consistency adjustment method for fixed scenarios according to claim 3, characterized in that: Set the reference image as The image to be adjusted is The adjusted image output after processing by the neural network model is ; Color difference loss function The calculations include, ; Where H represents the height of the image, W represents the width of the image, 3 represents the number of RGB channels, i represents the image number in the height direction, j represents the image number in the width direction, and c represents the numbers of the three RGB color channels. The calculation of the texture similarity loss function includes, The image to be adjusted and the preliminary adjusted image output after processing by the neural network model are both converted into grayscale images. and The Sobel operator is used to extract texture from grayscale images; The Sobel operator in the x-direction is defined as follows: ; The Sobel operator in the y-direction is defined as follows: ; Texture map of the grayscale image to be adjusted The extraction includes, ; Initial adjustment of the grayscale texture map of the image The extraction includes, 。 5. The gradient descent scenario consistency adjustment method for fixed scenarios according to claim 4, characterized in that: Texture map of the grayscale image to be adjusted Texture map of grayscale image and initial image adjustment Perform global Softmax normalization to compress the texture value range to [0,1]; ; ; in, The texture probability map represents the grayscale image of the image to be adjusted for normalization. The texture probability map of the grayscale image represents the initial normalized image, where exp represents the exponential function with the natural constant e as the base, i represents the image height index, and j represents the image width index. The difference in normalized texture maps is measured by MSE (Mean Separation Estimate), which constrains the consistency of texture structure between the initially adjusted image and the image to be adjusted, thus yielding the texture similarity loss. , 。 6. The gradient descent scenario consistency adjustment method for fixed scenarios according to claim 5, characterized in that: Total loss value The calculations include, The color difference loss and texture similarity loss are weighted and fused to obtain the total loss value. , ; in, , All of these represent weighting coefficients.
7. A gradient descent scenario consistency adjustment method for fixed scenarios according to claim 1 or 6, characterized in that: The conditions for determining the termination of optimization include: After each iteration, determine whether the optimization termination condition is met. If the number of iterations reaches the maximum set value, stop the iteration. Otherwise, continue iteratively optimizing the neural network parameters.
Citation Information
Patent Citations
Cross-domain image conversion method and device based on unsupervised neural network, computer equipment and storage medium
CN112819687A