Infrared image and visible light image fusion method, system, device and medium
Through the image fusion model of the Restormer module and the Dense Block module, the problem of insufficient basic layer feature extraction in the fusion of infrared images and visible light images in the existing technology is solved, and more comprehensive feature extraction and fusion image quality improvement are achieved.
Patent Information
- Application Number
- CN202410765799.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-06
AI Technical Summary
Existing infrared image and visible light image fusion technology lacks effective basic layer feature extraction, and is limited by the CNN receptive field, resulting in insufficient global semantics for the detail layer feature extraction of the fused image.
The Restormer module and Dense Block module are used to form an image fusion model. Infrared and visible light images are divided into basic layers and detail layers through hierarchical processing, and weighted fusion is performed. The shallow features and deep feature splicing are combined with global attention to reconstruct the fused image.
The feature extraction pertinence of the fused image is improved, the loss of shallow features is avoided, and the generated fused image is better and contains more infrared image thermal radiation information and visible light image texture information.
Smart Images

Figure CN118608399A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a method, system, device and medium for fusing infrared images and visible light images. Background Art
[0002] Image fusion is a hot topic in the field of image processing. The purpose is to generate information-rich fused images by combining the output images of different sensors. Due to the hardware limitations of imaging devices, images obtained by a single type of sensor cannot fully present the information in the scene. For example, infrared detectors rely on the temperature radiation imaging of objects, which can highlight objects with high radiation intensity and avoid environmental interference, but the resolution is low and cannot express the detailed features and background conditions of objects. In contrast, visible light images have high resolution and can show rich texture features of objects under good conditions, with good visual effects, but in dark environments, it is easy to lose the target in the scene. Therefore, the fusion technology of infrared images and visible light images came into being, aiming to combine the thermal radiation information in infrared images with the texture information in visible light images in the same scene, so that the fused image avoids the shortcomings of low contrast and low resolution in infrared images and the sensitivity of visible light images to lighting conditions. The fused image is conducive to promoting downstream tasks such as image recognition, image segmentation and target detection.
[0003] In recent years, with the continuous development of deep learning, many deep learning models have been applied to the fusion of infrared images and visible light images and achieved good results. In the prior art, the infrared and visible light images are divided into basic layers and detail layers using filtering functions, and the corresponding layers are added to form new basic layers and detail layers. In order to highlight the details, the ResNet network is used to enhance the detail layer information, and finally the basic layer and detail layer are fused. However, this method only considers the detail layer of the image, but lacks the feature extraction of the basic layer. When calculating the loss function, the proportion of infrared image and visible light image information in the fused image is not considered. Later, this method proposed to use dense network blocks to splice shallow features with deep features, so as to achieve feature reuse. Compared with ResNet, it reduces the number of parameters and improves the efficiency of feature extraction. However, due to the limitation of the CNN receptive field, the shallow features lack global semantics. Summary of the invention
[0004] The purpose of the present invention is to provide a method, system, device and medium for fusing infrared images and visible light images to solve the problems existing in the above-mentioned prior art.
[0005] To achieve the above object, the present invention provides a method for fusing an infrared image and a visible light image, comprising: obtaining an image to be fused; the image to be fused comprises a visible light image and a corresponding infrared image;
[0006] Performing layered processing on the image to be fused to obtain a layered image; the layered image includes a basic layer image and a detail layer image;
[0007] The layered image is input into the image fusion model for image fusion to obtain a fused image, wherein the image fusion model includes a shallow feature extraction module, a deep feature extraction module and a feature fusion module connected in sequence, the shallow feature extraction module adopts a Restormer module, and the deep feature extraction module adopts a Dense Block module.
[0008] Optionally, performing layered processing on the image to be fused specifically includes:
[0009] Based on the guided filter, the visible light image and the infrared image are respectively decomposed to obtain the basic layer and the detail layer corresponding to each image; the basic layers corresponding to each image are fused according to a set ratio to obtain the basic layer image; and the detail layers corresponding to each image are fused according to a set ratio to obtain the detail layer image.
[0010] Optionally, a specific calculation formula for obtaining the basic layer image and the detail layer image is:
[0011]
[0012] Where, VI b For the base layer image, VI d is the detail layer image, V b is the basic layer of the visible light image, V d I is the detail layer of the visible light image; b is the basic layer of infrared image, I d It is the detail layer of infrared image.
[0013] Optionally, the training process of the image fusion model includes:
[0014] Acquire training data, wherein the training data includes a visible light training image and a corresponding infrared training image;
[0015] Performing layered processing on the training data to obtain layered training images;
[0016] An initial image fusion model is constructed, the layered training image is input into the initial image fusion model for image fusion, and training is performed with the goal of minimizing the sum of intensity loss and gradient loss between the fused image obtained after fusion and the input visible light training image and the corresponding infrared training image to obtain the image fusion model.
[0017] Optionally, the processing process of the image fusion model includes:
[0018] Inputting the layered image into the shallow feature extraction module to perform shallow feature extraction, and outputting shallow feature maps corresponding to the basic layer image and the detail layer image respectively;
[0019] Inputting the shallow feature map output by the shallow feature extraction module into the deep feature extraction module for feature extraction, and outputting the deep feature maps corresponding to the basic layer image and the detail layer image respectively;
[0020] The depth feature map output by the deep feature extraction module is used as the input of the feature fusion module for feature splicing, so that the depth feature map corresponding to the basic layer image and the depth feature map corresponding to the detail layer image are spliced and fused to obtain the fused image.
[0021] An infrared image and visible light image fusion system, comprising:
[0022] An image acquisition module, used to acquire an image to be fused; the image to be fused includes a visible light image and a corresponding infrared image;
[0023] An image layering module, used for performing layering processing on the image to be fused to obtain a layered image; the layered image includes a basic layer image and a detail layer image;
[0024] The image fusion module is used to input the layered image into the image fusion model for image fusion to obtain a fused image, wherein the image fusion model includes a shallow feature extraction module, a deep feature extraction module and a feature fusion module connected in sequence, the shallow feature extraction module adopts a Restormer module, and the deep feature extraction module adopts a Dense Block module.
[0025] An electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a method for fusing infrared images and visible light images.
[0026] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the infrared image and visible light image fusion method is implemented.
[0027] The technical effects of the present invention are:
[0028] The present invention divides infrared and visible light images into a basic layer and a detail layer respectively, and then weightedly fuses the corresponding layers to form a new basic layer and detail layer, so that subsequent feature extraction is more targeted; the present invention adopts a Restormer module and a Dense Block module to form an encoder. Since the receptive field of a traditional CNN network is small, the Restormer can extract shallow features based on global attention, and the Dense Block splices shallow features with deep features to avoid the loss of shallow features. By putting these features into the decoder, a better fused image can be reconstructed. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0031] Figure 1 is a diagram of the algorithm structure in an embodiment of the present invention;
[0032] Figure 2 is an architecture diagram of a Restormer in an embodiment of the present invention;
[0033] Figure 3 is a diagram of the MDTA architecture in an embodiment of the present invention;
[0034] Figure 4 It is a GDFN framework diagram in an embodiment of the present invention;
[0035] Figure 5 It is a DenseNet framework diagram in an embodiment of the present invention;
[0036] Figure 6 It is a structural diagram of Dense Block in an embodiment of the present invention;
[0037] Figure 7 is a diagram of a decoder architecture in an embodiment of the present invention;
[0038] Figure 8 Schematic diagram of the experimental results of using seven fusion algorithms to perform image fusion on the first scene image in an embodiment of the present invention; wherein, Figure 8 (a) is a first scene visible light image in an embodiment of the present invention, Figure 8(b) is an infrared image of the first scene in an embodiment of the present invention, Figure 8 (c) is a schematic diagram of the experimental results of image fusion of the first scene image using the JSR algorithm in an embodiment of the present invention, Figure 8 (d) is a schematic diagram of the experimental results of image fusion of the first scene image using the CBF algorithm in an embodiment of the present invention, Figure 8 (e) is a schematic diagram of the experimental results of image fusion of the first scene image using the IVFDL algorithm in an embodiment of the present invention, Figure 8 (f) is a schematic diagram of the experimental results of using the DenseFuse algorithm to perform image fusion on the first scene image in an embodiment of the present invention, Figure 8 (g) is a schematic diagram of the experimental results of using the FusionGAN algorithm to perform image fusion on the first scene image in an embodiment of the present invention, Figure 8 (h) is a schematic diagram of the experimental results of image fusion of the first scene image using the PMGI algorithm in an embodiment of the present invention, Figure 8 (i) is a schematic diagram of the experimental results of using the U2Fusion algorithm to perform image fusion on the first scene image in an embodiment of the present invention, Figure 8 (j) is a schematic diagram of the experimental results of image fusion of the first scene image using the fusion algorithm of the embodiment of the present invention;
[0039] Fig. 9 Schematic diagram of the experimental results of using seven fusion algorithms to perform image fusion on the second scene image in an embodiment of the present invention; wherein, Fig. 9 (a) is a visible light image of a second scene in an embodiment of the present invention, Fig. 9 (b) is an infrared image of the second scene in an embodiment of the present invention, Fig. 9 (c) is a schematic diagram of the experimental results of image fusion of the second scene image using the JSR algorithm in an embodiment of the present invention, Fig. 9 (d) is a schematic diagram of the experimental results of image fusion of the second scene image using the CBF algorithm in an embodiment of the present invention, Fig. 9 (e) is a schematic diagram of the experimental results of image fusion of the second scene image using the IVFDL algorithm in an embodiment of the present invention, Fig. 9 (f) is a schematic diagram of the experimental results of using the DenseFuse algorithm to perform image fusion on the second scene image in an embodiment of the present invention, Fig. 9 (g) is a schematic diagram of the experimental results of using the FusionGAN algorithm to perform image fusion on the second scene image in an embodiment of the present invention, Fig. 9 (h) is a schematic diagram of the experimental results of image fusion of the second scene image using the PMGI algorithm in an embodiment of the present invention, Fig. 9(i) is a schematic diagram of the experimental results of using the U2Fusion algorithm to perform image fusion on the second scene image in an embodiment of the present invention, Fig. 9 (j) is a schematic diagram of the test result of performing image fusion on the second scene image using the fusion algorithm of the embodiment of the present invention;
[0040] Fig.10 FIG. 1 is a schematic diagram of the experimental results of using seven fusion algorithms to perform image fusion on the third scene image in an embodiment of the present invention; wherein, Fig.10 (a) is a visible light image of the third scene in an embodiment of the present invention, Fig.10 (b) is an infrared image of the third scene in the embodiment of the present invention. Fig.10 (c) is a schematic diagram of the experimental results of image fusion of the third scene image using the JSR algorithm in an embodiment of the present invention, Fig.10 (d) is a schematic diagram of the experimental results of image fusion of the third scene image using the CBF algorithm in an embodiment of the present invention, Fig.10 (e) is a schematic diagram of the experimental results of image fusion of the third scene image using the IVFDL algorithm in an embodiment of the present invention, Fig.10 (f) is a schematic diagram of the experimental results of using the DenseFuse algorithm to perform image fusion on the third scene image in an embodiment of the present invention, Fig.10 (g) is a schematic diagram of the experimental results of using the FusionGAN algorithm to perform image fusion on the third scene image in an embodiment of the present invention, Fig.10 (h) is a schematic diagram of the experimental results of image fusion of the third scene image using the PMGI algorithm in an embodiment of the present invention, Fig.10 (i) is a schematic diagram of the experimental results of using the U2Fusion algorithm to perform image fusion on the third scene image in an embodiment of the present invention, Fig.10 (j) is a schematic diagram of the test result of performing image fusion on the third scene image using the fusion algorithm of the embodiment of the present invention;
[0041] Fig.11 It is an implementation flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0042] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as limiting the present invention, but should be understood as a more detailed description of certain aspects, features, and embodiments of the present invention.
[0043] It should be understood that the terms described in the present invention are only for describing special embodiments and are not intended to limit the present invention. In addition, for the numerical range in the present invention, it should be understood that each intermediate value between the upper and lower limits of the scope is also specifically disclosed. Each smaller range between the intermediate value in any stated value or stated range and any other stated value or intermediate value in the described range is also included in the present invention. The upper and lower limits of these smaller ranges can be independently included or excluded in the scope.
[0044] Unless otherwise indicated, all technical and scientific terms used herein have the same meanings as those of ordinary skill in the art generally understood by the present invention. Although the present invention describes only preferred methods, any method similar or equivalent to that described herein may also be used in the implementation or testing of the present invention. All documents mentioned in this specification are incorporated by reference to disclose and describe the methods related to the documents. In the event of a conflict with any incorporated document, the content of this specification shall prevail.
[0045] It will be apparent to those skilled in the art that various modifications and variations may be made to the specific embodiments of the present invention description without departing from the scope or spirit of the present invention. Other embodiments derived from the present invention description will be apparent to those skilled in the art. The present application description and examples are exemplary only.
[0046] The words “include,” “including,” “have,” “contain,” etc. used in this article are open-ended terms, meaning including but not limited to.
[0047] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0048] Embodiment 1
[0049] like Figure 1 - Fig.11 As shown, in this embodiment, a method for fusing infrared images and visible light images is provided, comprising: obtaining an image to be fused; the image to be fused comprises a visible light image and a corresponding infrared image; performing layered processing on the image to be fused to obtain a layered image; the layered image comprises a basic layer image and a detail layer image; the layered image is input into the image fusion model for image fusion to obtain a fused image, wherein the image fusion model comprises a shallow feature extraction module, a deep feature extraction module and a feature fusion module connected in sequence, the shallow feature extraction module adopts a Restormer module, and the deep feature extraction module adopts a Dense Block module.
[0050] In the frequency domain concept of images, images are composed of low-frequency information and high-frequency information. The thermal radiation information of infrared images belongs to low-frequency information (basic layer), and the texture information of visible light images belongs to high-frequency information (detail layer). This embodiment divides infrared and visible light images into basic layers and detail layers respectively, and then weightedly fuses the corresponding layers to form new basic layers and detail layers, so that subsequent feature extraction is more targeted.
[0051] This embodiment uses a Restormer module and a Dense Block module to form an encoder. Since the receptive field of a traditional CNN network is small, Restormer can extract shallow features based on global attention, and Dense Block splices shallow features with deep features to avoid the loss of shallow features. By putting these features into the decoder, a better fused image can be reconstructed.
[0052] The loss function of this embodiment increases the intensity loss of the infrared image and the gradient loss ratio of the visible light image, so that the fused image contains more thermal radiation information of the infrared image and texture information of the visible light, and forms a corresponding relationship with the previous layered processing.
[0053] The core idea of the dual-branch infrared and visible light image fusion algorithm is to interactively process the infrared image and the visible light image in layers, extract the deep features of each layer, and finally reconstruct these features into a fused image. The above algorithm adopts an end-to-end network architecture and avoids the manual design of fusion rules in the automatic encoding model through feature map splicing.
[0054] The algorithm is mainly divided into three parts: (1) Image preprocessing part, which processes the source image in layers. The high-frequency information of the image corresponds to the detail layer of the image, and the low-frequency information of the image corresponds to the basic layer of the image. Then, the basic layer and detail layer corresponding to the source image are weightedly fused to obtain new detail layer and basic layer. (2) Encoder part, which puts the new basic layer and detail layer into the encoder to extract deep features. (3) Decoder part, which concatenates the deep features of the basic layer and detail layer obtained in the encoder in the feature dimension and inputs them into the decoder to reconstruct the fused image. In order to make the fused image contain more thermal radiation information of the infrared image and texture information of the visible light, the loss function is composed of the gradient loss and intensity loss between the infrared image and the fused image, and the gradient loss and intensity loss between the visible light image and the fused image, and they occupy different proportions. The specific framework diagram is shown in the figure below. Figure 1 .
[0055] Image preprocessing: In order to make the feature extraction of the subsequent encoder more targeted, the image needs to be preprocessed, that is, the source image (infrared image and visible light image) is separated into high and low frequencies, and the corresponding frequency information is weighted and fused. The specific steps are as follows:
[0056] (1) Use the guided filter to separate the source image (infrared image and visible light image) into a basic layer and a detail layer. The guided image is selected as a visible light image because the detail texture in the visible light image is more obvious, which is conducive to the layering effect. The formula is as follows:
[0057]
[0058] In formula (1-1), V is the visible light image, V b Is the basic layer of visible light, V d is the detail layer of visible light; I is the infrared image, I b It is the basic layer of infrared image. d is the detail layer of the infrared image. D(·) is the guided filter used to layer the source image.
[0059] (2) The corresponding basic layer and detail layer of the source image are merged to obtain a new basic layer and detail layer. The new detail layer is composed of 2 / 3 of the detail layer of the visible light image plus 1 / 3 of the detail layer of the infrared image. The reason is that the visible light image contains more detail information. Therefore, through weight adjustment, the weight of the detail layer of the visible light image is increased, and the weight of the detail layer of the infrared image is reduced; the new basic layer is composed of 1 / 3 of the basic layer of the visible light image plus 2 / 3 of the basic layer of the infrared image. This is because the thermal radiation information of the infrared image contains more target information. Therefore, through weight adjustment, the weight of the basic layer of the infrared image is increased, and the weight of the basic layer of the visible light image is reduced. The formula is as follows:
[0060]
[0061] In formula (1-2), VI b is the new base layer, VI d It is the new layer of detail.
[0062] Encoder: The encoder is composed of a Restormer module and a Dense Block module. First, in order to better extract the global features of the image and solve the problem of limited receptive field of CNN, this embodiment adopts an efficient global attention mechanism Restormer module, which can realize the reconstruction of low-quality images. This embodiment regards the reconstructed image as a shallow feature with global characteristics. Secondly, since CNN is prone to lose some shallow features in forward propagation, this embodiment adopts DenseBlock to realize the reuse of shallow features. The specific steps are as follows:
[0063] (1) The Restormer module is used to extract shallow features of the input image. Its input is the new basic layer and the new detail layer, and its output is the shallow features of the new basic layer and the new detail layer. Its formula is as follows:
[0064] RVI b =R(VI b ),RVI d =R(VI d ) (1-3)
[0065] In formula (1-3), R(·) represents the Restormer module, RVI b is the shallow feature of the new basic layer, RVI d is the shallow feature of the new detail layer. VI b is the new basic layer, VI d It is the new detail layer.
[0066] The process of the Restormer module extracting shallow features of the input image is as follows: Restormer first encodes the input image through a 3*3 convolution, and then inputs it into a 4-level symmetrical encoder-decoder to obtain deep features. Finally, the deep features are added to the input image using the residual principle to obtain the reconstructed output image. Each level of the encoder-decoder contains multiple Transformer Blocks. From the first level to the fourth level in the encoder, each level downsamples the features while adding attention heads. From the fourth level to the first level in the decoder, each level upsamples the features and uses a jump connection to splice with the previous level in the encoder. For example, after the fourth level in the decoder is upsampled, it is spliced with the third level in the encoder. The architecture diagram of Restormer is shown below. Figure 2 :
[0067] The innovation of Restormer is to improve the Transformer Block, replace the Self-Attention (SA) with the Multi-Dconv head Transposed Attention (MDTA) module, and replace the Feed-forward Network (FFN) with the Gated-Dconv Feed-forward Network (GDFN). Figure 3 .
[0068] Figure 3 In the above example, Norm uses Layer Norm to implement layer normalization; 1*1 convolution uses point-by-point convolution, and 3*3 convolution uses channel-by-channel convolution. The combination of the two is depth-separable convolution, which greatly reduces the amount of calculation for Q, K, and V. Calculating Q and K forms the cross covariance between channels and forms the attention between global contexts. This feature map is multiplied with the V matrix and added to the input features to obtain the output features.
[0069] GDFN is designed as the element-wise product of two linear projection layers, one of which is activated by the GELU nonlinearity. Like MDTA, GDFN also uses deep separable convolution to extract information between different channels to speed up computational efficiency. Figure 4 :
[0070] Dense Block is used to reuse shallow features, that is, the input of each layer is the concatenation of the output feature maps of all previous layers, which can avoid the problem of shallow features being lost in the deep network.
[0071] Dense Block comes from the DenseNet network, which is a deep convolutional neural network proposed by Huang et al. DenseNet achieves feature reuse by introducing dense connections in the network, thereby reducing information loss in forward propagation and improving the generalization ability and performance of the model to a certain extent. The DenseNet network is mainly composed of DenseBlock and Transition blocks. The DenseNet framework is shown in the figure below. Figure 5 shown.
[0072] Each Dense Block contains several Dense Layers, and each layer uses the output of all previous layers as its input, forming a dense connection structure. The size of the output feature map of each layer is consistent, so that it can be connected on the channel. A Dense Block with L layers has a total of L*(L+1) / 2 connections. The BN+ReLU+Conv structure is used in DenseBlock. The reason for this is that the input of the convolutional layer contains the output features of all previous layers. They come from the output of different layers, so the numerical distribution difference is relatively large. Therefore, when they are input to the next convolutional layer, they must first pass through the BN layer to standardize their values, and then perform the convolution operation. Since this embodiment has only one DenseBlock, there is no Transition module.
[0073] Dense Block is used to extract deep features of the input image. Its input is the shallow features of the new basic layer and the new detail layer output by the Restormer module. Through Dense Block, the deep features of the new basic layer and the new detail layer are extracted. The dense network is composed of three convolutional layers, each of which is composed of the same 16 3*3 convolution kernels and ReLU activation function. Its structure diagram is as follows: Figure 6 ;
[0074] The shallow features of the new basic layer and the new detail layer extracted by the Restormer module are used as the input of DenseBlock to obtain the deep features of the detail layer and the basic layer. Finally, they are concatenated in the feature dimension to replace the fusion layer, avoiding the manual design of fusion rules. The size of each convolution block is shown in Table 1.
[0075] Table 1 Parameters of each convolution layer of Dense Block
[0076] Kernel_Size Stride Input_channels Output_channels Activation C1 3 1 1 16 ReLu C2 3 1 16 16 ReLu C3 3 1 32 16 ReLu C4 3 1 48 16 ReLu
[0077] The size parameters of each convolution block are shown in Table 2.
[0078] Table 2 Parameters of each convolutional layer of the decoder
[0079]
[0080]
[0081] Loss function: In order to make the fused image better, a loss function is needed to constrain the fused image to contain more source image information. Therefore, the loss function of this embodiment is designed as follows: the loss function consists of two parts, the loss of the fused image to the infrared image, and the loss of the fused image to the visible light image. The loss between the fused image and the source image is composed of gradient loss and intensity loss. The gradient loss causes the fused image to contain rich texture details, while the intensity loss limits the fused image to maintain an intensity distribution similar to the source image. Therefore, the loss function contains four items with different weights, which are expressed as follows:
[0082]
[0083] In formula (1-4), Loss I is the loss between the fused image and the infrared image, Loss V is the loss between the fused image and the visible light image, is the intensity loss between the infrared image and the fused image, is the intensity loss between the visible light image and the fused image, is the gradient loss of the infrared image and the fused image, is the gradient loss of the visible light image and the fused image. This embodiment sets four parameters to limit the proportion of these four loss functions in the total loss. is the coefficient of infrared image intensity loss, is the infrared image gradient loss coefficient, is the visible light image intensity loss coefficient, is the visible light image gradient loss coefficient.
[0084] Since the fusion image of infrared and visible light is composed of infrared thermal radiation information and visible light texture information, the infrared image accounts for a larger proportion of the visible light image in terms of intensity loss; the visible light image accounts for a larger proportion of the infrared image in terms of gradient loss. In view of the weight ratio used in obtaining the new basic layer and the new detail layer in this embodiment, the four parameters are set as follows:
[0085]
[0086] The intensity loss and gradient loss formulas of infrared images and visible light images are as follows:
[0087]
[0088] In formula (1-5), H and W are the height and width of the source image and the fused image, I is the infrared image, V is the visible light image, and VI fused is the fused image, ▽VI fused is the gradient of the fused image. The gradient of the image is the sum of the square of the horizontal gradient and the square of the vertical gradient. ▽I is the gradient of the infrared image, and ▽V is the gradient of the visible light image. The intensity loss is the square of the pixel value difference between the fused image and the source image. The gradient loss is the square of the gradient difference between the fused image and the source image.
[0089] Experimental data set: The experimental model of this embodiment uses the Pytorch framework, where the torch version is 1.8.1+cu11. The training data uses the MSRS dataset, which has a total of 1083 sets of aligned infrared images and visible light images. The data source is: https: / / github.com / Linfeng-Tang / MSRS. During training, the RGB color space of the visible light image is converted into a grayscale image. The training number is 40 epochs, the learning rate is 1e-4, and it decreases by one order of magnitude after every 20 epochs. The test data set is the commonly used infrared and visible light image fusion data set TNO, which contains 25 sets of infrared images and visible light images.
[0090] Experimental evaluation indicators:
[0091] (1) Entropy (EN) indicates the richness of information contained in an image. Its formula is as follows:
[0092]
[0093] In formula (1-6), L represents the number of gray levels of the image. Generally, a grayscale image has 256 gray levels. i is the number of pixel values at a certain gray level n i The ratio of the total number of pixels N, that is, p i =ni / N. When EN is larger, it means that the image contains more information; when EN is smaller, it means that the image contains less information.
[0094] (2) Mutual Information (MI) is the similarity between the pixel distribution of the generated image and the source image. The formula is as follows:
[0095]
[0096] In formula (1-7), A represents the source image, B represents the generated image, and L represents the number of gray levels, which is generally 256. A,B (a,b) represents the joint probability density of A and B. At the same position in the image, we count the relationship between them, so there are (0,0), (0,1)...(254,255), (255,255), a total of 256 2 For data. A (a),P B (b) are the probabilities of the source image and the generated image at a certain gray level, with a total of 256 possibilities. In this embodiment, the formulas for calculating the correlation entropy between the fused image and the visible light image and the correlation entropy between the fused image and the infrared image are as follows:
[0097]
[0098] MI(A,B,F)=MI(A,F)+MI(B,F)
[0099] In formula (1-8), A is the visible light image, B is the infrared image, and F is the fused image. The larger the MI value, the more similar the fused image is to the source image, and the smaller the MI value, the more different the fused image is from the source image.
[0100] (3) Standard Deviation (SD) is the degree of deviation of the pixel value of an image relative to the average pixel value of the image. The formula is as follows:
[0101]
[0102] In formula (1-9), M and N are the size of the row and column of the image, x i,j represents the pixel value of the image at position (i, j), and μ represents the average pixel value of the image. The larger the SD value, the more dispersed the pixel values of the fused image are, and the smaller the SD value, the more concentrated the pixel values of the fused image are.
[0103] (4) Average Gradient (AG) represents the texture information of the image and is calculated as follows:
[0104]
[0105] In formula (1-10), M and N are the size of the row and column of the image, x i,j represents the pixel value of the image at position (i, j), x i+1,j is the value of the adjacent pixel in the row, x i,j+1 It is the value of adjacent pixels in a column. By calculating the interpolation between adjacent pixels, the gradient values in the horizontal and vertical directions are obtained. After weighted summation, it is the average gradient value of the entire image. When the value of MG is larger, the detailed texture of the image is clearer, and when the value of MG is smaller, the detailed texture of the image is more blurred.
[0106] (5) Structural Similarity Index Measure (SSIM) is used to indicate the similarity between the generated image and the source image in terms of brightness, contrast, and structure. Its calculation formula is as follows:
[0107]
[0108] In formula (1-11), x, y represent the generated image and the source image, l xy is the brightness similarity, μ x is the average pixel value of image x, μ y is the average pixel value of image y. xy is the contrast similarity, σ x is the standard deviation of image x, σ y is the standard deviation of image y; s xy is the structural similarity, σ xy is the covariance of image x and image y. C1, C2, and C3 are stability coefficients, which are selected in this embodiment as: 0.01*255, 0.02*255, and 0.03*255, respectively, and 255 represents the maximum grayscale. When the SSIM value is larger, the brightness, contrast, and structural similarity between the generated image and the source image is better. When the SSIM value is smaller, the brightness, contrast, and structural similarity between the generated image and the source image is worse. In the fusion of infrared images and visible light images, it is necessary to calculate the SSIM values between the fused image and the visible light image, and between the fused image and the infrared image, and add them together.
[0109] (6) Fusion quality Qabf is used to measure the degree of representation of significant information in the fused image. Its formula is as follows:
[0110]
[0111] In formula (1-12), Q0(a,b|ω) represents the fusion quality of image a and image b within window σ, where σab is the covariance of image a and image b, μ a is the average pixel value of image a, μ b is the average pixel value of image b. a is the standard deviation of image a, σ b is the standard deviation of image b; |W| is the number of elements in the window; λ1∈(0,1) represents the weight coefficient of the fusion quality between the fused image and the source image a.
[0112] Experimental results and comparative analysis:
[0113] (1) Qualitative comparison: In order to verify the fusion effect of the model in this embodiment, three images of different time periods and scenes in the TNO dataset were selected: portraits at night, gardens in the evening, and fields during the day. They were compared with seven fusion algorithms, namely, joint sparse representation fusion (JSR), cross bilateral filter-based fusion (CBF), deep learning-based fusion (IVFDL), dense network-based fusion (DenseFuse), fusion based on adversarial generative network (FusionGAN), intensity and gradient ratio-based fusion (PMGI), and unsupervised fusion (U2Fusion).
[0114] from Figure 8 It can be seen that the JSR portrait is blurry; the CBF portrait has an obvious gradient reversal on the right; the IVFDL and FusionGAN have a darker overall background and lack visible light background information; the legs of the DenseFuse and U2Fusion portraits lack infrared information; PMGI contains enough visible light information, but the details are slightly insufficient; the image of the algorithm in this embodiment is relatively smooth overall, and only some details are not obvious.
[0115] from Fig. 9 In the figure, we can see that the overall JSR is blurry; the gradient under the clouds of CBF is reversed; IVFDL lacks background information of visible light; DenseFuse, PMGI and FusionGAN have ghosts in the sky; FusionGAN lacks infrared information of the portrait. The portrait information is not obvious and lacks infrared information; the algorithm in this embodiment lacks a little in the tree feature, but the infrared information of the person is well integrated with the background of the sky.
[0116] from Fig.10It can be seen that JSR is overall blurry, especially the background in the sky is completely black, without any visible light information. CBF failed to solve the gradient inversion effect caused by bilateral filtering, and there are obvious white spots on some branches; IVFDL and FusioGAN can highlight the infrared information of the house, but the overall detail features are not prominent enough and are relatively blurry; DenseFuse and U2Fusion are better than the first two algorithms in detail representation, but the thermal radiation information of infrared images is slightly lower than the first two; PMGI has a better overall effect, it better integrates the thermal radiation information of infrared images and the detailed features of visible light, and the overall background needs to be improved. The algorithm in this embodiment can better retain the background while retaining the infrared radiation information, especially the background sky contains enough visible light information.
[0117] (2) Quantitative comparison: In order to further analyze the advantages and disadvantages of various algorithms and the algorithm of this embodiment, objective evaluation indicators in the experimental evaluation indicators are used, including information entropy (EN), correlation entropy (MI), standard deviation (SD), average gradient (AG), structural similarity (SSMI), and fusion quality (Qabf). Among them, EN can reflect the richness of information in the image. The larger its value, the richer the information; MI can reflect the information correlation between the input image and the output image. The larger its value, the higher the information correlation; SD can reflect the pixel distribution of the image. The larger its value, the wider the pixel distribution; AG can reflect the texture information of the image. The larger its value, the more obvious the texture; SSMI can reflect the overall similarity between the input image and the output image. The larger its value, the higher the similarity; Qabf can reflect the fusion quality of the image. The larger its value, the higher the fusion quality.
[0118] Tables 3 to 5 are objective analyses of the above three different scene images. The data are obtained by taking the images as input data and following the calculation rules of each indicator. The bold values are the optimal values of each indicator, and the italic underlined values represent the suboptimal values.
[0119] From the night portrait in Table 3, it can be seen that the algorithm of this embodiment is higher than other algorithms in terms of EN, MI, SD, SSMI, and Qabf indicators, and lower than DenseFuse and U2Fusion in terms of AG indicators. The EN indicator is 1.9% higher than the second-best algorithm U2Fusion; the MI indicator is 2.8% higher than the second-best algorithm CBF; the SD indicator is 2.6% higher than the second-best algorithm U2Fusion; the AG indicator is 5.8% lower than the best algorithm; the SSMI indicator is 2.70% higher than the second-best algorithm PMGI; and the Qabf indicator is 8.4% higher than the second-best algorithm PMGI.
[0120] Table 3 Comparison of indicators of night portraits
[0121] EN MI SD AG SSMI Qabf JSR 6.596 2.641 27.279 3.791 0.925 0.458 CBF 6.656 <![CDATA[ 2.757 ]]> 27.942 2.692 0.906 0.392 IVFDL 6.32 2.209 22.493 2.348 0.646 0.214 DenseFuse 7.043 1.271 33.881 7.551 0.532 0.223 FusionGAN 6.826 2.693 31.969 3.16 0.978 0.468 PMGI 6.936 2.29 32.291 4.49 <![CDATA[ 0.997 ]]> <![CDATA[ 0.56 ]]> U2Fusion <![CDATA[ 7.363 ]]> 2.06 <![CDATA[ 45.419 ]]> <![CDATA[ 6.469 ]]> 0.888 0.516 Ours 7.505 2.834 46.63 5.131 1.024 0.607
[0122] From the evening garden in Table 4, it can be seen that the algorithm of this embodiment is higher than other algorithms in EN, MI, SD, SSMI, and Qabf indicators, and lower than DenseFuse in AG indicator. The EN indicator is 1.0% higher than the second-best algorithm JSR; the MI indicator is 2.8% higher than the second-best algorithm JSR; the SD indicator is 4.6% higher than the second-best algorithm U2Fusion; the AG indicator is 6.0% lower than the best algorithm DenseFuse; the SSMI indicator is 5.0% higher than the second-best algorithm FusionGAN; and the Qabf indicator is 7.50% higher than the second-best algorithm FusionGAN.
[0123] Table 4 Comparison of indicators of the evening garden
[0124] EN MI SD AG SSMI <![CDATA[Q abf ]]> JSR <![CDATA[ 7.486 ]]> <![CDATA[ 4.106 ]]> 44.796 2.022 0.69 0.334 CBF 7.01 1.969 29.611 2.638 0.904 0.451 IVFDL 7.339 2.55 44.683 2.058 0.52 0.26 DenseFuse 7.45 2.091 45.613 7.983 0.411 0.198 FusionGAN 6.887 2.158 35.945 2.559 <![CDATA[ 0.905 ]]> <![CDATA[ 0.491 ]]> PMGI 7.426 1.646 38.601 3.688 0.844 0.464 U2Fusion 7.457 1.821 <![CDATA[ 46.382 ]]> 3.92 0.762 0.477 Ours 7.563 4.343 48.549 <![CDATA[ 7.516 ]]> 0.951 0.528
[0125] Table 5 Comparison of indicators in the field during the day
[0126] EN MI SD AG SSMI <![CDATA[Q abf ]]> JSR 6.733 <![CDATA[ 2.278 ]]> <![CDATA[ 58.605 ]]> 6.73 0.832 0.502 CBF 7.141 2.276 36.698 4.774 <![CDATA[ 0.93 ]]> 0.347 IVFDL 6.484 1.886 34.936 3.915 0.697 0.22 DenseFuse 6.938 1.242 58.576 8.746 0.39 0.262 FusionGAN 7.193 2.148 30.665 4.862 0.929 0.331 PMGI 7.373 1.979 34.029 7.664 0.86 0.454 U2Fusion <![CDATA[ 7.553 ]]> 1.897 44.483 <![CDATA[ 8.598 ]]> 0.891 <![CDATA[ 0.579 ]]> Ours 7.952 2.435 60.394 8.349 1.106 0.613
[0127] From the daytime field in Table 5, it can be seen that the algorithm of this embodiment is higher than other algorithms in terms of EN, MI, SD, SSMI, and Qabf indicators, and lower than DenseFuse in terms of AG indicator. The EN indicator is 5.3% higher than the second-best algorithm U2Fusion; the MI indicator is 6.9% higher than the second-best algorithm JSR; the SD indicator is 3.0% higher than the second-best algorithm JSR; the AG indicator is 4.7% lower than the optimal algorithm DenseFuse; the SSMI indicator is 18% higher than the second-best algorithm CBF; and the Qabf indicator is 5.8% higher than the second-best algorithm U2Fusion.
[0128] Table 6 Mean values of various indicators of 25 images in the TNO dataset
[0129]
[0130]
[0131] Table 6 is the average value of various indicators of 25 images in the TNO dataset. It can be seen that the algorithm in this embodiment is higher than other algorithms in EN, MI, SD, SSMI, and Qabf indicators, and lower than DenseFuse in AG indicator. The EN indicator is 0.8% higher than the second-best algorithm U2Fusion; the MI indicator is 3.1% higher than the second-best algorithm JSR; the SD indicator is 2.0% higher than the second-best algorithm UFusion; the AG indicator is 4.6% lower than the optimal algorithm DenseFuse; the SSMI indicator is 5.6% higher than the second-best algorithm FusionGAN; and the Qabf indicator is 6.4% higher than the second-best algorithm U2Fusion.
[0132] In order to better extract the thermal radiation information in infrared images and the detail texture information in visible light images, this embodiment proposes a deep learning algorithm with a dual-branch structure. The algorithm processes the infrared image and the visible light image separately in layers, and weightedly fuses the corresponding layers so that the basic layer contains more thermal radiation information of the infrared image, and the detail layer contains more detail texture information of the visible light image. Then, Restormer is used to extract shallow features in the basic layer and the detail layer respectively, and these features are respectively put into the dense network module to extract deep features. Finally, the features are spliced on the channel and input into the decoder to reconstruct the fused image. Through the trained model, in the fusion of infrared images and visible light images in different environments, indicators such as the structural similarity and fusion quality between the fused image and the source image have been improved to a certain extent.
[0133] An infrared image and visible light image fusion system, comprising:
[0134] An image acquisition module, used to acquire an image to be fused; the image to be fused includes a visible light image and a corresponding infrared image;
[0135] An image layering module, used for performing layering processing on the image to be fused to obtain a layered image; the layered image includes a basic layer image and a detail layer image;
[0136] The image fusion module is used to input the layered image into the image fusion model for image fusion to obtain a fused image, wherein the image fusion model includes a shallow feature extraction module, a deep feature extraction module and a feature fusion module connected in sequence, the shallow feature extraction module adopts a Restormer module, and the deep feature extraction module adopts a Dense Block module.
[0137] An electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a method for fusing infrared images and visible light images.
[0138] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the infrared image and visible light image fusion method is implemented.
[0139] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for fusing infrared images and visible light images, characterized in that: include: Acquire an image to be fused; the image to be fused includes a visible light image and a corresponding infrared image; Performing layered processing on the image to be fused to obtain a layered image; The layered images include a base layer image and a detail layer image; The layered image is input into the image fusion model for image fusion to obtain a fused image, wherein the image fusion model includes a shallow feature extraction module, a deep feature extraction module and a feature fusion module connected in sequence, the shallow feature extraction module adopts a Restormer module, and the deep feature extraction module adopts a DenseBlock module.
2. The method for fusing infrared images and visible light images according to claim 1, characterized in that: The image to be fused is subjected to layered processing, specifically comprising: Based on the guided filter, the visible light image and the infrared image are respectively decomposed to obtain the basic layer and the detail layer corresponding to each image; the basic layers corresponding to each image are fused according to a set ratio to obtain the basic layer image; and the detail layers corresponding to each image are fused according to a set ratio to obtain the detail layer image.
3. The method for fusing infrared images and visible light images according to claim 1, characterized in that: The specific calculation formula for obtaining the basic layer image and the detail layer image is: Where, VI b For the base layer image, VI d is the detail layer image, V b is the basic layer of the visible light image, V d I is the detail layer of the visible light image; b is the basic layer of infrared image, I d It is the detail layer of infrared image.
4. The method for fusing infrared images and visible light images according to claim 1, characterized in that: The training process of the image fusion model includes: Acquire training data, wherein the training data includes a visible light training image and a corresponding infrared training image; Performing layered processing on the training data to obtain layered training images; An initial image fusion model is constructed, the layered training image is input into the initial image fusion model for image fusion, and training is performed with the goal of minimizing the sum of intensity loss and gradient loss between the fused image obtained after fusion and the input visible light training image and the corresponding infrared training image to obtain the image fusion model.
5. The method for fusing infrared images and visible light images according to claim 1, characterized in that: The processing process of the image fusion model includes: Inputting the layered image into the shallow feature extraction module to perform shallow feature extraction, and outputting shallow feature maps corresponding to the basic layer image and the detail layer image respectively; Inputting the shallow feature map output by the shallow feature extraction module into the deep feature extraction module for feature extraction, and outputting the deep feature maps corresponding to the basic layer image and the detail layer image respectively; The depth feature map output by the deep feature extraction module is used as the input of the feature fusion module for feature splicing, so that the depth feature map corresponding to the basic layer image and the depth feature map corresponding to the detail layer image are spliced and fused to obtain the fused image.
6. An infrared image and visible light image fusion system, characterized in that: include: An image acquisition module, used to acquire an image to be fused; the image to be fused includes a visible light image and a corresponding infrared image; An image layering module, used for performing layering processing on the image to be fused to obtain a layered image; The layered images include a base layer image and a detail layer image; The image fusion module is used to input the layered image into the image fusion model for image fusion to obtain a fused image, wherein the image fusion model includes a shallow feature extraction module, a deep feature extraction module and a feature fusion module connected in sequence, the shallow feature extraction module adopts a Restormer module, and the deep feature extraction module adopts a Dense Block module.
7. An electronic device, characterized in that: It comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute a method for fusing infrared images and visible light images according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: It stores a computer program, and when the computer program is executed by a processor, it implements an infrared image and visible light image fusion method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Remote sensing image multi-scale target detection method based on attention mechanism
CN111179217A
Pedestrian detection method and device and computer readable storage medium
CN112465735A
Double-branch convolutional neural network for infrared and visible light image fusion and fusion method
CN113379661A
Power transmission line inspection method and system based on multi-source image fusion
CN116403057A
Infrared and visible light image fusion method, device and system and storage medium
CN117152037A
Cited By
Multimodal image fusion ghosting removal method based on downstream counting task reverse optimization
CN119579425A
Image splicing method and device and storage medium
CN120725864A
An image stitching method, device and storage medium
CN120725864B
Infrared and visible light image fusion method and device based on lightweight model
CN121329792A
