Lightweight high dynamic range image synthesis method based on parallel visual self-attention model

The lightweight Transformer architecture combined with parallel visual self-attention module and local context extractor solves the problems of ghosting and high computational cost in HDR image generation, achieving high-quality and fast HDR image generation, which is suitable for edge device deployment.

CN118674635APending Publication Date: 2024-09-20BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410579346.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Existing HDR image generation algorithms are prone to ghosting artifacts when processing camera motion and dynamic foreground objects, and have large model parameters, high computational costs, and slow inference speeds, making them unsuitable for deployment on edge devices such as smartphones.

Method used

It adopts a lightweight Transformer architecture that combines a parallel visual self-attention module and a local context extractor to extract low-level features through the convolutional layer and spatial attention module, segment the image into non-overlapping blocks, and utilize window multi-head self-attention and lightweight multi-head self-attention. Layer perceptrons capture global and local dependencies, reducing model parameters and computational complexity.

Benefits of technology

It achieves the generation of high-quality HDR images, significantly reduces ghosting, improves inference speed and model lightweight, and reduces the number of parameters by 40%, making it suitable for deployment on edge devices such as smartphones.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674635A
    Figure CN118674635A
Patent Text Reader

Abstract

The invention provides a method for synthesizing a high-quality ghosting-free high-dynamic-range (HDR) image from a multi-exposure low-dynamic-range (LDR) image based on a parallel visual self-attention model. The method comprises the following steps: 1) firstly, extracting low-layer features from three input LDR images with different exposure values by using a convolutional layer and a space attention module; 2) segmenting the low-layer features into non-overlapping image blocks; and 3) sending the image to a parallel visual self-attention module, and effectively capturing features and information in the image. And 4) finally, synthesizing a final HDR image through a convolutional layer and an activation function. The parallel architecture of the model enables the network to become wider and deeper, and three LDR images with different exposures are synthesized into a high-quality ghosting-free HDR image through faster speed and fewer computing resources, so that the method is very suitable for being deployed on various edge devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer image processing, and specifically, is a lightweight deep learning method for synthesizing low dynamic range (Low Dynamic Range, LDR) images into high dynamic range (High Dynamic Range, HDR) images. Background Art

[0002] High-Dynamic Range (HDR) is a technology widely used in computer graphics and photography. Its goal is to achieve a larger exposure dynamic range than traditional digital imaging technology, that is, to present light and dark details more comprehensively. Compared with LDR images, HDR images have a wider dynamic range, can provide brighter, high-contrast details and a wider color range, thus creating a more realistic and lifelike visual effect and improving the restoration of picture quality.

[0003] In addition, HDR technology is not only used in professional photography and filmmaking, but also widely used in daily life, such as smartphones, tablets, and TVs. By using HDR technology, these devices can provide more vivid highlights and shadow details, as well as more delicate color performance, thereby enhancing the user's viewing experience. Therefore, there is an increasing demand for algorithms that generate HDR images from multiple LDR images with different exposure values.

[0004] HDR reconstruction algorithms face two major challenges: (1) First, camera motion and dynamic foreground objects often lead to undesirable ghosting artifacts in the reconstructed HDR images; (2) Second, existing models have large parameter counts, high computational costs, and slow inference speeds, which are not conducive to deployment on edge devices such as smartphones.

[0005] Previous studies can be divided into two categories: traditional methods and deep learning methods. Traditional methods usually rely on motion registration techniques, which often result in slow inference speed. Kalantari et al. proposed the first convolutional neural network (CNN)-based method to process HDR imaging of dynamic scenes and provided a benchmark dataset. They used optical flow to align three LDR images and then fused the images through a CNN network. Due to the powerful feature extraction and representation capabilities of the CNN network, the HDR image results generated by the algorithm are better than those of traditional algorithms. However, due to the optical flow process, the inference speed of the algorithm is slow. And the algorithm will introduce obvious ghosting in the moving part of the character. Subsequent convolutional neural network-based methods further improved the HDR image generation algorithm, but still failed to effectively remove long-distance ghosting.

[0006] In order to solve the long-distance ghost problem, it is necessary to introduce the Transformer. The Transformer is a deep learning model that has a revolutionary impact in the field of natural language processing (NLP). This model was originally proposed by Vaswani et al. in the 2017 paper "Attention Is All You Need". The core feature of the Transformer model is that it relies entirely on the attention mechanism to process sequence data, rather than relying on the traditional recurrent neural network (RNN) or convolutional neural network (CNN) structure. Traditional RNNs are susceptible to gradient vanishing or gradient exploding when processing long sequences due to their recurrent structure, while Transformers effectively capture long-distance dependencies in sequences through the self-attention mechanism. Vision Transformer (ViT) is a model that combines the Transformer architecture with computer vision tasks. It was proposed by Google Research in the 2020 paper "An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale". ViT treats image processing tasks as sequence processing tasks, where the image is segmented into a series of patches, and each patch is regarded as a "word" in the sequence. Therefore, the Vision Transformer (ViT) algorithm can improve the long-distance modeling capability of the HDR image generation model, thereby more effectively removing ghosting. HDR-Transformer is the first Transformer framework for HDR ghost removal, showing significant performance improvements over previous methods, but its inference speed and model size still need to be further improved to facilitate its deployment on edge devices.

[0007] In summary, it is very important to develop a lightweight Transformer-based HDR image generation algorithm. Summary of the invention

[0008] The purpose of the present invention is to overcome the shortcomings of the prior art and propose a lightweight Transformer-based deep learning method for synthesizing LDR images into HDR images.

[0009] The present invention is achieved by adopting the following technical solutions:

[0010] Step 1: First, use the convolutional layer and spatial attention module to extract low-level features from the three input LDR images with different exposure values. The resolution of the input images is 1500×1000.

[0011] Step 2: Split the low-level features into non-overlapping image patches through patch embedding.

[0012] Step 3: Send it to the Parallel Vision Transformer, and effectively capture the global and local dependencies in the image through the Vit branch and the local context extractor (LCE) branch. For the global branch, this method uses the parallel ViT module based on window multi-head self-attention to capture long-distance contextual relationships, and introduces the Light MLP module into it; for the local branch, this method uses the local context extractor (LCE) to extract local features through convolution. Through this combination, global features and local features work in a complementary way.

[0013] Step 4: Finally, the final HDR image is synthesized through the convolution layer and activation function.

[0014] The advantages and positive effects of the present invention are: the present invention adopts a parallel ViT module to effectively capture features and long-distance information in the image through a self-attention mechanism. This parallel architecture allows the network to become wider and shallower, thereby improving the inference speed while maintaining high-quality HDR image output. At present, this method is even faster than the fastest existing model HDR-Transformer. The present invention uses window multi-head self-attention (W-MSA) in the parallel ViT module to effectively reduce model parameters. This algorithm contains 720,000 parameters, which is about 40% less than that of HDR-Transformer. This method first incorporates a lightweight multi-layer perceptron (Light MLP) module into the algorithm, which not only improves the peak signal-to-noise ratio (SSIM), but also ensures a fast inference speed and a small model size. Therefore, this method is very suitable for deployment on edge devices such as smartphones to synthesize HDR images. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is the overall block diagram of the algorithm network of the present invention.

[0016] Figure 2 This is the detailed structure diagram of the parallel Vit module.

[0017] Figure 3 This is a comparison chart between Light MLP and MLP.

[0018] Figure 4 It is a comparison diagram of the HDR image generated by the present invention and the HDR image generated by other methods. DETAILED DESCRIPTION

[0019] The present invention is further described in detail below with reference to the accompanying drawings.

[0020] First, if Figure 1 As shown in FIG. 1 , the present invention first uses convolutional layers and spatial attention modules to extract coarse features from three LDR images with a resolution of 1500×1000. In this method, three independent convolutional layers are first used to extract shallow features f from the three input images. 1 、f 2 and f 3 Then, the present invention uses the spatial attention network SA to combine the features of the first and third images with the features of the second image to create a feature map m 1 and m 3 Afterwards, the present invention calculates the attention feature f by multiplying the attention map with the previous feature 1 ′ and f 3 ′. Then, f 1 ′、f 2 and f 1 ′ are concatenated and fed into subsequent convolutional layers for further processing. In spatial attention networks, convolutional layers play a dual role of both enhancing feature representation and adding inductive biases to subsequent transformer layers.

[0021] m i =SA(f i ,f 2 ),i=1,3 (1)

[0022] f i ′=f i ·m i ,i=1,3 (2)

[0023] Then this method uses patch embedding to segment the image into non-overlapping patches. The purpose of this is to convert the input image into sequence data so that the Transformer architecture can be used to process visual tasks later.

[0024] Subsequently, the data will be fed into the Parallel Vit (Parallel Vision Transformer) module to reconstruct a high-quality HDR image without ghosting. This is achieved by effectively capturing the global and local dependencies in the image through two Vit branches and one LCE branch. Parallel ViT is to parallelize several consecutive Transformer Blocks, which can reduce the depth of the model and increase the width of the model. In the parallel ViT module, this method uses a parallel structure and a lightweight multi-layer perceptron (Light MLP), which greatly reduces the parameter size of the model.

[0025] like Figure 2 As shown, the parallel ViT module includes two Vit branches and one LCE branch. The ViT branch includes a window-based multi-head self-attention (W-MSA) module and a lightweight multi-layer perceptron (Light MLP) with residual connections. The W-MSA module allows the model to learn information in different representation subspaces, enhancing its expressiveness of HDR ghosting removal. In addition, compared with the global self-attention mechanism, W-MSA only performs calculations within the local window, significantly reducing the computational complexity. Compared with the two connected sequential ViTs, the parallel ViT produces an architecture with the same number of parameters and computational complexity, while being wider and shallower. This design allows more parallel processing and reduces latency. The feature E after the patch is embedded 0 As input, each parallel ViT branch can be described as:

[0026] E 1 =W-MSA(LN(E 0 )+E 0 ) (3)

[0027] PVT Output =LightMLP(LN(E 1 ))+E 1 (4)

[0028] like Figure 2 As shown in Figure 2, the local context extractor (LCE) branch in the parallel ViT module is used to obtain local features, which extracts information from neighboring pixels and selects cross-channel features for fusion. 0 Taking it as input, the local extraction process can be described as follows:

[0029] E 2 =Conv(LN(E 0 )) (5)

[0030] E 3 =Sigmoid(FC(RELU(FC(Pool(E 2 ))))) (6)

[0031] LCE Output =E 2 ·E 3 (7)

[0032] like Figure 3As shown in the figure, this method specifically explains the advantages of Light MLP. In other Transformer-based HDR synthesis algorithms, the multilayer perceptron (MLP) is generally composed of two linear layers. The first linear layer increases the dimension of the input in order to obtain more correlations between pixels. Then the second linear layer reduces its dimension so that the output can maintain the same shape as the input. In this method, Light MLP replaces this module. In Light MLP, 1×1 convolution is used to simulate the linear layer, which is used to perform weighted summation of pixels at the same position in different channels. The 1×1 convolution designed in this method keeps the number of input and output channels the same, instead of changing the dimension like the common MLP. This is the key to reducing the number of parameters. A 3×3 grouped convolution is also added between the two 1×1 convolutions. Grouped convolution can calculate pixels in a small area, one convolution corresponds to one channel, which also reduces the number of parameters compared to ordinary global convolution. Therefore, Light MLP can not only extract the correlation of pixels at the same position in different channels, but also extract the relationship between pixels in a small 3×3 area under the same channel. Taking the input of a feed-forward network (FFN) layer of size h×w×c as an example, the number of trainable parameters of MLP and Light MLP are:

[0033]

[0034]

[0035] In order to verify the effect of the present invention, the present invention has been compared with other algorithms on the Kalantari dataset, as shown in the following table.

[0036] method Parameter quantity PSNR-μ PSNR-l SSIM-μ SSIM-l Sen - 40.80 38.11 0.9808 0.9721 Hu - 35.79 30.76 0.9717 0.9503 Kalantari - 42.67 41.23 0.9888 0.9846 DeepHDR 20.4M 41.65 40.88 0.9860 0.9858 AHDRNet 1.24M 43.63 41.14 0.9900 0.9702 NHDRRNet 38.1M 42.41 41.43 0.9877 0.9857 HDR-GAN 2.56M 43.92 41.57 0.9905 0.9865 HDR-Transformer 1.22M 44.32 42.18 0.9916 0.9884 The present invention 0.71M 43.18 41.50 0.9906 0.9872

[0037] From the table, we can see that this method has the least number of parameters among all the methods, and the PSNR and SSIM indicators are among the best. Figure 4 It can also be seen that the HDR image generated by this method is of high quality, successfully removing ghosting and generating rich details in the moving part of the picture. In terms of the speed of generating images, the present invention is faster than the fastest HDR-Transformer currently available. On an RTX 2080Ti, it takes 5.33 seconds for HDR-Transformer to synthesize an image, while the present invention takes 2.10 seconds.

[0038] In summary, based on the deep learning method, the present invention proposes a lightweight Transformer-based method for synthesizing LDR images into HDR images, and verifies it on a public dataset, ensuring that the present invention has greater advantages than other methods in terms of parameter quantity and inference speed while generating high-quality HDR images.

Claims

1. A lightweight method for synthesizing high-quality ghost-free high dynamic range (HDR) images from multi-exposure low dynamic range (LDR) images based on a parallel vision self-attention model (Parallel Vision Transformer), characterized in that The following steps are involved: Step 1: First, use the convolutional layer and spatial attention module to extract low-level features from the three input LDR images with different exposure values. The resolution of the input images is 1500×1000. Step 2: Split the low-level features into non-overlapping image patches through patch embedding. Step 3: Send it to the Parallel Vision Transformer, and effectively capture the global and local dependencies in the image through the Vit branch and the local context extractor (LCE) branch. For the global branch, this method uses the parallel ViT module based on window multi-head self-attention to capture long-distance contextual relationships, and introduces the Light MLP module into it; for the local branch, this method uses the local context extractor (LCE) to extract local features through convolution. Through this combination, global features and local features work in a complementary way. Step 4: Finally, the final HDR image is synthesized through the convolution layer and activation function.

2. According to the above method of extracting low-level features from three LDR images with different exposure values ​​using convolutional layers and spatial attention modules, it is characterized by: The resolution of the input LDR images is 1500×1000. Three independent convolutional layers are first used to extract shallow features from the three input images. Then, the present invention uses a spatial attention network to combine the features of the first and third images with the features of the second image to create a feature map. After that, the present invention calculates the attention features by multiplying the attention map with the previous features. Subsequently, the attention features are concatenated.

3. According to the above, the Parallel Vision Transformer module is used to effectively capture the global and local dependencies in the image, which is characterized by: The module consists of two Vit branches and one LCE branch. The ViT branch includes a window-based multi-head self-attention (W-MSA) module and a lightweight multi-layer perceptron (Light MLP) with residual connections. The local context extractor (LCE) branch contains multiple convolutional layers and pooling layers.

4. A method for synthesizing a final HDR image based on the above-mentioned convolutional layer and activation function, characterized in that: The convolution layer and Sigmoid function are used to restore the data to the image size and obtain the final output.

5. The method for synthesizing high-quality ghost-free high dynamic range (HDR) images from multi-exposure low dynamic range (LDR) images based on a parallel vision self-attention model (Parallel Vision Transformer) according to any one of claims 1 to 4, characterized in that: The step 4 also includes the step of evaluating the network performance through indicators such as PSNR, and then continuously training the network to improve the network performance.