Unsupervised MRI image registration algorithm and system based on transformer and convnet fusion model
Patent Information
- Application Number
- CN202410152162.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-03
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-02-03
AI Technical Summary
由于卷积运算固有的局部性质,基于ConvNet的架构在显式建模图像中的长程空间关系时通常面临限制,导致空间信息的提取不完整
[0031] Compared with existing technologies, this invention is a technology for registering medical images. It can effectively and quickly register different two-dimensional or three-dimensional images, which is beneficial for subsequent processing such as fusion and segmentation of medical images. It also helps doctors to better understand the changes in the body of patients during follow-up and accurately judge the changes in the diseased areas of the body.
Smart Images

Figure CN117876445B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an unsupervised MRI image registration algorithm and system based on a Transformer and ConvNet fusion model. Background Technology
[0002] Deformable image registration is a fundamental process in many medical imaging analysis tasks. Its purpose is to obtain a dense, nonlinear spatial correspondence between a pair of stationary and moving images to minimize differences, which is crucial for clinical diagnosis and surgical treatment. Traditional image registration methods attempt to maximize image similarity between image pairs through intuitive explicit feature matching. However, these methods are cumbersome in solving for each new image pair, resulting in high computational costs and time consumption.
[0003] Deep learning-based models, especially convolutional neural networks (CNNs), have demonstrated excellent performance in medical image analysis tasks. To address the time-consuming nature of traditional methods, ConvNet-based models have been introduced in image registration. ConvNet-based models use a single global function optimization method during training and learn a general representation for image registration, which helps to quickly align unseen image pairs after training and improves registration performance. However, due to the inherent locality of convolutional operations, ConvNet-based architectures often face limitations when explicitly modeling long-range spatial relationships in images, leading to incomplete extraction of spatial information. Summary of the Invention
[0004] The purpose of this invention is to provide an unsupervised MRI image registration algorithm and system based on a Transformer and ConvNet fusion model, which can improve the accuracy of registered images.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] In a first aspect, the present invention provides an unsupervised MRI image registration algorithm based on a Transformer and ConvNet fusion model, comprising the following steps:
[0007] S1, Preprocess the MRI images;
[0008] S2, the deformation field in the pre-processed MRI image is extracted by a pre-trained fusion model, which includes a parallel Transformer sub-network and a ConvNet sub-network;
[0009] S3. Input the moving image and the obtained deformation field into the spatial transformation network to obtain the registered image.
[0010] Based on the embodiments of the present invention, step S1 includes the following steps:
[0011] S11, convert the T2 sequence of the original MRI image from dcm format to .nii.gz format;
[0012] S12, adjust the voxels of the converted image to a uniform standard;
[0013] S13, adjust the size of the voxel-adjusted image to the set size;
[0014] S14, pre-registers the image pairs processed by S13 through affine transformation and rigid registration;
[0015] S15, normalize the pre-registered image.
[0016] Based on the embodiments of the present invention, the fusion model in S2 is obtained through the following steps:
[0017] S21, Construct the Transformer subnetwork;
[0018] S22, ConvNet subnetwork is constructed;
[0019] S23, merge the Transformer subnetwork and the ConvNet subnetwork to obtain the fused model;
[0020] S24. The fusion model is trained unsupervised based on the dataset to obtain the trained fusion model.
[0021] Based on the embodiments of the present invention, the Transformer sub-network includes four stages, with the first stage performing a 4x downsampling and the following three stages performing a 2x downsampling.
[0022] Based on the embodiments of the present invention, the ConvNet subnetwork includes 5 stages, and each stage is downsampled by 2 times.
[0023] In step S23, the following formula is used for fusion. Among them, T i For the Transformer subnetwork, feature maps are obtained by sampling in the i-th stage, C i F is used to sample the feature map of the ConvNet subnetwork in the i-th stage. i The fusion feature map is obtained for the fusion model in the i-th stage.
[0024] Secondly, the present invention provides an unsupervised MRI image registration system based on a Transformer and ConvNet fusion model, comprising:
[0025] The image preprocessing module is used to preprocess MRI images;
[0026] The deformation field extraction module is used to extract the deformation field in the preprocessed MRI image through a pre-trained fusion model, which includes a parallel Transformer sub-network and a ConvNet sub-network.
[0027] The registration module is used to input the moving image and the obtained deformation field into the spatial transformation network to obtain the registered image.
[0028] Thirdly, the present invention provides a computer program product including computer-readable instructions, characterized in that the computer-readable instructions, when executed by a processor, implement the steps in the unsupervised MRI image registration algorithm of the present invention.
[0029] Fourthly, the present invention provides a computer-readable storage medium including computer-readable instructions, wherein the computer-readable instructions, when executed by a processor, implement the steps in the unsupervised MRI image registration algorithm of the present invention.
[0030] Fifthly, the present invention provides an electronic device, comprising: a memory storing program instructions; and a processor connected to the memory, executing the program instructions in the memory to implement the steps in the unsupervised MRI image registration algorithm of the present invention.
[0031] Compared with existing technologies, this invention is a technology for registering medical images. It can effectively and quickly register different two-dimensional or three-dimensional images, which is beneficial for subsequent processing such as fusion and segmentation of medical images. It also helps doctors to better understand the changes in the body of patients during follow-up and accurately judge the changes in the diseased areas of the body.
[0032] Other advantages of this invention are described in the embodiments section. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart of an unsupervised MRI image registration algorithm based on a Transformer and ConvNet fusion model in an embodiment of the present invention.
[0035] Figure 2 for Figure 1The processing flowchart for step S1.
[0036] Figure 3 for Figure 1 The processing flowchart for step S2.
[0037] Figure 4 The diagram shows the structure of the NeXt-B and NeXt-D modules.
[0038] Figure 5 This is a schematic diagram of the fusion process of two sub-networks.
[0039] Figure 6 A comparison chart of registration results for different algorithms.
[0040] Figure 7 This is a block diagram of an unsupervised MRI image registration system based on a Transformer and ConvNet fusion model.
[0041] Figure 8 This is a block diagram of the components of an electronic device. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0043] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.
[0044] Please see Figure 1 The unsupervised MRI image registration algorithm based on the Transformer and ConvNet fusion model provided in this embodiment includes the following steps:
[0045] S1 preprocesses the three-dimensional MRI (Magnetic Resonance Imaging) images.
[0046] S2 extracts the deformation field from the preprocessed MRI image using a fusion model of Transformer and ConvNet.
[0047] S3. Input the moving image and the obtained deformation field into the spatial transformation network to obtain the registered image.
[0048] Please see Figure 2 In this embodiment, step S1 specifically includes the following steps:
[0049] S11 converts the T2 sequence of the original MRI image from dcm format to .nii.gz format.
[0050] In this step, format conversion can reduce file size, maintain data integrity, increase compatibility, and facilitate subsequent image processing and analysis.
[0051] S12, using interpolation methods such as linear interpolation, the voxel spacing of the format-converted MRI image is adjusted to 1mm*1mm*1mm.
[0052] The purpose of adjusting the voxel spacing in this step is to standardize the voxel spacing of MRI images acquired by different devices, so as to facilitate subsequent image processing and analysis. Therefore, the voxel spacing can also be other values.
[0053] In step S13, the MRI image size in step S12 is adjusted to 160*160*96. This size satisfies the network requirements while reducing the computational space requirements to some extent.
[0054] S14 pre-registers the image pairs processed by S13 using affine transformation and rigid registration to reduce image differences between the image pairs.
[0055] Affine transformations are applied to deform the image to handle transformations such as scaling, rotation, and translation. While affine transformations typically only handle simple geometric transformations, image deformation can be much more complex. Therefore, to better align the images, this step employs rigid registration to address image rotation and distortion. The pre-registered image initially reduces image differences.
[0056] S15, normalize the pre-registered image so that the normalized pixel range changes from the interval [0,255] to the interval [0,1].
[0057] Normalization can be achieved by subtracting the minimum value from the pixel values of the image and then dividing by the difference between the maximum and minimum values.
[0058] Please see Figure 3 In this embodiment, the fusion model described in step S2 above is obtained through the following steps:
[0059] S21, Construct the Transformer subnetwork.
[0060] In this embodiment, the Transformer subnetwork consists of four stages, each containing a specific number of Swing Transformer blocks for image feature extraction and learning: 2, 2, 4, and 2 blocks respectively. In the last three stages, the feature maps are downsampled by a factor of 2, resulting in a decrease in resolution while doubling the number of channels. Subsequently, the downsampled feature maps are processed by stacking Swing Transformer blocks.
[0061] In the Transformer subnetwork, the encoder initially divides the input image pairs into patches of size 2×P×P×P, where P is typically set to 4. The j-th patch of the input image pair is denoted as... Where j ranges from 1 to N, This represents the total number of patches, where H, W, and L represent the height, width, and length of the image patch, respectively. Linear projection. Projecting each flattened patch onto the feature representation C of arbitrary dimensions yields the output Z0:
[0062]
[0063] The feature map obtained from the l-th W-MSA / SW-MSA and MLP is... and z l This indicates that self-attention is calculated as follows:
[0064]
[0065] In the equation In this matrix, Q, K, and V represent the query, key, and value matrices, respectively, and A(Q,K,V) represents the attention matrix. Here, d represents the dimension of the query and key features, while M... x *M y *M z This represents the number of tokens in the 3D window. Additionally, B indicates the relative position of each token within each window.
[0066] S22, ConvNet subnetwork is constructed.
[0067] To achieve better feature extraction performance, the MedNeX architecture is introduced to build the network. For example... Figure 4 As shown, the ConVNet subnetwork contains two types of ConVNet blocks: NeXt-B and NeXt-D. NeXt-B performs feature detail extraction, while NeXt-D performs downsampling. Each stage is constructed from one NeXt-B and one NeXt-D block.
[0068] The NeXt-B block utilizes a 3x3x3 deep convolutional layer with a stride of 1 to extract image features. To ensure stability across batches, a channel groupnorm is employed. A Transformers-style convolutional neural network extension layer is used, applying channel expansion with a scaling ratio R to improve the model's representational power. Furthermore, a compression layer is used to channel-compress the feature map, enhancing the block's generalization ability. Finally, a residual structure combines the output with the input.
[0069] NeXt-D is a downsampling block similar to NeXt-B. However, it includes some additional steps. In the deep convolutional layers, it performs downsampling using a 3x3x3 kernel size and a stride of 2. In the shortcut connections, a 1x1x1 3D convolution with a stride of 2 is applied, doubling the number of channels in the input feature map. This doubled feature map is then added to the output of the compressed layer, resulting in a feature map with twice the number of channels. These steps facilitate downsampling and allow the block to capture more comprehensive information.
[0070] S23, merge the Transformer subnetwork and the ConvNet subnetwork to obtain the fused model.
[0071] In this embodiment, two parallel sub-networks are used to extract features, which are then directly added at multiple scales to fuse and enhance the features. A V-Net architecture is used to connect the encoder and decoder, and long-hop connections are employed to facilitate the exchange of localization information between the encoder and decoder levels. The encoder contains two parallel sub-networks for feature extraction: a Transformer sub-network and a ConvNet sub-network. These sub-networks can extract fused feature maps at multiple scales.
[0072] like Figure 5 As shown, the Transformer subnetwork performs four downsampling operations to obtain the feature map. Based on the selected SwinTransformer construction, the first downsampling requires a 4x downsampling, followed by three 2x downsampling operations to obtain the feature map T. i The ConvNet subnetwork performs five 2x downsampling iterations to obtain feature map C. i When the downsampling factor is 2, the features at odd and even positions of the input can be better aligned, which helps to extract more representative features and better preserve important shape and structural features, thus helping to retain more detailed information for more accurate localization and recognition.
[0073] Throughout the process, the two sub-networks perform feature fusion at four different scales. Because the Transformer sub-network's initial downsampling factor is 4 and the ConvNet sub-network's initial downsampling factor is 2, the fused feature maps F obtained at different scales are... i :
[0074] T i ={T1,T2,T3,T4},
[0075] C i ={C1,C2,C3,C4,C5},
[0076]
[0077] S24. Perform unsupervised training to obtain the deformation field and obtain the trained fusion model.
[0078] The overall loss function consists of two parts: mean squared error (MSE) loss L. mse and deformation regularization loss L diffusion Where the mean square error loss represents the accuracy of registration, and the deformation regularization loss represents the smoothness of the deformation field:
[0079]
[0080] Where λ is the regularization parameter, which is set to 0.02, φ represents the deformation field, Ω represents the image domain, and u represents the displacement field.
[0081] The deformation field can be obtained by fusing the feature maps from the four stages of the two sub-networks and then performing multiple upsampling and feature extraction processes. Figure 5 As shown.
[0082] The algorithm model was trained for 200 epochs using the Adam optimization algorithm on the fusion model of this invention (and all models used in the comparative experiments). A learning rate decay strategy was employed, and the batch size was 1. m Let lr represent the learning rate for the m-th epoch. init That is the initial learning rate.
[0083]
[0084] To verify the reliability of the method of the present invention, a comparative experiment was conducted.
[0085] 1) Experimental Dataset
[0086] This study used a dataset from a public hospital, which included 110 real T2-axis MRI sequences of the prostate from diagnosed patients. This dataset was labeled by professional physicians to identify prostate regions. The proposed fusion model was trained using an Atlas-based registration method. The training set consisted of 100 images, and the validation set consisted of 10 images. All data underwent preprocessing steps including resampling, min-max normalization, affine alignment, and resizing to 160×160×96.
[0087] 2) Evaluation Indicators
[0088] For the 3D medical image registration task, commonly used quantitative evaluation metrics in this field were selected, including the Dice Similarity Coefficient (DSC), the number and percentage of voxels in the non-positive Jacobian determinant, and registration time. The evaluation metrics are described in detail below:
[0089] 1. Dice similarity coefficient
[0090] Currently, in the field of medical image registration research, due to the lack of real labeled data as the gold standard to quantify the results of image registration, most algorithms mainly use the Dice similarity coefficient to calculate the similarity between the fixed image and the registered image. DSC can measure the structural consistency between the fixed image F and the registered image M(φ) through segmentation labels, thereby reflecting the accuracy of the registration result. Please note that the segmented labeled images used in this invention are limited to the prostate region, that is, the prostate region is labeled in 40-50 slices of the three-dimensional prostate image. The specific calculation formula for the DSC value between the fixed image F and the registered image M(φ) is shown in Equation (6).
[0091]
[0092] in, and φ and F represent the k-th region of interest corresponding to the segmentation labels of the registered image and the fixed image, respectively. The value of DSC ranges from [0, 1]. The larger the DSC value, the more overlapping parts there are between the segmentation labels of the registered image M(φ) and the fixed image F, which means that the accuracy and precision of the algorithm registration are higher.
[0093] 2. Percentage of non-positive Jacobian determinant voxels
[0094] Currently, in the field of medical image registration, in addition to improving the accuracy and precision of registration, it is also necessary to ensure that the registration field generated during the registration process maintains the topological structure of the deformed image and achieves the reversibility of the transformation. The Jacobian determinant describes the influence of the registration field on volume changes. When the Jacobian determinant is positive, it indicates that the registration field is smoother, which means that the image registration is more accurate; when the Jacobian determinant is negative, it indicates that folding has occurred at some locations. The smaller the absolute value of the Jacobian determinant, the smaller the influence of deformation on volume changes. This paper uses the percentage of non-positive Jacobian determinant voxels to evaluate the regularity of the registration field and the accuracy of the registration results. The registered images in this paper are three-dimensional data, and the definition of the Jacobian determinant is shown in Equation (7).
[0095]
[0096] Where φ represents the registration field, p represents a point in the registration field, and x, y, and z represent the coordinates of point p on the corresponding coordinate axes.
[0097] 3) Experimental Design and Result Analysis
[0098] The algorithm proposed in this invention was compared with several state-of-the-art registration methods, namely: (1) VoxelMorph: a popular single-stage registration network using VoxelMorph-V1 and VoxelMorph-V2; (2) Vit-V-Net: a registration network based on Vision Transformer; (3) CycleMorph: cycle-consistent deformable image registration; and (4) TransMorph: a registration network with a Swin-Transformer enhanced encoder. All comparison algorithms used the same learning rate and loss function.
[0099] Among the six algorithms, the die values of the registered and fixed images in the prostate region were compared, as well as the percentage of negative Jacobian matrix voxels, i.e., the smoothness of the deformation field. A higher die value indicates better performance, and a lower percentage of negative Jacobian matrix voxels also indicates better performance. The best results are shown in bold. Table 1 shows that the algorithm proposed in this invention has the highest mean DSC value of 0.901, and compared to the Transformer-based algorithms of VIT-V-Net and TransMorph, it achieves the lowest percentage of negative Jacobian matrix voxels: 4.48%. In the ablation experiments, we compared the backbone network TransMorph, fusion operations performed on TransMorph using ordinary 3D convolution, and the proposed algorithm. The experimental results are shown in Table 2. Through comparison, the algorithm of this invention achieved the highest DSC value and the lowest percentage of negative Jacobian matrix voxels. Figure 6 For the registration results images of different algorithms, from Figure 6 It can be seen that the details after registration by the algorithm of this invention are closest to the target image, which shows that while the registration performance of the algorithm proposed in this invention is improved, the smoothness of the deformation field is also guaranteed, which shows considerable superiority compared with other algorithms.
[0100] Table 1: Comparison of DSC and %|Jφ|≤0 results for different algorithms
[0101] VM-1 0.870±0.052 5.65±2.01 VM-2 0.872±0.053 5.51±2.35 Cyclemorph 0.872±0.053 5.06±1.54 VIT-V-Net 0.883±0.048 6.41±1.68 TransMorph 0.893±0.054 5.30±2.54 Algorithm of this invention 0.901±0.053 4.48+-2.25
[0102] Table 2: Comparison of ablation results
[0103]
[0104] Please see Figure 7 Based on the same inventive concept, embodiments of the present invention also provide an unsupervised MRI image registration system based on a Transformer and ConvNet fusion model, comprising:
[0105] The image preprocessing module is used to preprocess MRI images;
[0106] The deformation field extraction module is used to extract the deformation field in the preprocessed MRI image through a pre-trained fusion model, which includes a parallel Transformer sub-network and a ConvNet sub-network.
[0107] The registration module is used to input the moving image and the obtained deformation field into the spatial transformation network to obtain the registered image.
[0108] For details on the specific processing of each module, please refer to the relevant descriptions of the corresponding steps in the aforementioned methods, which will not be repeated here.
[0109] like Figure 8 As shown, this embodiment also provides an electronic device that may include a processor 41 and a memory 42, wherein the memory 42 is coupled to the processor 41. It is worth noting that this figure is exemplary, and other types of structures can be used to supplement or replace this structure to achieve data extraction, report generation, communication, or other functions.
[0110] like Figure 8 As shown, the electronic device may also include an input unit 43, a display unit 44, and a power supply 45. It is worth noting that the electronic device is not necessarily required to include these components. Figure 8 All components shown in the image. Furthermore, electronic devices may also include... Figure 8 For components not shown, please refer to existing technologies.
[0111] Processor 41, sometimes also called controller or operation control, may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device.
[0112] The memory 42 may be one or more of the following: a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It can store configuration information of the processor 41, instructions executed by the processor 41, and other information. The processor 41 can execute programs stored in the memory 42 to perform information storage or processing. In one embodiment, the memory 42 further includes a buffer memory, or buffer, to store intermediate information.
[0113] Input unit 43 is used, for example, to input MRI images to processor 41. Display unit 44 is used to display various results during the processing; this display unit may be, for example, an LCD display, but the invention is not limited thereto. Power supply 45 is used to provide power to the electronic device.
[0114] This invention also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed in an electronic device, the program product causes the electronic device to perform the operation steps included in the method of this invention.
[0115] This invention also provides a storage medium storing computer-readable instructions that cause an electronic device to perform the operation steps included in the method of this invention.
[0116] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0117] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0118] Those skilled in the art will recognize that the modules of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the constituent modules and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0119] In the several embodiments provided in this application, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0120] The embodiments described above are merely specific implementations of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications, substitutions, and improvements within the technical scope disclosed in the present invention, and these modifications, substitutions, and improvements should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An unsupervised MRI image registration algorithm based on a Transformer and ConvNet fusion model, characterized in that, Includes the following steps: S1, Preprocess the MRI images; S2, the deformation field in the pre-processed MRI image is extracted by a pre-trained fusion model, which includes a parallel Transformer sub-network and a ConvNet sub-network; The fusion model in S2 is trained through the following steps: S21, Construct the Transformer subnetwork; S22, ConvNet subnetwork is constructed; S23, merge the Transformer subnetwork and the ConvNet subnetwork to obtain the fused model; In step S23, the following formula is used for fusion. , Among them, T i For the Transformer subnetwork, feature maps are obtained by sampling in the i-th stage, C i F is used to sample the feature map of the ConvNet subnetwork in the i-th stage. i To obtain the fusion feature map for the fusion model in the i-th stage; S24, perform unsupervised training on the fusion model based on the dataset to obtain the trained fusion model; the overall loss function L includes the mean squared error loss L0. mse and deformation regularization loss L diffusion Where the mean square error loss represents the accuracy of registration, and the deformation regularization loss represents the smoothness of the deformation field: , in, This is the regularization parameter; set it to 0.
02. Represents the deformation field. The image domain is represented by u, and the displacement field is represented by u. S3. Input the moving image and the obtained deformation field into the spatial transformation network to obtain the registered image.
2. The unsupervised MRI image registration algorithm based on the Transformer and ConvNet fusion model according to claim 1, characterized in that, S1 includes the following steps: S11, convert the T2 sequence of the original MRI image from dcm format to .nii.gz format; S12, adjust the voxels of the converted image to a uniform standard; S13, adjust the size of the voxel-adjusted image to the set size; S14, pre-registers the image pairs processed by S13 through affine transformation and rigid registration; S15, normalize the pre-registered image.
3. The unsupervised MRI image registration algorithm based on the Transformer and ConvNet fusion model according to claim 2, characterized in that, The Transformer subnetwork consists of four stages. The first stage performs a 4x downsampling, and the following three stages each perform a 2x downsampling.
4. The unsupervised MRI image registration algorithm based on the Transformer and ConvNet fusion model according to claim 3, characterized in that, The ConvNet subnetwork consists of 5 stages, each of which is downsampled by a factor of 2.
5. An unsupervised MRI image registration system based on a Transformer and ConvNet fusion model, characterized in that, include: The image preprocessing module is used to preprocess MRI images; The deformation field extraction module is used to extract the deformation field in the preprocessed MRI image through a pre-trained fusion model, which includes a parallel Transformer sub-network and a ConvNet sub-network. The fusion model is trained through the following steps: S21, Construct the Transformer subnetwork; S22, ConvNet subnetwork is constructed; S23, merge the Transformer subnetwork and the ConvNet subnetwork to obtain the fused model; In step S23, the following formula is used for fusion. , Among them, T i For the Transformer subnetwork, feature maps are obtained by sampling in the i-th stage, C i F is used to sample the feature map of the ConvNet subnetwork in the i-th stage. i To obtain the fusion feature map for the fusion model in the i-th stage; S24, perform unsupervised training on the fusion model based on the dataset to obtain the trained fusion model; the overall loss function L includes the mean squared error loss L0. mse and deformation regularization loss L diffusion Where the mean square error loss represents the accuracy of registration, and the deformation regularization loss represents the smoothness of the deformation field: , in, This is the regularization parameter; set it to 0.
02. Represents the deformation field. The image domain is represented by u, and the displacement field is represented by u. The registration module is used to input the moving image and the obtained deformation field into the spatial transformation network to obtain the registered image.
6. A computer program product comprising computer-readable instructions, characterized in that, The computer-readable instructions, when executed by a processor, implement the steps in the unsupervised MRI image registration algorithm of any one of claims 1-4.
7. A computer-readable storage medium comprising computer-readable instructions, characterized in that, The computer-readable instructions, when executed by a processor, implement the steps in the unsupervised MRI image registration algorithm of any one of claims 1-4.
8. An electronic device, characterized in that, include: Memory, which stores program instructions; The processor, connected to the memory, executes the program instructions in the memory to implement the steps in the unsupervised MRI image registration algorithm according to any one of claims 1-4.