Single-image high dynamic range reconstruction method and system based on detail coding gain graph

By combining a three-channel gain map and a two-stage detail recovery network, the problems of texture detail recovery and computational efficiency in single-image HDR reconstruction are solved, achieving efficient and high-fidelity HDR image generation.

CN121837097APending Publication Date: 2026-04-10TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2026-01-09
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing single-image HDR reconstruction techniques cannot effectively restore texture details and color information caused by overexposure or underexposure, and are computationally expensive or difficult to apply in real time on mobile devices.

Method used

A detail-encoding gain map-based approach is adopted to independently modulate texture and color information through a three-channel gain map, and a two-stage detail recovery network and a self-supervised training strategy are used to generate high dynamic range images.

Benefits of technology

It effectively restores the texture and color information of overexposed or underexposed areas while maintaining the fidelity of the original image structure and reducing computational costs. It is suitable for mobile devices and existing display pipelines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837097A_ABST
    Figure CN121837097A_ABST
Patent Text Reader

Abstract

The invention discloses an image high dynamic range reconstruction method and system based on a detail coding gain graph, and belongs to the technical field of computer vision and image processing. The method comprises the following steps: S1, data preprocessing: acquiring an input single standard dynamic range image, and preprocessing the image to obtain image data in a linear space or normalized floating point tensor format; s2, proposing a detail recovery network design based on detail generation of a diffusion model; s3, predicting a detail coding gain graph, and providing a gain convolutional neural network design; and S4, final HDR synthesis: carrying out pixel-by-pixel multiplication on the processed standard dynamic range (SDR) image and the three-channel (R, G, B) gain image according to channels to obtain a reconstructed HDR image. According to the method, the problems of detail recovery missing, image structure distortion, low calculation efficiency and the like in the existing single image HDR (High Dynamic Range) reconstruction technology are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and image processing technology, and particularly relates to a method and system for high dynamic range (HDR) reconstruction of a single image based on detail-coded gain maps. More specifically, it relates to a method, system, electronic device, and storage medium for reconstructing a high-resolution HDR image from a single standard dynamic range (SDR) image using detail-coded gain maps by combining diffusion models and gain map technology. Background Technology

[0002] With the rapid development of display technology, High Dynamic Range (HDR) display devices (such as smartphones, monitors, and televisions) have gradually become widespread. Compared with traditional Standard Dynamic Range (SDR) devices, HDR devices can present a wider range of brightness (usually more than 10 exposure stops) and a wider color gamut, thus bringing a more realistic and immersive visual experience.

[0003] However, the vast majority of existing digital image resources are still stored and transmitted in SDR format (such as 8-bit JPEG images). Limited by the sensor capabilities of the shooting equipment and the bit depth limitations of the SDR format, these images often suffer from "highlight clipping" and "shadow crushing" when capturing high-contrast scenes. Specifically, the pixel values ​​in highlight areas are truncated to their maximum value (e.g., 255), while the pixel values ​​in shadow areas are truncated to their minimum value (e.g., 0). This results in the irreversible loss of the original physical details, texture levels, and color information in the scene during the shooting process.

[0004] To display this SDR content in high quality on advanced HDR display devices, single-image HDR reconstruction is required to restore low-quality SDR images to high-quality HDR images. This process involves not only expanding the dynamic range (i.e., stretching the brightness), but more challengingly, it requires restoring or "hallucinates" the texture details and color information lost due to truncation during SDR shooting.

[0005] Currently available single-image HDR reconstruction technologies mainly fall into three categories: traditional algorithms, generative methods based on deep learning, and gain map techniques. The most similar existing technologies to this invention and their shortcomings are analyzed below: (1) Method based on Inverse Tone Mapping (ITM) Early ITM methods primarily involved designing mathematical operators to map the brightness of SDR images to the HDR domain. For example, the approach proposed by Liu et al. ("Single-image HDR reconstruction by learning to reverse the camera pipeline", CVPR 2020) attempted to recover scene irradiance by explicitly modeling and inverting the camera response function (CRF).

[0006] Such methods are essentially mapping and stretching of existing pixel values, and are limited by information loss during the imaging process. For overexposed (pure white) or underexposed (pure black) areas in SDR images that have been truncated, the reversed result is still a flat color block because the original pixels lack texture variation. It is impossible to recover the lost scene details, and the visual effect is unnatural.

[0007] (2) Methods based on convolutional neural networks (CNN) or generative adversarial networks (GAN) With the development of deep learning, researchers have begun to use CNNs or GANs to predict missing information. For example, the HDRCNN method proposed by Eilertsen et al. ("HDR image reconstruction from a single exposure using deepCNNs", ACM TOG 2017) uses a convolutional neural network with a U-Net structure to predict masks for highlight areas and generate HDR content.

[0008] Limited by the model's capacity and generation mechanism, these techniques often struggle to generate high-frequency details not seen in the training data and are prone to producing noticeable artifacts, halos, or noise in the reconstructed area, resulting in unstable image quality.

[0009] (3) Methods based on diffusion models Recently, diffusion models have been applied to HDR reconstruction due to their powerful image generation capabilities. For example, the LeDiff method proposed by Wang et al. (“LeDiff: Latent exposure diffusion for HDR generation”, CVPR 2025) generates multiple latent representations with consistent exposure by fine-tuning the decoder of the diffusion model, and then fuses them into an HDR image.

[0010] While this diffusion model can generate realistic details, it suffers from "generative bias." The model often unintentionally alters the original fine structure and texture of underexposed areas (i.e., normally exposed areas) in the original SDR image, leading to a decrease in the fidelity of the original image content. Furthermore, the iterative sampling process of the diffusion model is computationally intensive and slow inference, making it difficult to support the direct generation of high-resolution images (such as 2K or 4K and above), and thus failing to meet the real-time requirements of mobile devices.

[0011] (4) Gain Map Technology Gain mapping is an auxiliary image processing technique widely used in modern HDR imaging pipelines (such as the photo album display on some smartphones). Its basic principle was first proposed by Guan et al. ("Display HDR image using a gainmap", ICIP 2007). This technique decomposes an HDR image into an SDR base layer and an auxiliary gain map. During display, it is reconstructed using the formula HDR = SDR × G, where G is typically a single-channel grayscale image representing the pixel-level brightness enhancement ratio. This technique has the following problems: First, details cannot be recovered. Existing gain maps are usually single-channel, containing only brightness enhancement information. For overexposed areas in SDR images (e.g., pure white areas with pixel values ​​of 255, 255, 255), regardless of the scalar gain value multiplied, the result is still white with varying brightness, failing to introduce new textures or color changes.

[0012] Second, the information dimension is limited. Due to the lack of independent modulation capability of the RGB channels, traditional gain maps cannot correct color deviations in overexposed areas, nor can they encode complex texture details, resulting in reconstructed highlight areas still lacking a sense of depth.

[0013] In summary, existing technologies for HDR reconstruction of single images either fail to effectively recover lost details (traditional ITM and gain maps) or, while capable of recovering details, suffer from high computational costs and are prone to disrupting the original image structure (diffusion models). Therefore, there is an urgent need for a novel technical solution that can utilize generative models to recover rich details, maintain high fidelity of the original image structure, and is computationally efficient and compatible with existing display pipelines. Summary of the Invention

[0014] The purpose of this invention is to provide a method and system for high dynamic range reconstruction of a single image based on detail-coded gain maps to solve the following technical problems: (1) The challenge of detail recovery due to loss of physical information: Traditional inverse tone mapping (ITM) methods mainly rely on brightness expansion operators, which cannot recover the details of areas clipped due to overexposure (highlights) or underexposure (shadows) during the shooting of SDR images. Since the pixel information in these areas has been physically and irreversibly lost, traditional methods can only adjust the brightness and cannot reconstruct the lost texture and color content.

[0015] (2) Structural distortion and computational bottleneck of generative models: Although diffusion model-based methods have strong detail generation capabilities, they suffer from "generative bias". These models tend to unintentionally tamper with the original fine structure of underexposed areas (i.e., normally exposed areas) during the generation process, resulting in a decrease in image fidelity. In addition, diffusion models usually require huge computational resources and are difficult to directly generate high-resolution HDR images above 2K, which limits their application on edge devices.

[0016] (3) Limitations of traditional gain map representation: The gain map technology widely used in existing HDR display pipelines usually only contains brightness ratio information of a single channel. Although this single-channel representation can improve dynamic range, it cannot introduce new texture or color information by simply scaling the brightness of overexposed or underexposed areas in SDR images that have lost details. As a result, the reconstructed highlight or shadow areas are still flat and lack details.

[0017] To achieve the above objectives, the present invention adopts the following technical solution: A method for high dynamic range image reconstruction based on detail-coded gain maps includes the following steps: S1. Data Preprocessing: Acquire the input single standard dynamic range (SDR) image and preprocess the image to obtain image data in linear domain or normalized floating-point tensor format; S2. Detail Generation Based on Diffusion Model: A Detail Recovery Network (DRN) design is proposed, specifically including: S2.1 Introducing the Prompt-Free Branch (PFB): The pre-trained visual encoder directly extracts the global visual feature vector from the input image; the global visual feature vector is transformed into a semantic embedding through a mapping network (PFBNet) and used as a conditional injection diffusion model, enabling the network to automatically understand the image content (such as "night scene" or "backlit portrait"). S2.2 Introducing the Spatial Feature Branch (SFB): Establishing a lightweight convolutional network branch to extract multi-scale spatial features from the input image; injecting the multi-scale spatial features layer by layer into the backbone network (U-Net) of the diffusion model to form strong spatial constraints; S2.3 Generating Spatial Results: Through an iterative denoising process, output a spatial image with the same resolution as the original. Figure 1 To produce an intermediate generated image (I_genc) containing rich details; S3. Detail Encoding Gain Map Prediction: A Gain Convolutional Neural Network (GainCNN) design is proposed, specifically including: S3.1 Input Construction: The original Standard Dynamic Range (SDR) image is concatenated with the intermediate generated image (I_genc) generated in the first stage along the channel dimension to form 6-channel input data; S3.2 Network Inference: Input to GainCNN, learn the difference between the original standard dynamic range (SDR) image and the intermediate generated image (I_genc), and predict the "gain coefficient" required to transform the original standard dynamic range (SDR) image into a detailed intermediate generated image (I_genc); S3.3, Three-channel differentiated output: Outputs a three-channel (R, G, B) gain map (G_DE). In the normal exposure area, the gain values ​​of the three channels R / G / B are similar (only brightness is adjusted); in the overexposed / underexposed area, the gain values ​​of the three channels R / G / B are different. S4. Final HDR Composition: The processed Standard Dynamic Range (SDR) image is multiplied pixel-by-pixel with the three-channel (R, G, B) gain map (G_DE) to obtain the reconstructed high dynamic range HDR image. The specific details and calculation formula are as follows: HDR_c(x,y) = SDR_c(x,y) × G_DE_c(x,y) Wherein, SDR represents the standard dynamic range image; G_DE represents the three-channel gain map; and c represents the R, G, and B channels.

[0018] Preferably, the preprocessing in S1 includes a gamma correction removal operation to convert the image data to linear space.

[0019] Preferably, the visual encoder described in S2.1 is a CLIP visual encoder.

[0020] Preferably, the backbone network of the diffusion model described in S2.2 is a U-Net structure.

[0021] Preferably, the gain convolutional neural network described in S3.2 is a fully convolutional neural network.

[0022] Preferably, the method further includes a step of self-supervised joint training of the detail recovery network (DRN) and the gain convolutional neural network (GainCNN), specifically including: Forward generation chain: Input standard dynamic range (SDR) training samples → generate intermediate detail maps through detail recovery network (DRN) → generate gain maps through gain convolutional neural network (GainCNN) → synthesize predicted HDR images; Inverse mapping supervision: Using a differentiable tone mapping operator, the predicted HDR image is compressed back into the SDR domain to obtain a "reconstructed SDR image"; Composite loss function design: (1) Local detail loss: In the overexposed / underexposed mask area, force the "reconstructed SDR image" to approximate the "intermediate detail map (I_genc)" to ensure that the details are effectively encoded into the gain map; (2) Global consistency loss: In the normal exposure area, the "reconstructed SDR image" is forced to approximate the "original input image" to prevent image distortion; (3) Edge consistency loss: constrain edge gradients to improve texture sharpness.

[0023] A high dynamic range image reconstruction system based on detail-coded gain map includes: Image acquisition and preprocessing module: used to read image data from camera or memory, and perform gamma de-correction and normalization operations to provide linear space input data for subsequent networks; The detail restoration module (DRN) has a built-in pre-trained visual encoder and diffusion model to perform the task of generating details from scratch. It uses semantic vectors to replace text prompts, uses spatial feature maps to constrain the generation range, and outputs intermediate generated images. Gain Map Generation Module (GainCNN): It has a built-in fully convolutional neural network to perform the "information encoding" task. It receives the spliced ​​data of the original image and the intermediate image, predicts the pixel-level R, G, and B channel gain values ​​through convolution operations, and outputs the detail-encoded gain map. HDR Composition Module: It has a built-in multiplication unit to perform the final HDR = SDR × GainMap operation. It is compatible with image signal processor (ISP) hardware to achieve fast rendering on the device side.

[0024] Preferably, the visual encoder is a CLIP visual encoder; the backbone network of the diffusion model is a U-Net structure.

[0025] The present invention further protects a computer device, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the instruction, program, code set or instruction set being loaded and executed by the processor to implement the above-described method for high dynamic range image reconstruction based on detail-coded gain map.

[0026] The present invention further provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the instruction, program, code set, or instruction set is loaded and executed by a processor to implement the above-described method for high dynamic range image reconstruction based on detail-coded gain map.

[0027] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention can effectively restore the texture details and color information physically lost in SDR images due to overexposure or underexposure, while greatly maintaining the original structural fidelity of the non-truncated regions. This advantage is because this invention adopts a three-channel detail-encoded gain map (DEgainmap) technology, which is different from the existing "single-channel gain map". Through independent gain modulation of the three RGB channels, the gain map is mathematically endowed with the ability to encode color and texture. At the same time, this invention adopts a two-stage detail restoration network (DSDR-Net) and spatial feature branch (SFB), which is different from the existing "end-to-end generation". It uses spatial features to strongly constrain the generation range of the diffusion model and synthesizes the image through gain modulation, thereby avoiding the defect of traditional generative models that easily tamper with the normal regional structure of the original image.

[0028] (2) This invention has higher computational efficiency and lower data dependency, making it easier to deploy in practical applications. This advantage is because this invention uses GainCNN as the second stage, which significantly reduces the computational resources required to predict the gain map compared to directly using a diffusion model to generate high-resolution HDR images. (3) This invention adopts a self-supervised joint training strategy that is different from the existing fully supervised learning. By mapping the reconstructed HDR back to the SDR domain for supervision, it solves the problem that the existing technology is highly dependent on the difficult-to-obtain "SDR-HDR pairwise ground truth data", so that the model can be trained using a large number of ordinary SDR images. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings involved in the embodiments are now briefly described. Obviously, the drawings in the following description are merely illustrative of some embodiments of the present invention. For those skilled in the art, other forms of drawings can be constructed based on these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram of the overall structure of the single-image high dynamic range reconstruction method and system based on detail coding gain map proposed in this invention; Figure 2 This is a diagram illustrating the overall reconstruction process and algorithm logic proposed in this invention. Figure 3 This is a diagram of the neural network design structure proposed in this invention; Figure 4 These are test result images on the overexposed and underexposed image subsets mentioned in Embodiment 2 of the present invention; Figure 5 This is a comparison chart of the DEgainmap and Gain map effects mentioned in Embodiment 2 of the present invention. Detailed Implementation

[0031] 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.

[0032] This invention aims to solve the problems of lack of detail recovery, image structure distortion, and low computational efficiency in existing single-image high dynamic range (HDR) reconstruction techniques, specifically including: (1) Lack of physical detail recovery capability: Existing methods based on inverse tone mapping (ITM) and traditional gain maps cannot effectively recover the texture details and color information of clipped areas in standard dynamic range (SDR) images caused by overexposure (highlights) or underexposure (shadows). Since the pixel information in these areas has been physically and irreversibly lost, the reconstructed high dynamic range (HDR) image often appears as flat color blocks in extremely bright or dark areas, lacking realism and resulting in poor visual effects.

[0033] (2) Low image structure fidelity: Existing generation methods based on diffusion models, although they have strong detail generation capabilities, suffer from "generative bias". These models are prone to producing "illusions" or unnecessary alterations in the normally exposed areas (non-truncated areas) of the image, causing the originally clear and correct structure and texture in the image to be distorted, thus reducing the overall fidelity of the image.

[0034] (3) High computational resource consumption and limited resolution: Reconstruction methods based on diffusion models usually rely on a heavy iterative sampling process, which has huge computational overhead and is difficult to run efficiently on edge devices such as smartphones. At the same time, due to the limitations of video memory and computing power, these methods are usually difficult to directly generate high-resolution HDR images above 2K, which limits their practical application scenarios.

[0035] (4) Single dimension of gain map information expression: Existing industry standard gain map technology usually only uses a single channel (grayscale) to represent the brightness enhancement ratio. Although this single-channel representation can improve the dynamic range, it cannot encode the color information lost in the overexposed area, nor can it introduce differential modulation between channels, resulting in the reconstructed highlight area still having color distortion or pale colorlessness.

[0036] The above problems are caused by: (1) Irreversible information loss during imaging: During the capture and storage of SDR images, due to the limitations of the sensor's dynamic range and storage bit depth (usually 8 bits), pixel values ​​are forcibly truncated to the maximum value (e.g., 255) or the minimum value (e.g., 0) in extremely bright and extremely dark areas. Traditional mathematical mapping methods are essentially stretching existing pixel values ​​and cannot infer non-existent textures from physically lost information.

[0037] (2) Limitations of Single-Channel Gain Representation Traditional gain maps compress pixel-level brightness ratios into single-channel data (HDR = SDR × G). This mathematical model assumes that the gains of the three RGB channels are the same, thus failing to introduce differential modulation between channels. For regions in SDR where RGB values ​​are saturated (such as pure white), single-channel gain can only adjust their brightness and cannot recover texture details with color variations.

[0038] (3) Statistical distribution of the main learning data of generative networks such as the unconstrained bias diffusion model of generative models. In the absence of a targeted spatial constraint mechanism, the model has difficulty in accurately distinguishing between "truncated regions that need to be restored" and "normal regions that need to be preserved", thus tending to reconstruct global pixels, resulting in the destruction of the original structure of normal regions.

[0039] (4) Complex iterative generation mechanism: The diffusion model generates images by gradually denoising, which usually requires dozens or even hundreds of network inferences to obtain a single result. This mechanism determines its high time complexity and memory usage, limiting its direct application in high-resolution scenes.

[0040] To address the aforementioned problems, this invention proposes a single-image HDR reconstruction method and system based on a detail-encoded gain map. First, this invention provides an HDR reconstruction scheme capable of effectively recovering details in overexposed and underexposed areas. Addressing the issue that existing technologies cannot recover physically lost information, this invention proposes a detail-encoded gain map (DEgainmap) representation. Unlike traditional single-channel luminance gain maps, this invention aims to encode the texture details and color information predicted by the generative model into the gain map through independent gain modulation of three channels (RGB). This ensures that the reconstructed HDR image not only has correct brightness in extremely bright and dark areas but also exhibits rich texture and natural color transitions.

[0041] Secondly, this invention solves the problem of generative models tampering with the original image structure, effectively improving image fidelity. Addressing the issue that diffusion models easily lead to structural distortion in non-overexposed areas, this invention aims to provide a two-stage detail restoration network (DSDR-Net). This method decouples the detail generation process from the final image synthesis process: the first stage utilizes a diffusion model to centrally restore lost structural information, and the second stage predicts the gain map through a convolutional network. Since the final HDR image is obtained by multiplying the original SDR image pixel-by-pixel with the gain map, this invention ensures that the structure and content of non-overexposed areas in the original image are preserved to the greatest extent, accurately repairing only problematic areas.

[0042] This invention reduces the computational cost of high-resolution HDR generation while maintaining compatibility with the existing ecosystem. Addressing the issue of high computational cost in directly generating high-resolution images using diffusion models, this invention utilizes a gain map as an intermediate medium. Since the DEgainmap's resolution can be smaller than the original image while still maintaining its effectiveness, this method can achieve high-resolution HDR reconstruction at a lower computational cost. Furthermore, the output format generated by this invention (SDR basemap + gain map) is naturally compatible with existing gain map-based HDR display pipelines, facilitating direct application on mobile devices and existing displays.

[0043] Finally, this invention achieves self-supervised training without requiring paired ground truth HDR data. Addressing the difficulty in obtaining real HDR data, this invention aims to introduce a self-supervised training strategy. By remapping the reconstructed HDR images back to the SDR domain for supervision, this invention can directly utilize large-scale SDR datasets for model training, significantly reducing the dependence on hard-to-obtain paired SDR-HDR training data.

[0044] The following description, in conjunction with the accompanying drawings and specific examples, illustrates the high dynamic range image reconstruction method and system based on detail coding gain maps proposed in this invention.

[0045] Example 1: Please see Figure 1-3 This invention proposes a method and system for high dynamic range image reconstruction based on detail coding gain maps. The proposed method specifically includes the following: I. Overall Reconstruction Process and Algorithm Logic This invention proposes a single-image HDR reconstruction scheme based on a detail-coded gain map (DEgainmap). The scheme employs a two-stage processing logic: The first stage utilizes a diffusion model to "phantomize" the lost physical details. The second stage "encodes" these details into a three-channel gain map, and finally, HDR reconstruction is achieved through gain modulation. The specific design steps are as follows: Step 1: Data Preprocessing The system first acquires a single input standard dynamic range (SDR) image. Since the original SDR image is usually subjected to nonlinear gamma correction, in order to conform to the laws of physical lighting, the design prioritizes converting the image data to linear domain or a normalized floating-point tensor format. At this point, the image has pixel truncation in overexposed (highlight) or underexposed (shadow) areas, lacking texture information. Step 2: First Stage – Detail Generation Based on Diffusion Model (DRN Network Design) To address the problem that traditional methods cannot recover physically lost information, this invention introduces a detail recovery network (DRN). To overcome the shortcomings of existing diffusion models, such as susceptibility to tampering with the original image structure and reliance on text prompts, this solution incorporates the following targeted improvements: (1) Introducing the Prompt-Free Branch (PFB): The design removes the dependence on user input text prompts. The pre-trained CLIP visual encoder is used to directly extract global visual feature vectors from the input image. This vector is transformed into a semantic embedding through a mapping network (PFBNet) and used as a conditional injection diffusion model, enabling the network to automatically understand the image content (such as "night scene" and "backlit portrait").

[0046] (2) Introducing the Spatial Feature Branch (SFB): Designed to address the structural fidelity problem. A lightweight convolutional network branch is established specifically to extract multi-scale spatial features from the input image. These features are injected layer by layer into the backbone network (U-Net) of the diffusion model, forming strong spatial constraints. This ensures that the generated intermediate image strictly preserves the geometric structure of the original image in non-overexposed areas, and generates texture only in truncated areas.

[0047] (3) Generating intermediate results: The network outputs an image with the same resolution as the original image through an iterative denoising process. Figure 1 To produce an intermediate generated image (I_genc) containing rich details. Step 3: Second Stage – Prediction of the Gain Map Encoding Details (GainCNN Network Design) To address the issues of high computational cost and incompatibility with existing display pipelines when directly generating HDR images, this invention does not directly output HDR, but instead predicts a "gain map": (1) Input construction: The original SDR image and the intermediate generated image (I_genc) generated in the first stage are concatenated in the channel dimension to form 6-channel input data.

[0048] (2) Network inference: Input to Gain Convolutional Neural Network (GainCNN). This network learns the difference between the two and predicts the "gain coefficient" needed to turn the SDR into a detailed image.

[0049] (3) Three-channel differentiated output: Traditional gain maps are single-channel, while this invention improves upon this by outputting a three-channel (R, G, B) gain map (G_DE). In the normal exposure area, the gain values ​​of the R / G / B channels converge (only brightness is adjusted); in the overexposed / underexposed areas, the gain values ​​of the R / G / B channels are different. This channel-wise modulation effectively encodes color and texture information in the gain values. Step 4: Final HDR Compositing Achieving final synthesis with low computing power through mathematical formulas: HDR_c(x,y) = SDR_c(x,y) × G_DE_c(x,y) Here, 'c' represents the R, G, and B channels. The HDR image generated in this step retains the true structure of the original image while also possessing realistic highlight / shadow details generated by the diffusion model.

[0050] II. Self-supervised joint training strategy To address the difficulty in obtaining paired data (perfectly aligned SDR-HDR image pairs) in HDR reconstruction tasks, this invention proposes a self-supervised closed-loop training strategy that does not require HDR ground truth: 1. Forward generation process: Input SDR training samples → Generate intermediate detail maps via DRN → Generate gain maps via GainCNN → Synthesize predicted HDR images.

[0051] 2. Inverse Mapping Supervision: Using a differentiable tone mapping operator, the predicted HDR image is compressed back into the SDR domain to obtain the "reconstructed SDR image".

[0052] 3. Design of composite loss function: (1) Local detail loss: In the overexposed / underexposed mask area, the “reconstructed SDR image” is forced to approach the “intermediate detail map (I_genc)” to ensure that the details are effectively encoded into the gain map.

[0053] (2) Global consistency loss: In the normal exposure area, the “reconstructed SDR image” is forced to approximate the “original input image” to prevent image distortion.

[0054] (3) Edge consistency loss: constrains edge gradients and improves texture sharpness. With this design, the model can be trained directly on large-scale SDR datasets, which greatly reduces the data threshold.

[0055] III. System Module Architecture Design Based on the above algorithm flow, the system proposed in this invention mainly includes the following core functional modules: 1. Image Acquisition and Preprocessing Module: Responsible for reading image data from the camera or memory, and performing gamma de-correction and normalization operations to provide linear space input data for subsequent networks.

[0056] 2. Detail Reconstruction Module (DRN): This module incorporates a pre-trained CLIP visual encoder and a diffusion model (U-Net). It is responsible for generating details from scratch. Its core logic involves replacing textual prompts with semantic vectors, constraining the generation range using spatial feature maps, and outputting an intermediate generated image.

[0057] 3. Gain Map Generation Module (GainCNN): This module incorporates a fully convolutional neural network. It is responsible for the "information encoding" task. It receives the concatenated data of the original and intermediate images, predicts the pixel-level R, G, and B channel gain values ​​through convolution operations, and outputs a detail-encoded gain map.

[0058] 4. HDR Composition Module: Includes a built-in multiplication unit. This module performs the final HDR = SDR × GainMap calculation. It can be designed to be compatible with existing image signal processor (ISP) hardware, enabling fast rendering on the edge.

[0059] In summary, this invention first proposes a gain map representation with three independent channels: red, green, and blue (RGB). Technically, this invention utilizes channel-wise modulation to encode lost color and texture details in overexposed or underexposed areas by leveraging the differences in gain values ​​between different channels. In contrast, existing gain maps (such as the currently used HDR display standard) typically use single-channel grayscale representations. Their implementation calculates the global brightness ratio of HDR to SDR and applies the same gain coefficient to all channels of the SDR during reconstruction. The fundamental difference lies in the fact that existing single-channel gain methods can only stretch the overall brightness; for areas in the SDR that are already saturated in all three channels (such as pure white), they cannot introduce color changes or texture levels. In contrast, the three-channel design of this invention can mathematically recover previously non-existent color and high-frequency texture information through the independent values ​​of the gain values ​​of the three channels.

[0060] Secondly, this invention proposes a decoupled architecture for a two-stage detail recovery network (DSDR-Net), which employs a two-stage serial architecture of "first generating intermediate details, then predicting the gain map." The first stage uses a diffusion model to generate an intermediate image containing details, and the second stage uses a convolutional network (GainCNN) to learn how to transform these details into a gain map. In contrast, existing diffusion model-based HDR reconstruction methods (such as LeDiff) typically adopt an end-to-end direct generation approach, that is, directly using the diffusion model to output the final HDR image or its latent representation. The fundamental difference between the two is that the end-to-end generation of existing technologies is prone to "generative bias," that is, unintentionally tampering with the normal structural information of the original image while recovering details; this invention, through decoupling design, only uses the diffusion model to provide detail references, and the final reconstruction is achieved through the multiplication of SDR and the gain map, thereby forcibly preserving the original structure and fidelity of non-truncated regions of the original image.

[0061] Finally, this invention proposes a control mechanism for wordless semantic guidance and spatial feature injection. In the detail recovery network (DRN), a wordless branch (PFB) is designed to extract global semantic vectors using the CLIP visual encoder to replace text prompts; simultaneously, a spatial feature branch (SFB) is designed to extract multi-scale spatial features and inject them into the diffusion model. In contrast, standard diffusion model generation typically relies on user-inputted text prompts to control the generated content and lacks a strong constraint mechanism on the original image's geometry. The fundamental difference lies in the fact that existing technologies cannot automatically adapt to unknown image content (requiring manual input of prompts) and are prone to structural deformation; this invention achieves fully automated semantic understanding through PFB and locks the geometric contours of the original SDR image at the feature level through SFB, ensuring that the generated details are accurately attached to the original object structure, thus solving the problem of "random drawing" in traditional generation models.

[0062] Example 2: Based on Example 1, but with some differences, the following experiments, combined with specific examples, further illustrate and characterize the effectiveness of the image high dynamic range reconstruction method and system based on detail coding gain map proposed in this invention. The specific content is as follows: The detail coding gain map (DEgainmap) proposed in this invention is a three-channel gain map. It achieves the encoding of missing details in overexposed / underexposed areas and the preservation of details in normally exposed areas through channel-level gain modulation. Its mathematical definition is as follows:

[0063] in, , , These represent the independent gain values ​​of the red (R), green (G), and blue (B) channels, respectively. The detail-coded gain map (DEgainmap) is fused with the input SDR image through pixel-by-pixel multiplication to achieve HDR reconstruction. The reconstruction formula is:

[0064] In the formula, For input SDR images in channels pixel values ​​on To reconstruct HDR images in channels pixel values ​​on This indicates a pixel-by-pixel multiplication operation.

[0065] The Depth Retrieval Network (DRN) generates missing details using a diffusion model, and its semantically guided feature extraction function is as follows:

[0066] in, For pre-trained CLIP visual encoder, To input an SDR image, This is the extracted visual semantic feature vector. This feature vector is mapped to the conditional latent space of the diffuse U-Net via PFBNet. PFBNet consists of two linear layers (containing layer normalization and Leaky ReLU activation) and one dimensionality-reducing linear layer, outputting semantic embedding features. .

[0067] The spatial control feature extraction function of the Depth of Details (DRN) is:

[0068] in, It is a spatial feature branching network (SFBNet). The input SDR image is encoded using VAE. Semantic guided embedding features generated for PFBNet A set of 12 spatial control features

[0069] The training loss function for the Depth of Details Network (DRN) is:

[0070] in, For balance coefficient, Based on the predicted loss of diffused noise, Loss of detail recovery for mask-based regions; Noise prediction loss: , In the formula, Predicting noise for U-Net ( (Residual control features extracted by SFBNet) For time steps A noisy latent vector; Loss in area detail recovery:

[0071] In the formula, For overexposed / underexposed areas, Generate images for DRN. This is a real image.

[0072] Gain Map Prediction (GainCNN) with input SDR image Detail-enhanced images generated by detail restoration networks (DRN) As input, the output is a normalized gain map, and its prediction function is:

[0073] In the formula, This refers to the GainCNN network (which includes an encoder, bottleneck layer, and decoder). This indicates that two images are stitched together along the channel dimension. This represents the normalized three-channel gain value. The normalized gain value generated by GainCNN is then denormalized to a linear gain value via an exponential mapping. .

[0074] The training loss function for GainCNN is:

[0075] in, , , These are the weighting coefficients for each loss term; Loss of local detail recovery :calculate and In the mask Smoothing L1 loss within the region is used to enhance the ability to recover details in overexposed / underexposed areas; Global exposure correction loss :calculate and The average smoothed L1 loss ensures global exposure correction and color consistency; Edge consistency loss Edge intensity maps are extracted using the Sobel operator, and calculations are performed. and The average L1 distance of the edge map is calculated using the following formula:

[0076] In the formula, , They are respectively , Edge intensity map, For the set of all pixel locations, This represents the total number of pixels.

[0077] We selected the current mainstream single-image HDR reconstruction methods as comparison objects, including: HDRCNN, SingleHDR, ExpandNet, and Multi-Exp.

[0078] Test dataset: The publicly available Single-Image High Dynamic Range (SI-HDR) benchmark dataset is used, which contains 181 HDR images, covering various scenes such as natural landscapes, portraits, and urban environments, and including different lighting conditions such as indoor / outdoor and day / night. Evaluation metrics: Three industry-recognized metrics are used, including: 1. HDR-VDP3: Evaluates the perceptual fidelity of HDR images; a higher score indicates better perceptual quality. 2. PU21-PIQE: A no-reference image quality metric that evaluates the perceptual fidelity after tone mapping; a lower score indicates better quality. 3. FID: Evaluates the realism of the generated image; a lower score indicates that the generated result is closer to the real scene.

[0079] The test results of the method proposed in this invention and existing technologies on overexposed and underexposed image subsets are as follows: Figure 4 And as shown in Table 1: Table 1

[0080] Combination Figure 4 As can be seen from Table 1, the method of the present invention has the following outstanding advantages compared with the prior art: 1. Superior Detail Recovery Capability: As shown in the table, this invention achieves an HDR-VDP3 score of 8.0196 / 0.8371 for underexposed images, significantly higher than SingleHDR (7.0957 / 1.1727) and ExpandNet (6.8704 / 1.3522). Furthermore, the PU21-PIQE score (6.2288 / 3.6434) is far lower than HDRCNN (17.5512 / 9.9654) and SingleHDR (17.0072 / 11.9770), indicating that this invention can effectively recover the fine structure and color information of overexposed / underexposed areas without obvious artifacts (such as...). Figure 4 As shown, the reconstruction results of this invention have clearer textures and stronger semantic consistency. 2. Enhanced compatibility and practicality: The DEgainmap proposed in this invention is fully compatible with existing HDR display pipelines. Compared to traditional single-channel gain maps, it retains richer details and color information (such as...). Figure 5 As shown, the color recovery accuracy of DEgainmap is significantly better than that of traditional gain map. 3. High-resolution reconstruction support: Existing diffusion model methods are limited by computational resources and cannot support high-resolution output above 2k. However, this invention, through the lightweight design of DEgainmap and a two-stage network architecture, ensures high-resolution output while avoiding distortion of the fine structure of the original image. 4. Low data dependency: This invention adopts a self-supervised training strategy, which can complete training without HDR real labels. Compared with existing methods that rely on paired SDR / HDR data, it has a wider range of applicable scenarios.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of image high dynamic range reconstruction based on a details coding gain map, characterized in that, Includes the following steps: S1. Data preprocessing: Obtain the input single standard dynamic range image and preprocess the image to obtain image data in linear space or normalized floating-point tensor format; S2. Detail Generation Based on Diffusion Model: A detail recovery network design is proposed, specifically including: S2.1 Introducing a wordless branch: A pre-trained visual encoder is used to directly extract global visual feature vectors from the input image; the global visual feature vectors are transformed into semantic embeddings through a mapping network and used as a conditional injection diffusion model to enable the network to automatically understand the image content; S2.2 Introducing a spatial feature branch: Establish a lightweight convolutional network branch to extract multi-scale spatial features from the input image; inject the multi-scale spatial features layer by layer into the backbone network of the diffusion model to form strong spatial constraints; S2.3 Generating Spatial Results: Through an iterative denoising process, an intermediate generated image with the same resolution as the original image and containing rich details is output. S3. Detail Encoding Gain Map Prediction: A gain convolutional neural network design is proposed, specifically including: S3.1 Input Construction: The original standard dynamic range image is stitched together with the intermediate generated image generated in the first stage in the channel dimension to form 6-channel input data; S3.2 Network Inference: Input to the gain convolutional neural network, learn the difference between the original standard dynamic range image and the intermediate generated image, and predict the "gain coefficient" required to transform the original standard dynamic range image into a detailed intermediate generated image; S3.3 Three-channel differentiated output: Outputs a three-channel (R, G, B) gain map. In the normal exposure area, the gain values ​​of the three channels R / G / B are similar; in the overexposed / underexposed area, the gain values ​​of the three channels R / G / B are different. S4. Final HDR Composition: The processed Standard Dynamic Range (SDR) image is multiplied pixel-by-pixel with the three-channel (R, G, B) gain map to obtain the reconstructed High Dynamic Range (HDR) image. The specific details and calculation formula are as follows: HDR_c(x,y) = SDR_c(x,y) × G_DE_c(x,y) Wherein, SDR represents the standard dynamic range image; G_DE represents the three-channel gain map; and c represents the R, G, and B channels.

2. The method of claim 1, wherein, The preprocessing described in S1 includes a gamma correction removal operation, which converts the image data to a linear space.

3. The method of claim 1, wherein, The visual encoder described in S2.1 is a CLIP visual encoder.

4. The method of claim 1, wherein, The backbone network of the diffusion model described in S2.2 is a U-Net structure.

5. The method of claim 1, wherein, The gain convolutional neural network described in S3.2 is a fully convolutional neural network.

6. The method of claim 1, wherein, It also includes a step of self-supervised joint training of the detail recovery network and the gain convolutional neural network, specifically including: Forward generation process: Input standard dynamic range training samples → Generate intermediate detail maps through a detail recovery network → Generate gain maps through a gain convolutional neural network → Synthesize predicted HDR images; Inverse mapping supervision: Using a differentiable tone mapping operator, the predicted HDR image is compressed back into the SDR domain to obtain the "reconstructed SDR image"; Composite loss function design: (1) Local detail loss: In the overexposed / underexposed mask area, the "reconstructed SDR image" is forced to approximate the "intermediate detail map" to ensure that the details are effectively encoded into the gain map; (2) Global consistency loss: In the normal exposure area, the "reconstructed SDR image" is forced to approximate the "original input image" to prevent image distortion; (3) Edge consistency loss: constrain edge gradients to improve texture sharpness.

7. A system for image high dynamic range reconstruction based on detail coding gain map using the method of any of claims 1-6, characterized in that, include: Image acquisition and preprocessing module: used to read image data from camera or memory, and perform gamma correction removal and normalization operations to provide linear space input data for subsequent networks; Detail restoration module: It has a built-in pre-trained visual encoder and diffusion model to perform the task of generating details from scratch. It uses semantic vectors to replace text prompts, uses spatial feature maps to constrain the generation range, and outputs intermediate generated images. Gain map generation module: It has a built-in fully convolutional neural network to perform the "information encoding" task. It receives the spliced ​​data of the original image and the intermediate image, predicts the pixel-level R, G and B three-channel gain values ​​through convolution operation, and outputs the detail-encoded gain map. HDR Composition Module: It has a built-in multiplication unit to perform the final HDR = SDR × GainMap operation. It is compatible with image signal processor hardware and enables fast rendering on the device side.

8. The system as described in claim 7, characterized in that, The visual encoder is a CLIP visual encoder; the backbone network of the diffusion model is a U-Net structure.

9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, the instruction, program, code set, or instruction set being loaded and executed by the processor to implement the image high dynamic range reconstruction method based on detail-coded gain map as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, at least one program, code set, or instruction set, which is loaded and executed by a processor to implement the image high dynamic range reconstruction method based on detail-coded gain map as described in any one of claims 1-7.