CT-MRI image fusion method
Through the combination of global enhancement module, detail improvement module and feature fusion module, combined with multi-constraint loss function and AdamW optimization algorithm, the problems of poor adaptability and blurred details in CT-MRI image fusion are solved, achieving high-quality image fusion and simplifying the diagnostic process.
Patent Information
- Application Number
- CN202310376916.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2024-10-15
AI Technical Summary
Existing CT-MRI image fusion methods suffer from poor adaptability, blurred details, and information loss, as well as high computational costs, which complicates the diagnostic process.
Using a combination method of global enhancement module, detail improvement module and feature fusion module, the global and local features of the image are extracted through the MLP structure, and combined with the multi-constraint loss function and AdamW optimization algorithm, a clear CT-MRI fusion image is constructed.
It achieves clearer CT-MRI image fusion, taking into account overall and local details, improving visual perception and image quality, and reducing model calculation complexity.
Smart Images

Figure CN118780993A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a CT-MRI image fusion method, and belongs to the technical field of medical image processing. Background Art
[0002] Medical imaging plays an indispensable role in modern clinical diagnosis. Radiologists have a clearer understanding of the human body structure from images, which greatly improves clinical diagnostic decisions. Magnetic resonance imaging (MRI) and computed tomography (CT) are two extremely common modal images. MRI images provide high-resolution soft tissue information and anatomical detail textures, such as muscles, ligaments and brain, and are often used for surgical navigation, tumor detection, etc. Computed tomography (CT) provides high-quality bone density information and can show strong tissue contrast capabilities, which can highlight large abnormalities, strokes, hemorrhages and brain lesions. In some complex diagnostic scenarios, experts usually need to see the structure and tissue information of the human body at different depths, such as the clear soft tissue information provided by MRI and the bone density information provided by CT. Observing two images at the same time may complicate the diagnostic process due to subjective fatigue and visual bias. Constructing a composite CT-MRI fusion image is conducive to assisting the diagnosis and treatment process. Through its complementary lesion characteristics, it tells experts more information, making clinical diagnosis more accurate and the diagnostic process more convenient. The composite image should have rich detail textures, bone density information and good visual effects.
[0003] Medical image fusion methods can be generally divided into traditional methods and deep learning-based methods. Traditional methods are generally performed in the spatial domain or transform domain and are roughly divided into three steps: (1) Design relevant rules to measure the activity level of the image. (2) Design fusion rules to generate a fusion weight map. (3) Reconstruct the fused image through inverse transformation. Traditional fusion methods are usually complex and uncertain, and their fusion results are prone to problems such as pixel distortion, artifacts, and color distortion.
[0004] The medical image fusion method based on deep learning mainly builds a feature extraction network with a certain depth. Under the constraint of specific loss, the algorithm learns the parameters of the convolution kernel through multiple iterations, and finally extracts the required information through parameter sharing between layers, so as to minimize the loss and achieve end-to-end image fusion. At present, the methods based on deep learning usually face the problems of poor adaptability, blurred details and information loss. At the same time, there may also be problems of high computational cost and large amount of computation for model inference. Summary of the invention
[0005] The purpose of the present invention is to provide a CT-MRI image fusion method to solve the problems of poor adaptability and blurred details in current fusion methods.
[0006] In order to solve the above technical problems, the present invention provides a CT-MRI image fusion method, which comprises the following steps:
[0007] 1) constructing a CT-MRI image fusion model, which includes a global enhancement module, a detail enhancement module and a feature fusion module; the global enhancement module is used to extract global coarse contour information of the registered CT and MRI image pairs using an MLP structure, the detail enhancement module is used to segment the registered CT and MRI image pairs into equal sizes, and to extract features of each segmented sub-image using an MLP structure to ensure the detail content information of the overall image, and the feature fusion module is used to integrate the local detail information extracted by the detail enhancement module with the global information extracted by the global enhancement module as a guide to construct a fused image;
[0008] 2) Training the constructed CT-MRI image fusion model;
[0009] 3) Use the trained CT-MRI image fusion model to fuse the registered CT and MRI image pairs.
[0010] The present invention extracts the global rough contour information of the input image through the global enhancement module, divides the input image into equal sizes using the detail enhancement module, extracts the features of each sub-image after segmentation to ensure the detail content information of the overall image; and uses the feature fusion module to construct a fused image by integrating the local detail information extracted by the detail enhancement module with the global information extracted by the global enhancement module as a guide. Therefore, the fused image obtained by the present invention can take into account both the overall and local details, and the method can more clearly construct a CT-MRI fused image.
[0011] Furthermore, the global enhancement module includes an encoding unit, two downsampling units, two upsampling units and three MLP feature extraction units, wherein the encoding unit is used to encode CT and MRI image pairs; the MLP feature extraction unit is used to extract features of input features along the channel dimension, the high direction dimension and the wide direction dimension; the first MLP feature extraction unit takes the output of the encoding unit as input, the output of the first MLP feature extraction unit is used as input of the second MLP feature extraction unit after downsampling processing of the first downsampling unit, the output of the second MLP feature extraction unit is used as input of the third MLP feature extraction unit after downsampling processing of the second downsampling unit, the output of the third MLP feature extraction unit is superimposed with the output of the first downsampling unit after upsampling processing of the first upsampling unit, the superposition result is used as input of the second upsampling unit, and the output of the second upsampling unit is superimposed with the output of the first MLP feature extraction unit as the output of the global enhancement module.
[0012] The global enhancement module of the present invention can quickly and accurately extract the overall image features of the image pair through the operations of encoding, downsampling, upsampling and MLP feature extraction, thereby achieving the purpose of global enhancement.
[0013] Furthermore, the detail enhancement module includes a segmentation unit, an encoding unit, two down-sampling units, two up-sampling units and three MLP feature extraction units. The segmentation unit is used to perform a cutting operation on the CT and MRI image pairs, cutting them into multiple sub-images; the encoding unit is used to encode the cut sub-images; the MLP feature extraction unit is used to extract features of the input features along the channel dimension, the high direction dimension and the wide direction dimension; the first MLP feature extraction unit takes the output of the encoding unit as input, the output of the first MLP feature extraction unit is used as input of the second MLP feature extraction unit after down-sampling processing of the first down-sampling unit, the output of the second MLP feature extraction unit is used as input of the third MLP feature extraction unit after down-sampling processing of the second down-sampling unit, the output of the third MLP feature extraction unit is superimposed with the output of the first down-sampling unit after up-sampling processing of the first up-sampling unit, the superposition result is used as input of the second up-sampling unit, and the output of the second up-sampling unit is superimposed with the output of the first MLP feature extraction unit as the output of the detail enhancement module.
[0014] The detail enhancement module of the present invention first uses a segmentation unit to cut the CT and MRI image pairs into multiple sub-images, and then encodes, downsamples, upsamples and extracts MLP features on each sub-image, which can quickly and accurately extract the detail image features of the image pairs and achieve the purpose of detail enhancement.
[0015] Furthermore, the MLP feature extraction unit is used to perform feature map channel dimension gated MLP mapping on the input features to obtain a first mapping result, perform feature map high dimension gated MLP mapping on the first mapping result to obtain a second mapping result, and superimpose the first mapping result and the second mapping result and then perform feature map wide dimension gated MLP mapping to obtain a third mapping result, superimpose the third mapping result and the first mapping result, and use the superimposed result as the output result of the MLP feature extraction unit.
[0016] The MLP feature extraction unit of the present invention can consider the channel dimension, the high direction dimension and the wide direction dimension, thereby ensuring that the extracted features can take into account the influence of each dimension.
[0017] Furthermore, the feature fusion module is used to perform a convolution operation on the output result of the global enhancement module, a nonlinear activation processing and a secondary convolution operation to obtain a first global feature, and to perform a convolution operation again on the output result of the global enhancement module, a nonlinear activation processing and a secondary convolution operation to obtain a second global feature, and to fuse the first global feature, the second global feature and the output result of the detail enhancement module.
[0018] Furthermore, the calculation formula used for the output result of the detail enhancement module is:
[0019] Fusion_F=Local_F*(Global_F1+1)+Global_F2
[0020] Among them, Fusion_F is the fusion result, Global_F1 is the first global feature, Global_F2 is the second global feature, Local_F is the output result of the detail enhancement module, and * is the dot multiplication operation.
[0021] The image fusion module of the present invention can fully fuse the output results of the global enhancement module and the detail enhancement module.
[0022] Furthermore, the step 2) is trained with triple constraints, that is, the sub-image blocks segmented by the output result R1 of the global enhancement module, the output result R2 of the detail enhancement module and the fusion result R3 of the feature fusion module are respectively subjected to loss calculation with the sub-image blocks corresponding to the images of the original input images CT and MRI.
[0023] Furthermore, the loss function used in training is:
[0024] TotalLOSS=LOSS R1 +LOSS R2 +LOSS R3
[0025] loss X$F =αEN_loss X$F +βGrad_loss X$F +MI_loss X$F +SSI_loss X$F
[0026] Where TotleLOSS is the total loss, LOSS R1 is the R1 loss, LOSS R2 is the R2 loss, LOSS R3is R3 loss, EN_loss is entropy loss, Grad_loss is gradient loss, MI_loss is mutual information loss, SSIM_loss is structural similarity loss, α and β are hyperparameters, X$F represents loss calculation of images X and F, X represents CT or MRI image, and F represents fusion result R1, R2 or R3.
[0027] Furthermore, the calculation formula used for each loss is:
[0028]
[0029] Among them, LOSS out is the loss of each constraint, MN represents the number of image blocks cut to calculate the loss, represents the loss calculated for the two image blocks ct and out corresponding to the i-th row and j-th column, Represents the loss calculated for the two image blocks mri and out corresponding to the i-th row and j-th column, and Represent the weights of image block CT and image block MRI respectively.
[0030] The present invention uses the sub-image blocks after R1, R2 and R3 segmentation to perform loss calculation with the sub-image blocks corresponding to the original input images CT and MRI, respectively, to complete the triple constraint; in each constraint, the entropy loss, gradient loss, mutual information loss and structural similarity loss are integrated, and the calculation is based on the image block loss weight.
[0031] Furthermore, during training, the AdamW optimization algorithm is used to optimize the loss function.
[0032] The present invention adopts the AdamW optimization algorithm to optimize the loss function, and can add the regularization term gradient in the back propagation formula to reduce the amount of calculation and improve the optimization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a structural diagram of the image fusion model adopted by the CT-MRI image fusion method of the present invention;
[0034] Figure 2 It is a flow chart of the implementation of the CT-MRI image fusion method of the present invention;
[0035] Figure 3 It is a workflow diagram of the multi-axis gated MLP feature extraction structure adopted in the present invention;
[0036] Figure 4 Schematic diagram of the bilinear interpolation operation process adopted by the present invention;
[0037] Figure 5It is a schematic diagram of the image cutting and numbering process adopted by the present invention;
[0038] Figure 6 It is a schematic diagram of the implementation principle of the feature fusion module adopted by the present invention;
[0039] Figure 7 It is a schematic diagram of the triple constraints and block-based loss calculation process adopted by the present invention;
[0040] Figure 8 It is a schematic diagram of a partial fusion result obtained in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0042] In order to solve the problems of blurred fusion image details, information loss and complex process in previous fusion methods, this paper proposes a CT-MRI image fusion method using a multi-axis gated MLP (multi-layer perceptron) structure and a convolutional neural network. This method constructs a CT-MRI image fusion model, such as Figure 1 As shown, it includes a global enhancement module, a detail enhancement module and a feature fusion module; the global enhancement module is used to extract the global coarse contour information of the registered CT and MRI image pairs using the MLP structure, the detail enhancement module is used to segment the registered CT and MRI image pairs into equal sizes, and to extract the features of each sub-image after segmentation using the MLP structure to ensure the detailed content information of the overall image, and the feature fusion module is used to integrate the local detail information extracted by the detail enhancement module with the global information extracted by the global enhancement module as a guide to construct a fused image. And by introducing a rich loss function and an adaptive dynamic loss function weight adjustment method, the visual perception effect and image quality are effectively improved, the trainability of MLP on small data sets is achieved, and the computational complexity of the model is reduced. The implementation process of this method is as follows Figure 2 As shown, the specific implementation process of the present invention is described in detail below in conjunction with specific examples.
[0043] 1. Perform global feature enhancement on the registered CT and MRI image pairs.
[0044] This step is implemented using the global enhancement module, such as Figure 1As shown, the global enhancement module includes a coding unit, two down-sampling units, two up-sampling units and three MLP feature extraction units, wherein the coding unit is used to encode the CT and MRI image pairs; the MLP feature extraction unit is used to extract features of the input features along the channel dimension, the high direction dimension and the wide direction dimension; the first MLP feature extraction unit takes the output of the coding unit as input, the output of the first MLP feature extraction unit is used as the input of the second MLP feature extraction unit after the down-sampling processing of the first down-sampling unit, the output of the second MLP feature extraction unit is used as the input of the third MLP feature extraction unit after the down-sampling processing of the second down-sampling unit, the output of the third MLP feature extraction unit is superimposed with the output of the first down-sampling unit after the up-sampling processing of the first up-sampling unit, the superimposed result is used as the input of the second up-sampling unit, and the output of the second up-sampling unit is superimposed with the output of the first MLP feature extraction unit as the output of the global enhancement module.
[0045] The MLP feature extraction unit is used to perform feature map channel dimension gated MLP mapping on the input features to obtain a first mapping result, perform feature map high dimension gated MLP mapping on the first mapping result to obtain a second mapping result, and superimpose the first mapping result and the second mapping result and then perform feature map wide dimension gated MLP mapping to obtain a third mapping result, superimpose the third mapping result and the first mapping result, and use the superimposed result as the output result of the MLP feature extraction unit.
[0046] The specific working process of the global enhancement module is as follows Figure 2 As shown, the global enhancement process is described in detail below.
[0047] 1. Encode the image pair using the coding unit.
[0048] The present invention is directed to a pair of CT and MRI images that have been registered. First, the pair of CT and MRI images that have been registered are 12 Encode to obtain the corresponding feature map. This embodiment uses a convolutional layer to encode the above image pair I 12 The convolution layer contains 32 convolution kernels of size 3×3×2 (since the input image contains images of two modalities, CT and MRI, the convolution kernel is 2 channels), and the displacement step is 1. The input size is m×n×2 (the size of a single CT and MRI image is m×n×1), and the encoding extracts a feature map of size m×n×32. Given the two components of the first convolution kernel of the first convolution layer The following is one of the convolution kernel components:
[0049]
[0050] The input image imagel With the first convolution kernel Perform convolution calculation:
[0051]
[0052] In the formula, It is the feature map output by the first convolution kernel in the convolution operation, input image l Each channel of (l=1, 2) corresponds to a convolution kernel component, and different convolution kernel components have different effects on different images. l The convolution operation is performed at the same position of the input image and the sum is calculated, and finally divided by the number of channels of the input image.
[0053] 2. Use the MLP feature extraction unit for feature extraction.
[0054] The obtained feature map is passed through the multi-axis gated MLP structure designed by the present invention, such as Figure 3 As shown, the input feature map size of this step is m×n×32, and the output size is m×n×32. The processing process is as follows:
[0055] 1) The input feature map is mapped through the feature map channel dimension gated MLP to obtain the feature map M1.
[0056] The purpose of this step is to keep the parameter calculation in linear complexity through axial operations, thereby increasing the trainability of the multi-layer perceptron MLP; the gating operation increases the interactive flexibility of information.
[0057] Redefine the shape input feature map, and the size of the feature map is mn×32 (combine the first dimension component and the second dimension component of the input feature map to convert the input feature map from a 3-dimensional tensor to a 2-dimensional tensor). The feature map is divided into two feature maps Gate_C and Feature_C with a size of mn×16 along the channel dimension; Feature_C performs LayerNorm normalization along its first dimension to obtain a feature map Feature_C1 with a size of mn×16. The specific normalization calculation is:
[0058]
[0059] Where E(x) and Var(x) are the mean and variance of the input x, respectively. γ and β are learnable variable parameters. Initially, γ = 1 and β = 0 in training. ∈ is a non-zero random value to avoid the denominator being zero.
[0060] Feature_C1 and Gate_C are multiplied to obtain a feature map FG_C of size mn×16.
[0061] FG_C passes through the multi-layer perceptron MLP structure and outputs a feature map FG_CM of size mn×32. The specific operation is: FG_C passes through a one-dimensional convolution layer, the number of convolution kernels is 64, the convolution kernel size is 3×32, and the displacement step is 1. The output size is a feature map FG_C1 of size mn×64.
[0062] In this step of one-dimensional convolution, the 32 components of a convolution kernel One of the convolution kernel components: Input feature map FG_C and the first convolution kernel Perform a convolution operation:
[0063]
[0064] In the formula, It is the feature map output by the first convolution kernel in the one-dimensional convolution layer, input FG_C l Each channel of (l=1, 2...32) corresponds to a convolution kernel component, and different convolution kernel components have different effects on FG_C l The convolution operation is performed at the same position of the input feature map and the sum is calculated, and finally divided by the number of channels of the input feature map.
[0065] FG_C1 is processed by GeLU nonlinear activation to obtain the feature map FG_C2. The GeLU nonlinear activation process is as follows:
[0066]
[0067] Where Φ(x) is the Gaussian normal distribution of X, μ and σ are the standard deviation and variance of the input x respectively, P(X≤x) is the probability distribution (x can be regarded as the activation value input of the current neuron), and GeLU(x) changes in direct proportion to the size of x. When the current activation function is activated, the smaller x is, the more likely the activation result is 0, and the larger x is, the easier it is to be retained.
[0068] Repeat this process to obtain a feature map FG_CM of size mn×32. Redefine the shape of FG_CM and obtain a feature map shape of m×n×32, denoted as M1.
[0069] 2) Map M1 through the gated MLP of the feature map height dimension to obtain the feature map M2.
[0070] The specific implementation process of this step is the same as step 1), except that the operations along the dimension in this step are all high-dimensional.
[0071] 3) Map M1+M2 through the feature map wide dimension gated MLP to obtain feature map M3.
[0072] M1 and M2 are superimposed to obtain M1+M2, and M1+M2 is mapped through the feature map wide dimension gated MLP to obtain a feature map M3 of size m×n×32. The specific operation is the same as step 1), except that the operations along the dimension in this step are all along the wide dimension ( Figure 3 The high-dimensional, wide-dimensional, and channel-dimensional dimensions of the feature map are shown).
[0073] 3. Superimpose M3 and M1 to obtain M1+M3. M1+M3 is processed by Dropout regularization and recorded as F1.
[0074] The Dropout regularization ratio is set to 0.3, specifically:
[0075] 1) Randomly (temporarily) delete half of the hidden neurons in the network, while keeping the input and output neurons unchanged.
[0076] 2) The input feature map is forward propagated through the modified network, and then the loss result is back-propagated through the modified network. After a small batch of training samples completes this process, the corresponding parameters are updated according to the stochastic gradient descent method on the neurons that have not been deleted.
[0077] 3) Restore the deleted neurons (the deleted neurons remain the same, while the neurons that have not been deleted have been updated). This method can effectively solve the problem of overfitting in training on small data sets.
[0078] 4. Downsample the obtained feature map.
[0079] The extracted feature map is convolved to reduce its size to half of the input, and then normalized by BatchNorm and activated by ReLU nonlinear features. The input feature map size is m×n×32, and the output feature map size is m / 2×n / 2×64.
[0080] The downsampling operation adopted by the present invention is a convolution operation, in which the number of convolution kernels is 64, the convolution kernel size is 3×3×32, and the displacement step is 2; the convolution operation result is subjected to BatchNorm normalization, assuming is the output of the first convolutional layer, which is normalized:
[0081]
[0082]
[0083]
[0084] In the formula, β 1 , β 2are two parameters that need to be learned, and their initial values are any value from 0 to 1. The normalization operation can speed up the training of the neural network; the ReLU nonlinear mapping is performed on the normalized transformation result: the value in each feature map is compared with 0, and the value greater than 0 remains unchanged, and the value less than 0 is set to 0.
[0085] Through the above steps 2 and 3, the feature map F1 can be obtained. The output map obtained in step 3 is subjected to a multi-axis gated MLP feature extraction operation according to step 1) to obtain a feature map F2, whose size is m / 4×n / 4×64. Steps 3 and 2 are repeated in sequence, and a downsampling operation and a multi-axis gated MLP feature extraction operation are performed to obtain a feature map F3, whose size is m / 4×n / 4×128.
[0086] 5. Perform upsampling operation.
[0087] The obtained feature map F3 is upsampled and restored to a feature map S1 of size m / 2×n / 2×64. The process is as follows:
[0088] First, the bilinear interpolation method is used to restore the feature map F3 and double the size of the feature map. Figure 4 The bilinear interpolation process is shown. The specific method of bilinear interpolation is: (the size of the feature map is doubled, and the number of interpolations is also doubled)
[0089] Known point Q 11 =(x 1 ,y 1 ), Q 12 =(x 1 ,y 2 ), Q 21 =(x 2 ,y 1 ), Q 22 =(x 2 ,y 2 ). Complete the interpolation of point P;
[0090] Performing linear interpolation in the x direction, we obtain:
[0091]
[0092]
[0093] Performing linear interpolation in the y direction, we obtain:
[0094]
[0095] Finally, the interpolation result is:
[0096]
[0097] The obtained feature map is then passed through a convolution layer; the number of convolution kernels used in this embodiment is 64, the convolution kernel size is 3×3×128, and the step size is 1.
[0098] Finally, feature map S1 is obtained by using BatchNorm normalization processing and ReLU nonlinear feature activation processing. The BatchNorm normalization principle and ReLU nonlinear feature activation processing can be referred to step 4.
[0099] 6. Perform overlay processing.
[0100] Superimpose S1 and F2 to obtain feature map S1+F2, and repeat step 5 for S1+F2 to obtain feature map S2, whose size is m×n×32. The difference is that the number of convolution kernels in this step is 32, and the size of the convolution kernel is 3×3×64.
[0101] Superimpose S2 and F1 to obtain the feature map S2+F1, denoted as Global_F, and restore the feature map Global_F to the image size through a convolution layer. The output image size is m×n×1, denoted as R1. In this operation, the number of convolution kernels is 1, the convolution kernel size is 3×3×32, and the displacement step is 1.
[0102] Second, perform detail enhancement processing on the registered CT and MRI image pairs.
[0103] This step is implemented using the detail enhancement module, such as Figure 1 As shown, the structure of the detail enhancement module is similar to that of the global enhancement module, both of which adopt a multi-axis gated MLP structure. In this embodiment, a segmentation unit, an encoding unit, two downsampling units, two upsampling units, and three MLP feature extraction units are included. The difference is that the present invention targets the sub-image cut by the segmentation unit when performing feature extraction. The specific processing process of the detail enhancement module is as follows:
[0104] 1. Perform cutting operation on the image pairs.
[0105] For the registered CT and MRI images, 12 Perform equal-sized patch cutting operations, cut into i×j sub-images of size m / i×n / j×2, input to the detail enhancement module for input encoding, encoding for convolution calculation, encoding to extract i×j sub-feature maps of size m / i×n / j×32. The size of i and j can be dynamically adjusted according to actual needs, but i and j should be able to divide m and n respectively. The specific cutting steps are:
[0106] (1) The length and width of the operation image (size is m×n×1) are divided into equal parts, and the unit lengths of the divisions are m / i and n / j respectively.
[0107] (2) The coordinates of the lower left corner of the operating image are marked as (0,0). Each image block is numbered according to the coordinates of the upper right corner of the cut image block. The image block with the coordinates of the upper right corner (m / i,n / j) is numbered (1,1), the image block with the coordinates of (m / i,2n / j) is numbered (1,2), and so on (the image cutting and numbering process is as follows). Figure 5 shown).
[0108] 2. Use MLP to process each sub-feature map after cutting.
[0109] Repeat steps 2-4 in the global enhancement module for each sub-feature map (i.e., each Patch feature map) to perform processing operations on the feature map. After repeating step 4, i×j sub-feature maps of size m / i×n / j×32 are obtained, denoted as Splite_S2. After repeating step 2, i×j sub-feature maps of size m / i×n / j×32 are obtained, denoted as Splite__F1.
[0110] 3. Combine the processed sub-feature maps.
[0111] The sub-feature maps in Splite_S2 and the sub-feature maps in Splite__F1 are combined respectively, and the combination order is the reverse operation of the cutting order, that is, the combination is performed according to the corresponding number of each sub-feature map; the feature map after Splite_S2 is combined is denoted as S2_2; the feature map after Splite__F1 is combined is denoted as F1_1; the feature map sizes of feature maps F1_1 and S2_2 are both m×n×32.
[0112] 4. Perform overlay processing.
[0113] Superimpose S2_2 and F1_1 to obtain the feature map S2_2+F1_1, denoted as Local_F. The feature map Local_F is restored to the image size through a convolution layer, where the number of convolution kernels is 1, the convolution kernel size is 3×3×32, the displacement step is 1, and the convolution operation principle can refer to step 1. The output image size is m×n×1, denoted as R2.
[0114] 3. Perform image fusion.
[0115] The feature maps Local_F and Global_F are input into the feature fusion module together to obtain the feature map Fusion_F. In this step, the size of all feature maps is kept at m×n×32. The specific implementation includes the following steps:
[0116] 1) Perform a convolution operation, LReLU nonlinear activation processing and another convolution operation on Global_F in sequence to obtain the feature map Global_F1. The number of convolution kernels used in the two convolution operations is 32, the size is 3×3×32, and the displacement step is 1. The formula used for LReLU nonlinear activation processing is:
[0117]
[0118] 2) Repeat step 1) to obtain the feature map Global_F2.
[0119] 3) Global_F1, Global_F2 and Local_F are fused to obtain the feature map Fusion_F. The calculation formula used is:
[0120] Fusion F=Local F*(Global_F1+1)+Global_F2
[0121] * is the dot multiplication operation, and Global_F is used to guide the integration of Local_F information in this formula (the working process of the feature fusion module is as follows Figure 6 shown).
[0122] The obtained feature map Fusion_F is subjected to a convolution operation, where the number of convolution kernels is 1, the convolution kernel size is 3×3×32, and the displacement step is 1. This step can restore the fused feature map to the image size, and the final output result is recorded as R3, whose size is m×n×1.
[0123] 4. Model training.
[0124] The present invention introduces a rich loss function and an adaptive dynamic loss function weight adjustment method during model training to effectively improve visual perception effects and image quality.
[0125] 1. Construct a loss function.
[0126] First, the obtained images R1, R2, R3, as well as the original input CT image and the original input MRI image are respectively subjected to equal-sized patch cutting operations, and cut into p×q image blocks of size m / p×n / q×1, and p×q sub-images of R1, R2, R3, the original input CT image and the original input MRI image are obtained respectively. The size of p and q can be dynamically adjusted according to actual needs, but it should be satisfied that p and q can divide m and n respectively. Then, the grayscale value of each sub-image block corresponding to the original input CT and MRI images after cutting is compared and calculated one by one, and p×q loss weight values are obtained. The following is the calculation formula for the weights of one pair of image blocks:
[0127]
[0128]
[0129]
[0130] Where Sign(·) is the sign function, H and W represent the size of a single image block, and is the gray value of the pixel in the i-th row and j-th column of the image block, m ct and m mri is the generated adaptive weighted activity score, c is the hyperparameter that controls the scaling difference between the two activity scores and is set to 4, and ω is the generated weight value.
[0131] The sub-image blocks segmented by R1 (the fusion result of the global enhancement module), R2 (the fusion result of the detail enhancement module) and R3 (the fusion result of the feature fusion module) are respectively calculated with the sub-image blocks corresponding to the original input images CT and MRI to complete the triple constraint. The loss of the corresponding image block is calculated using the obtained p×q weight values, and the loss ratio is dynamically adjusted (each of the triple constraints uses this loss weight, taking p×q=4×4 as an example, the triple constraint and the image block-based loss calculation process can be referred to Figure 7 ). The specific loss function is:
[0132] loss X$F =αEN_loss X$F +βGrad_loss X$F +MI_loss X$F +SSIM_loss X$F
[0133]
[0134] TotalLOSS=LOSS R1 +LOSS R2 +LOSS R3
[0135] Among them, EN_loss is entropy loss, Grad_loss is gradient loss, MI_loss is mutual information loss, SSIM_loss is structural similarity loss, α and β are hyperparameters, represents the loss calculated by the two image blocks (ct and out (the fusion result of a certain path)) corresponding to the i-th row and j-th column (the cutting process when calculating the loss is independent of the cutting process of the previous enhancement path). If out is R1, the fusion result of the enhancement path is taken as the loss calculation data; loss X$FRepresents the loss of image X and image F. Because it is a triple constraint structure, that is, the results generated after the global module path, the enhancement module path and the feature fusion module are all calculated for loss, and the loss calculation method for each path is the same, which is LOSS out Formula, TotleLOSS represents the total loss of the three paths added together (the total loss of the three constraints). Specifically, α=0.01, β=1.5, and ω is the loss weight value. X$F represents the loss calculation of images X and F (X represents CT or MRI image, and F represents the fusion result R1, R2 or R3), and MN represents the number of image blocks cut to calculate the loss. The calculation method used for each loss is:
[0136] 1) Entropy loss
[0137]
[0138] p(i, j) = f(i, j) / HW
[0139]
[0140] p(i, j) is the probability distribution, X and F are images of size H×W, i and j represent the pixel in the i-th row and j-th column of the image (X or F), and f(i, j) represents the frequency of occurrence of the pixel (i, j).
[0141] 2) Gradient loss
[0142]
[0143]
[0144] Where Grad is the gradient extraction factor, f(i, j) is the grayscale value of the pixel in the i-th row and j-th column. X and F are images of size H×W.
[0145] 3) Mutual Information Loss
[0146]
[0147]
[0148]
[0149] Where I(x, y) is the joint entropy of images x and y, X and F are images of size H×W, p(x(i, j)) and p(y(i, j)) represent the probability distribution of images x and y respectively, EN(x) and EN(y) represent the entropy of images x and y respectively, and the calculation process of probability distribution and entropy can refer to entropy loss; p(x(i, j), y(i, j)) represents the joint probability distribution of images x and y, specifically: p(x(i, j), y(i, j)) = f(x(i, j), y(i, j)) / HW, f(x(i, j), y(i, j)) represents the frequency of simultaneous occurrence of pixel point (i, j) of image x and pixel point (i, j) of image y.
[0150] 4) Structural similarity loss
[0151] SSIM_loss X$F =1-SSIM(X,F)
[0152]
[0153] where μ x , μ y and σ x , σ y Represents the mean and variance of all pixel grayscale values of images x and y, σ xy is the covariance of the grayscale values of all pixels in images x and y. C is a constant that suppresses the instability caused by the average value approaching 0.
[0154] 2. Training based on loss function.
[0155] According to the loss function, the model parameters are updated using the gradient backpropagation method, and the model optimizer used is AdamW. When using the AdamW optimization algorithm to optimize the loss function, the regularization term gradient can be added to the backpropagation formula to reduce the amount of calculation and improve the optimization efficiency. The backpropagation chain derivation method is specifically:
[0156] The back-propagation algorithm uses the chain rule to derive the parameters from the last loss function to each previous layer of the network. After obtaining the gradient, the gradient descent algorithm is used to update the parameters so that the output of the model's loss function is as small as possible.
[0157] Assume that the input value of the neural network is x, the output value is y, the activation function is f, the parameter is W, the bias is b, and the loss function is L. The input value of the nth layer is x (n) The output value is y (n+1) , parameter is W (n) , the offset is b (n) have:
[0158] y (n+1)=f(W (n) x (n) +b (n) )
[0159]
[0160] because:
[0161]
[0162]
[0163]
[0164]
[0165] That is, the nth layer parameter W can be obtained through the above formula (n) and the offset b (n) The gradient of the loss function L and To calculate the partial derivatives of the nth layer, the partial derivatives and parameters obtained in the n+1th layer are needed. The overall calculation process should be done from back to front, which is called the gradient backpropagation algorithm.
[0166] The present invention sets the number of iterations during the training process, and if the number of iterations reaches a preset value, the network parameter value is saved and the training ends. Otherwise, the training continues.
[0167] In the test part, only the output result R3 of step 3 is taken as the final fusion result, such as Figure 8 As shown, the CT-MRI image fusion results including some diseased brains and normal brains are shown.
Claims
1. A CT-MRI image fusion method, characterized in that: The fusion method includes the following steps: 1) constructing a CT-MRI image fusion model, which includes a global enhancement module, a detail enhancement module and a feature fusion module; the global enhancement module is used to extract global coarse contour information of the registered CT and MRI image pairs using an MLP structure, the detail enhancement module is used to segment the registered CT and MRI image pairs into equal sizes, and to extract features of each segmented sub-image using an MLP structure to ensure the detail content information of the overall image, and the feature fusion module is used to integrate the local detail information extracted by the detail enhancement module with the global information extracted by the global enhancement module as a guide to construct a fused image; 2) Training the constructed CT-MRI image fusion model; 3) Use the trained CT-MRI image fusion model to fuse the registered CT and MRI image pairs.
2. The CT-MRI image fusion method according to claim 1, characterized in that: The global enhancement module includes an encoding unit, two downsampling units, two upsampling units and three MLP feature extraction units. The encoding unit is used to encode CT and MRI image pairs; the MLP feature extraction unit is used to extract features of input features along the channel dimension, the high direction dimension and the wide direction dimension; the first MLP feature extraction unit takes the output of the encoding unit as input, the output of the first MLP feature extraction unit is used as the input of the second MLP feature extraction unit after downsampling processing of the first downsampling unit, the output of the second MLP feature extraction unit is used as the input of the third MLP feature extraction unit after downsampling processing of the second downsampling unit, the output of the third MLP feature extraction unit is superimposed with the output of the first downsampling unit after upsampling processing of the first upsampling unit, the superposition result is used as the input of the second upsampling unit, and the output of the second upsampling unit is superimposed with the output of the first MLP feature extraction unit as the output of the global enhancement module.
3. The CT-MRI image fusion method according to claim 1, characterized in that: The detail enhancement module includes a segmentation unit, an encoding unit, two down-sampling units, two up-sampling units and three MLP feature extraction units. The segmentation unit is used to perform a cutting operation on the CT and MRI image pairs and cut them into multiple sub-images; the encoding unit is used to encode the cut sub-images; the MLP feature extraction unit is used to extract features of the input features along the channel dimension, the high direction dimension and the wide direction dimension; the first MLP feature extraction unit takes the output of the encoding unit as input, the output of the first MLP feature extraction unit is used as the input of the second MLP feature extraction unit after down-sampling processing of the first down-sampling unit, the output of the second MLP feature extraction unit is used as the input of the third MLP feature extraction unit after down-sampling processing of the second down-sampling unit, the output of the third MLP feature extraction unit is superimposed with the output of the first down-sampling unit after up-sampling processing of the first up-sampling unit, the superposition result is used as the input of the second up-sampling unit, and the output of the second up-sampling unit is superimposed with the output of the first MLP feature extraction unit as the output of the detail enhancement module.
4. The CT-MRI image fusion method according to claim 2 or 3, characterized in that: The MLP feature extraction unit is used to perform feature map channel dimension gated MLP mapping on the input feature to obtain a first mapping result, perform feature map high dimension gated MLP mapping on the first mapping result to obtain a second mapping result, and superimpose the first mapping result and the second mapping result and then perform feature map wide dimension gated MLP mapping to obtain a third mapping result, superimpose the third mapping result and the first mapping result, and use the superimposed result as the output result of the MLP feature extraction unit.
5. The CT-MRI image fusion method according to claim 1, characterized in that: The feature fusion module is used to perform a convolution operation on the output result of the global enhancement module, perform nonlinear activation processing and secondary convolution operations to obtain a first global feature, and perform a convolution operation on the output result of the global enhancement module again, perform nonlinear activation processing and secondary convolution operations to obtain a second global feature, and fuse the first global feature, the second global feature and the output result of the detail enhancement module.
6. The CT-MRI image fusion method according to claim 1, characterized in that: The calculation formula used for the output result of the detail enhancement module is: Fusion_F=Local_F*(Global_F1+1)+Global_F2 Among them, Fusion_F is the fusion result, Global_F1 is the first global feature, Global_F2 is the second global feature, Local_F is the output result of the detail enhancement module, and * is the dot multiplication operation.
7. The CT-MRI image fusion method according to claim 1, 2, 3, 5 or 6, characterized in that: The step 2) adopts triple constraints during training, that is, the sub-image blocks divided by the output result R1 of the global enhancement module, the output result R2 of the detail enhancement module and the fusion result R3 of the feature fusion module are respectively subjected to loss calculation with the sub-image blocks corresponding to the images of the original input images CT and MRI.
8. The CT-MRI image fusion method according to claim 7, characterized in that: The loss function used in training is: TotleLOSS=LOSS R1 +LOSS R2 +LOSS R3 loss XSF =αEN_loss XSF +βGrad_loss XSF +MI_loss XSF +SSIM_loss XSF Where TotleLOSS is the total loss, LOSS R1 is the R1 loss, LOSS R2 is the R2 loss, LOSS R3 is R3 loss, EN_loss is entropy loss, Grad_loss is gradient loss, MI_loss is mutual information loss, SSIM_loss is structural similarity loss, α and β are hyperparameters, XSF represents loss calculation for images X and F, X represents CT or MRI image, and F represents fusion result R1, R2 or R3.
9. The CT-MRI image fusion method according to claim 8, characterized in that: The calculation formula for each loss is: Among them, LOSS out is the loss of each constraint, MN represents the number of image blocks cut to calculate the loss, Represents the loss calculated for the two image blocks ct and out corresponding to the i-th row and j-th column, Represents the loss calculated for the two image blocks mri and out corresponding to the i-th row and j-th column, and Represent the weights of image block CT and image block MRI respectively.
Citation Information
Cited By
Cardiovascular surgery image processing system and method for image enhancement
CN119809971A
An image-enhanced cardiovascular surgical image processing system and method
CN119809971B
