Lightweight image enhancement method based on wavelet transform and deep learning
By combining wavelet transformation and deep learning methods, the problems of instability and high computing consumption of traditional image enhancement methods are solved, and the image efficiency and high quality enhancement is achieved, contrast and clarity are improved, and image processing in different scenarios is adapted to image processing.
Patent Information
- Application Number
- CN202410907364.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Traditional image enhancement methods have problems such as instability and high computing resource consumption in improving image quality, and wavelet transformation is not effective in improving image contrast.
Combining wavelet transformation and deep learning, a lightweight image enhancement method was designed. Through four residual modules based on deep learning and a multi-directional wavelet transformation layer, a feature fusion layer and an output convolutional layer are used to introduce trainable The gamma mapping mechanism optimizes the frequency domain decomposition and feature extraction of images.
It realizes efficient and high-quality enhancement of images, improves the contrast and clarity of images, enhances visual effects, adapts to image processing of different scenes and needs, and shows good computing efficiency on resource-constrained devices.
Smart Images

Figure CN118887112A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a lightweight image enhancement method based on wavelet transform and deep learning. Background Art
[0002] In today's digital image processing field, image enhancement technology is a crucial task, which aims to improve the visual quality of images to meet the needs of various applications, such as computer vision, medical image processing, remote sensing image analysis, etc. Traditional image enhancement methods are usually based on filtering, histogram equalization and other technologies, but these methods often have problems such as unstable enhancement effect and easy distortion. With the rapid development of deep learning technology, deep learning-based image enhancement methods have achieved remarkable results in improving image quality, but these methods often require a lot of computing resources and parameters, which limits their application on resource-constrained devices. On the other hand, wavelet transform, as a multi-scale analysis tool, can effectively capture the local features and global structure of images and is good at enhancing the detail information of images, so it is widely used in the field of image processing. However, the traditional wavelet transform does not improve the contrast of images well when processing images. Therefore, it is necessary to develop a lightweight image enhancement method that combines wavelet transform and deep learning to overcome the problems of traditional methods and improve the visual quality of images while maintaining computational efficiency. Summary of the invention
[0003] Purpose of the invention: In order to overcome the shortcomings of the prior art, the present invention provides a lightweight image enhancement method based on wavelet transform and deep learning, combines wavelet transform with deep learning, and proposes a lightweight image enhancement method, which fully utilizes the frequency domain decomposition capability of wavelet transform and the feature learning capability of deep learning, and realizes efficient and high-quality enhancement processing of images.
[0004] Technical solution: To achieve the above purpose, the lightweight image enhancement method based on wavelet transform and deep learning of the present invention includes four residual modules established based on deep learning, a wavelet transform module composed of multiple wavelet transform layers in different directions, a feature fusion layer and an output convolution layer; and includes the following steps:
[0005] S1, obtain the image to be processed and perform preprocessing;
[0006] S2, four residual modules based on deep learning extract the features of the input image respectively;
[0007] S3, extracting features of the input image using a wavelet transform module consisting of multiple wavelet transform layers in different directions;
[0008] S4, the features extracted by the wavelet transform module are fused with the features extracted by the four residual modules through the feature fusion layer to form a comprehensive feature map;
[0009] S5. Perform a convolution operation on the comprehensive feature map through the output convolution layer to obtain an image enhancement model, and output the image enhanced.
[0010] Furthermore, in the step S2, the output of the convolution layer of each residual module is spliced with the output feature image of the previous residual module to construct a residual connection; the convolution layer of the first residual module splices the output feature image and the initial input image to obtain a first residual feature image; the convolution layer of the second residual module splices the output feature image and the output image of the first residual module to obtain a second residual feature image; the convolution layer of the third residual module splices the output feature image and the output image of the second residual module to obtain a third residual feature image; the convolution layer of the fourth residual module splices the output feature image and the output image of the third residual module to obtain a fourth residual feature image.
[0011] Furthermore, in the step S3, the wavelet transform module includes wavelet exchange layers in the horizontal direction, the vertical direction and the two diagonal directions; and the wavelet filter in the wavelet exchange layer in each direction is customized; the output of the wavelet exchange layer in each direction is connected to a corresponding trainable gamma mapping layer.
[0012] Furthermore, the features extracted by the wavelet exchange layers in the horizontal direction, vertical direction and two diagonal directions in the wavelet exchange module are respectively output through the corresponding trainable gamma mapping layers to output the horizontal direction wavelet transform feature map, the vertical direction wavelet transform feature map, the first diagonal direction wavelet transform feature map and the second diagonal direction wavelet transform feature map.
[0013] Furthermore, in the step S4, the feature fusion layer performs channel merging on the four residual feature maps obtained by the four residual modules and the four enhanced feature wavelet transform feature maps obtained by the wavelet exchange layers in four different directions to obtain a comprehensive feature map, thereby forming a feature fusion.
[0014] Furthermore, the training of the image enhancement model includes the following steps:
[0015] S1-1. Define and compile the model, use the Adam optimizer to compile the image enhancement model, and define the loss function;
[0016] S1-2, data preparation, using a one-to-one image dataset, each sample contains an original image and a corresponding target image, and the original image is used as input during training, and the target image is used as a label;
[0017] S1-3. Use image datasets to train the image enhancement model.
[0018] Furthermore, the loss function is composed of the gradient loss L grad , structural similarity index L SSIM , Perceptual loss L perceptual and L1 loss L L1 Composition; the loss function is calculated as follows:
[0019] L total =L grad +L L1 +5*L SSIM +L perceptual .
[0020] Furthermore, the gradient loss L grad The calculation of is as follows:
[0021]
[0022] In the formula, y true is the original image, y pred For the generated image, let and denote the gradient operators in the vertical and horizontal directions respectively, H and W denote the number of vertical and horizontal pixels of the image respectively, i is a positive integer greater than or equal to 1 and less than or equal to H, and j is a positive integer greater than or equal to 1 and less than or equal to W;
[0023] The structural similarity index L SSIM The calculation of is as follows:
[0024] L SSIM =1-SSIM(y true ,y pred )
[0025] Use TensorFlow's `tf.image.ssim` function to calculate the input real image y true and pred Generates the distance between images.
[0026] Furthermore, the perceptual loss L perceptual The calculation of is as follows:
[0027]
[0028] Where N is the number of features, indicating the number of layers or channels in the perception model; is the true value y pred The i-th layer features, is the predicted value y pred The i-th layer features of
[0029] The L1 loss L L1 The calculation of is as follows:
[0030]
[0031] Where H and W are the vertical and horizontal pixel numbers of the image, respectively. true (i, j) and y pred (i, j) represents the pixel value of the real image and the predicted image at position (i, j), respectively.
[0032] Beneficial effects: The lightweight image enhancement method based on wavelet transform and deep learning of the present invention combines the advantages of wavelet transform and deep learning, overcomes the limitations of traditional image enhancement methods, improves the effect and quality of image enhancement, and performs detailed enhancement processing on the image; introduces a trainable gamma mapping mechanism, and performs nonlinear mapping on the image by adjusting the gamma value, thereby improving the contrast and clarity of the image, enhancing the visual effect of the image, making the image enhancement process more flexible and controllable, and adapting to image processing of different scenes and needs; adopts multi-directional wavelet filters for feature extraction, enhances the sensitivity to features in different directions, improves the quality and visual effect of the image, and improves the quality and clarity of the image; adopts feature fusion to merge the wavelet decomposition results with the features extracted by deep learning, fully utilizes the advantages of both, achieves a more comprehensive image enhancement effect, realizes the comprehensive capture of different frequency and direction information of the image, and improves the visual quality and detail clarity of the image; through multi-directional wavelet filters and feature fusion, the ability to capture different frequency and direction information of the image is enhanced, making the image enhancement effect more comprehensive and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Attached Figure 1 Schematic diagram of image enhancement model;
[0034] Attached Figure 2 Some results for image number 2039 in the LSRW dataset;
[0035] Attached Figure 3 Partial results for image number 778 of the LSRW dataset. DETAILED DESCRIPTION
[0036] The present invention will be further described below in conjunction with the accompanying drawings.
[0037] As attached Figure 1 As shown, a lightweight image enhancement method based on wavelet transform and deep learning is characterized by: comprising four residual modules based on deep learning, a wavelet transform module composed of multiple wavelet transform layers in different directions, a feature fusion layer and an output convolution layer; comprising the following steps:
[0038] S1, obtain the image to be processed and perform preprocessing;
[0039] S2, four residual modules based on deep learning extract the features of the input image respectively;
[0040] S3, extracting features of the input image using a wavelet transform module consisting of multiple wavelet transform layers in different directions;
[0041] S4, the features extracted by the wavelet transform module are fused with the features extracted by the four residual modules through the feature fusion layer to form a comprehensive feature map;
[0042] S5. Perform a convolution operation on the comprehensive feature map through the output convolution layer to obtain an image enhancement model, and output the image enhanced.
[0043] An image enhancement model combining wavelet transform and deep learning includes components such as an input layer, a residual module, a wavelet decomposition module, a trainable gamma mapping layer, a feature fusion layer, and an output convolution layer composed of two convolution layers, which realizes detailed enhancement processing of the image; the input size of the input layer is (None, None, 3), which represents an RGB image of any size.
[0044] As attached Figure 1 As shown, in the step S2, the output of the convolution layer of each residual module is spliced with the output feature image of the previous residual module to construct a residual connection; the convolution layer of the first residual module splices the output feature image and the initial input image to obtain a first residual feature image; the convolution layer of the second residual module splices the output feature image and the output image of the first residual module to obtain a second residual feature image; the convolution layer of the third residual module splices the output feature image and the output image of the second residual module to obtain a third residual feature image; the convolution layer of the fourth residual module splices the output feature image and the output image of the third residual module to obtain a fourth residual feature image.
[0045] The convolutional layers of the first residual module, the second residual module, the third residual module and the fourth residual module have the same structure; the convolutional layer includes a convolution kernel of 16, a convolution kernel size of (3, 3), and an activation function of the ReLU function; and the filling method is selected to be the same.
[0046] As attached Figure 1As shown, in the step S3, the wavelet transform module includes wavelet exchange layers in the horizontal direction, the vertical direction and the two diagonal directions; and the wavelet filter in the wavelet exchange layer in each direction is customized; the output of the wavelet exchange layer in each direction is connected to a corresponding trainable gamma mapping layer; the trainable gamma mapping layer can adaptively learn and optimize mapping parameters, and by learning and optimizing mapping parameters, more flexible and accurate performance can be obtained, which can be applied to a wider range of scenarios; by adjusting the gamma value, the image is nonlinearly mapped, the contrast and clarity of the image are improved, and the visual effect of the image is enhanced. The trainable gamma mapping layer can train the mapping parameters of the gamma mapping layer according to the different requirements of the wavelet exchange layers in the horizontal direction, the vertical direction and the two diagonal directions.
[0047] The features extracted by the wavelet exchange layers in the horizontal direction, vertical direction and two diagonal directions in the wavelet exchange module are respectively output through the corresponding trainable gamma mapping layer to output the horizontal direction wavelet transform feature map, the vertical direction wavelet transform feature map, the first diagonal direction wavelet transform feature map and the second diagonal direction wavelet transform feature map. The wavelet exchange layer in the horizontal direction extracts the features of the initial input image, and then the image with the extracted features is input into the trainable gamma mapping layer for a series of image processing operations such as nonlinear transformation; finally, the horizontal direction wavelet transform feature map is obtained.
[0048] The wavelet exchange layer in the horizontal direction in the wavelet transform module inputs the image to be enhanced; the wavelet filter in the wavelet exchange layer in the horizontal direction is customized:
[0049] [[[-1,-1,-1],[1,1,1],[-1,-1,-1]],
[0050] [[-1,-1,-1],[1,1,1],[-1,-1,-1]],
[0051] [[-1,-1,-1], [1,1,1], [-1,-1,-1]]];
[0052] The vertical wavelet exchange layer in the wavelet transform module inputs the image to be enhanced; the wavelet filter in the vertical wavelet exchange layer is customized:
[0053] [[[-1,1,-1],[-1,1,-1],[-1,1,-1]],
[0054] [[-1,1,-1],[-1,1,-1],[-1,1,-1]],
[0055] [[-1,1,-1], [-1,1,-1], [-1,1,-1]]];
[0056] The wavelet exchange layer in the first diagonal direction in the wavelet transform module inputs the image to be enhanced; the wavelet filter in the wavelet exchange layer in the first diagonal direction is customized:
[0057] [[[1,-1,-1],[-1,1,-1],[-1,-1,1]],
[0058] [[1,-1,-1],[-1,1,-1],[-1,-1,1]],
[0059] [[1,-1,-1], [-1,1,-1], [-1,-1,1]]];
[0060] The wavelet exchange layer in the second diagonal direction in the wavelet transform module inputs the image to be enhanced; the wavelet filter in the wavelet exchange layer in the second diagonal direction is customized:
[0061] [[[-1,-1,1],[-1,1,-1],[1,-1,-1]],
[0062] [[-1,-1,1],[-1,1,-1],[1,-1,-1]],
[0063] [[-1,-1,1], [-1,1,-1], [1,-1,-1]]];
[0064] The customization of the wavelet filter elements in the wavelet exchange layer in the horizontal direction determines the sensitivity of the filter to horizontal edges, so as to detect edge changes in the horizontal direction; the customization of the wavelet filter elements in the wavelet exchange layer in the vertical direction determines the sensitivity of the filter to vertical edges, so as to detect edge changes in the vertical direction; the customization of the wavelet filter elements in the wavelet exchange layer in the two diagonal directions determines the sensitivity of the filter to the two diagonal edges, so as to detect edge changes in the two diagonal directions.
[0065] As attached Figure 1 As shown, in the step S4, the feature fusion layer performs channel merging on the first residual feature image, the second residual feature image, the third residual feature image and the fourth residual feature image respectively obtained by the four residual modules and the four enhanced features of the small horizontal direction wavelet transform feature map, the vertical direction wavelet transform feature map, the first diagonal direction wavelet transform feature map and the second diagonal direction wavelet transform feature map respectively obtained by the wavelet exchange layers in four different directions to obtain a comprehensive feature map to form a feature fusion; the obtained comprehensive feature map contains the feature information extracted by the wavelet transform module and the residual module at the same time, thereby realizing the fusion of features.
[0066] A comprehensive feature map is obtained by fusing four wavelet transform feature maps and four residual feature maps using a feature fusion layer. The comprehensive feature map passes through two convolution layers to output an image for image enhancement; the convolution kernels of the two convolution layers are 16, and the size of the convolution kernel is (3, 3), and the activation function is the ReLU function; the filling method is selected as the same; a convolution layer is used to further map the features to the RGB space to obtain the output image.
[0067] The training of the image enhancement model includes the following steps:
[0068] S1-1. Define and compile the model, use the Adam optimizer to compile the image enhancement model, and define the loss function;
[0069] S1-2, data preparation, using a one-to-one image dataset, each sample contains an original image and a corresponding target image, and the original image is used as input during training, and the target image is used as a label;
[0070] S1-3. Use image datasets to train the image enhancement model.
[0071] The loss function is composed of the gradient loss L grad , structural similarity index L SSIM , Perceptual loss L perceptual and L1 loss L L1 Composition; the loss function is calculated as follows:
[0072] L total =L grad +L L1 +5*L SSIM +L perceptual .
[0073] The gradient loss L grad The calculation of is as follows:
[0074]
[0075] In the formula, y true is the original image, y pred For the generated image, let and denote the gradient operators in the vertical and horizontal directions respectively, H and W denote the number of vertical and horizontal pixels of the image respectively, i is a positive integer greater than or equal to 1 and less than or equal to H, and j is a positive integer greater than or equal to 1 and less than or equal to W;
[0076] The structural similarity index L SSIM The calculation of is as follows:
[0077] L SSIM =1-SSIM(ytrue ,y pred )
[0078] Use TensorFlow's `tf.image.ssim` function to calculate the input real image y true and pred Generates the distance between images.
[0079] The perceptual loss L perceptual The calculation of is as follows:
[0080]
[0081] Where N is the number of features, indicating the number of layers or channels in the perception model; is the true value y pred The i-th layer features, is the predicted value y pred The i-th layer features of
[0082] The L1 loss L L1 The calculation of is as follows:
[0083]
[0084] Where H and W are the vertical and horizontal pixel numbers of the image, respectively. true (i, j) and y prud (i, j) represents the pixel value of the real image and the predicted image at position (i, j), respectively.
[0085] The model deployment of the trained image enhancement model includes the following steps:
[0086] S2-1, model export, export the trained image enhancement model into a format suitable for the target platform;
[0087] S2-2, platform adaptation, adapting and optimizing the exported model according to the characteristics and requirements of the target platform;
[0088] S2-3, Calling interface design, design the model calling interface, define the format and specifications of model input and output;
[0089] S2-4. Deployment service construction: build a model calling service on the target platform to provide online calling function of the model; deployment service construction can be achieved by building network services, developing mobile applications, building web applications, etc., so that users can call the model through the network or background to perform image enhancement operations.
[0090] As attached Figure 1As shown, in the parameter setting of the image enhancement model, the parameters of convolution layer 1, convolution layer 2, convolution layer 3, convolution layer 4, convolution layer 5 and convolution layer 6 are 448, 2752, 2752, 2752, 4480 and 425 respectively; the parameter amounts of gamma map 1, gamma map 2, gamma map 3 and gamma map 4 are all 1, so the total number of parameters of the model is 13623, all of which are trainable parameters.
[0091] The image enhancement method provided by the present invention has broad application prospects in the fields of digital photography, medical imaging, monitoring and security, satellite remote sensing, artistic creation, etc. By improving the contrast, clarity and details of the image, it can meet the high requirements of image quality in different fields and application scenarios, and provide users with high-quality image enhancement services and solutions. Figure 2 As shown in FIG. 1 , the image No. 2039 of the LSRW dataset is processed by other methods, such as the LightenNet method, the Zero-DCE method, and the RetinexNet method to enhance the image; at the same time, the lightweight image enhancement method of the present invention is used to obtain an enhanced image that is more similar to the target image. Similarly, as shown in FIG. Figure 3 As shown, the image No. 778 of the LOL dataset is processed by other methods, such as the LightenNet method, the Zero-DCE method and the RetinexNet method to process the enhanced image; at the same time, the lightweight image enhancement method of the present invention is used to obtain an enhanced image that is more similar to the target image than the images obtained by other methods.
[0092] The above is only a description of the preferred embodiments of the present invention. Ordinary technicians in this technical field can make several modifications and optimizations based on the above disclosure without departing from the above basic principles. These improvements and optimizations should be regarded as the understood protection scope of the present invention.
Claims
1. Lightweight image enhancement method based on wavelet transform and deep learning, Features: It includes four residual modules based on deep learning, a wavelet transform module composed of multiple wavelet transform layers in different directions, a feature fusion layer and an output convolution layer; and includes the following steps: S1, obtain the image to be processed and perform preprocessing; S2, four residual modules based on deep learning extract the features of the input image respectively; S3, extracting features of the input image using a wavelet transform module consisting of multiple wavelet transform layers in different directions; S4, the features extracted by the wavelet transform module are fused with the features extracted by the four residual modules through the feature fusion layer to form a comprehensive feature map; S5. Perform a convolution operation on the comprehensive feature map through the output convolution layer to obtain an image enhancement model, and output the image enhanced.
2. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 1, Features: In the step S2, the output of the convolution layer of each residual module is spliced with the output feature image of the previous residual module to construct a residual connection; the convolution layer of the first residual module splices the output feature image and the initial input image to obtain a first residual feature image; The convolution layer of the second residual module splices the output feature image and the output image of the first residual module to obtain a second residual feature image; the convolution layer of the third residual module splices the output feature image and the output image of the second residual module to obtain a third residual feature image; the convolution layer of the fourth residual module splices the output feature image and the output image of the third residual module to obtain a fourth residual feature image.
3. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 1, Features: In the step S3, the wavelet transform module includes wavelet exchange layers in the horizontal direction, the vertical direction and the two diagonal directions; and the wavelet filter in the wavelet exchange layer in each direction is customized; the output of the wavelet exchange layer in each direction is connected to a corresponding trainable gamma mapping layer.
4. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 3, Features: The features extracted by the wavelet exchange layers in the horizontal direction, vertical direction and two diagonal directions in the wavelet exchange module are respectively output through corresponding trainable gamma mapping layers to output horizontal wavelet transform feature maps, vertical wavelet transform feature maps, first diagonal direction wavelet transform feature maps and second diagonal direction wavelet transform feature maps.
5. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 1, Features: In the step S4, the feature fusion layer performs channel merging on the four residual feature maps obtained by the four residual modules and the four enhanced feature wavelet transform feature maps obtained by the wavelet exchange layers in four different directions to obtain a comprehensive feature map, thereby forming a feature fusion.
6. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 1, Features: The training of the image enhancement model includes the following steps: S1-1. Define and compile the model, use the Adam optimizer to compile the image enhancement model, and define the loss function; S1-2, data preparation, using a one-to-one image dataset, each sample contains an original image and a corresponding target image, and the original image is used as input during training, and the target image is used as a label; S1-3. Use image datasets to train the image enhancement model.
7. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 6, Features: The loss function is composed of the gradient loss L grad , structural similarity index L SSIM , Perceptual loss L perceptual and L1 loss L L1 Composition; the loss function is calculated as follows: L total =L grad +L L1 +5*L SSIM +L perceptual .
8. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 7, Features: The gradient loss L grad The calculation of is as follows: In the formula, y true is the original image, y pred For the generated image, let and denote the gradient operators in the vertical and horizontal directions respectively, H and W denote the number of vertical and horizontal pixels of the image respectively, i is a positive integer greater than or equal to 1 and less than or equal to H, and j is a positive integer greater than or equal to 1 and less than or equal to W; The structural similarity index L SSIM The calculation of is as follows: L SSIM =1-SSIM(y true ,y pred ) Use TensorFlow's `tf.image.ssim` function to calculate the input real image y true and pred Generates the distance between images.
9. The lightweight image enhancement method based on wavelet transform and deep learning according to claim 7, Features: The perceptual loss L perceptual The calculation of is as follows: Where N is the number of features, indicating the number of layers or channels in the perception model; is the true value y pred The i-th layer features, is the predicted value y pred The i-th layer features of The L1 loss L L1 The calculation of is as follows: Where H and W are the vertical and horizontal pixel numbers of the image, respectively. true (i, j) and y pred (i, j) represents the pixel value of the real image and the predicted image at position (i, j), respectively.
Citation Information
Patent Citations
Training method of deep residual network for removing moire of two-dimensional code
CN111340729A
MR image super-resolution reconstruction method and device, computer equipment and storage medium
CN111932460A
Image defogging method based on double-path residual convolutional neural network
CN112365414A
Image enhancement method and device fusing wavelet transform and attention mechanism
CN115170410A
Remote sensing image scene classification method fusing attention mechanism and multi-scale depth texture features
CN116051981A
Cited By
Robot low-light grabbing detection method based on wavelet domain vision enhancement
CN119734271A
