Medical image registration method based on grouping deformation
The grouping module and context fusion module decompose and fuse pyramid-level deformations to generate deformation fields with flexible receptive fields, which solves the limitations of existing pyramid methods in processing deformations of different scales and achieves efficient medical image registration.
Patent Information
- Application Number
- CN202410759214.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-08-30
AI Technical Summary
When existing pyramid-form medical image registration methods handle deformations of different scales, the number of deformation decompositions is limited by the number of pyramid layers, and the amount of calculation is large, making it difficult to handle large-scale and small-scale deformations at the same time.
The deformation of each level of the pyramid is further decomposed through the grouping module, convolution kernels of different sizes are used to extract features, and the grouping correlation calculation method is used to generate correlation graphs. A context fusion module is added to adaptively fuse context information between different groups. Generate deformation fields with flexible receptive fields.
It achieves effective processing of large-scale and small-scale deformations without increasing the amount of calculation, and improves the accuracy and efficiency of medical image registration.
Smart Images

Figure CN118570268A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence, deep learning and computer vision content technology, and in particular to a medical image registration method based on group deformation. Background Art
[0002] In recent years, deep learning technology has promoted the development of deformable image registration. In most data types, the deformable image registration methods based on deep learning proposed by scholars have surpassed traditional registration methods in terms of accuracy and speed. In the image registration methods based on deep learning, some studies have shown that image misalignment occurs, and there is still the problem of exponential growth in computational complexity. Therefore, a key contribution proposed by some scholars is the pyramid registration method, such as "KangM, Hu X, Huang W, et al. Dual-stream pyramid registration network[J]. Medical Image Analysis, 2022, 78: 102379." "Zhou S, Hu B, Xiong Z, et al. Self-Distilled hierarchical network for unsupervised deformable image registration[J]. IEEE Transactions on Medical Imaging, 2023, 42(8): 2162–2175." "Hu B, Zhou S, Xiong Z, et al. Recursive decomposition network for deformable image registration[J]. IEEE Journal of Biomedical and Health Informatics, 2022, 26(10): 5130–5141.", which predicts deformation fields at different scales to adapt to changes at different scales. This method uses low-resolution deformation fields to process global deformations and high-resolution deformation fields to process local details, and is widely considered to be one of the best registration algorithms currently. However, this method still has some problems. In this algorithm, only one deformation field can be generated for each pyramid level, which means that the number of deformation decompositions is limited by the number of pyramid levels. In addition, all deformations at the corresponding scale must be processed by the deformation field of the corresponding level, that is, both large-scale and small-scale deformations need to be captured. Summary of the invention
[0003] The present invention further decomposes the deformation of each level of the pyramid through a grouping module to simplify the learning process of the model. The features extracted by the grouping module are sent to the convolution layer with convolution kernels of different sizes to obtain features extracted by different receptive fields. Then, the group correlation calculation method is used to calculate the feature similarity between each group of features of the moving image and the fixed image, and a correlation graph is generated. This method can retain more information. In addition, in order to enhance the collaboration between groups, a context fusion module is added to adaptively fuse the context information between different groups. Finally, through these predicted deformation fields with different receptive fields, deformations of different sizes can be processed exclusively. They are fused into a deformation field with a more flexible receptive field range, so that large-scale and small-scale deformations can be processed simultaneously.
[0004] The technical problem to be solved by the present invention is to make up for the shortcomings of each current pyramid registration method and propose a medical image registration method based on group deformation to achieve an accurate and effective medical image matching effect.
[0005] The technical solution of the present invention is as follows: A medical image registration method based on group deformation, using two weight-sharing encoders to extract fixed images I F With moving images I M Each encoder extracts four different levels of features F1, F2, F3, and F4 of the corresponding image; the different levels of features extracted by the two encoders are respectively input into the group update module GUM of the corresponding level, thereby generating the deformation field φ of the corresponding level l and context feature F Cl ; The last level of deformation field is generated by concatenating deformation features, last level fixed image features, and last level context features, and then a convolution is performed; the deformation fields of adjacent group update modules are combined with each other until the final deformation field φ is formed; the moving image and fixed image are segmented and labeled according to the final deformation field; the generation of the deformation field and the segmentation and labeling are optimized through the loss function.
[0006] The grouping update module includes a grouping module and a context fusion module; the grouping module outputs the deformed deformation field and the calculated grouping correlation; the context fusion module fuses the context features of different groups; the grouping module has 4 levels, wherein the input of the first level grouping module is the first level moving image feature F M1 , first-level fixed image features F F1 The input of the remaining grouping modules consists of four parts: the first level moving image feature F Ml , the first level fixed image feature F Fl , the first-order deformation field φ l 、N l Group context features Enter F Ml and F Fl Divide into N l The grouped features are sent to convolution to extract features, and the convolution kernel size is (2i-1) 3 , thus obtaining the characteristics and Features in different groups have receptive fields of different sizes, moving image features Through the deformation field φ l Perform spatial transformation to generate deformable image features
[0007] In the grouping module, group correlation is used to represent the correspondence of the chart. The calculation formula for the correlation of the i-th group is as follows:
[0008]
[0009] Where a, b, c represent the displacements in the x, y, and z directions, and the ranges of the three displacements satisfy a, b, c ∈ [-r, r], where r represents the maximum displacement radius; <, > means performing the inner product first and then averaging along the direction of the channel;
[0010] For each group and After concatenation, it is input to the grouped field estimator; it generates N l Group deformation field and contextual features Then use different numbers of 3×3×3 convolution kernels to generate the deformation field φ l , thus ensuring that the deformation field has receptive fields of different scales.
[0011] The context fusion module first combines the context features of two adjacent groups and Implement absolute position encoding; the initial value of the position encoding is set to 0 and dynamically updated by gradient descent; after completing the position encoding, the two sets of context features are merged and a convolution operation is performed to generate an intermediate feature set; then, the spatial attention mechanism is used to and The weighted graph of is used to weight the intermediate features to achieve the focus on spatial information; the weighted features are added to the intermediate features to form new context features that flow to the next level context fusion module; the new context features determine their flow direction according to the number of groups in the next level context fusion module; if the number of groups remains unchanged, the new context features flow to two corresponding groups at the same time, and if the number of groups is halved, they only flow to one group.
[0012] The loss function includes a regularization loss function and a weak supervision loss function;
[0013] The regularized loss function L reg Specifically:
[0014]
[0015] Where l represents each level of the output deformation field;
[0016] The segmentation annotations of the moving image and the fixed image are represented as S M and S F , deformation field Φ to S M Perform the nearest neighbor sampling spatial transformation to obtain S W ; The weak supervision loss function L seg Specifically:
[0017]
[0018] Where C represents the number of anatomical structure categories;
[0019] Therefore, the entire loss function is:
[0020] L total =λ1L reg +λ2L seg
[0021] λ1 and λ2 represent hyperparameters for adjusting the strength of the regularization loss function and the weak supervision loss function.
[0022] The encoder includes 7 convolutional layers, instance normalization and activation functions; the convolution kernel size of the convolutional layer is 3×3×3, the convolution with a step size of 1 is responsible for feature extraction, and the convolution with a step size of 2 is responsible for sampling; the activation function is a LeakyRLU activation function with a "leakage value" of 0.2.
[0023] Training Methods
[0024] This method is implemented based on the Pytorch framework and uses the Adam optimizer to update the gradient and learning rate. The total number of training iterations is 100,000 times, the learning rate of the first 88,000 iterations is set to 1e-4, and the learning rate of the last 12,000 iterations is set to 1e-5. In the present invention, we used the public OASIS image dataset. In these datasets, we randomly selected x annotated images and used them as reference images. The remaining images in the dataset are defined as moving images to be registered. These moving images are then further randomly assigned to three different sets: one for model training, one for model verification, and the last for model testing. Such a division ensures that the network can effectively learn and evaluate performance at different stages.
[0025] Table 1.1 Explanation of all abbreviations
[0026]
[0027] Beneficial effects of the present invention: The present invention aims to solve the problems existing in the existing pyramid registration algorithm when processing medical images, such as image misalignment and excessive calculation. The deformation of the pyramid level is further decomposed by the grouping module to simplify the learning process of the model and retain more information. This medical image registration method adopts a grouped deformation method, and the deformation of each level of the pyramid is further decomposed by the grouping module to simplify the learning process of the model. The features extracted by the grouping module are sent to the convolution layer with convolution kernels of different sizes to obtain features extracted by different receptive fields. Then, the feature similarity between each group of features of the moving image and the fixed image is calculated by the grouping correlation calculation method, and a correlation map is generated. This method can retain more information. In addition, in order to enhance the collaboration between groups, a context fusion module is added to adaptively fuse the context information between different groups. Finally, through these predicted deformation fields with different receptive fields, deformations of different sizes can be processed attentively. They are fused into a deformation field with a more flexible receptive field range, so that large-scale and small-scale deformations can be processed simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 The figure is a schematic diagram of the entire network structure of the medical image registration method based on group deformation of the present invention. GUM is the group update module, C&C is the splicing and convolution operation, Combination of deformation fields, It is a space transformation operation.
[0029] Figure 2 The detailed structure of the encoder. The structure where Conv3D is located is the convolution operation, where C represents the number of convolution channels. The structure where IN is located represents the normalization and activation function.
[0030] Figure 3 Schematic diagram of the group update module for group l. The black box is the grouping module, followed by the context fusion module.
[0031] Figure 4 An example of correlation calculation.
[0032] Figure 5 The process of fusing the first and second sets of context features for the context fusion module. DETAILED DESCRIPTION
[0033] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0034] A medical image registration method based on group deformation, the specific method is as follows:
[0035] Use two weight-sharing encoders, with a structure like Figure 2 As shown, the fixed image I is extracted respectively F With moving images I M Each encoder extracts four different levels of features F1, F2, F3, and F4 of the corresponding image, and the number of channels they correspond to is 8, 16, 32, and 64 respectively; the different levels of features extracted by the two encoders are respectively input into the group update module GUM of the corresponding level, thereby generating the deformation field φ of the corresponding level l and context feature F Cl ; The deformation fields of adjacent group update modules are combined with each other until the final deformation field φ is formed; the deformation features, the last level fixed image features and the last level context features are concatenated, and then a convolution is performed to generate the last level deformation field; the moving image and the fixed image are segmented and annotated according to the final deformation field; the generation of the deformation field and the segmentation and annotation are optimized through the loss function.
[0036] The grouping update module includes a grouping module and a context fusion module; the grouping module outputs the deformed deformation field and the calculated grouping correlation; the context fusion module fuses the context features of different groups; the grouping module has 4 levels, wherein the input of the first level grouping module is the first level moving image feature F M1 , first-level fixed image features F F1 ; Other grouping modules, such as Figure 3 As shown in the black box, the input has four parts, the first level moving image feature F Ml , the first level fixed image feature F Fl , the first level deformation field N l Group context features Enter F Ml and F Fl Divide into N l The grouped features are sent to convolution to extract features, and the convolution kernel size is (2i-1) 3 , thus obtaining the characteristics and Features in different groups have receptive fields of different sizes, moving image features Through the deformation field φ l Perform spatial transformation to generate deformable image features
[0037] When calculating the correlation, each feature point will traverse all points within a certain radius around it and perform a dot product operation. The value of this dot product is then recorded at the corresponding feature map location and finally averaged along the channel dimension. Each dot product operation will produce a channel correlation map. For example, in Figure 4 In Figure 1, the correlation calculation process of two 2D feature maps is shown, where the radius is set to 1. In this example, the dark points in feature map 1 are dot-producted with the dark points in feature map 2, and the resulting values are stored in the corresponding positions of the feature map with 9 channels. The calculation process for other points is also performed in this way.
[0038] In the grouping module, group correlation is used to represent the correspondence of the chart. The calculation formula for the correlation of the i-th group is as follows:
[0039]
[0040] Where a, b, c represent the displacements in the x, y, and z directions, and the ranges of the three displacements satisfy a, b, c ∈ [-r, r], where r represents the maximum displacement radius; <, > means performing the inner product first and then averaging along the direction of the channel;
[0041] For each group and After concatenation, it is input to the grouped field estimator; it generates N l Group deformation field and contextual features Then use different numbers of 3×3×3 convolution kernels to generate the deformation field φ l , thus ensuring that the deformation field has receptive fields of different scales.
[0042] The context fusion module, such as Figure 5 The following fusion module fuses the first and second groups of context features. First, the context features of the two adjacent groups are fused. and Implement absolute position encoding; the initial value of the position encoding is set to 0 and dynamically updated by gradient descent; after completing the position encoding, the two sets of context features are merged and a convolution operation is performed to generate an intermediate feature set; then, the spatial attention mechanism is used to and The weighted graph of is used to weight the intermediate features to achieve the focus on spatial information; the weighted features are added to the intermediate features to form new context features that flow to the next level context fusion module; the new context features determine their flow direction according to the number of groups in the next level context fusion module; if the number of groups remains unchanged, the new context features flow to two corresponding groups at the same time, and if the number of groups is halved, they only flow to one group.
[0043] The loss function includes a regularization loss function and a weak supervision loss function;
[0044] The regularized loss function L reg Specifically:
[0045]
[0046] Where l represents each level of the output deformation field;
[0047] The segmentation annotations of the moving image and the fixed image are represented as S M and S F , deformation field Φ to S M Perform the nearest neighbor sampling spatial transformation to obtain S W ; The weak supervision loss function L seg Specifically:
[0048]
[0049] Where C represents the number of anatomical structure categories;
[0050] Therefore, the entire loss function is:
[0051] L total =λ1L reg +λ2L seg
[0052] λ1 and λ2 represent hyperparameters for adjusting the strength of the regularization loss function and the weak supervision loss function.
[0053] The encoder includes 7 convolutional layers, instance normalization and activation functions; the convolution kernel size of the convolutional layer is 3×3×3, the convolution with a step size of 1 is responsible for feature extraction, and the convolution with a step size of 2 is responsible for sampling; the activation function is a LeakyRLU activation function with a "leakage value" of 0.2.
[0054] Training Methods
[0055] This method is implemented based on the Pytorch framework, and the Adam optimizer is used to update the gradient and learning rate. The total number of training iterations is 100,000. The learning rate of the first 88,000 iterations is set to 1e-4, and the learning rate of the last 12,000 iterations is set to 1e-5. In the present invention, we used the public OASIS image dataset. The dataset contains 414 T1-weighted magnetic resonance imaging images. In order to remove unnecessary black backgrounds and reduce the storage requirements of the graphics processing unit, we cropped the size of all images from 160×192×244 pixels to 160×192×144 pixels. Among these images, we randomly selected 5 annotated images and used them as reference images. The remaining 409 images were regarded as moving images to be registered, and during the experiment, we did not use the annotation information of these moving images to simulate a real situation with only a small amount of annotation information. These moving images were then randomly assigned to a training set (255 images), a validation set (22 images), and a test set (132 images). Therefore, we obtained 1275, 110, and 660 pairs of images for the training, validation, and testing phases of the network, respectively. After the training is completed, the deformation field can be predicted. The model inputs the moving image and the fixed image into the network, outputs the deformation field, and then the deformation field acts on the moving image to obtain the deformed image.
Claims
1. A medical image registration method based on group deformation, characterized in that: Use two weight-sharing encoders to extract fixed images I F With moving images I M Each encoder extracts four different levels of features F1, F2, F3, and F4 of the corresponding image; the different levels of features extracted by the two encoders are respectively input into the group update module GUM of the corresponding level, thereby generating the deformation field φ of the corresponding level l and context feature F Cl ; The last level of deformation field is generated by concatenating deformation features, last level fixed image features, and last level context features, and then a convolution is performed; the deformation fields of adjacent group update modules are combined with each other until the final deformation field φ is formed; the moving image and fixed image are segmented and labeled according to the final deformation field; the generation of the deformation field and the segmentation and labeling are optimized through the loss function.
2. The medical image registration method based on group deformation according to claim 1, characterized in that: The grouping update module includes a grouping module and a context fusion module; The grouping module outputs the deformed deformation field and the calculated group correlation; The context fusion module fuses the context features of different groups; the grouping module has 4 levels, where the input of the first level grouping module is the first level moving image feature F M1 , the first level fixed image feature F F1 The input of the remaining grouping modules consists of four parts: the first level moving image feature F Ml , the first level fixed image feature F Fl , the first level deformation field φ l 、N l Group context features Enter F Ml and F Fl Divide into N l The grouped features are sent to convolution to extract features, and the convolution kernel size is (2i-1) 3 , thus obtaining the characteristics and Features in different groups have receptive fields of different sizes, moving image features Through the deformation field φ l Perform spatial transformation to generate deformable image features In the grouping module, group correlation is used to represent the correspondence of the chart. The calculation formula for the correlation of the i-th group is as follows: Where a, b, c represent the displacements in the x, y, and z directions, and the ranges of the three displacements satisfy a, b, c ∈ [-r, r], where r represents the maximum displacement radius; <, > means performing the inner product first and then averaging along the direction of the channel; For each group and After concatenation, it is input to the grouped field estimator; it generates N l Group deformation field and contextual features Then use different numbers of 3×3×3 convolution kernels to generate the deformation field φ l , thus ensuring that the deformation field has receptive fields of different scales.
3. The medical image registration method based on group deformation according to claim 2, characterized in that: The context fusion module first combines the context features of two adjacent groups and Implement absolute position encoding; the initial value of the position encoding is set to 0 and dynamically updated by gradient descent; after completing the position encoding, the two sets of context features are merged and a convolution operation is performed to generate an intermediate feature set; then, the spatial attention mechanism is used to and The weighted graph of is used to weight the intermediate features to achieve the focus on spatial information; the weighted features are added to the intermediate features to form new context features that flow to the next level context fusion module; the new context features determine their flow direction according to the number of groups in the next level context fusion module; if the number of groups remains unchanged, the new context features flow to two corresponding groups at the same time, and if the number of groups is halved, they only flow to one group.
4. The medical image registration method based on group deformation according to claim 3, characterized in that: The loss function includes a regularization loss function and a weak supervision loss function; The regularized loss function L reg Specifically: Where l represents each level of the output deformation field; The segmentation annotations of the moving image and the fixed image are represented as S M and S F , deformation field Φ to S M Perform the nearest neighbor sampling spatial transformation to obtain S W ; The weak supervision loss function L seg Specifically: Where C represents the number of anatomical structure categories; Therefore, the entire loss function is: L total =λ1L reg +λ2L seg λ1 and λ2 represent hyperparameters for adjusting the strength of the regularization loss function and the weak supervision loss function.
5. The medical image registration method based on group deformation according to any one of claims 1 to 4, characterized in that: The encoder includes 7 convolutional layers, instance normalization and activation function; the convolution kernel size of the convolutional layer is 3×3×3, the convolution with a step size of 1 is responsible for feature extraction, and the convolution with a step size of 2 is responsible for sampling; the activation function is the LeakyRLU activation function with a "leakage value" of 0.2.
