Swin Transform self-adaptive image fusion method containing perception enhancement module

By introducing the perception enhancement module and adaptive fusion strategy into image fusion, and optimizing the visible light image based on infrared image features, the existing technology solves the problem of image fusion quality degradation in complex environments, and achieves high performance in dense fog, strong light, High-quality image fusion in low-light and other scenes.

CN118644401APending Publication Date: 2024-09-13NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410771519.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Existing CNN-based image fusion methods are difficult to capture global context information, and perform poorly in complex environments such as dense fog, strong light, and low light, which affects the quality of image fusion.

Method used

Introducing the perceptual enhancement module and adaptive fusion strategy, through the SwinTransformer adaptive image fusion method, combined with infrared image features to optimize and enhance the visible light image, and use the convolution operation and Swin Transformer module to extract the global semantic information of the image to achieve image adaptation Fusion.

Benefits of technology

It improves the robustness and fusion quality of the image fusion model in complex scenes, and can maintain high-quality image fusion performance under conditions such as dense fog, strong light, and low light. It is suitable for aviation, aerospace and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644401A
    Figure CN118644401A
Patent Text Reader

Abstract

The invention discloses a Swin Transform adaptive image fusion method containing a perception enhancement module, which is characterized in that a visible light image is optimized and enhanced according to a scene environment, and an adaptive fusion strategy is adopted to realize image fusion. The method comprises the following implementation steps of: 1) optimizing and enhancing a visible light image by combining infrared image features according to an actual scene condition; 2) performing convolution operation on the optimized visible light image and the input infrared image to obtain a low-layer feature map, and obtaining a feature vector through embedded coding; 3) acquiring global semantic information of the image by using a feature extraction module based on Swin Transform, and generating a high-level feature map; 4) fusing the feature maps of the two source images by using an adaptive fusion strategy; and 5) the high-level semantic features and the low-level semantic features of the image are refined and successively restored through a convolution layer and a Swin Transform module, and image reconstruction is realized. According to the method, manual intervention is not needed, and the optimal strategy under the expectation constraint can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a SwinTransformer adaptive image fusion method containing a perception enhancement module. Background Art

[0002] In recent years, with the development of deep learning technology, image fusion tasks have made significant progress. With the powerful feature extraction capability of Convolutional Neural Networks (CNN), the performance of fused images has been effectively improved. However, there are some problems with CNN-based fusion methods, such as the inability to fully capture the global contextual information between source images and only local information. At the same time, as the network depth increases, the underlying information (such as edges, lines, etc.) may be lost in the convolutional layer, thus affecting the fusion effect. Therefore, it becomes crucial to introduce an attention mechanism to capture global feature associations. The core of the attention mechanism is to assign weights to each position of the feature map to improve the representation ability and decision accuracy of the model.

[0003] In recent years, Transformer has been introduced from the field of natural language processing (NLP) to the field of computer vision to solve image-related problems and has achieved remarkable results. Compared with traditional CNN, Transformer can associate the global information of the image through self-attention calculation. The improved Swin Transformer even achieves performance that exceeds CNN under the condition that the computational complexity is linearly related to the image size, and can replace it as a general backbone for tasks such as image classification and dense recognition. Methods based on Swin Transformer, such as SwinFuse, use autoencoder networks as a framework, and have greatly improved visual effects and objective evaluation over previous image fusion methods. However, most of the existing image fusion algorithms based on autoencoder networks (including SwinFuse) use manual fusion strategies and cannot adapt to complex environments. In addition, the image fusion algorithm based on Swin Transformer tends to focus on pixels with higher brightness, which makes it easy to be affected when the visible light image is in challenging conditions such as dense fog, strong light or weak light, and the fusion quality will drop sharply, which is not conducive to practical applications in aviation, aerospace, medical and other fields. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a Swin Transformer adaptive image fusion method containing a perception enhancement module, which is characterized in that the visible light image is optimized and enhanced according to the scene environment, and an adaptive fusion strategy is used to achieve image fusion. The implementation steps of the method are: 1) According to the actual scene conditions, the visible light image is optimized and enhanced in combination with the infrared image features; 2) The optimized visible light image and the input infrared image are subjected to convolution operation to obtain a low-level feature map, and a feature vector is obtained through embedded coding; 3) The global semantic information of the image is obtained by using a feature extraction module based on Swin Transformer to generate a high-level feature map; 4) The feature maps of the two source images are fused using an adaptive fusion strategy; 5) The high-level and low-level semantic features of the image are restored one by one through the convolution layer and the Swin Transformer module to achieve image reconstruction.

[0005] Compared with the prior art, the technical approach provided by the present invention introduces a perception enhancement module and cooperates with the image fusion strategy to perform end-to-end network training. Compared with manual design that relies on prior knowledge, this method does not require human intervention, so the optimal strategy under the desired constraints can be obtained. At the same time, the perception enhancement module optimizes the visible light image according to the application scenario, which can improve its poor performance in scenes with challenging factors such as dense fog, strong light, and weak light, thereby enhancing the robustness of the model in complex scenes. In addition, an adaptive fusion strategy is adopted to better aggregate the complementary information of the source images, so that the fused image has a significant infrared target while maintaining rich visible light details, which has extremely high practical value.

[0006] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0007] Step 1: Visible light image perception enhancement;

[0008] Improve the quality of visible light images using the Perceptual Enhancement Module (PEM);

[0009] Step 2: Low-level semantic feature extraction;

[0010] The preprocessed visible light image and the original infrared image are subjected to three consecutive convolutions to obtain a low-level feature map;

[0011] Step 3: high-level semantic feature extraction;

[0012] The low-level feature maps are embedded and encoded to flatten the height and width dimensions to generate a sequence vector that meets the processing requirements of Swin Transformer:

[0013]

[0014] in, Represents the encoded input sequence, and Reshape(.) represents the image transformation operation;

[0015] The sequence vector is fed into two Swin Transformer-based feature extraction modules ESTB to obtain the global context of the image; each ESTB module consists of 6 Swin Transformer layers;

[0016] After passing through two ESTB modules, the high-level semantic features are normalized and their shape is reshaped into a feature map matrix:

[0017]

[0018] in is the high-level semantic feature of the image, It is the high-level feature map after shape transformation; UnReshape(.) image transformation operation;

[0019] Step 4: Adaptive feature fusion;

[0020] After the encoder completes the image feature extraction, it inputs the infrared and visible light feature maps into the cross self-attention CMSA module; this module receives the feature maps from two source images at the same time, obtains the query matrix Q based on the feature map of one source image, and obtains the key matrix K and value matrix V based on the feature map of the other source image to perform self-attention calculation;

[0021]

[0022] in, The feature maps of the source images after the cross attention calculation are completed. The CMSA contains two layers of STB to obtain the global correlation features of the two source images;

[0023] The output interactive feature map will be used as the input of two branches. One branch will perform channel splicing on the feature maps of the two source images after feature enhancement through the convolution layer. Then, the number of channels will be reduced to the original number of channels through three convolution layers to complete local information fusion. The other branch will directly splice and input FSTB to achieve global feature enhancement after dimension reduction and fusion through a convolution layer to complete global information fusion. Finally, the local fusion information and the global fusion information are added to obtain the fused feature map:

[0024]

[0025] in and They represent local fusion information and global fusion information respectively. Conv represents the convolution operation. Cat represents the concatenation operation, which directly concatenates the channel dimensions of the two feature maps. FSTB represents the fusion self-attention layer, which contains 6 layers of STB and is used to enhance the global features of the fused image.

[0026] Step 5: Image reconstruction;

[0027] Using the Transformer module and CNN-based decoder, the fused deep features are mapped back to the image space;

[0028] First, the feature map of the fused image is input into the decoder module RSTB based on Swin Transformer to refine the high-level semantic features in the fused feature map and restore the fused low-level semantic features from a global perspective. Then, the number of channels of the fused feature map is reduced through convolution to generate the final fused image.

[0029] Step 6: Model training;

[0030] For the image fusion algorithm of the autoencoder structure, the training is divided into two stages. In the first stage, the autoencoder is trained, that is, the encoder and decoder are trained first, so that the model has the ability to extract image information and reconstruct images. After the first stage of training is completed, the parameters of the encoder and decoder are fixed, and the fusion strategy and perception enhancement module are trained to realize the complete image fusion algorithm. The whole process adopts end-to-end training.

[0031] Step 7: Test verification:

[0032] The trained model is tested through the test data set, and the effectiveness of the model is verified by evaluating the subjective and objective indicators of the fusion results obtained based on the test data set under different challenging factors.

[0033] Preferably, the PEM is based on the demisting principle:

[0034] I(x)=J(x)t(x)+A(1-t(x)) (1)

[0035] Where I(x) and J(x) represent the observed foggy image and its fog-free image inference; t(x) is the transmission map, also known as transmittance; A is the global atmospheric light;

[0036] Transform formula (1) into:

[0037] J(x)=K(x)I(x)-K(x)+b (2)

[0038] in, b is a constant bias, the default value is 1;

[0039] K(x) is regarded as the feature conversion map from the source image to the preprocessed image, and the features of the infrared and visible light images are used to estimate K(x). The input visible light original image and K(x) are substituted into formula (2) to calculate J(x), and then the optimized visible light image is obtained by activating it with the Sigmoid function.

[0040] Preferably, the RSTB structure is completely consistent with the ESTB and consists of 6 STB layers.

[0041] The beneficial effects of the present invention are as follows:

[0042] (1) The perception enhancement module collaborates with the image fusion strategy to perform end-to-end network training. Compared with manual design that relies on prior knowledge, this method does not require human intervention and can obtain the optimal strategy under the desired constraints.

[0043] (2) A visible light image perception enhancement module is designed. By combining infrared features, the visible light images that perform poorly in scenes with challenging factors such as dense fog, strong light, and weak light are optimized and enhanced, making the model still have strong robustness under conditions with challenging factors.

[0044] (3) The image fusion algorithm adopts an autoencoder framework and designs an adaptive fusion strategy. The autoencoder framework enables the model to use a large number of visible light data sets with higher quality and better effects when training image feature extraction and reconstruction. At the same time, the adaptive fusion strategy is conducive to being applicable in various complex scenes. The algorithm can select the desired useful features for fusion according to the characteristics of the current infrared and visible light images, thereby obtaining better fusion performance.

[0045] (4) The effectiveness of the algorithm was verified through experiments. On the TNO dataset containing a variety of complex scenes and the RoadSense dataset containing a strong light environment, our method has a stronger visual perception ability than other mainstream image fusion algorithms, can better overcome the adverse effects brought by various challenging scenes, and has a higher objective evaluation. In particular, compared with the SwinFuse model which also uses the Swin Transformer as the backbone network, the method of the present invention has a significant performance improvement. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flow chart of the method of the present invention;

[0047] Figure 2 is a diagram of a perception enhancement module according to an embodiment of the present invention, (a) perception enhancement module, (b) CBAM;

[0048] Figure 3 is an adaptive fusion strategy diagram of an embodiment of the present invention;

[0049] Figure 4 It is a schematic diagram of the training phase of the fusion strategy and perception enhancement module according to an embodiment of the present invention;

[0050] Figure 5 It is a diagram of the fusion results of various methods in a challenging environment according to an embodiment of the present invention.

[0051] Figure 6 It is a framework diagram of the method of the present invention. DETAILED DESCRIPTION

[0052] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0053] The present invention designs a Swin Transformer adaptive image fusion algorithm containing a perception enhancement module, which can improve the unfavorable performance of visible light images in challenging scenes.

[0054] The present invention takes into account that in the infrared and visible light image fusion tasks, on the one hand, most of the fusion algorithms based on the autoencoder network framework adopt manually designed fusion strategies and cannot adapt to complex application scenarios; on the other hand, the image fusion algorithm based on Swin Transformer performs poorly when the visible light image is in challenging scenes such as dense fog, strong light, and weak light, which easily leads to the lack of significant targets in the results or the overall visual perception ability is impaired. Therefore, a Swin Transformer adaptive image fusion algorithm containing a perception enhancement module is proposed. Among them, the perception enhancement module cooperates with the image fusion strategy to perform end-to-end network training. Compared with the manual design relying on prior knowledge, this method does not require manual intervention, so the optimal strategy under the expected constraints can be obtained. At the same time, the adaptive fusion strategy better aggregates the complementary information of the source image and improves the robustness of the model. In addition, before extracting the source image features, the visible light image is optimized in advance by the perception enhancement module, so that it can overcome the adverse effects in the dense fog state and even generalize to other challenging scenes, improve the image fusion performance to optimize the results of downstream links such as target detection, and has strong practical application value.

[0055] In order to achieve the above content, the present invention proposes a Swin Transformer adaptive image fusion algorithm containing a perception enhancement module, and its process is as follows: Figure 1 and Figure 6 As shown, the following steps are included:

[0056] Step 1: Visible light image perception enhancement;

[0057] Considering that visible light images will perform poorly in scenes with challenging factors such as dense fog, strong light, and weak light, which seriously affects the image fusion performance, the Perception Enhancement Module (PEM) is used to improve the quality of visible light images under challenging conditions. PEM is based on the dehazing principle:

[0058] I(x)=J(x)t(x)+A(1-t(x)) (1)

[0059] Where I(x) and J(x) represent the observed foggy image and its fog-free image inference; t(x) is the transmission map, also known as transmittance; A is the global atmospheric light. Transform equation (1):

[0060] J(x)=K(x)I(x)-K(x)+b (2)

[0061] in, b is a constant bias, which defaults to 1. In this way, the ill-posed problem with two unknowns becomes a well-posed problem with only K(x). K(x) is regarded as a feature conversion map from the source image to the preprocessed image, and the features of the infrared and visible light images are used to estimate K(x). Substitute the input visible light original image and K(x) into formula (2) to calculate J(x), and then activate it through the Sigmoid function to obtain the optimized visible light image.

[0062] Step 2: Low-level semantic feature extraction The convolution layer performs well in early visual processing and has more stable optimization results. It can simply and effectively extract low-level semantic information such as texture and shape, and map this information to a high-dimensional feature space. The preprocessed source image is convolved three times to obtain a low-level feature map.

[0063] Step 3: High-level semantic feature extraction embeds the low-level feature map to flatten the height and width dimensions and generate a sequence vector that meets the processing requirements of Swin Transformer:

[0064]

[0065] The sequence vector is fed into two Swin Transformer-based feature extraction modules (Extraction Swin Transformer Block, ESTB) to obtain the global context of the image. Each ESTB module consists of 6 Swin Transformer layers (Swin Transformer Block, STB). By assigning weights to low-level semantic features, the global feature association of the image is obtained, thereby better capturing the complementary information of the source image. After passing through two ESTB modules, the high-level semantic features are normalized and their shape is re-transformed into the feature map matrix:

[0066]

[0067] in is the high-level semantic feature of the image, It is the high-level feature map after shape transformation.

[0068] Step 4: After the adaptive feature fusion encoder completes the image feature extraction, it inputs the infrared and visible light feature maps into the Cross Multi Self-Attention (CMSA) module. This module receives feature maps from two source images at the same time. For a certain source image feature map, it obtains the query matrix Q based on itself, and obtains the key matrix K and value matrix V based on the feature map of the other source image to perform self-attention calculation. Cross attention can establish long-range feature associations and effectively aggregate useful information of infrared and visible light images:

[0069]

[0070] in, The feature maps of the source images after the cross attention calculation are completed. The CMSA contains two layers of STB to obtain the global correlation features of the two source images.

[0071] The output interactive feature map will be used as the input of two branches. One branch will perform channel splicing on the feature maps of the two source images after feature enhancement through the convolution layer. Then, the number of channels will be reduced to the original number through three convolution layers to complete local information fusion. The other branch will directly splice, and after dimensionality reduction and fusion through a convolution layer, it will be input into FSTB to achieve global feature enhancement and complete global information fusion. Finally, the local fusion information and the global fusion information are added to obtain the fused feature map:

[0072]

[0073] in and They represent local fusion information and global fusion information respectively, Conv represents convolution operation, Cat represents concatenation operation, which directly concatenates the channel dimensions of two feature maps, and FSTB represents fusion self-attention layer (Fusion SwinTransformer Block, FSTB), which contains 6 layers of STB and is used to enhance the global features of the fused image.

[0074] Step 5: After image reconstruction fuses the complementary information of the source images, the present invention uses the Transformer module and the CNN-based decoder to map the fused deep features back to the image space. First, the feature map of the fused image is input into the Swin Transformer-based decoder module (Reconstitution Swin Transformer Block, RSTB) to refine the high-level semantic features in the fused feature map and restore the fused low-level semantic features from a global perspective. The RSTB structure is exactly the same as ESTB and consists of 6 STB layers. Then, the number of channels of the fused feature map is reduced by convolution to generate the final fused image.

[0075] Step 6: Model training For the image fusion algorithm with autoencoder structure, the training is divided into two stages. In the first stage, the autoencoder is trained, that is, the encoder and decoder are trained first, so that the model has the ability to extract image information and reconstruct images. After the first stage of training is completed, the parameters of the encoder and decoder are fixed, and the fusion strategy and perception enhancement module are trained to realize the complete image fusion algorithm. The whole process adopts end-to-end training, and no manual design intervention is required.

[0076] Step 7: Test and verify the trained model through the test data set. The effectiveness of the model is verified by evaluating the subjective and objective indicators of the fusion results obtained based on the test data set under different challenging factors.

[0077] Example:

[0078] The convolutional layer step size of the present invention is 1, and the reflection padding and BatchNorm normalization operations are used. Except for the activation function of the final decoder output fusion image which is Sigmoid, the rest are LeakyReLU.

[0079] like Figure 1 This is the algorithm flow chart of the present invention. The model of the present invention consists of a perception enhancement module, an encoder, a fusion strategy and a decoder. Its implementation process mainly includes visible light image perception enhancement, feature extraction, feature fusion and image reconstruction. The following takes the task of foggy infrared and visible light image fusion as an example to further illustrate the specific implementation steps of the present invention.

[0080] (1) Image perception enhancement: Figure 2(a) is the design diagram of the perception enhancement module. Assume that the source image size is I∈[224x224]. In order to reduce the adverse performance interference of visible light images under dense fog conditions, the foggy visible light image and infrared image are input into a two-layer 3x3 size non-shared convolutional neural network to extract image features. Subsequently, the image features are extracted through a two-layer non-shared convolutional block attention module (CBAM) (e.g. Figure 2 (b) shows that we perform spatial and channel attention calculations on the image features to obtain the overall contextual features of various images:

[0081] F=cov 3x3 (cov 3x3 (I)), F∈[224,224,96] (10)

[0082] M C (F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F)))×F (11)

[0083] M S (F) = σ(f 7x7 ([AvgPool(M C (F)); MaxPool(M C (F))]))×M C (F) (12)

[0084] Where F is the input feature map, AvgPool and MaxPool represent global average pooling and maximum pooling operations respectively, MLP represents multi-layer perceptron, and σ represents Sigmoid activation function. 7x7 It is a convolution operation with a convolution kernel size of 7x7. ([AvgPool(F); MaxPool(F)] means concatenating the average pooling and maximum pooling results along the channel axis.

[0085] Here, the lightweight module CBAM is selected instead of the Transformer module to save computing resources. Subsequently, after each of them passes through a 1x1 convolution layer to increase the nonlinear fitting capability, the infrared and visible light feature maps are spliced ​​in the channel dimension, and three convolution layers are used for dimensionality reduction to obtain the feature transformation map K(x). Finally, the visible light image and K(x) are substituted into formula (2) for calculation, and the Sigmoid function is used for activation to obtain the dehazed visible light image:

[0086]

[0087] J(x)=σ(K(x)I vi (x)-K(x)+1) (14)

[0088] in, is the feature map of the infrared and visible light images after passing through the CBAM module, and J(x) represents the visible light image after perceptual enhancement.

[0089] (2) Feature extraction: Use the encoder to extract complementary information of the image and generate a feature map containing key information of the image. The encoder includes a low-level feature extraction module (LFEB) and a feature extraction module (ESTB) based on SwinTransformer. Since the source image shares the encoder and decoder parameters, the following process does not list the calculation symbols of infrared and visible light images separately. The optimized and enhanced source image is first input into the LFEB for processing. This module consists of three 3x3 convolutional layers, and the output channels of each convolutional layer increase successively, namely 24, 48, and 96. Finally, the low-level feature map of the source image with 96 channels is output:

[0090]

[0091] in is the low-level feature map. Perform shape transformation, that is, embedding encoding:

[0092]

[0093] Among them, Reshape() represents the image transformation operation, is the sequence vector after embedding coding. The sequence vector is sent to two ESTB modules to obtain the global information association of the image, normalize the high-level features, and transform its shape back into the feature map matrix:

[0094]

[0095] in It is the low-level feature map of the source image, and LayerNorm is used for the normalization operation of the sequence vector.

[0096] (3) Adaptive feature fusion: The fusion strategy combines the feature maps of the source images to generate a fused image feature map with complementary information. Figure 3 (a) is the structure diagram of the adaptive strategy. The infrared and visible light feature maps are input into the Cross Multi Self-Attention (CMSA) module. The CMSA module is as follows: Figure 3As shown in (c), the module receives feature maps from two source images at the same time. For a feature map of a source image, it obtains the query matrix Q based on itself, and obtains the key matrix K and value matrix V based on the feature map of another source image to perform self-attention calculation. Cross attention can establish long-range feature associations and effectively aggregate useful information of infrared and visible light images. Therefore, it is conducive to the subsequent fusion operation. The specific formula is as follows:

[0097]

[0098] in, The feature maps of the source images after the cross attention calculation are completed. The CMSA contains two layers of STB to obtain the global correlation features of the two source images.

[0099] After the cross attention calculation is performed on the two feature maps, the output interactive feature map will be used as the input of the two branches. After the feature enhancement of the convolutional layers Conv1 and Conv2, the left branch concatenates the feature maps of the two source images. Subsequently, the number of channels is reduced to the original number of channels through three convolutional layers to complete the local information fusion. The right branch is directly concatenated, and after a convolutional layer Conv6 completes the dimensionality reduction fusion, it is input into FSTB for self-attention operation to achieve global feature enhancement and complete global information fusion. Finally, the local fusion information and the global fusion information are added to obtain the fused feature map:

[0100]

[0101] in and Represents local fusion information and global fusion information respectively. Conv1, Conv2, Conv4, and Conv5 are all 3x3 in size, and their input and output channels remain unchanged at 96; Conv3 and Conv6 are also 3x3 in size, but the input channel is 96x2 and the output channel is 96. Cat is a concatenation operation, which directly concatenates the channel dimensions of the two feature maps. FSTB is a fusion self-attention layer (Fusion Swin Transformer Block, FSTB), which contains 6 layers of STB, and is used to enhance the global features of the fused image to complete global information fusion.

[0102] (4) Image reconstruction. Image reconstruction maps the fused deep features back to the image space. First, the feature map of the fused image is input into the RSTB module to refine the high-level semantic features in the fused image feature map and restore the fused low-level semantic features from a global perspective. The RSTB structure is exactly the same as ESTB and consists of 6 STB layers. Then, the shallow feature reconstruction module SFRB based on the 3x3 convolutional layer is used to reduce the number of channels of the image feature map and generate the final fused image. The output channels of the convolutional layer are 48, 24, and 1 respectively:

[0103]

[0104] (5) Model training. This is divided into the autoencoder training phase and the fusion strategy and perception enhancement module training phase. The entire process uses end-to-end training without manual design intervention.

[0105] In the autoencoder training phase, the COCO (Train2014) visible light dataset was used for training. Adam was selected as the optimizer, and the learning rate, batch size, and epoch were set to 1e-4, 4, and 12, respectively.

[0106] Fusion strategy and perception enhancement module training phase, such as Figure 4 . The parameters of the encoder and decoder are fixed, and the LLVIP infrared and visible light datasets are used. In it, half of the visible light images are randomly selected to generate different degrees of dense fog as visible light image input, and then the original visible light image is used as the standard image, that is, the loss calculation of the fused image output in the loss function and the visible light image is trained using the fog-free standard image to train the perception enhancement ability of visible light images. Similarly, Adam is selected as the optimizer, and the Learning Rate, Batchsize and Epoch are set to 1e-4, 1 and 6 respectively.

[0107] The GPU of the training device is RTX 3080Ti, and the size of the independent graphics card is 12GB.

[0108] (6) Test verification. The present invention uses the TNO dataset and the RoadSense dataset to verify the effectiveness of the model. The grayscale range of the source image is adjusted to [0, 255], which is consistent with the dataset in the training process. To achieve image fusion of any size, the source image is divided into several blocks using a sliding window of shape [224×224]. The values ​​of the invalid areas in these blocks are filled with 0. After each pair of source image blocks is fused by the model, the reverse operation is performed according to the previous segmentation order, and the images are spliced ​​together to obtain the final fused image.

[0109] The present invention selects five objective evaluation indicators to quantitatively evaluate the quality of the fused image, namely, Information Entropy (IE), Peak Signal-To-Noise Ratio (PSNR), Contrast (Standard Deviation, SD), Average Gradient (AG), and Mutual Information (MI).

[0110] The following experiments illustrate the technical effects of the present invention. Specifically, the TNO dataset containing various complex scenes is used to obtain objective evaluation indicators, proving that the present invention can well combine the significant targets of infrared with the rich detail features of visible light to improve the quality of fused images. At the same time, images in challenging scenes such as dense fog, strong light, and weak light in the TNO dataset and the RoadSense dataset are selected for subjective comparison to prove the anti-interference ability of the model proposed in the present invention for challenging scenes.

[0111] In the experiment, both the present invention and the comparative method were implemented in Python 3.8 language.

[0112] Table 1 Objective evaluation indicators of image fusion results on the TNO dataset

[0113]

[0114] As shown in Table 1, only the bold numbers represent the optimal values, and the bold italic numbers represent the suboptimal values. It can be seen that the method of the present invention has a better comprehensive objective evaluation than the current mainstream image fusion algorithm: it obtains the optimal values ​​in IE, AG, and MI indicators, and obtains suboptimal values ​​in the other two indicators, which are not much different from the optimal values. Figure 5 , showing the fusion results of various image fusion methods under challenging factors such as strong light, dark light, and dense fog. It can be seen that in scenes with dense fog, the method of the present invention has better visual effects, and in scenes with other challenging factors, the method also has strong adaptability, showing powerful image enhancement capabilities compared to other methods. On the one hand, this is because the visible light perception enhancement module of the present invention can make up for the shortcomings of visible light images when there are challenging factors; on the other hand, the adaptive fusion strategy can select appropriate source image complementary information according to complex environments to improve fusion performance, while retaining rich visible light texture and other details while having significant infrared targets.

[0115] In contrast, SwinFuse, which also uses Swin Transformer as a general backbone network, uses a manually designed fusion strategy. Although the contrast is slightly better than the method of the present invention under normal conditions, the overall image quality is not as good as the method of the present invention. In addition, it cannot adapt and update the fusion strategy in strong light, dense fog, or even dark light environments, so that factors such as illumination and fog are fused into the image as significant targets, causing a sharp drop in image quality. Although other mainstream fusion models such as DenseFuse and CMTFuion can also improve the above-mentioned challenging factors, the effects are not as good as the method of the present invention. The brightness of significant targets or image texture is also much lower than the method of the present invention, which is not conducive to practical applications.

[0116] The comprehensive evaluation of subjective and objective factors proves that the present invention has strong robustness and superior quality when facing challenging factors such as dense fog, dark light, and strong light, which can undoubtedly improve the actual performance of downstream tasks such as target detection, target tracking, and semantic segmentation.

Claims

1. A Swin Transformer adaptive image fusion method containing a perception enhancement module, characterized in that: The steps include: Step 1: Visible light image perception enhancement; Improve the quality of visible light images using the Perceptual Enhancement Module (PEM); Step 2: Low-level semantic feature extraction; The preprocessed visible light image and the original infrared image are subjected to three consecutive convolutions to obtain a low-level feature map; Step 3: high-level semantic feature extraction; The low-level feature maps are embedded and encoded to flatten the height and width dimensions to generate a sequence vector that meets the processing requirements of Swin Transformer: in, Represents the encoded input sequence, and Reshape(.) represents the image transformation operation; The sequence vector is fed into two Swin Transformer-based feature extraction modules ESTB to obtain the global context of the image; each ESTB module consists of 6 Swin Transformer layers; After passing through two ESTB modules, the high-level semantic features are normalized and their shape is reshaped into a feature map matrix: in is the high-level semantic feature of the image, It is the high-level feature map after shape transformation; UnReshape(.) image transformation operation; Step 4: Adaptive feature fusion; After the encoder completes the image feature extraction, it inputs the infrared and visible light feature maps into the cross self-attention CMSA module; this module receives the feature maps from two source images at the same time, obtains the query matrix Q based on the feature map of one source image, and obtains the key matrix K and value matrix V based on the feature map of the other source image to perform self-attention calculation; in, The feature maps of the source images after the cross attention calculation are completed. The CMSA contains two layers of STB to obtain the global correlation features of the two source images; The output interactive feature map will be used as the input of two branches. One branch will perform channel splicing on the feature maps of the two source images after feature enhancement through the convolution layer. Then, the number of channels will be reduced to the original number through three convolution layers to complete local information fusion. The other branch will directly splice and input FSTB to achieve global feature enhancement after dimension reduction and fusion through a convolution layer to complete global information fusion. Finally, the local fusion information and the global fusion information are added to obtain the fused feature map: in and They represent local fusion information and global fusion information respectively. Conv represents the convolution operation. Cat represents the concatenation operation, which directly concatenates the channel dimensions of the two feature maps. FSTB represents the fusion self-attention layer, which contains 6 layers of STB and is used to enhance the global features of the fused image. Step 5: Image reconstruction; Using the Transformer module and CNN-based decoder, the fused deep features are mapped back to the image space; First, the feature map of the fused image is input into the decoder module RSTB based on Swin Transformer to refine the high-level semantic features in the fused feature map and restore the fused low-level semantic features from a global perspective. Then, the number of channels of the fused feature map is reduced through convolution to generate the final fused image. Step 6: Model training; For the image fusion algorithm of the autoencoder structure, the training is divided into two stages. In the first stage, the autoencoder is trained, that is, the encoder and decoder are trained first, so that the model has the ability to extract image information and reconstruct images. After the first stage of training is completed, the parameters of the encoder and decoder are fixed, and the fusion strategy and perception enhancement module are trained to realize the complete image fusion algorithm. The whole process adopts end-to-end training. Step 7: Test verification: The trained model is tested through the test data set, and the effectiveness of the model is verified by evaluating the subjective and objective indicators of the fusion results obtained based on the test data set under different challenging factors.

2. The Swin Transformer adaptive image fusion method with a built-in perception enhancement module according to claim 1, characterized in that: The PEM is based on the defogging principle: I(x)=J(x)t(x)+A(1-t(x)) (1) Where I(x) and J(x) represent the observed foggy image and its fog-free image inference; t(x) is the transmission map, also known as transmittance; A is the global atmospheric light; Transform formula (1) into: J(x)=K(x)I(x)-K(x)+b (2) in, b is a constant bias, the default value is 1; K(x) is regarded as the feature conversion map from the source image to the preprocessed image, and the features of the infrared and visible light images are used to estimate K(x). The input visible light original image and K(x) are substituted into formula (2) to calculate J(x), and then the optimized visible light image is obtained by activating it with the Sigmoid function.

3. The Swin Transformer adaptive image fusion method with a built-in perception enhancement module according to claim 2, characterized in that: The RSTB structure is completely consistent with the ESTB and consists of 6 STB layers.

Citation Information

Cited By

  • Insulator anomaly detection method and system based on infrared image and visible light image

    CN119624924A

  • Infrared visible light image fusion method for complex lighting environment

    CN119784603A

  • An infrared and visible light image fusion method for complex lighting environment

    CN119784603B

  • Automatic driving image defogging method based on CTFormer

    CN119941576A

  • Power battery disassembly path optimization method based on autoregression generation strategy

    CN120218382A