Infrared and visible image fusion method based on infrared target mask
By constructing an infrared target mask image and a dual-channel multi-scale feature extraction module, the problems of information loss and cross-modal interference in the fusion of infrared and visible light images are solved. The generated fused image retains significant targets and rich background textures, improving fusion efficiency and quality, and is applicable to fields such as medical imaging, military identification, and remote sensing.
Patent Information
- Application Number
- CN202311739704.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-12-18
AI Technical Summary
Existing deep learning-based infrared and visible light image fusion methods suffer from insufficient preservation of important information, feature degradation, and loss of details, leading to cross-modal interference, dimming of infrared targets in the fused image, and loss of details in the visible scene.
An infrared target mask image is constructed, and the fusion process is constrained by a hybrid loss function. By combining a dual-channel multi-scale feature extraction module and a feature fusion module, thermal radiation targets and visible light detail textures in the infrared image are extracted. The loss function guided by the infrared target mask and the dual-channel multi-scale feature extraction module are used to alleviate the gradient vanishing and exploding problems and improve the fusion efficiency.
This technology enables the simultaneous acquisition of salient targets and rich background texture information in fused images, reduces cross-modal interference, and improves the fusion efficiency and quality of infrared and visible light images. The generated fused images retain thermal targets and rich detailed textures, making them suitable for fields such as medical imaging, military identification, and remote sensing.
Smart Images

Figure CN117611469B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image fusion technology, and particularly relates to a method for fusion of infrared and visible light images based on an infrared target mask. Background Technology
[0002] Image fusion technology aims to combine different modal features to generate information-rich images and achieve a clear representation of a scene. Infrared images effectively highlight targets by capturing the thermal radiation emitted by objects, but lack detailed information; visible light images contain rich texture structures, but are easily affected by external factors such as weather, lighting conditions, and obstacles, thus losing sight of the target. Infrared and visible light fused images contain both infrared targets and rich visible light details, and are currently widely used in fields such as medical imaging, military identification, target detection, and remote sensing.
[0003] Currently, fusing infrared and visible light images using deep learning methods is a key research focus. Based on network architecture, deep learning-based fusion algorithms are mainly divided into methods based on convolutional neural networks (CNNs), methods based on autoencoders (AEs), and methods based on generative adversarial networks (GANs). Although these deep learning-based fusion methods have overcome the shortcomings of traditional algorithms and achieved better fusion performance, they still suffer from insufficient preservation of important information in the source images, feature degradation, and loss of details. This leads to cross-modal interference, darkening of infrared targets in the fused image, and loss of details in the visible scene. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, the present invention aims to provide an infrared and visible light image fusion method based on an infrared target mask. This method captures information about thermally radiating targets in infrared images by constructing an infrared target mask image; and constrains the fusion process by constructing a hybrid loss function guided by the infrared target mask. This invention enables the fusion of infrared and visible light images, allowing the fused image to simultaneously acquire significant target information and rich background texture information, while also improving image fusion efficiency.
[0005] To achieve the above objectives, the present invention is accomplished through the following technical solution.
[0006] This invention discloses an infrared and visible light image fusion method based on an infrared target mask. First, an infrared target mask image is constructed to capture information about thermally radiating targets in the infrared image. When the pixel value of the infrared image is higher than a predefined threshold, the pixel value of the mask image is set to 1; when the pixel value of the infrared image is lower than the predefined threshold, the pixel value of the mask image is set to 0. The threshold is calculated based on the grayscale histogram image features of the infrared image. When the image histogram has obvious single-peak features, the triangular method is used to calculate the threshold; when the image histogram has obvious double-peak features, the double-peak method is used to calculate the threshold; when the image histogram has no obvious peak and trough features, the maximum inter-class variance method is used to calculate the threshold. Based on the aforementioned infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The infrared target mask type is introduced into the hybrid loss function, and pixel, gradient, and structural similarity are used to calculate the loss between the two modal images and the fused image. This guides the network to extract the thermal radiation target region. By ensuring the consistency of intensity, gradient, and structure in specific regions, the protection of infrared target and visible light detail texture is achieved, thereby mitigating cross-modal interference. Then, considering that infrared and visible light images belong to two different modalities, a dual-channel multi-scale feature extraction module is constructed to fully capture complementary features in the two source images. The dual-channel multi-scale feature extraction module includes two feature extraction channels to extract features from infrared and visible light images respectively. Each feature extraction channel consists of a shallow feature extraction submodule, a multi-scale convolution submodule, N cascaded ResBlock submodules, and a GOBlock submodule, where N is the number of predictions in the ResBlock. The optimal performance of the dual-channel multi-scale feature extraction module can be achieved by adjusting the value of N. The shallow feature extraction submodule extracts shallow features from the image through convolutional layers and activation functions. These shallow features are then used by a multi-scale convolutional submodule to extract comprehensive image information at different scales. This multi-scale convolutional submodule extracts local features from small receptive fields and semantic features from large receptive fields using convolutional layers with different kernel sizes and activation functions. These features are then reused again through convolutional layers with different kernel sizes and activation functions to obtain higher-level robust features. The extracted deep features are fused using convolutional layers. The ResBlock submodule further enhances the network's extraction capabilities and mitigates gradient vanishing and exploding problems. This ResBlock submodule uses different convolutional layers and activation functions for feature extraction, fuses the results through convolutional layers, and adds the fused result to the input via skip connections. An activation function is then used to increase the non-linear expressive power of the structure. Finally, the output of the ResBlock submodule is combined with the gradient details extracted from the image by the GOBlock submodule to achieve the extraction of infrared and visible light image features.The GOBlock submodule extracts texture features from the image using the Sobel operator and convolutional layers; finally, the extracted features are fused using a feature fusion module, which uses N. R Each ResBlock submodule fuses the features extracted by the dual-channel multi-scale feature extraction module, and performs image reconstruction through two convolutional layers combined with activation functions, completing the fusion of infrared and visible light images. This allows the fused image to simultaneously capture salient targets and rich background texture information, while improving the fusion efficiency of infrared and visible light images. Where N R The number of predictions for ResBlock is determined by adjusting N. R The value of is used to maximize the performance of the feature fusion module.
[0007] The infrared and visible light image fusion method based on infrared target mask disclosed in this invention includes the following steps:
[0008] Step 1: Construct an infrared target mask image to capture information about thermally radiating targets in the infrared image. When the pixel value of the infrared image is higher than a predefined threshold, the pixel value of the mask image is set to 1; when the pixel value of the infrared image is lower than the predefined threshold, the pixel value of the mask image is set to 0. The threshold is calculated based on the grayscale histogram image features of the infrared image. When the image histogram has obvious single-peak features, the triangular method is used to calculate the threshold; when the image histogram has obvious double-peak features, the double-peak method is used to calculate the threshold; when the image histogram has no obvious peak and trough features, the maximum inter-class variance method is used to calculate the threshold. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The infrared target mask type is introduced into the hybrid loss function. Using pixel, gradient, and structural similarity, the loss between the two modal images and the fused image is calculated to guide the network to extract the thermally radiating target region. By ensuring the consistency of intensity, gradient, and structure in the predetermined region, the infrared target and visible light detail texture are protected, thereby reducing cross-modal interference.
[0009] Gamma correction is used to preprocess the infrared image by adjusting the ratio of pixels in bright areas to pixels in dark areas. The infrared target mask is calculated according to equation (1):
[0010]
[0011] Where (i,j) represents the pixel position, and M is the infrared target mask image. ijLet be the intensity of pixel (i,j) in the mask image, and t be a predefined threshold. The threshold is calculated based on the gray-level histogram of the infrared image. When the image histogram has obvious unimodal characteristics, the triangular method is used to calculate t; when the image histogram has obvious bimodal characteristics, the bimodal method is used to calculate t; when the image histogram has no obvious peak and trough characteristics, the Otsu's method is used to calculate t.
[0012] An infrared target mask is introduced into a hybrid loss function, which includes pixel loss, gradient loss, and structural loss, as expressed below:
[0013]
[0014] in, For image fusion I f With infrared image I r Pixel loss in the target area between; For image fusion I f With visible light image I v Pixel loss between; For I f with I r Gradient loss between; For I f with I v Gradient loss between; For I f with I r Structural losses between; For I f with I v The structural loss between regions; λ is a weighting coefficient used to weigh the proportions between different regions.
[0015] The aforementioned and The expressions are as follows:
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022] Among them, (M·I f To fuse information about the target region in the image, ((1-M)·I fTo fuse texture details and structural information in an image, H and W are the height and width of the image, ||·||1 is the l1 norm, · represents element-wise multiplication, and MSE is the mean squared error. This represents the Sobel gradient operator, and SSIM represents the structural similarity.
[0023] Step 2: Considering that infrared and visible light images belong to two different modalities, a dual-channel multi-scale feature extraction module is constructed to fully capture the complementary features in the two source images. The dual-channel multi-scale feature extraction module includes two feature extraction channels to extract features from the infrared and visible light images respectively. Each feature extraction channel consists of a shallow feature extraction sub-module, a multi-scale convolution sub-module, N cascaded ResBlock sub-modules, and a GOBlock sub-module, where N is the number of predictions for the ResBlock. By adjusting the value of N, the optimal performance of the dual-channel multi-scale feature extraction module is achieved. The shallow feature extraction sub-module extracts shallow features of the image through convolutional layers and activation functions. The obtained shallow features are then used by the multi-scale convolution sub-module to extract comprehensive image information at different scales. The multi-scale convolution sub-module extracts local features of small receptive fields and semantic features of large receptive fields through convolutional layers with different kernel sizes combined with activation functions. These features are then reused again through convolutional layers with different kernel sizes combined with activation functions to obtain higher-level robust features. The network extracts deep features using convolutional layers, and further enhances its extraction capabilities through the ResBlock submodule, mitigating the vanishing and exploding gradient problems. The ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, fuses the results through convolutional layers, and adds the fused result to the input via skip connections. Activation functions are then used to increase the non-linear expressiveness of the structure. The output of the ResBlock submodule is then combined with the image, and gradient details extracted by the GOBlock submodule are aggregated to achieve the extraction of infrared and visible light image features. The GOBlock submodule extracts texture features from the image using the Sobel operator and convolutional layers.
[0024] The dual-channel multi-scale feature extraction module includes two feature extraction channels for extracting features from infrared and visible light images, respectively. Each feature extraction channel consists of a shallow feature extraction submodule, a multi-scale convolutional submodule, N cascaded ResBlock submodules, and a GOBlock submodule, where N is the number of predictions in the ResBlock. The optimal performance of the dual-channel multi-scale feature extraction module is achieved by adjusting the value of N. The shallow feature extraction submodule includes one convolutional layer and one activation layer, with the corresponding formula as follows:
[0025] F r =δ(Conv(I) r )n×n (9)
[0026] F v =δ(Conv(I) r ) n×n (10)
[0027] Among them, F r For shallow features of infrared images, F v δ represents the shallow features of the visible light image, δ is the activation function, Conv is the convolutional layer, and n is the kernel size.
[0028] The multi-scale convolutional submodule first uses convolutional layers with different kernel sizes combined with activation functions to extract comprehensive image information at different scales; then, it obtains higher-level robust features through mutual reuse; finally, it fuses the extracted features and reduces the number of feature map channels through convolutional layers, thereby reducing computational complexity and increasing the module's non-linear expressive power. Each convolutional layer is followed by an activation function, the corresponding formula of which is as follows:
[0029] F mul =δ(Conv(Cat(F3(Cat(F3(F)) r ),F5(F v ))),F5(Cat(F3(F r ),F5(F v ))))) n×n (11)
[0030] Among them, F mul Features extracted by the dual-channel multi-scale feature extraction module; F n =δ(Conv(·) n×n To represent the use of different convolution kernel sizes for feature extraction, in (11) we use n=3 and n=5 to represent the size of the convolution kernel, respectively, i.e., F3=δ(Conv(·)). 3×3 ), F5=δ(Conv(·) 5×5 ); Cat indicates a channel connection operation.
[0031] The ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, fuses the results through convolutional layers, adds the fused result to the input through skip connections, and increases the non-linear expressiveness of the structure through activation functions. The corresponding formula is as follows:
[0032] F res =δ(Cat(F1(F3(Conv(F in ) n×n )),Conv(F in ) n×n (12)
[0033] Among them, F res For the output of the ResBlock submodule; F in The input to the ResBlock submodule is the output of the multi-scale convolutional submodule. In the network structure, the input of the first ResBlock submodule is the output of the first ResBlock submodule, and so on. To reflect that the ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, n=1 and n=3 are used in (12) to represent the size of the convolutional kernel, i.e., F1=δ(Conv(·)). 1×1 ), F3=δ(Conv(·) 3×3 ).
[0034] The GOBlock submodule includes a Sobel operator and convolutional layers to extract image gradient details, and uses skip connections to aggregate image details with multi-scale deep feature maps. The corresponding formula is as follows:
[0035] F GOB =Conv(Conv(I) Sobel ) n×n (13)
[0036] Where F GOB For the output of GOBlock, Conv(·) Sobel This is a convolution with a Sobel kernel. The Sobel operator is formed by calculating the gradient K in the horizontal direction. x And calculate the gradient K in the vertical direction y Composition, K x and K y The representation is as follows:
[0037]
[0038] Then the horizontal gradient map G of the input image I x and vertical gradient map G y It is expressed as follows:
[0039] G x =K x *I,G y =K y *I (15)
[0040] Here, * represents the convolution operation. The final output of GOBlock is as follows:
[0041] F GOB =Conv(|G x |+|G y |) 1×1(16)
[0042] Where |·| represents absolute value.
[0043] The formula for constructing the dual-channel multi-scale feature extraction module is expressed as follows:
[0044]
[0045] Where Add represents matrix addition, and F is the output of the dual-channel multi-scale feature extraction module.
[0046] Step 3: Fuse the extracted features using the feature fusion module. The feature fusion module uses N... R Each ResBlock submodule fuses the features extracted by the dual-channel multi-scale feature extraction module, and performs image reconstruction through two convolutional layers combined with activation functions, completing the fusion of infrared and visible light images. This improves the fusion efficiency and effect, enabling the fused image to simultaneously capture salient targets and rich background texture information. N R The number of predictions for ResBlock is determined by adjusting N. R The value of is used to maximize the performance of the feature fusion module.
[0047] The feature fusion module consists of N R The module consists of a ResBlock and two convolutional layers, each combined with an activation function. All convolutional layers have the same kernel size. Specifically, the activation function for the second layer is Tanh. The output of this module is the final fused image, and its corresponding formula is as follows:
[0048]
[0049] Among them, F out This is the output of the feature fusion module.
[0050] Step 4: Based on steps 1 to 3, the infrared target mask image is first determined by formula (1), where the threshold t is calculated based on the grayscale histogram image features of the infrared image. When the histogram of the image has obvious single-peak features, the threshold is calculated using the triangular method; when the histogram of the image has obvious double-peak features, the threshold is calculated using the double-peak method; when the histogram of the image has no obvious peak and valley features, the threshold is calculated using the maximum inter-class variance method. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The loss between the two modal images and the fused image is calculated by formula (2), guiding the network to extract the thermal radiation target area. By ensuring the consistency of the intensity, gradient, and structure of the predetermined area, the protection of the infrared target and visible light detail texture is achieved, thereby reducing cross-modal interference. Then, a dual-channel multi-scale feature extraction module as shown in formula (11) is constructed to fully capture the complementary features in the two source images. The extracted features are fused by the feature fusion module shown in formula (18), and an infrared and visible light image fusion network model based on the infrared target mask is constructed. The learning rate, batch size, weight initialization method, optimization method, and number of iterations of the model are set, and the training set and test set of the model are selected. The model is trained using infrared and visible light image pairs from the training set. The optimized parameters of the infrared and visible light image fusion network model are obtained when the total loss is minimized. The final fused image is obtained by inputting infrared and visible light image pairs from the test set. Feature fusion is achieved based on the infrared and visible light image fusion network model, improving the fusion efficiency and fusion effect, enabling the fused image to simultaneously capture salient targets and rich background texture information.
[0051] Based on the infrared target mask-guided hybrid loss function, dual-channel multi-scale feature extraction module, and feature fusion module, an infrared and visible light image fusion network model based on the infrared target mask is constructed as follows: First, the infrared target mask image is determined by formula (1), where the threshold t is calculated based on the grayscale histogram image features of the infrared image. When the histogram of the image has obvious single-peak features, the threshold is calculated using the triangular method; when the histogram of the image has obvious double-peak features, the threshold is calculated using the double-peak method; when the histogram of the image has no obvious peak and trough features, the threshold is calculated using the maximum inter-class variance method. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The loss between the two modal images and the fused image is calculated by formula (2), guiding the network to extract the thermal radiation target region. By ensuring the consistency of the intensity, gradient, and structure of the predetermined region, the protection of the infrared target and visible light detail texture is achieved, thereby reducing cross-modal interference. Then, a dual-channel multi-scale feature extraction module as shown in formula (11) is constructed to fully capture the complementary features in the two source images. The extracted features are fused using the feature fusion module shown in formula (18), and the output of the module is the final fused image.
[0052] Beneficial effects:
[0053] 1. This invention discloses an infrared and visible light image fusion method based on an infrared target mask. An infrared target mask image is constructed to capture information about thermally radiating targets in the infrared image. When the pixel value of the infrared image is higher than a predefined threshold, the pixel value of the mask image is set to 1; when the pixel value of the infrared image is lower than the predefined threshold, the pixel value of the mask image is set to 0. The threshold is calculated based on the grayscale histogram image features of the infrared image. When the image histogram has obvious single-peak features, the triangular method is used to calculate the threshold; when the image histogram has obvious double-peak features, the double-peak method is used to calculate the threshold; when the image histogram has no obvious peak and trough features, the maximum inter-class variance method is used to calculate the threshold. A hybrid loss function guided by the infrared target mask is constructed to constrain the fusion process. The infrared target mask type is introduced into the hybrid loss function. Using pixel, gradient, and structural similarity, the loss between the two modal images and the fused image is calculated to guide the network to extract the thermally radiating target region. By ensuring the consistency of intensity, gradient, and structure in specific regions, the infrared target and visible light detail texture are protected, thereby reducing cross-modal interference.
[0054] 2. The infrared and visible light image fusion method based on infrared target masks disclosed in this invention constructs a dual-channel multi-scale feature extraction module to fully capture complementary features in two source images. The dual-channel multi-scale feature extraction module includes two feature extraction channels for extracting features from infrared and visible light images respectively. Each feature extraction channel consists of a shallow feature extraction submodule, a multi-scale convolution submodule, N cascaded ResBlock submodules, and a GOBlock submodule, where N is the number of predictions for the ResBlock. The optimal performance of the module can be achieved by adjusting the value of N. The shallow feature extraction submodule extracts shallow features of the image through convolutional layers and activation functions. The obtained shallow features are then used by the multi-scale convolution submodule to extract comprehensive image information at different scales. The multi-scale convolution submodule extracts local features of small receptive fields and semantic features of large receptive fields through convolutional layers with different kernel sizes combined with activation functions. These features are then reused again through convolutional layers with different kernel sizes combined with activation functions to obtain higher-level robust features. The network extracts deep features using convolutional layers, and further enhances its extraction capabilities through the ResBlock submodule, mitigating the vanishing and exploding gradient problems. The ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, fuses the results through convolutional layers, and adds the fused result to the input via skip connections. Activation functions are then used to increase the non-linear expressiveness of the structure. The output of the ResBlock submodule is then combined with the image, and gradient details extracted by the GOBlock submodule are aggregated to achieve the extraction of infrared and visible light image features. The GOBlock submodule extracts texture features from the image using the Sobel operator and convolutional layers.
[0055] 3. The infrared and visible light image fusion method based on infrared target mask disclosed in this invention uses N in its feature fusion module. R Each ResBlock submodule fuses the features extracted by the dual-channel multi-scale feature extraction module, and performs image reconstruction through two convolutional layers combined with activation functions, thereby completing the fusion of infrared and visible light images. This improves the efficiency and effect of infrared and visible light image fusion, enabling the fused image to simultaneously capture salient targets and rich background texture information. Where N R The number of predictions for ResBlock can be adjusted by changing N. R The value of is used to maximize the module's performance.
[0056] 4. The infrared-visible image fusion method based on infrared target mask described in this invention can better achieve the complementarity of infrared and visible image information. The generated fused image overcomes the problems of cross-modal interference and information loss to a certain extent, retains thermal targets and rich detail textures, improves image contrast, and is more conducive to subsequent processing of the fused image. This invention can balance the quality of the fused image and the running efficiency, and has a relatively fast fusion efficiency. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is an overall flowchart of an infrared and visible light image fusion method based on infrared target masks;
[0059] Figure 2 This is a diagram illustrating the overall structure of an infrared and visible light image fusion method based on infrared target masks.
[0060] Figure 3 Here is a diagram of the ResBlock module structure;
[0061] Figure 4 Here is a diagram of the GOBlock module structure;
[0062] Figure 5 The experimental results for the "bunker" image, in which Figure 5 (a) is an infrared image of "bunker". Figure 5 (b) is a visible light image of the "bunker". Figure 5 (c) is the fused image obtained by the MDLatLRR method. Figure 5 (d) is the fused image obtained by the PFF method. Figure 5 (e) is the fused image obtained by the DenseFuse method. Figure 5 (f) is the fused image obtained by the U2Fusion method. Figure 5 (g) is the fused image obtained by the CSF method. Figure 5 (h) is the fused image obtained by the STDFusion method. Figure 5 (i) is the fused image obtained by the PIAFusion method. Figure 5 (j) is the fused image obtained by the DATFuse method. Figure 5(k) is the fused image obtained by the ICAFSion method. Figure 5 (l) is the fused image obtained by the method of the present invention.
[0063] Figure 6 Experimental results based on the "Nato_camp_sequence_1811" image. Figure 6 (a) is an infrared image of “Nato_camp_sequence_1811”. Figure 6 (b) is the visible light image of “Nato_camp_sequence_1811”. Figure 6 (c) is the fused image obtained by the MDLatLRR method. Figure 6 (d) is the fused image obtained by the PFF method. Figure 6 (e) is the fused image obtained by the DenseFuse method. Figure 6 (f) is the fused image obtained by the U2Fusion method. Figure 6 (g) is the fused image obtained by the CSF method. Figure 6 (h) is the fused image obtained by the STDFusion method. Figure 6 (i) is the fused image obtained by the PIAFusion method. Figure 6 (j) is the fused image obtained by the DATFuse method. Figure 6 (k) is the fused image obtained by the ICAFSion method. Figure 6 (l) is the fused image obtained by the method of the present invention.
[0064] ⊙ represents matrix multiplication.
[0065] This represents matrix addition.
[0066] Indicates a channel connection. Detailed Implementation
[0067] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0068] like Figure 1 , 2As shown in the figure, the method for infrared and visible light image fusion based on infrared target mask disclosed in this embodiment has the following specific implementation steps:
[0069] Step 1: Construct an infrared target mask image to capture information about thermally radiating targets in the infrared image. When the pixel value of the infrared image is higher than a predefined threshold, the pixel value of the mask image is set to 1; when the pixel value of the infrared image is lower than the predefined threshold, the pixel value of the mask image is set to 0. The threshold is calculated based on the grayscale histogram image features of the infrared image. When the image histogram has obvious single-peak features, the triangular method is used to calculate the threshold; when the image histogram has obvious double-peak features, the double-peak method is used to calculate the threshold; when the image histogram has no obvious peak and trough features, the maximum inter-class variance method is used to calculate the threshold. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The infrared target mask type is introduced into the hybrid loss function. Using pixel, gradient, and structural similarity, the loss between the two modal images and the fused image is calculated to guide the network to extract the thermally radiating target region. By ensuring the consistency of intensity, gradient, and structure in the predetermined region, the infrared target and visible light detail texture are protected, thereby reducing cross-modal interference.
[0070] Gamma correction is used to preprocess the infrared image by adjusting the ratio of pixels in bright areas to pixels in dark areas. The infrared target mask is calculated according to equation (1):
[0071]
[0072] Where (i,j) represents the pixel position, and M is the infrared target mask image. ij Let be the intensity of pixel (i,j) in the mask image, and t be a predefined threshold. The threshold is calculated based on the gray-level histogram of the infrared image. When the image histogram has obvious unimodal characteristics, the triangular method is used to calculate t; when the image histogram has obvious bimodal characteristics, the bimodal method is used to calculate t; when the image histogram has no obvious peak and trough characteristics, the Otsu's method is used to calculate t.
[0073] An infrared target mask is introduced into a hybrid loss function, which includes pixel loss, gradient loss, and structural loss, as expressed below:
[0074]
[0075] in, For image fusion I f With infrared image I r Pixel loss in the target area between; For image fusion I f With visible light image I v Pixel loss between; For I f with I r Gradient loss between; For I f with I v Gradient loss between; For I f with I r Structural losses between; For I f with I v The structural loss between regions; λ is a weighting coefficient used to weigh the proportions between different regions.
[0076] The aforementioned and The expressions are as follows:
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083] Among them, (M·I f To fuse information about the target region in the image, ((1-M)·I f To fuse texture details and structural information in an image, H and W are the height and width of the image, ||·||1 is the l1 norm, · represents element-wise multiplication, and MSE is the mean squared error. This represents the Sobel gradient operator, and SSIM represents the structural similarity.
[0084] Step 2: Considering that infrared and visible light images belong to two different modalities, a dual-channel multi-scale feature extraction module is constructed to fully capture the complementary features in the two source images. The dual-channel multi-scale feature extraction module includes two feature extraction channels to extract features from the infrared and visible light images respectively. Each feature extraction channel consists of a shallow feature extraction submodule, a multi-scale convolution submodule, three cascaded ResBlock submodules, and a GOBlock submodule. The shallow feature extraction submodule extracts shallow features from the image using a 3×3 convolutional layer and a Leaky ReLU activation layer. The obtained shallow features are then used by the multi-scale convolution submodule to extract comprehensive image information at different scales. The multi-scale convolution submodule uses a 3×3 convolutional layer and a 5×5 convolutional layer combined with the Leaky ReLU activation function to extract local features in a small receptive field and semantic features in a large receptive field. These features are then reused again by using a 3×3 convolutional layer and a 5×5 convolutional layer combined with the Leaky ReLU activation function to obtain higher-level robust features. The extracted deep features are fused using 1×1 convolutional layers combined with the Leaky ReLU activation function, reducing computational complexity and increasing the module's non-linear expressive power. Furthermore, the ResBlock submodule enhances the network's extraction capabilities and alleviates the gradient vanishing and exploding problems. The ResBlock submodule is described below. Figure 3 As shown, 1×1 and 3×3 convolutional layers are used with the Leaky ReLU activation function for feature extraction, and a 3×3 convolutional layer is used for feature fusion. The fused result is added to a 1×1 skip connection, and the Leaky ReLU activation function is used to increase the non-linear expressive power of the structure. The output of the ResBlock submodule is combined with the gradient details extracted from the image by the GOBlock submodule to achieve the extraction of infrared and visible light image features. The GOBlock submodule is as follows. Figure 4 As shown, image gradient details are extracted using a 3×3 Sobel operator and a 1×1 convolutional layer.
[0085] The dual-channel multi-scale feature extraction module includes two feature extraction channels for extracting features from infrared and visible light images, respectively. Each feature extraction channel consists of a shallow feature extraction submodule, a multi-scale convolution submodule, three cascaded ResBlock submodules, and a GOBlock submodule. The shallow feature extraction submodule includes a 3×3 convolutional layer and a Leaky ReLU activation layer, with the following formula:
[0086] F r =Lrelu(Conv(I r ) 3×3 (9)
[0087] Fv =Lrelu(Conv(I v ) 3×3 (10)
[0088] Among them, F r For shallow features of infrared images, F v For shallow features of visible light images, Lrelu is the Leaky ReLU activation function, and Conv(·) is used. 3×3 It is a 3×3 convolutional layer.
[0089] The multi-scale convolutional submodule first extracts comprehensive image information at different scales using 3×3 and 5×5 convolutional layers; then, it obtains higher-level robust features through mutual reuse; finally, it fuses the extracted features and reduces the number of feature map channels through 1×1 convolutional layers, thereby reducing computational complexity and increasing the module's non-linear expressive power. Each convolutional layer is followed by the Leaky ReLU activation function, the corresponding formula of which is as follows:
[0090] F mul =Lrelu(Conv(Cat(F3(Cat(F3(F r ),F5(F v ))),F5(Cat(F3(F r ),F5(F v ))))) 1×1 (11)
[0091] Where F3 = Lrelu(Conv(·) 3×3 ), F5 = Lrelu(Conv(·) 5×5 Lrelu is the Leaky ReLU activation function, F mul Features extracted by the dual-channel multi-scale feature extraction module; Cat indicates channel connection operation.
[0092] The ResBlock submodule uses 1×1 and 3×3 convolutional layers combined with the Leaky ReLU activation function for feature extraction, and a 3×3 convolutional layer for feature fusion. The fused result is added to a 1×1 skip connection, and the non-linear expressive power of the structure is increased by the Leaky ReLU activation function. Figure 3 As shown, the corresponding formula is as follows:
[0093] F res =Lrelu(Cat(F1(F3(Conv(F in ) 1×1 )),Conv(F in ) 1×1 (12)
[0094] Among them, F res For the output of the ResBlock submodule; F in For the input of the ResBlock submodule, F1 = Lrelu(Conv(·) 1×1 ).
[0095] The GOBlock submodule includes a 3×3 Sobel operator and a 1×1 convolutional layer to extract image gradient details. Skip connections are used to aggregate image details with multi-scale deep feature maps, and the corresponding formula is as follows:
[0096] F GOB =Conv(Conv(I) Sobel ) 1×1 (13)
[0097] Where F GOB For the output of GOBlock, Conv(·) Sobel This is a convolution with a Sobel kernel. The Sobel operator is formed by calculating the gradient K in the horizontal direction. x And calculate the gradient K in the vertical direction y Composition, K x and K y The representation is as follows:
[0098]
[0099] Then the horizontal gradient map G of the input image I x and vertical gradient map G y It is expressed as follows:
[0100] G x =K x *I,G y =K y *I (15)
[0101] Here, * represents the convolution operation. The final output of GOBlock is as follows:
[0102] F GOB =Conv(|G x |+|G y |) 1×1 (16)
[0103] Where |·| represents absolute value.
[0104] The formula for constructing the dual-channel multi-scale feature extraction module is expressed as follows:
[0105] F = F1(Add(Cat(F) res (F res (Fres (F mul (F r )))),F GOB (I r )),Add(F res (F res (F res (F mul (F v )))),F GOB (I v (17)
[0106] Where Add represents matrix addition, and F is the output of the dual-channel multi-scale feature extraction module.
[0107] Step 3: The extracted features are fused through the feature fusion module. The feature fusion module uses four ResBlock sub-modules to fuse the features extracted by the dual-channel multi-scale feature extraction module, and performs image reconstruction by combining two 3×3 convolutional layers with Leaky ReLU activation function and Tanh activation function respectively, thereby completing the fusion of infrared and visible light images, improving the fusion efficiency of infrared and visible light images, improving the fusion effect, and enabling the fused image to simultaneously obtain significant target and rich background texture information.
[0108] The feature fusion module consists of four ResBlock layers and two 3×3 convolutional layers, combined with the Leaky ReLU activation function and the Tanh activation function, respectively. The corresponding formulas are as follows:
[0109] F out =Tanh(Conv(F(F) res (F res (F res (F res (F in )))))3) 3×3 (18)
[0110] Among them, F out This is the output of the feature fusion module.
[0111] Step 4: Based on steps 1 to 3, the infrared target mask image is first determined by formula (1), where the threshold t is calculated based on the grayscale histogram image features of the infrared image. When the histogram of the image has obvious single-peak features, the threshold is calculated using the triangular method; when the histogram of the image has obvious double-peak features, the threshold is calculated using the double-peak method; when the histogram of the image has no obvious peak and valley features, the threshold is calculated using the maximum inter-class variance method. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The loss between the two modal images and the fused image is calculated by formula (2), guiding the network to extract the thermal radiation target area. By ensuring the consistency of the intensity, gradient, and structure of the predetermined area, the protection of the infrared target and visible light detail texture is achieved, thereby reducing cross-modal interference. Then, a dual-channel multi-scale feature extraction module as shown in formula (11) is constructed to fully capture the complementary features in the two source images. The extracted features are fused by the feature fusion module shown in formula (18), and an infrared and visible light image fusion network model based on the infrared target mask is constructed. The learning rate, batch size, weight initialization method, optimization method, and number of iterations of the model are set, and the training set and test set of the model are selected. The model is trained using infrared and visible light image pairs from the training set. The optimized parameters of the infrared and visible light image fusion network model are obtained when the total loss is minimized. The final fused image is obtained by inputting infrared and visible light image pairs from the test set. Feature fusion is achieved based on the infrared and visible light image fusion network model, improving the fusion efficiency and fusion effect, enabling the fused image to simultaneously capture salient targets and rich background texture information.
[0112] The learning rate, batch size, weight initialization method, optimization method, and number of iterations of the model are set. The learning rate is set to 0.0001, the batch size is set to 32, and to balance the loss between the infrared target region and the visible light background region, λ in the loss function is set to 7. The Adam optimizer is used, and the optimal value is found based on the gradient descent algorithm and backpropagated to update the parameters of the entire model. The number of iterations is set to 300. The training set and test set of the model are selected, including: 20 pairs of images are selected as the training set and 20 pairs as the test set from the infrared and visible light image fusion dataset TNO; the 20 pairs of training images are cropped to a size of 128×128 with a cropping step size of 24, resulting in 6921 training image pairs. Each source image is normalized to [-1,1]. The infrared and visible light image fusion network model is trained using pairs of infrared and visible light images from the training set. The optimized parameters are obtained when the total loss is minimized. The infrared and visible light fusion model based on an infrared target mask is then tested using the test set. Mutual information (MI), information entropy (EN), spatial frequency (SF), standard deviation (SD), and Q are used as metrics. abfVisual information fidelity (VIFF) is used as an evaluation metric for the model.
[0113] To verify the feasibility and effectiveness of the method of this invention, experiments were conducted. The image fusion method described in this invention was compared with two traditional algorithms, MDLatLRR and PFF, and seven neural network methods, DenseFuse, U2Fusion, CSF, STDFusion, PIAFusion, DATFuse, and ICAFSusion, using test images. The fused images are shown below. Figure 5 and Figure 6 As shown. Figure 5 and Figure 6 The results show that the present invention can effectively preserve salient targets in infrared images, and the fused image has high contrast and prominent contours, which is beneficial for visual observation. Furthermore, the fusion result of the present invention can retain rich texture details from visible light images, which better conforms to the human visual system. To verify the running efficiency of the present invention, experiments were conducted. The running time of the image fusion method described in the present invention, two traditional algorithms (MDLatLRR and PFF), and seven neural network methods (DenseFuse, U2Fusion, CSF, STDFusion, PIAFusion, DATFuse, and ICAFusion) was compared using test images. The results are shown in Table 1. The best results are indicated in bold, the second best results are indicated by solid underlines, and the third best results are indicated by dashed underlines. The results show that the present invention has a relatively fast running speed, but is slightly slower than the optimal DATFuse and the second best STDFusion. Therefore, in general, the present invention achieves a better balance between fusion quality and efficiency.
[0114] Table 1 shows the average running time (in seconds) of the 10 fusion methods on the dataset.
[0115]
[0116] The above detailed description further illustrates the purpose, technical solution, and beneficial effects of the invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for fusing infrared and visible light images based on infrared target masks, characterized in that: Includes the following steps, Step 1: Construct an infrared target mask image to capture information about thermally radiating targets in the infrared image; When the pixel value of the infrared image is higher than a predefined threshold, the pixel value of the mask image is set to 1; when the pixel value of the infrared image is lower than the predefined threshold, the pixel value of the mask image is set to 0. The threshold is calculated based on the grayscale histogram image features of the infrared image. When the histogram of the image has obvious single-peak features, the threshold is calculated using the triangular method; when the histogram of the image has obvious double-peak features, the threshold is calculated using the double-peak method; when the histogram of the image has no obvious peak and trough features, the threshold is calculated using the maximum inter-class variance method. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The infrared target mask type is introduced into the hybrid loss function. Using pixel, gradient, and structural similarity, the loss between the two modal images and the fused image is calculated to guide the network to extract the thermal radiation target region. By ensuring the consistency of intensity, gradient, and structure of the predetermined region, the infrared target and visible light detail texture are protected, thereby reducing cross-modal interference. In step 1, The infrared image is preprocessed using Gamma correction by adjusting the ratio of pixels in bright areas to pixels in dark areas; the infrared target mask is then calculated according to equation (1): (1) wherein (i, j) is the position of a pixel, M is the infrared target mask image, M ij is the intensity of pixel (i, j) in the mask image, t is a predefined threshold value; the threshold value is calculated according to the gray histogram of the infrared image, when the histogram of the image has obvious unimodal characteristics, the threshold value t is calculated by using a triangle method; when the histogram of the image has obvious bimodal characteristics, the threshold value t is calculated by using a bimodal method; when the histogram of the image has no obvious peak and valley characteristics, the threshold value t is calculated by using an OTSU method. An infrared target mask is introduced into a hybrid loss function, which includes pixel loss, gradient loss, and structural loss, as expressed below: (2) in, To merge images With infrared images Pixel loss in the target area between; To merge images With visible light images Pixel loss between; for and Gradient loss between; for and Gradient loss between; for and Structural losses between; for and Structural losses between; These are weighting coefficients used to weigh the proportions between different regions; The aforementioned , , , , and The expressions are as follows: (3) (4) (5) (6) (7) (8) in, To fuse information about the target region in the image, To fuse texture details and structural information in an image, H and W are the height and width of the image. It is the l1 norm. For element-wise multiplication, MSE is the mean squared error. This represents the Sobel gradient operator, and SSIM represents the structural similarity. Step 2: Considering that infrared and visible light images belong to two different modalities, a dual-channel multi-scale feature extraction module is constructed to fully capture the complementary features in the two source images. The dual-channel multi-scale feature extraction module includes two feature extraction channels to extract features from the infrared and visible light images respectively. Each feature extraction channel consists of a shallow feature extraction sub-module, a multi-scale convolution sub-module, N cascaded ResBlock sub-modules, and a GOBlock sub-module, where N is the number of predictions in the ResBlock. By adjusting the value of N, the optimal performance of the dual-channel multi-scale feature extraction module is achieved. The shallow feature extraction sub-module extracts shallow features of the image through convolutional layers and activation functions. The obtained shallow features are then used by the multi-scale convolution sub-module to extract comprehensive image information at different scales. The multi-scale convolution sub-module extracts small features by combining convolutional layers with different kernel sizes and activation functions. The network extracts local features from the receptive field and semantic features from the large receptive field, reusing them and then combining them with activation functions through convolutional layers of different kernel sizes to obtain higher-level robust features. The deep features extracted are fused using convolutional layers, and the network's extraction capability is further enhanced by the ResBlock submodule, mitigating the vanishing and exploding gradient problems. The ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, and the results are fused through convolutional layers. The fused result is added to the input through skip connections, and the non-linear expressive power of the structure is increased through activation functions. The output of the ResBlock submodule is combined with the image and the gradient details extracted by the GOBlock submodule to achieve the extraction of infrared and visible light image features. The GOBlock submodule extracts the texture features of the image through the Sobel operator and convolutional layers. The multi-scale convolutional submodule first uses convolutional layers with different kernel sizes combined with activation functions to extract comprehensive image information at different scales; it obtains higher-level robust features through mutual reuse; it fuses the extracted features and reduces the number of feature map channels through convolutional layers, increasing the non-linear expressive power of the multi-scale convolutional submodule. Each convolutional layer is followed by an activation function, the corresponding formula of which is as follows: (11) in, Features extracted by the dual-channel multi-scale feature extraction module; To represent the use of different convolution kernel sizes for feature extraction, in (11) we use n=3 and n=5 to represent the size of the convolution kernel, respectively. , Cat indicates a channel connection operation; Step 3, fuse the extracted features through a feature fusion module, wherein the feature fusion module uses N R ResBlock sub-modules to fuse the features extracted by the double-channel multi-scale feature extraction module, and reconstructs the image through two convolution layers combined with activation functions respectively; wherein N R is the predicted number of ResBlock, and the optimal performance of the feature fusion module is exerted by adjusting the value of N R . In step 3, The feature fusion module is composed of N R ResBlocks and two convolution layers combined with activation functions, the convolution kernel sizes of the convolution layers are the same, in particular, the activation function of the second layer is Tanh, and the output of the module is the final fused image, and the corresponding formula is as follows: (18) Among them, F out This is the output of the feature fusion module; Step 4: Based on steps 1 to 3, firstly, the infrared target mask image is determined by formula (1), where the threshold t is calculated based on the grayscale histogram image features of the infrared image. When the image histogram has obvious single-peak features, the threshold is calculated using the triangular method; when the image histogram has obvious double-peak features, the threshold is calculated using the double-peak method; when the image histogram has no obvious peak and trough features, the threshold is calculated using the maximum inter-class variance method. Based on the infrared target mask, a hybrid loss function guided by the infrared image target mask is constructed to constrain the fusion process. The loss between the two modal images and the fused image is calculated by formula (2), guiding the network to extract the thermal radiation target area. By ensuring the consistency of the intensity, gradient, and structure of the predetermined area, the protection of the infrared target and visible light detail texture is achieved, thereby reducing cross-modal interference. Then, the following formula ( The dual-channel multi-scale feature extraction module shown in 11) is used to fully capture the complementary features in the two source images; the extracted features are fused by the feature fusion module shown in formula (18) to construct an infrared and visible light image fusion network model based on an infrared target mask; the learning rate, batch size, weight initialization method, optimization method, and iteration number of the model are set, and the training set and test set of the model are selected; the infrared and visible light image pairs of the training set are used for training, and the optimized infrared and visible light image fusion network model parameters are obtained when the total loss reaches the minimum; the final fused image is obtained by inputting the infrared and visible light image pairs of the test set; feature fusion is realized based on the infrared and visible light image fusion network model to improve the fusion efficiency of infrared and visible light images, improve the fusion effect, and enable the fused image to simultaneously obtain significant target and rich background texture information.
2. The infrared and visible light image fusion method based on infrared target mask as described in claim 1, characterized in that: In step 2, The dual-channel multi-scale feature extraction module includes two feature extraction channels for extracting features from infrared and visible light images, respectively. Each feature extraction channel consists of a shallow feature extraction sub-module, a multi-scale convolutional sub-module, N cascaded ResBlock sub-modules, and a GOBlock sub-module, where N is the number of predictions in the ResBlock. By adjusting the value of N, the performance of the dual-channel multi-scale feature extraction module is optimized. The shallow feature extraction sub-module includes a convolutional layer and an activation layer, and its corresponding formula is as follows: (9) (10) Among them, F r For shallow features of infrared images, F v These are shallow features of visible light images. For activation function, This is a convolutional layer, where n is the kernel size. The ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, fuses the results through convolutional layers, adds the fused result to the input through skip connections, and increases the non-linear expressiveness of the structure through activation functions. The corresponding formula is as follows: (12) in, This is the output of the ResBlock submodule; The input to the ResBlock submodule is the output of the multi-scale convolutional submodule. In the network structure, the input of the first ResBlock submodule is the output of the first ResBlock submodule, and so on. To demonstrate that the ResBlock submodule uses different convolutional layers combined with activation functions for feature extraction, n=1 and n=3 are used in (12) to represent the size of the convolutional kernel, respectively. , ; The GOBlock submodule includes a Sobel operator and convolutional layers to extract image gradient details, and uses skip connections to aggregate image details with multi-scale deep feature maps. The corresponding formula is as follows: (13) in For the output of GOBlock, This is a convolution with a Sobel kernel; the Sobel operator is used to compute the gradient in the horizontal direction. And calculate the gradient in the vertical direction composition, and The representation is as follows: , (14) Then input image Horizontal gradient map and vertical gradient plot It is expressed as follows: , (15) Where * denotes convolution operation; the final output of GOBlock is as follows: (16) in, Represents absolute value; The formula for constructing the dual-channel multi-scale feature extraction module is expressed as follows: (17) Where Add represents matrix addition, and F is the output of the dual-channel multi-scale feature extraction module.
3. The infrared and visible light image fusion method based on infrared target mask as described in claim 1, characterized in that: In step 4, Based on the infrared target mask-guided hybrid loss function, dual-channel multi-scale feature extraction module and feature fusion module, the infrared and visible light image fusion network model based on the infrared target mask is constructed as follows: First, the infrared target mask image is determined by formula (1), where the threshold t is calculated based on the grayscale histogram image features of the infrared image. When the histogram of the image has obvious single-peak features, the threshold is calculated by the triangular method; when the histogram of the image has obvious double-peak features, the threshold is calculated by the double-peak method; when the histogram of the image has no obvious peak and valley features, the threshold is calculated by the maximum inter-class variance method. Based on the infrared target mask, the infrared image target mask-guided hybrid loss function is constructed to constrain the fusion process. The loss between the two modal images and the fused image is calculated by formula (2), guiding the network to extract the thermal radiation target area. By ensuring the consistency of the intensity, gradient and structure of the predetermined area, the protection of the infrared target and visible light detail texture is achieved, thereby reducing cross-modal interference. Then, a dual-channel multi-scale feature extraction module as shown in formula (11) is constructed to fully capture the complementary features in the two source images; the extracted features are fused by the feature fusion module shown in formula (18), and the output of the module is the final fused image.
Citation Information
Patent Citations
Image fusion method, device and equipment, and storage medium
CN114519808A
Multi-scale generative adversarial fusion network method for infrared and visible light images
CN114841907A
