Infrared and visible light image fusion method with pixel-level and object-level feature balance
By designing a cross-task-level collaborative model structure in image fusion and image segmentation tasks, the problem of feature differences is solved, information matching and interaction is achieved, and the effect of infrared and visible light image fusion is improved.
Patent Information
- Application Number
- CN202411025584.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Existing multi-task learning methods face feature differences when dealing with two different levels of tasks: image fusion and image segmentation, resulting in mismatch of information features and inability to fully utilize the complementary information between the two, affecting the fusion of infrared and visible light images. Effect.
A model structure for cross-task level collaboration is designed. Through hierarchical interaction modules, including cross-pixel-level detail feature interaction modules and cross-object-level semantic feature interaction modules, it ensures the matching and interaction of different levels of feature information, and utilizes the multi-task learning Advantages enable information transfer and complementation between tasks.
Through feature conversion and interaction, the feature difference between image fusion and image segmentation tasks is reduced, the performance of both is improved, the overall effect of infrared and visible light image fusion is improved, and more accurate and high-quality fused images are generated.
Smart Images

Figure CN118552424B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image information processing, and relates to a method for fusing infrared and visible light images, and specifically to a method for fusing infrared and visible light images with pixel-level-object-level feature balance. Background Art
[0002] At present, the technologies related to the present invention include two aspects: the first is the infrared and visible light image fusion method, and the second is the multi-task learning method.
[0003] Image fusion is a technology that combines two or more source images acquired by different sensors into an image with richer information. In the field of image fusion, infrared and visible light image fusion is an important branch. Infrared images mainly use infrared sensors to receive the thermal radiation information of objects for imaging. They have the advantages of anti-interference and all-weather, but the image contrast and resolution are low, and it is difficult to show clear details. Visible light images use visible light reflected by objects for imaging. They have high spatial resolution and clarity, can provide rich texture detail information and color information, but are easily affected by factors such as weather and lighting conditions, and it is difficult to highlight the target. There is a certain complementarity between infrared images and visible light images. By fusing the two images together, an image that contains both rich background and detail information of visible light images and good target information of infrared images can be obtained. Compared with a single source image, the fused image contains more information and can improve the visibility and recognition of the target, thereby providing a better basis for image analysis and processing. In current research, there are many methods to achieve the fusion of infrared and visible light images. Traditional image fusion methods usually achieve the fusion of infrared and visible light images based on hand-crafted features. For example, Liu et al. proposed an image fusion framework based on multi-scale transform and sparse representation in the paper "A general framework for image fusion based on multi-scale transform and sparse representation". Li et al. proposed an effective image fusion framework in the paper "Mdlatlrr: A novel decomposition method for infrared and visible image fusion", which uses a new deep decomposition method based on latent low-rank representation (LatLRR). The advantage of this type of method is that it can preserve the details of the source image, but the disadvantage is that it cannot handle complex scenes well, such as different lighting conditions, different target shapes, different background textures, etc. In order to improve the quality of image fusion, some researchers have proposed some novel image fusion methods using deep learning technology. This type of method uses deep learning models such as convolutional neural networks or generative adversarial networks to automatically learn high-level semantic features of the source images and fuse them. Image fusion methods based on deep learning do not require manual selection and design of features, but automatically learn the representation and fusion rules of the source images by training the network. For example, Li et al. proposed an image fusion method based on convolution-guided transformer in the paper “Cgtf: Convolution-guided transformer for infrared and visible image fusion”.Ma et al. proposed an image fusion method based on a dual-discriminator conditional generative adversarial network in the paper "Ddcgan: A dual-discriminator conditionalgenerative adversarial network for multi-resolution image fusion".
[0004] Most of the traditional image fusion methods and deep learning-based image fusion methods are often independent of other high-level visual tasks, such as object detection and image segmentation. These high-level visual tasks can provide rich semantic information and are helpful in improving the quality and effect of image fusion. However, existing image fusion methods often do not fully utilize the advantages of multi-task learning and ignore the potential of these high-level tasks to help and improve the fusion effect. Therefore, combining image fusion tasks with other high-level visual tasks and adopting multi-task learning methods is expected to improve the performance of image fusion and make the fusion results more accurate and high-quality.
[0005] Multi-task learning is an important research direction in the field of machine learning. It aims to exploit the similarities between different tasks and learn to handle multiple related visual tasks at the same time, thereby improving the generalization ability and effect of the model. For example, Xu et al. proposed a Transformer-based multi-task learning framework called MTFormer in the paper "MTFormer: Multi-Task Learning via Transformer and Cross-Task Reasoning". This framework designs a cross-task attention mechanism and introduces a self-supervised cross-task contrastive learning algorithm to further improve the performance of the model in multi-task learning. The advantage of multi-task learning is that it can promote knowledge sharing. There may be some shared feature information between different tasks. By learning multiple tasks at the same time, the model can obtain different information from different perspectives and complement each other, thereby helping to improve the performance of the model for each task. For example, image fusion can provide higher quality input images for image segmentation. These images contain rich pixel-level texture detail information, which helps to improve the accuracy of image segmentation results. In turn, image segmentation can provide target-level semantic information for image fusion, such as object category information, which helps to improve the quality and accuracy of the fused image.
[0006] Although multi-task learning has shown great potential in visual tasks, existing multi-task learning methods are mainly applicable to tasks at the same level. As two visual tasks, image fusion and image segmentation have certain differences in task levels, which leads to differences in their feature representation. Specifically, the image segmentation task focuses on target-level semantic feature information such as object categories, while the image fusion task focuses more on pixel-level detail feature information such as local details and textures. This feature difference makes it challenging to directly apply existing multi-task learning methods because they need to be able to process feature information at different levels at the same time. Therefore, when using the idea of multi-task learning to establish the correlation between the two tasks of image fusion and image segmentation, it is necessary to ensure the correct matching between feature information at different levels.
[0007] In response to the feature difference problem faced by existing multi-task learning methods when dealing with image fusion and image segmentation, two tasks at different levels, an innovative cross-task learning framework is proposed to bridge the difference in feature representation between image fusion and image segmentation tasks, and make full use of the complementary information between the two to achieve cross-task hierarchical collaboration, thereby further improving the effect of infrared and visible light image fusion tasks. Summary of the invention
[0008] The present invention aims at the problem of information feature mismatch between image fusion and image segmentation due to the difference between task levels, and proposes a model structure based on cross-task hierarchical collaboration. The model takes advantage of multi-task learning and designs a hierarchical interaction module. By performing feature interaction between image fusion and image segmentation tasks at different levels, the information transfer between tasks is balanced. The hierarchical interaction module includes two key parts: a cross-pixel-level detail feature interaction module and a cross-target-level semantic feature interaction module. These two modules work together through feature conversion and feature interaction at different levels, which not only solves the feature mismatch problem between image fusion and image segmentation tasks, but also promotes in-depth interaction of features at different levels by making full use of complementary information between tasks. Specifically, firstly, in order to enable the image segmentation task to provide target-level semantic information for the image fusion task, we design a cross-pixel-level detail feature interaction module. This module is responsible for converting the target-level semantic features extracted by the image segmentation task into pixel-level features, so that these features can interact with the pixel-level features of the image fusion task at the detail level. Secondly, in order to enable the image fusion task to help the image segmentation task, we design a cross-target-level semantic feature interaction module. This module processes the pixel-level detail features extracted by the image fusion task and converts them into object-level features. In this way, the converted features can interact with the features of the image segmentation task at the semantic level through cross-object-level semantic features. Through the synergy of the cross-pixel-level detail feature interaction module and the cross-object-level semantic feature interaction module, our model can narrow the difference in feature representation between image fusion and image segmentation tasks. These two modules ensure the correct matching between feature information through effective feature conversion, and on this basis, through further feature interaction, jointly construct a hierarchical interaction module in the model. This hierarchical interaction module makes full use of the complementary information between image fusion and image segmentation tasks, realizes cross-task hierarchical collaboration, thereby improving the performance of image fusion and image segmentation tasks, and ultimately improves the overall effect of infrared and visible light image fusion tasks.
[0009] The technical solution of the present invention:
[0010] The infrared and visible light image fusion method with pixel-level-object-level feature balance has the following steps:
[0011] The model used in the infrared and visible light image fusion method is mainly composed of a fusion network, a segmentation network and a hierarchical interaction module; the fusion network and the segmentation network both adopt an encoder-decoder structure. The encoder consists of four VGG convolutional blocks and is responsible for feature extraction; the decoder consists of four convolutional blocks corresponding to the encoder, each of which includes an upsampling layer and two 3 3 convolutional layers are used to generate the final output of image fusion and image segmentation; the hierarchical interaction module is used in the encoder stage, and there are four hierarchical interaction modules in total. Each hierarchical interaction module includes a cross-pixel-level detail feature interaction module and a cross-target-level semantic feature interaction module. Both the cross-pixel-level detail feature interaction module and the cross-target-level semantic feature interaction module contain feature conversion and interaction mechanisms; before the features interact, two feature conversion modules are designed as an image reconstruction module and a segmentation head module to realize the conversion between features at different levels; the two feature conversion modules are composed of four convolution blocks each;
[0012] The training process is mainly divided into the training phase of the cross-object-level semantic feature interaction module and the training phase of the cross-pixel-level detail feature interaction module;
[0013] Step 1: Training of cross-target semantic feature interaction modules
[0014] Before performing cross-target level semantic feature interaction, the first ( ) convolutional blocks extract pixel-level features The segmentation head module converts the pixel-level features extracted by the fusion network into target-level semantic features. With segmentation network The object-level features extracted by the convolutional blocks It can interact with object-level semantic features at the semantic level; the segmentation head module consists of four 3 3 convolution blocks, the number of output channels of the first two convolution blocks Pixel-level features extracted by the fusion network with the input The number of channels is consistent to ensure that the target-level features extracted by the segmentation network are consistent with each other. The number of channels of the two features are matched during interaction; the number of output channels of the last two convolutional blocks is set to 64 and the number of output categories, respectively, to output the final target-level semantic features; in order to constrain the training process of the segmentation head module, the cross-entropy loss function is used, which measures the difference between the segmentation map output by the segmentation head module and the given semantic segmentation true label, and by minimizing the loss, the segmentation map output by the segmentation head module is made as close to the true label as possible, thereby realizing the conversion of pixel-level features to target-level features; the cross-entropy loss function The formula is expressed as:
[0015] (1)
[0016] Among them, class represents the number of categories, is the true label of semantic segmentation, is the probability distribution predicted by the segmentation head module;
[0017] After completing the feature conversion and segmentation head loss optimization, the converted target-level semantic features and the first The object-level features extracted by the convolutional blocks The pixel-level features extracted by the fusion network are sent to the multi-head attention mechanism (MHA) for interaction between target-level semantic features. The converted target-level semantic features are used as keys ( ), query ( ) and value ( ) corresponds to the object-level features extracted by the segmentation network ; The formula corresponding to the target-level feature interaction process is as follows:
[0018] (2)
[0019] (3)
[0020] (4)
[0021] in, Indicates normalization of similarity weights; is the dimension of the key vector; The function calculates the similarity weight between the query and the key, and performs weighted summation on the value vector to obtain the attention output; is the number of attention heads; It means to stitch the results of all attention heads together; is the final output learnable weight matrix; represents the final multi-head attention output; , , They correspond to Learnable weight matrices for queries, keys, and values for each attention head;
[0022] After completing the cross-object level semantic feature interaction, the object level feature obtained by the interaction is combined with the first The object-level features extracted by the convolutional blocks Splicing is performed to obtain the final target-level semantic features of the convolutional block ;
[0023] Step 2: Training of the cross-pixel detail feature interaction module
[0024] Before interacting with pixel-level detail features, the first The final object-level semantic features obtained by convolutional blocks The image reconstruction module converts it into pixel-level detail features, so that the target-level semantic features obtained by the segmentation network are Converged Network Pixel-level features extracted by convolutional blocks It can interact with pixel-level detail features at the detail level; the image reconstruction module consists of four 3 3 convolution blocks, the number of output channels of the first two convolution blocks The object-level features obtained by the segmentation network with the input The number of channels is consistent to ensure that the pixel-level features extracted by the subsequent fusion network are consistent with each other. The number of channels of the two features are matched during interaction; the number of output channels of the last two layers of convolution blocks are set to 64 and 1 respectively to output the final pixel-level detail features; in order to constrain the training process of the image reconstruction module, the reconstruction loss L2 function is used, which measures the difference between the features output by the image reconstruction module and the input original infrared image and original visible light image, and by minimizing the loss, the image reconstruction module is prompted to reconstruct the pixel-level detail features consistent with the original infrared image and the original visible light image as much as possible, thereby realizing the conversion of target-level features to pixel-level detail features; the reconstruction loss L2 function The formula is expressed as:
[0025] (5)
[0026] in, Represents the features output after being processed by the image reconstruction module. and Represent the features of the original infrared image and the visible light image respectively, and Respectively represent weight parameters;
[0027] After completing the feature conversion and reconstruction loss optimization, the pixel-level detail features obtained after conversion are combined with the first Pixel-level features extracted by convolutional blocks The pixel-level features are fed into the multi-head attention mechanism (MHA) for interaction; specifically, the target-level features obtained by the segmentation network are The pixel-level features obtained after transformation are used as keys ( ), query ( ) and value ( ) corresponds to the pixel-level features extracted by the fusion network ; The formula for the pixel-level feature interaction stage is as follows:
[0028] (6)
[0029] (7)
[0030] (8)
[0031] in, Indicates normalization of similarity weights; is the dimension of the key vector; The function calculates the similarity weight between the query and the key, and performs weighted summation on the value vector to obtain the attention output; is the number of attention heads; It means to stitch the results of all attention heads together; is the final output learnable weight matrix; represents the final multi-head attention output; , , They correspond to Learnable weight matrices for queries, keys, and values for each attention head;
[0032] After completing the interaction of cross-pixel level detail features, the pixel-level features obtained by the interaction are combined with the first Pixel-level features extracted by convolutional blocks Splicing is performed to obtain the final pixel-level features of the convolution block ;
[0033] The above is a training phase of a hierarchical interaction module. After the training of the four hierarchical interaction modules is completed, the encoder stage of the segmentation network extracts the object-level features, and the encoder of the fusion network extracts the pixel-level features. These features are then sent to the decoders of their respective networks for further convolution and upsampling operations, and finally clear segmentation maps are obtained. and high-quality fused images ;
[0034] Next, in order to optimize the performance of the segmentation network and the fusion network, the loss functions are defined for them respectively; for the segmentation network, the cross entropy loss function is used for optimization, and the loss function is defined as follows:
[0035] (9)
[0036] Among them, class represents the number of categories, is the true label of semantic segmentation, It is the result of the segmentation network output;
[0037] For the fusion network, the loss function It consists of structural similarity (SSIM) loss and mean square error (MSE) loss, and the formula is as follows:
[0038] L SSIM = [1 - SSIM ( f F , f IR )]+[1 - SSIM ( f F , f Vis )] 2 (10)
[0039] (11)
[0040] (12)
[0041] in, It is based on the loss of structural similarity index (SSIM), and the fused image is calculated separately. and the original infrared image And fused images and the original visible light image The structural similarity loss is then averaged to obtain the final structural similarity loss. ; It represents the fused image Respectively with the original image (infrared image and visible light images ) The sum of mean square error losses; and is the weight parameter;
[0042] In summary, the complete loss function for training the overall network is:
[0043] (13)
[0044] in, is the loss function of the fusion network, is the loss function of the segmentation network, is the loss function of the image reconstruction module, is the loss function of the segmentation head, , , , are the weight parameters corresponding to the fusion network loss, segmentation network loss, reconstruction module loss and segmentation head loss respectively.
[0045] Beneficial effects of the present invention: The present invention proposes a model structure based on cross-task hierarchical collaboration. Specifically, the model realizes the effective conversion of target-level semantic features and pixel-level detail features by designing a cross-pixel-level detail feature interaction module and a cross-target-level semantic feature interaction module. This structure not only ensures the correct matching between the feature information of the two tasks, but also solves the feature mismatch problem caused by differences in task hierarchies. It also promotes the interaction of the features of the two tasks of image fusion and image segmentation at different levels, makes full use of the complementary information of the two tasks, balances the information transfer between image fusion and image segmentation tasks, and realizes cross-task hierarchical collaboration, thereby improving the performance of image fusion and image segmentation, and further improving the overall effect of infrared and visible light image fusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is the overall network framework diagram.
[0047] Figure 2 Schematic diagram of the internal structure of the cross-pixel level detail feature interaction module.
[0048] Figure 3 Schematic diagram of the internal structure of the cross-target level semantic feature interaction module. DETAILED DESCRIPTION
[0049] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0050] Figure 1 The overall network framework diagram is shown in Figure 1. The overall network consists of a segmentation network at the top, a fusion network at the bottom, and a hierarchical interaction module in the middle. The training process of the overall network is as follows: The first step is to train the cross-target level semantic feature interaction module. The training of the segmentation head module uses Figure 3 In The loss is formula (1), which optimizes the difference between the segmentation map and the true semantic segmentation label so that it can complete the conversion from pixel-level features to target-level features. The converted target-level features interact with the target-level features extracted by the segmentation network at the semantic level through MHA. The second step is to train the cross-pixel level detail feature interaction module. The image reconstruction module is trained using Figure 2 The reconstruction loss in That is, formula (5), by optimizing the difference between the reconstructed image and the original infrared image and the original visible light image, it can complete the conversion of target-level features to pixel-level features. The converted pixel-level features and the pixel-level features extracted by the fusion network interact at the detail level through MHA. The third step is to train the segmentation network, using Figure 1 In The loss is formula (9), and an accurate segmentation map is generated by minimizing the loss. The fourth step is to train the fusion network using Figure 1 In The loss is formula (12), and a high-quality fused image is generated by minimizing the loss. In the first step of training the cross-target level semantic feature interaction module, we first Figure 1 China Fusion Network Output pixel-level features Feed Figure 3 The first two layers of convolution in the segmentation head module perform feature conversion processing, and the converted target-level features are input as keys (K) into Figure 3 At the same time, the network will be segmented Output object-level features As a query ( ) and value ( ) are sent to the same MHA to complete the interaction of cross-object-level semantic features. The object-level features after interaction are combined with the segmentation network The extracted original object-level features Splice to get the segmentation network Final object-level features In the second step, during the training of the pixel-level detail feature interaction module, Figure 1 Middle segmentation network The final target-level features obtained Input to Figure 2 The first two layers of convolution in the image reconstruction module are processed to obtain the converted pixel-level features as the key (K) and sent to Figure 2 In the MHA of Output pixel-level features As a query ( ) and value ( ) are sent to the same MHA to complete the interaction of cross-pixel level detail features. The pixel-level features after interaction are concatenated and fused with the network Extracted original pixel-level features Combined network Final pixel-level features In the third step of training the segmentation network, Figure 1 As shown in Figure 2, after completing the hierarchical interaction of the four parts, the final target-level features are sent to the decoder stage for further convolution and upsampling operations to obtain the final segmentation map. In the fourth step of training the fusion network, Figure 1As shown in Figure 2, after completing the hierarchical interaction of the four parts, the final pixel-level features are sent to the decoder stage for further convolution and upsampling operations to obtain the final fused image. .
Claims
1. A pixel-level-object-level feature-balanced infrared and visible light image fusion method. It is characterized in that Here are the steps: The model used in the infrared and visible light image fusion method consists of a fusion network, a segmentation network, and a hierarchical interaction module. The fusion network and the segmentation network both adopt an encoder-decoder structure. The encoder consists of four VGG convolutional blocks and is responsible for feature extraction. The decoder consists of four convolution blocks corresponding to the encoder. Each convolution block includes an upsampling layer and two 3*3 convolution layers, which are used to generate the final image fusion and image segmentation outputs. The hierarchical interaction module is used in the encoder stage. There are four hierarchical interaction modules in total. Each hierarchical interaction module includes a cross-pixel-level detail feature interaction module and a cross-target-level semantic feature interaction module. Both the cross-pixel-level detail feature interaction module and the cross-target-level semantic feature interaction module contain feature conversion and interaction mechanisms. Before the features interact, the conversion between features at different levels is realized through the feature conversion module. The feature conversion module is divided into an image reconstruction module and a segmentation head module, each of which is composed of four convolution blocks. The training process is divided into the training phase of the cross-object-level semantic feature interaction module and the training phase of the cross-pixel-level detail feature interaction module; Step 1: Training of cross-target semantic feature interaction modules Before performing cross-target semantic feature interaction, the pixel-level features extracted by the i-th convolutional block of the fusion network are first The segmentation head module converts the pixel-level features extracted by the fusion network into target-level semantic features. The object-level features extracted by the i-th convolutional block of the segmentation network It can interact with object-level semantic features at the semantic level; where i = 1, 2, 3, 4, the segmentation head module consists of four 3*3 convolution blocks, and the number of output channels of the first two layers of convolution blocks is C i Pixel-level features extracted by the fusion network with the input The number of channels is consistent to ensure that the target-level features extracted by the segmentation network are consistent with each other. The number of channels of the two features are matched during interaction; the number of output channels of the last two layers of convolutional blocks is set to 64 and the number of output categories, respectively, to output the final target-level semantic features; in order to constrain the training process of the segmentation head module, the cross entropy loss function is used, which measures the difference between the segmentation map output by the segmentation head module and the given semantic segmentation true label, and by minimizing the loss, the segmentation map output by the segmentation head module is made as close to the true label as possible, thereby realizing the conversion of pixel-level features to target-level features; the cross entropy loss function L sh The formula is: L sh =-∑ class S * *log(S) Among them, class represents the number of categories, S * is the true label of semantic segmentation, S is the probability distribution predicted by the segmentation head module; After completing the feature conversion and segmentation head loss optimization, the target-level semantic features obtained after the conversion and the target-level features extracted by the i-th convolutional block of the segmentation network are combined. The multi-head attention mechanism is used to interact with the target-level semantic features; specifically, the pixel-level features extracted by the fusion network are The target-level semantic features obtained after transformation are used as the key K f , query Q s Sum value V s Corresponding to the object-level features extracted by the segmentation network The formula corresponding to the target-level semantic feature interaction process is as follows: MultiHead(Q s ,K f ,V s )=Concat(head 1 ,...,head h )W O Among them, softmax means normalizing the similarity weight; d k is the dimension of the key vector; the Attention function calculates the similarity weight between the query and the key, and performs weighted summation on the value vector to obtain the attention output; h is the number of attention heads; Concat means concatenating the results of all attention heads together; W O is the learnable weight matrix of the final output; MultiHead represents the final multi-head attention output; are the learnable weight matrices corresponding to the query, key, and value of the jth attention head, respectively; After completing the cross-target level semantic feature interaction, the target level semantic features obtained by the interaction are combined with the target level features extracted by the i-th convolutional block of the segmentation network. Splicing is performed to obtain the final target-level semantic features of the convolutional block Step 2: Training of the cross-pixel detail feature interaction module Before performing cross-pixel level detail feature interaction, the final target-level semantic feature obtained by the i-th convolutional block of the segmentation network is first The image reconstruction module converts it into pixel-level detail features, so that the target-level semantic features obtained by the segmentation network are The pixel-level features extracted by the i-th convolutional block of the fusion network It can interact with pixel-level detail features at the detail level; the image reconstruction module consists of four 3*3 convolution blocks, and the number of output channels of the first two layers of convolution blocks is C i The object-level features obtained by the segmentation network with the input The number of channels is consistent to ensure that the pixel-level features extracted by the subsequent fusion network are consistent with each other. The number of channels of the two features are matched during interaction; the number of output channels of the last two layers of convolution blocks are set to 64 and 1 respectively to output the final pixel-level detail features; in order to constrain the training process of the image reconstruction module, the reconstruction loss L2 function is used, which measures the difference between the features output by the image reconstruction module and the input original infrared image and original visible light image, and by minimizing the loss, the image reconstruction module is prompted to reconstruct the pixel-level detail features consistent with the original infrared image and the original visible light image as much as possible, thereby realizing the conversion of target-level features to pixel-level detail features; the reconstruction loss L2 function L recon The formula is: in, represents the features output after being processed by the image reconstruction module, f IR and f Vis They represent the features of the original infrared image and the visible light image respectively, and α and β represent the weight parameters respectively; After completing the feature conversion and reconstruction loss optimization, the pixel-level detail features obtained after conversion are combined with the pixel-level features extracted by the i-th convolutional block of the fusion network. The pixel-level features are fed into the multi-head attention mechanism for interaction; specifically, the target-level features obtained by the segmentation network are The pixel-level features obtained after transformation are used as the key K s , query Q f Sum value V f Corresponding to the pixel-level features extracted by the fusion network The formula for the pixel-level feature interaction stage is as follows: MultiHead(Q f ,K s ,V f )=Concat(head 1 ,...,head h )W O Among them, softmax means normalizing the similarity weight; d k is the dimension of the key vector; the Attention function calculates the similarity weight between the query and the key, and performs weighted summation on the value vector to obtain the attention output; h is the number of attention heads; Concat means concatenating the results of all attention heads together; W O is the learnable weight matrix of the final output; MultiHead represents the final multi-head attention output; are the learnable weight matrices corresponding to the query, key, and value of the jth attention head, respectively; After completing the cross-pixel level detail feature interaction, the pixel-level features obtained by the interaction are combined with the pixel-level features extracted by the i-th convolutional block of the fusion network. Splicing is performed to obtain the final pixel-level features of the convolution block The above is a training stage of a hierarchical interaction module. After the training of the four hierarchical interaction modules is completed, the encoder stage of the segmentation network extracts the object-level features, and the encoder of the fusion network extracts the pixel-level features. The object-level features and pixel-level features are respectively sent to the decoders of their respective networks for further convolution and upsampling operations, and finally clear segmentation maps f are obtained. S and high-quality fused image f F ; Next, in order to optimize the performance of the segmentation network and the fusion network, loss functions are defined for them respectively; for the segmentation network, the cross entropy loss function is used for optimization, and the loss function L S is defined as follows: Among them, class represents the number of categories, S * is the true label of semantic segmentation, f S It is the result of the segmentation network output; For the fusion network, the loss function L F It consists of structural similarity loss and mean square error loss, and the formula is as follows: L F =λ SSIM *L SSIM +λ MSE *L MSE Among them, L SSIM is the loss based on the structural similarity index, and the fused image f is calculated separately. F and the original infrared image f IR And the fused image f F and the original visible light image f Vis The structural similarity loss is then averaged to obtain the final structural similarity loss L SSIM ; L MSE It represents the fused image f F Respectively with the infrared image f IR and the visible light image f Vis The sum of the mean squared error losses; λ SSIM and λ MSE is the weight parameter; In summary, the complete loss function for training the overall network is: L=λ F *L F +λ S *L S +λ recon *L recon +λ sh *L sh Among them, L F is the loss function of the fusion network, L S is the loss function of the segmentation network, L recon is the loss function of the image reconstruction module, L sh is the loss function of the segmentation head module, λ F , S , recon , sh They are the weight parameters corresponding to the fusion network loss, segmentation network loss, image reconstruction module loss and segmentation head module loss respectively.
