Smooth image sampling registration method and device based on sampling frequency map, terminal and medium
By constructing a smooth image sampling registration method based on the sampling frequency map, and optimizing the loss function of the registration field and the sampling frequency map, the problem of hidden sampling holes in the backward mapping registration method is solved, achieving more accurate image registration and preservation of detail information.
Patent Information
- Application Number
- CN202311369885.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-10-20
AI Technical Summary
While existing image registration methods based on back mapping can provide registration results without obvious holes, they hide sampling holes in the source image, resulting in the loss of detailed information.
By constructing a smooth image sampling and registration method based on sampling frequency maps, a loss function is used to optimize the registration field and the initial sampling frequency map. By combining regularization loss function and similarity loss function, the spatial gradient of the sampling frequency map is optimized to achieve a smooth distribution of the final registration field.
It effectively discloses the sampling holes in the source image space, ensures that the sampling probability map is differentiable, improves the regularity of the registration field, preserves the detailed information of the source image, and achieves more accurate image registration.
Smart Images

Figure CN117593343B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image registration technology, and in particular to a method, apparatus, terminal and medium for smooth image sampling registration based on sampling frequency maps. Background Technology
[0002] Image registration plays a crucial role in medical image analysis. For example, registering dynamic contrast-enhanced MRI images at different time points can reveal the flow of contrast agents and the exposure of potential lesions. Registered images can track the response of tumors at the same location to contrast agents, aiding in the evaluation of clinical oncology treatment efficacy. Furthermore, image registration at different time points can help physicians determine the extent of tumor involvement and clinical grade.
[0003] In their article "Voxelmorph: a learning framework for deformable medical image registration" published in Volume 38, Issue 8 of IEEE Transactions on Medical Imaging, Guha Balakrishnan et al. mentioned that existing deep learning-based registration methods involve using a neural network to input two images from a dataset of images, and then using backpropagation and gradient descent to find a spatial transformation to map one image (source image) onto the other image (target image), so that points corresponding to the same spatial location in the two images correspond one-to-one, thereby achieving the purpose of information fusion.
[0004] Registering images from dynamic contrast-enhanced MRI, which exhibit varying gray levels or structural appearances, presents significant challenges. Zhang et al., in their article "Backward registration based aspect ratio similarity for image retargeting quality assessment" published in IEEE Transactions on Image Processing, Volume 25, Issue 9, mention that registration models are often based on backward mapping. However, backward mapping-based registration models tend to sample points with similar gray levels, which may lead to the loss of points with mismatched gray levels but matching anatomical correspondences, or points from lesion regions with mismatched gray levels. Both of these issues hinder the acquisition of accurate and meaningful image registration results.
[0005] This loss of detail can be attributed to the fact that the commonly used back-mapping-based registration field is not subject to sampling constraints when performing spatial transformations. While forward-mapping-based registration fields are theoretically feasible, they are challenging from an application perspective. In particular, sampling and interpolation techniques have greatly facilitated the efficient implementation of back-mapping-based registration fields. Although this widely used back-mapping-based registration field can provide registration results without obvious holes, it hides the presence of sampling holes in the source image. Summary of the Invention
[0006] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a smooth image sampling registration method, apparatus, terminal and medium based on sampling frequency map, to solve the technical problem that although the registration field based on back mapping can provide registration results without obvious holes, it hides the existence of sampling holes in the source image.
[0007] To achieve the above and other related objectives, a first aspect of this application provides a smooth image sampling registration method based on a sampling frequency map, comprising: acquiring an image dataset; the image dataset including a source image and a target image; inputting the image dataset into a pre-constructed registration model to calculate a registration field based on back mapping; registering the source image to the target image space based on the registration field to obtain a pre-registered image; optimizing the registration field and the pre-registered image using a loss function respectively; obtaining a pre-constructed sampling frequency map based on the registration field using a pre-constructed sampling frequency estimator; optimizing the pre-registered sampling frequency map using a loss function; repeating all the above steps until the registration model converges; and obtaining the final registration field, the final registered image, and the final sampling frequency map based on the converged registration model.
[0008] In some embodiments of the first aspect of this application, the registration field based on backward mapping output by the registration model is defined in the target image space, wherein the values in the registration field represent the coordinates of the grid position points in the target image space to the sampling points in the source image space.
[0009] In some embodiments of the first aspect of this application, registering the source image to the target image space based on the registration field to obtain a pre-registered image includes: constructing a spatial transformation based on the registration field; and using the spatial transformation to register the source image to the target image space.
[0010] In some embodiments of the first aspect of this application, the spatial transformation process includes the following: obtaining the coordinates of sampling points falling in the source image space according to the registration field, determining the corresponding sampling values according to the sampling point coordinates; backfilling the sampling values to the corresponding positions in the target image space, and constructing the image after completing the backfilling of the sampling values of all sampling points.
[0011] In some embodiments of the first aspect of this application, the method includes: optimizing the registration field using a regularized loss function; the regularized loss function is used to obtain a spatial gradient of the displacement field that minimizes the magnitude of the difference between the numerical values of adjacent positions in the sampling offset displacement field at the time of sampling.
[0012] In some embodiments of the first aspect of this application, the regularization loss function of the registration field minimizes the spatial gradient of the displacement field by utilizing the modulus of the difference between the sampled offset displacement values of adjacent grid positions in the sampled offset displacement field, as expressed below:
[0013]
[0014] Where Ω represents the target image space, and |Ω| represents the total number of grid positions within the target image space. The difference between the sampling offset displacement of a grid position point and its adjacent grid position points in the target image space is represented by the sampling offset displacement field u: u = φ - Id; φ represents the registration field, and Id represents the grid position point in the target spatial image.
[0015] In some embodiments of the first aspect of this application, the method includes: characterizing a similarity loss function of image pairs by measuring the differences between image pairs, thereby optimizing images after preliminary registration.
[0016] In some embodiments of the first aspect of this application, the similarity loss function is expressed as follows:
[0017]
[0018] Here, NCC represents the normalized cross-correlation loss function, used to measure the image after initial registration. The similarity between the target image T and the image T. In some embodiments of the first aspect of this application, the process of obtaining a preliminary sampling frequency map based on the registration field by means of a pre-constructed sampling frequency estimator includes: determining the sampling frequency based on the number of times a point in the source image is sampled at a grid location; determining the sampling frequency value by the sum of interpolation weights of an uncertain number of sampling points around it; and performing vectorization construction of the preliminary sampling frequency map.
[0019] In some embodiments of the first aspect of this application, the sampling frequency in the sampling frequency diagram is calculated as follows:
[0020]
[0021] Where SFM is the sampling frequency map; SFM(q) is the sampling frequency of the sampling frequency map at the grid position point in the source image; Z(q) is the set of neighboring sampling points at a distance of no more than 1 around the grid position point; the elements of this set are sampling points φ(p); when the element φ(p) of this set coincides with the position of q, it is a grid position point, and when the distance from q is greater than 0, it is a non-grid position point; φ represents the registration field defined in the target image space; d are the three spatial dimensions of the registered image. When the image is 2D, the set of spatial dimensions is {x,y}; when the image is 3D, the set of spatial dimensions is {x,y,z}. It is the interpolation weight contributed by the grid position point q to the sampling point φ(p) when the sampling point φ(p) is interpolated.
[0022] In some embodiments of the first aspect of this application, the vectorization construction of the preliminary sampling frequency map includes:
[0023] Based on the sampling offset displacement specified by the registration field, the coordinates of the grid position points in the target image space are obtained by adding the sampling offset displacement to the coordinates of the sampling point; wherein, the sampling offset displacement refers to the numerical value of the point in the sampling offset displacement field;
[0024] If the coordinates of the sampling point fall within a grid location point in the source image space, then The sampling frequency is entirely distributed to SFM(q); if the coordinates of the sampling point fall within a non-grid location in the source image space, then The sampling frequency is distributed to SFM(q), and the remaining sampling frequency is distributed to the grid points around the non-grid point according to the interpolation weight. If it is a 3D image registration, the number of grid points around the non-grid point is 8, and a 1-to-8 distribution operation is performed. If it is a 2D image registration, the number of grid points around the non-grid point is 4, and a 1-to-4 distribution operation is performed.
[0025] In some embodiments of the first aspect of this application, the optimization of the preliminary sampling frequency map using a loss function includes the following steps: minimizing the difference between the all-one matrix and the preliminary sampling frequency map using a mean squared error loss function; and minimizing the spatial gradient of the sampling frequency map using the square of the magnitude of the difference in sampling frequencies at adjacent positions.
[0026] In some embodiments of the first aspect of this application, the convergence condition of the registration model includes: if the registration model is an algorithm model based on iterative optimization, then satisfying the conditions of iterative optimization is taken as the convergence condition of the model; if the registration model is a deep learning model based on learning, then the convergence condition of the model is taken as the convergence of the loss function optimized by deep learning on the entire dataset.
[0027] In some embodiments of the first aspect of this application, the learning-based deep learning model includes a convolutional neural network, the loss function of which is optimized over the entire dataset and expressed as follows:
[0028]
[0029] Among them, L smooth L is the regularized loss function; sim The similarity loss function; Let the mean squared error loss function be used. Let λ be the spatial gradient loss function; smooth and λ sfm As weight.
[0030] To achieve the above and other related objectives, a second aspect of this application provides a smooth image sampling registration apparatus based on a sampling frequency map, comprising: a dataset acquisition module for acquiring an image dataset; the image dataset including a source image and a target image; a registration model module for inputting the image dataset into a pre-constructed registration model to calculate a registration field based on back mapping; a spatial transformation module for registering the source image to the target image space based on the registration field to obtain a pre-registered image; and optimizing the registration field and the pre-registered image using a loss function respectively; a sampling frequency map estimation module for obtaining a pre-registered sampling frequency map based on the registration field using a pre-constructed sampling frequency estimator; and optimizing the pre-registered sampling frequency map using a loss function; and a model convergence module for repeating all the above steps until the registration model converges; and obtaining a final registration field, a final registered image, and a final sampling frequency map based on the converged registration model.
[0031] To achieve the above and other related objectives, a third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the smooth image sampling registration method based on a sampling frequency map.
[0032] To achieve the above and other related objectives, a fourth aspect of this application provides an electronic terminal, comprising: a processor and a memory; the memory for storing a computer program, and the processor for executing the computer program stored in the memory to enable the terminal to perform the smooth image sampling registration method based on the sampling frequency map.
[0033] As described above, the smooth image sampling registration method, apparatus, terminal, and medium based on sampling frequency maps of this application have the following beneficial effects: This application analyzes the information loss during the registration process from the perspective of sampling frequency maps, thus revealing sampling holes originally hidden in the source image space; the theoretical construction of the sampling frequency map and the interpolation operation during sampling in spatial transformation have a consistent theoretical basis, thereby ensuring that the sampling probability map is differentiable, which is a prerequisite for optimizing and differentiating gradient descent; moreover, since the sampling frequency map can be considered independent of the registration model, as long as the model depends on the registration field based on backward mapping, the sampling frequency estimator of this invention can construct the sampling frequency map using interpolation weights; the sampling frequency loss function can promote the smooth distribution of sampling points by suppressing the occurrence of extreme sampling frequencies and suppressing drastic changes in sampling frequencies at adjacent grid positions, thereby helping to improve the regularity of the registration field and retaining detailed information of the source image. Attached Figure Description
[0034] Figure 1 The diagram shown is a flowchart illustrating a smooth image sampling registration method based on a sampling frequency map according to an embodiment of this application.
[0035] Figure 2 The diagram shown illustrates the execution structure of a smooth image sampling registration method based on a sampling frequency map according to an embodiment of this application.
[0036] Figure 3A The diagram shown is a schematic representation of a spatial transformation process in one embodiment of this application.
[0037] Figure 3B The diagram shows a sampling frequency estimator process in one embodiment of this application.
[0038] Figure 4 The diagram shown is a schematic diagram of a UNet-type registration network structure in one embodiment of this application.
[0039] Figure 5 The diagram shown is a schematic representation of a spatial transformation process in one embodiment of this application.
[0040] Figure 6A The diagram shown is a flowchart illustrating how the sampling frequency estimator obtains a preliminary sampling frequency map based on the registration field in one embodiment of this application.
[0041] Figure 6B The diagram shown is a schematic representation of the vectorization process in one embodiment of this application.
[0042] Figure 7 The diagram shown is a structural schematic of a smooth image sampling registration device based on a sampling frequency map according to an embodiment of this application.
[0043] Figure 8 The diagram shown is a structural schematic of an electronic terminal according to an embodiment of this application.
[0044] Component designation explanation
[0045]
[0046] Detailed Implementation
[0047] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0048] It should be noted that in the following description, reference is made to the accompanying drawings, which illustrate several embodiments of this application. It should be understood that other embodiments may also be used, and changes in mechanical composition, structure, electrical system, and operation may be made without departing from the spirit and scope of this application. The following detailed description should not be considered limiting, and the scope of the embodiments of this application is defined only by the claims of the published patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. Spatially related terms, such as “upper,” “lower,” “left,” “right,” “below,” “below,” “lower part,” “above,” “upper part,” etc., may be used herein to illustrate the relationship between one element or feature shown in the figures and another element or feature.
[0049] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," "fixing," and "holding" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0050] Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms “comprising,” “including,” indicate the presence of the stated feature, operation, element, component, item, kind, and / or group, but do not preclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms “or” and “and / or” as used herein are interpreted as inclusive, or mean any one or any combination thereof. Thus, “A, B, or C” or “A, B, and / or C” means “any one of: A; B; C; A and B; A and C; B and C; A, B, and C.” Exceptions to this definition arise only when combinations of elements, functions, or operations are inherently mutually exclusive in some manner.
[0051] To address the problems mentioned above in the background art, the present invention provides a smooth image sampling registration method, apparatus, terminal, and medium based on sampling frequency maps. The aim is to achieve smooth registration field estimation by limiting the sampling frequency of points during deformation, avoiding the occurrence of irregular deformation of sampling holes, and improving the preservation of detail information.
[0052] Meanwhile, to make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the invention.
[0053] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:
[0054] <1> Image registration is the process of matching and overlaying two or more images acquired at different times, using different sensors (imaging devices), or under different conditions (such as climate, illumination, camera position, and angle). Image registration technology can be applied to fields such as remote sensing data analysis, computer vision, and image processing.
[0055] <2> Rigid registration refers to the floating image only being able to translate left and right (X-axis), forward and backward (Y-axis), and up and down (Z-axis), as well as rotate around the three coordinate axes, with a total of 6 degrees of freedom.
[0056] <3> Affine registration: Building upon similarity registration, it allows for variations in the angles between the three coordinate axes; that is, the angles between the X, Y, and Z axes can be non-right angles and can vary. This results in a total of 12 degrees of freedom.
[0057] This invention provides a method for smooth image sampling registration based on a sampling frequency map, a system for the method, and a storage medium storing an executable program for implementing the method. Regarding the implementation of the method, this invention will describe exemplary implementation scenarios.
[0058] like Figure 1 The diagram illustrates a flowchart of a smooth image sampling registration method based on a sampling frequency map, as shown in an embodiment of the present invention. To facilitate understanding by those skilled in the art, the embodiments of the present invention also incorporate... Figure 2 The implementation process of the smooth image sampling registration method based on the sampling frequency map is explained.
[0059] Specifically, the smooth image sampling registration method based on sampling frequency maps in this embodiment mainly includes the following steps:
[0060] Step S1: Obtain the image dataset; the image dataset includes source images and target images.
[0061] In this embodiment of the invention, the method further includes performing preliminary registration preprocessing on the acquired image dataset. Specifically, the preliminary registration preprocessing includes using affine registration or rigid registration to initially register the source image and target image in the image dataset into the target image space.
[0062] It should be understood that rigid body registration refers to the floating image only performing translations along the left-right (X-axis), front-back (Y-axis), and up-down (Z-axis), as well as rotations around the three coordinate axes, resulting in six degrees of freedom. Affine registration, on the other hand, allows for variations in the angles between the three coordinate axes, meaning the angles between the X, Y, and Z axes can be non-right angles and variable. This gives a total of 12 degrees of freedom. Similarity registration, in addition to rigid body registration, adds scaling variations along the three coordinate axes, resulting in nine degrees of freedom.
[0063] Step S2: Input the image dataset into the pre-built registration model to calculate the registration field based on back mapping.
[0064] Furthermore, the registration field based on back-mapping output by the registration model is defined in the target image space, where the values in the registration field represent the coordinates of the grid positions in the target image space to the sampling points in the source image space. For ease of understanding, combined with... Figure 3AThe spatial transformation process is illustrated in the diagram: The registration field should be defined in the target image space, that is, the value φ(p)10 in the registration field represents the coordinates of the sampling point from the grid position point p11 in the target image space to the sampling point in the source image space.
[0065] In some examples, the registration model can be a traditional iterative optimization-based algorithm or a learning-based deep learning model. Exemplarily, the iterative optimization-based algorithm includes, but is not limited to, gradient descent algorithms (such as batch gradient descent, stochastic gradient descent, or mini-batch gradient descent), coordinate descent algorithms, Newton's iteration algorithm, stepwise regression algorithm, least angle regression algorithm, Lagrange multiplication algorithm, etc. The deep learning model includes, but is not limited to, Convolutional Neural Networks (CNNs), but also includes, but is not limited to, the following models: including, but not limited to, Perceptron models, Multilayer Perceptron models (MLPs), Recurrent Neural Networks (RNNs), Long Short-Term Memory (LSTM) networks, Autoencoders, Generative Adversarial Networks (GANs), Deep Belief Networks (DBNs), Variational Autoencoders (VAEs), etc.
[0066] To facilitate a better understanding of the structure and registration process of the registration model by those skilled in the art, the following is combined with Figure 4Explanation: In the UNet architecture based on convolutional neural networks, each rectangle represents the 3D data generated by the previous layer, computed using 3D convolutional kernels. The spatial resolution of each 3D data point relative to the input is shown below the rectangle, and the numbers within the rectangles represent the number of channels in the feature map. The boxes arranged from largest to smallest on the left side of the diagram constitute the encoder, and the boxes arranged from smallest to largest on the right side constitute the decoder. The decoder contains several filters composed of 3D convolutional kernels, each followed by an upsampling layer to restore the 3D data to full resolution. The arrows in the diagram indicate skip connections between the encoder and decoder. The final part of the network architecture uses several convolutional operations to further refine the full-resolution 3D data. In short, the registration model utilizes a convolutional neural network to construct a UNet-type registration network. The network's input parameters are the source image S and the target image T, and the network's output is the registration field φ. The value φ(p) in the registration field φ represents the coordinates of the sampling point p in the target image space when sampling from the source image space.
[0067] Step S3: Based on the registration field, register the source image to the target image space to obtain a pre-registered image.
[0068] Specifically, the process of registering the source image to the target image space based on the registration field to obtain a preliminarily registered image includes the following steps: constructing a spatial transformation based on the registration field; and using the spatial transformation to register the source image to the target image space.
[0069] Furthermore, the spatial transformation process includes, as follows: Figure 5 The steps shown are as follows:
[0070] Step S31: Obtain the coordinates of the sampling points falling within the source image space based on the registration field, and determine the corresponding sampling values based on the sampling point coordinates.
[0071] In some examples, the method of determining the corresponding sampled value based on the coordinates of the sampling point includes the following: if the coordinates of the sampling point fall on a grid position point in the source image space, then the sampled value is the value of the grid position point in the source image space; if the coordinates of the sampling point fall on a non-grid position point in the source image space, then an interpolation operation is performed based on several grid position points around the non-grid position point in the source image space, and the result of the interpolation operation is used as the sampled value.
[0072] Specifically, with Figure 3AFor example, the spatial transformation process involves sampling point p11 in the target image space. First, based on the registration field φ4, the coordinates of the sampling point φ(p)10 are obtained. These coordinates fall within the source image space. If they fall at grid point q9, the sampled value is the value at grid q9 in the source image space. If they fall outside the grid, interpolation is performed based on the values of the grid points surrounding φ(p)10 in the source image space. The result of the interpolation is the sampled value. Finally, the sampled value is filled back into p11 in the target image space. After all the point sampling operations in the target image space are completed, the preliminarily registered image can be formed.
[0073] Step S32: Fill the sampled values back into the corresponding positions in the target image space, and construct the image after filling in the sampled values of all sampled points.
[0074] Step S4: Optimize the registration field and the image after preliminary registration using the loss function.
[0075] In some examples, a regularized loss function is used to optimize the registration field; the regularized loss function is based on the square of the magnitude of the difference between the numerical values of adjacent positions in the sample offset displacement field at the time of sampling to minimize the spatial gradient of the displacement field.
[0076] The regularized loss function L of the registration field smooth This operation targets the sampling offset displacement field u during sampling; the displacement field can be obtained from the registration field, and the specific calculation formula is as follows:
[0077] u = φ - Id; Formula (1)
[0078] Where φ represents the registration field, and Id represents the coordinate grid of the identity transformation, that is, the grid position point in the target image space.
[0079] L smooth Minimizing the spatial gradient of the displacement field by using the square of the magnitude of the difference between adjacent positions in the displacement field u can be formulated as follows:
[0080]
[0081] Where Ω represents the target image space, and |Ω| represents the total number of grid positions within the target image space. This represents the difference between the sampled offset displacement values of grid position point p11 and its adjacent grid position points within the target image space; the sampled offset displacement refers to the value of a point p in the sampled offset displacement field.
[0082] In some examples, the similarity loss function of image pairs is characterized by measuring the differences between them, which is used to optimize the images after initial registration.
[0083] Image pair similarity loss function L sim This is achieved by measuring the differences between image pairs, and can be formulated as follows:
[0084]
[0085] Here, NCC represents the normalized cross-correlation loss function, used to measure the image after initial registration. Similarity between the target image T2 and the target image T2.
[0086] Step S5: Obtain a preliminary sampling frequency map based on the registration field using a pre-built sampling frequency estimator.
[0087] In this embodiment of the invention, the process of obtaining a preliminary sampling frequency map based on the registration field through a pre-constructed sampling frequency estimator is as follows: Figure 6A As shown, it includes the following steps:
[0088] Step S51: Determine the sampling frequency based on the number of times the grid location points in the source image are sampled; the sampling frequency value is determined by the sum of the interpolation weights of an uncertain number of sampling points around it.
[0089] Specifically, the theoretical construction of the preliminary sampling frequency map includes: the number of times a point in the source image located at a grid position is sampled, and this sampling frequency value is determined by the sum of the interpolation weights of an uncertain number of sampling points around it; the formula for calculating the sampling frequency in the sampling frequency map is as follows:
[0090]
[0091] Where SFM is the sampling frequency map; SFM(q) is the sampling frequency of the sampling frequency map at the grid position point in the source image; Z(q) is the set of neighboring sampling points at a distance of no more than 1 around the grid position point; the elements of this set are sampling points φ(p); when the element φ(p) of this set coincides with the position of q, it is a grid position point, and when the distance from q is greater than 0, it is a non-grid position point; φ represents the registration field defined in the target image space; d are the three spatial dimensions of the registered image. When the image is 2D, the set of spatial dimensions is {x,y}; when the image is 3D, the set of spatial dimensions is {x,y,z}. It is the interpolation weight contributed by the grid position point q to the sampling point φ(p) when the sampling point φ(p) is interpolated.
[0092] Step S52: Perform vectorization construction of the initial sampling frequency map.
[0093] Specifically, the vectorization of the initial sampling frequency map is the vectorization implementation of the sampling frequency estimator, and the specific implementation process includes the following:
[0094] First, based on the sampling offset displacement specified by the registration field, the coordinates of the grid position points in the target image space are added to the sampling offset displacement to obtain the coordinates of the sampling point; wherein, the sampling offset displacement refers to the numerical value of the point in the sampling offset displacement field.
[0095] Secondly, if the coordinates of the sampling point fall within a grid location point in the source image space, then The sampling frequency is entirely distributed to SFM(q); if the coordinates of the sampling point fall within a non-grid location in the source image space, then The sampling frequency is distributed to SFM(q), and the remaining sampling frequency is distributed to the grid points around the non-grid point according to the interpolation weight.
[0096] Furthermore, if it is 3D image registration, the number of grid points around the non-grid location point is 8; if it is 2D image registration, the number of grid points around the non-grid location point is 4.
[0097] Combination Figure 2 and Figure 3B The following explanation is provided: Sampling frequency Figure 8 The vectorization construction, i.e., the vectorization implementation of the sampling frequency estimator 6, is based on the sampling offset displacement specified by the registration field φ4. The coordinates of the grid position point p13 in the target image space are added to the sampling offset displacement to obtain the sampling / projection point coordinates φ(p)14. These sampling / projection coordinates φ(p)14 will fall within the source image space. If they fall at grid position q15, then... The sampling frequency will be entirely distributed to SFM(q). If φ(p)14 does not coincide with q15, then The sampling frequency will be distributed to SFM(q). At this time, the sampling frequency that is 1 from φ(p)14 will continue to distribute the remaining sampling frequency to the grid position points q' around φ(p)14 according to the interpolation weight. If it is 3D image registration, the number of surrounding grid position points q' is 8. If it is 2D image registration, the number of surrounding grid position points q' is 4. The operation of distributing the sampling frequency of a sampling / projection point φ(p)14 to a fixed number of surrounding grid position points can be vectorized to all sampling / projection points. Finally, after all scattering operations are completed, the accumulated sampling frequency will constitute the sampling frequency map SFM8 of the source image.
[0098] It should be noted that the vectorization operation in this embodiment of the invention is explained as follows: According to the theoretical construction, the sampling frequency of a grid point in the source image should be equal to the combined effect of an uncountable number of surrounding sampling / projection points; however, due to the uncountable nature of the surrounding sampling / projection points, vectorization is not possible. In view of this, this embodiment of the invention proposes a vectorization construction method, which involves starting from a grid point in the target image space and distributing that grid point to multiple points in the source image. This distribution operation is 1 to 4 or 1 to 8 (determined by whether the image type is 2D or 3D; 1 to 4 for 2D images, 1 to 8 for 3D images). Since the projection and scattering of a point are fixed, all points in the target image space can undergo such a 1 to 4 or 1 to 8 distribution operation. Vectorization involves performing h*w*d such 1 to 4 or 1 to 8 distribution operations; h*w*d refers to the total number of grid points in the target image space.
[0099] The following text will further combine Figure 6B To explain vectorization: In the diagram, the top row represents the grid positions in the target image space, and the bottom row represents the grid positions in the source image space. Taking 2D as an example, assuming there are a total of 3*4=12 grid positions, the target image is defined as array T, and the source image is defined as array S.
[0100] The first column describes the sampling and interpolation process during image registration, which is a current registration technique. Specifically, one point in the target image space is sampled from four points in the source image space. This is a 4-to-1 data point conversion operation, and the same 4-to-1 operation can be performed on all 12 elements of array T. In short, this allows 12 GPUs to perform the same operation, reducing the operation time to 1 / 12 of the original (vectorized implementation). Only a vectorized implementation can enable efficient training in neural networks.
[0101] The second column is the theoretical construction of the sampling frequency (refer to formula (4) and related content above). Specifically, a point in the source image space is derived from the projection of "n uncountable" points in the target image. This is an operation from an uncountable n data points to a single data point. Therefore, the same n-to-1 operation cannot be performed on the 12 elements in array S, because the n around each point in S is uncountable. So, it can only be calculated one by one. Therefore, without vectorization, it is not possible to train efficiently in a neural network.
[0102] The third column represents the vectorized construction of the sampling frequency. Specifically, a point in the target image space affects four points in the source image during sampling (in 2D). This effect is a distribution operation from one data point to four data points. Therefore, the same 1-to-4 operation can be performed on the 12 elements of array T, because a point in the target image can first be projected into the source image space, and then the value with a probability of 1 is distributed to the surrounding four points according to the weights used in interpolation. In short, this allows 12 GPUs to perform the same operation, reducing the time to 1 / 12 of the original (vectorized implementation). Only a vectorized implementation can enable efficient training in neural networks.
[0103] Step S6: Optimize the initial sampling frequency map using a loss function.
[0104] In this embodiment of the invention, the optimization of the initial sampling frequency map using a loss function includes the following steps:
[0105] Step S61: Minimize the difference between the all-one matrix and the initial sampling frequency map using the mean square error loss function.
[0106] In some examples, the mean squared error loss function can be formulated as follows:
[0107] Loss sfm1 =MSE(SFM,1); Formula (5)
[0108] Where MSE represents the mean square error function, SFM represents the sampling frequency diagram, and 1 represents a one matrix.
[0109] Step S62: Minimize the spatial gradient of the sampling frequency map by using the square of the magnitude of the difference in sampling frequencies between adjacent positions.
[0110] Specifically, minimizing the spatial gradient of the sampling frequency map by using the square of the magnitude of the difference in sampling frequencies between adjacent positions can be formulated as follows:
[0111]
[0112] Where Ω represents the source image space, and |Ω| represents the total number of grid positions within the source image space. This represents the difference in sampling frequency between the source image spatial grid position q15 and its adjacent grid positions.
[0113] Step S7: Repeat all the above steps until the registration model converges.
[0114] In this embodiment of the invention, the convergence condition of the registration model includes: if the registration model is an algorithm model based on iterative optimization, then satisfying the iterative optimization condition is taken as the convergence condition of the model; if the registration model is a deep learning model based on learning, then the convergence condition is taken as the convergence of the loss function optimized by deep learning on the entire dataset.
[0115] Taking a learning-based deep learning model as an example, the objective loss function of a convolutional neural network is as follows:
[0116]
[0117] Among them, L smooth L is the regularized loss function; sim The similarity loss function; Let the mean squared error loss function be used. Let λ be the spatial gradient loss function; smooth and As weight.
[0118] The target loss function is minimized by performing backpropagation and gradient descent. This minimization process is based on optimization of the entire dataset. Ultimately, by optimizing the entire dataset, the neural network can be encouraged to achieve smooth registration field while learning image similarity. This results in smooth and accurate image sampling registration of the image, preserving anatomical morphology to the greatest extent.
[0119] Step S8: Obtain the final registration field, the final registered image, and the final sampling frequency map based on the converged registration model.
[0120] Specifically, the final registration field can be obtained from the converged registration model, and the final registered image and the final sampling frequency map can be obtained from the final registration field. For comparison, [the following is added] and This paper examines the impact of these two loss functions on the sampling frequency and the preservation of detail in the final registered image. By adding these two loss functions, smooth sampling of all regions of the source image and preservation of anatomical details in the final registered image can be achieved.
[0121] The foregoing has provided a detailed explanation of the implementation process of a smooth image sampling registration method based on a sampling frequency map in an embodiment of the present invention. The following will further describe the smooth image sampling registration device, terminal, and medium based on a sampling frequency map in conjunction with other specific embodiments.
[0122] like Figure 7The diagram illustrates a schematic representation of a smooth image sampling registration device 700 based on a sampling frequency map, according to an embodiment of the present invention. The smooth image sampling registration device 700 includes a dataset acquisition module 701, a registration model module 702, a spatial transformation module 703, a sampling frequency map estimation module 704, and a model convergence module 705.
[0123] The dataset acquisition module 701 is used to acquire an image dataset, which includes a source image and a target image. The registration model module 702 is used to input the image dataset into a pre-built registration model to calculate a registration field based on backward mapping. The spatial transformation module 703 is used to register the source image to the target image space based on the registration field to obtain a pre-registered image; and to optimize the registration field and the pre-registered image using a loss function. The sampling frequency map estimation module 704 is used to obtain a pre-registered sampling frequency map based on the registration field using a pre-built sampling frequency estimator; and to optimize the pre-registered sampling frequency map using a loss function. The model convergence module 705 is used to repeat all the above steps until the registration model converges; and to obtain the final registration field, the final registered image, and the final sampling frequency map based on the converged registration model.
[0124] It should be noted that the above-described embodiment of the smooth image sampling registration device based on sampling frequency maps is only illustrated by the division of the above-described program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. Furthermore, the above-described embodiment of the smooth image sampling registration device based on sampling frequency maps and the embodiment of the smooth image sampling registration method based on sampling frequency maps belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0125] The smooth image sampling registration method based on sampling frequency maps provided in this invention can be implemented on the terminal side or the server side. For the hardware structure of the terminal for smooth image sampling registration based on sampling frequency maps, please refer to [link to relevant documentation]. Figure 8This is a schematic diagram of an optional hardware structure of an electronic terminal 800 provided in an embodiment of the present invention. The terminal 800 can be a mobile phone, computer device, tablet device, personal digital processing device, factory back-end processing device, etc. The smooth image sampling registration terminal 800 based on a sampling frequency map includes: at least one processor 801, a memory 802, at least one network interface 804, and a user interface 806. The various components in the device are coupled together through a bus system 805. It is understood that the bus system 805 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 805 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 8 The general will label all buses as bus systems.
[0126] The user interface 806 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.
[0127] It is understood that memory 802 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable categories of memory.
[0128] In this embodiment of the invention, the memory 802 is used to store various types of data to support the operation of the smooth image sampling registration terminal 800 based on the sampling frequency map. Examples of this data include: any executable program for operation on the smooth image sampling registration terminal 800 based on the sampling frequency map, such as the operating system 8021 and application program 8022; the operating system 8021 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. The application program 8022 may contain various applications, such as media players, browsers, etc., for implementing various application services. The implementation of the smooth image sampling registration method based on the sampling frequency map provided in this embodiment of the invention can be included in the application program 8022.
[0129] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 801. Processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 801 or by instructions in software form. The processor 801 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 801 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 801 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.
[0130] In an exemplary embodiment, the smooth image sampling registration terminal 800 based on the sampling frequency map can be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to perform the aforementioned method.
[0131] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented using computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0132] In the embodiments provided in this application, the computer-readable and writable storage medium may include read-only memory, random access memory, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, flash memory, USB flash drive, portable hard drive, or any other medium capable of storing desired program code in the form of instructions or data structures and accessible by a computer. Additionally, any connection may be appropriately referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium. However, it should be understood that computer-readable and writable storage media and data storage media do not include connections, carrier waves, signals, or other transient media, but are intended for non-transient, tangible storage media. The disks and optical discs used in the application include compact discs (CDs), laser discs, optical discs, digital multifunction discs (DVDs), floppy disks, and Blu-ray discs, where disks typically copy data magnetically, while optical discs use lasers to copy data optically.
[0133] In summary, this application provides a method, apparatus, terminal, and medium for smooth image sampling registration based on sampling frequency maps. This application analyzes information loss during the registration process from the perspective of sampling frequency maps, revealing sampling holes originally hidden in the source image space. The theoretical construction of the sampling frequency map and the interpolation operation during sampling in spatial transformation have a consistent theoretical basis, ensuring that the sampling probability map is differentiable, which is a prerequisite for gradient descent optimization. Moreover, since the sampling frequency map can be considered independent of the registration model, as long as the model relies on a registration field based on backward mapping, the sampling frequency estimator of this invention can construct the sampling frequency map using interpolation weights. The sampling frequency loss function can promote the smooth distribution of sampling points by suppressing the occurrence of extreme sampling frequencies and suppressing drastic changes in sampling frequencies at adjacent grid positions, thereby helping to improve the regularity of the registration field and preserve the detailed information of the source image. Therefore, this application effectively overcomes the various shortcomings of the prior art and has high industrial applicability.
[0134] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A smooth image sampling registration method based on sampling frequency maps, characterized in that, include: Obtain the image dataset; The image dataset includes source images and target images; The image dataset is input into a pre-built registration model to calculate the registration field based on back mapping; Based on the registration field, the source image is registered to the target image space to obtain a pre-registered image; The registration field and the image after preliminary registration are optimized using the loss function, respectively. A preliminary sampling frequency map based on the registration field is obtained by using a pre-built sampling frequency estimator; The process includes: determining the sampling frequency based on the number of times points located at grid positions in the source image are sampled; the sampling frequency value is determined by the sum of interpolation weights of an uncertain number of surrounding sampling points; performing vectorization construction of the initial sampling frequency map; the sampling frequency in the sampling frequency map is calculated as follows: ;in, It is a sampling frequency diagram; It is the sampling frequency of the sampling frequency map at the grid position points in the source image; It appears at the grid location point. A set consisting of neighboring sampling points at a distance of no more than 1; the elements of this set are sampling points. The elements of this set and When the positions coincide, they are grid position points, and Points with a distance greater than 0 are considered non-grid locations. This represents the registration field defined in the target image space; These are the three spatial dimensions of the registered image. When the image is 2D, the set of spatial dimensions is... When the image is 3D, the set of spatial dimensions is: ; Sampling points Grid position points during interpolation operation Contributed to sampling points Interpolation weights; The initial sampling frequency map is optimized using a loss function; Repeat all the above steps until the registration model converges; The final registration field, the final registered image, and the final sampling frequency map are obtained based on the converged registration model.
2. The smooth image sampling registration method based on sampling frequency maps according to claim 1, characterized in that, The registration field based on backward mapping, output by the registration model, is defined in the target image space, where the values in the registration field represent the coordinates of the grid position points in the target image space to the sampling points in the source image space.
3. The smooth image sampling registration method based on sampling frequency maps according to claim 1, characterized in that, The step of registering the source image to the target image space based on the registration field to obtain a preliminarily registered image includes: constructing a spatial transformation based on the registration field; and using the spatial transformation to register the source image to the target image space.
4. The smooth image sampling registration method based on sampling frequency map according to claim 3, characterized in that, The spatial transformation process includes the following steps: obtaining the coordinates of the sampling points falling within the source image space based on the registration field, determining the corresponding sampling values based on the sampling point coordinates; backfilling the sampling values into the corresponding positions in the target image space, and constructing the image after completing the backfilling of the sampling values of all sampling points.
5. The smooth image sampling registration method based on sampling frequency map according to claim 1, characterized in that, The method includes: optimizing the registration field using a regularized loss function; the regularized loss function is based on the square of the magnitude of the difference between the numerical values of adjacent positions in the sampling offset displacement field at the time of sampling to obtain the spatial gradient of the displacement field that minimizes the displacement field.
6. The smooth image sampling registration method based on sampling frequency map according to claim 5, characterized in that, The regularization loss function of the registration field minimizes the spatial gradient of the displacement field by utilizing the magnitude of the difference between the sampled offset displacement values of adjacent grid positions in the sampled offset displacement field, as expressed below: ; in, Represents the target image space. Represents the total number of grid positions within the target image space. The difference between the sampling offset displacement of a grid point and its adjacent grid points within the target image space; the sampling offset displacement field. Represented as: ; Indicates the registration field. Represents the grid location points within the target spatial image.
7. The smooth image sampling registration method based on sampling frequency maps according to claim 1, characterized in that, The method includes: characterizing the similarity loss function of image pairs by measuring the differences between them, and optimizing the images after initial registration.
8. The smooth image sampling registration method based on sampling frequency maps according to claim 7, characterized in that, The similarity loss function is expressed as follows: ; in, This represents the normalized cross-correlation loss function, used to measure the image after initial registration. and target image The similarity between them.
9. The smooth image sampling registration method based on sampling frequency map according to claim 1, characterized in that, The vectorization construction of the preliminary sampling frequency map includes: Based on the sampling offset displacement specified by the registration field, the coordinates of the grid position points in the target image space are obtained by adding the sampling offset displacement to the coordinates of the sampling point; wherein, the sampling offset displacement refers to the numerical value of the point in the sampling offset displacement field; If the coordinates of the sampling point fall within a grid location point in the source image space, then The sampling frequency is all distributed to If the coordinates of the sampling point fall within a non-grid location in the source image space, then The sampling frequency is distributed to The remaining sampling frequencies are distributed to the grid points around the non-grid location point according to the interpolation weights; where, if it is 3D image registration, the number of grid points around the non-grid location point is 8, and a 1 to 8 distribution operation is performed; if it is 2D image registration, the number of grid points around the non-grid location point is 4, and a 1 to 4 distribution operation is performed.
10. The smooth image sampling registration method based on sampling frequency maps according to claim 1, characterized in that, The optimization of the initial sampling frequency map using the loss function includes the following steps: Minimize the difference between the all-one matrix and the initial sampling frequency map using the mean square error loss function; The spatial gradient of the sampling frequency map is minimized by using the square of the magnitude of the difference in sampling frequencies between adjacent locations.
11. The smooth image sampling registration method based on sampling frequency map according to claim 1, characterized in that, The convergence conditions of the registration model include: if the registration model is an algorithm model based on iterative optimization, then satisfying the conditions of iterative optimization is taken as the convergence condition of the model; if the registration model is a deep learning model based on learning, then the convergence condition is taken as the convergence of the loss function optimized by deep learning on the entire dataset.
12. The smooth image sampling registration method based on sampling frequency maps according to claim 11, characterized in that, The learning-based deep learning model includes a convolutional neural network, and the loss function of the convolutional neural network optimized over the entire dataset is expressed as follows: ; in, This is the regularization loss function; For similarity loss function; Let the mean squared error loss function be used. Let be the spatial gradient loss function; and As weight.
13. A smooth image sampling registration device based on a sampling frequency map, characterized in that, include: The dataset acquisition module is used to acquire image datasets; The image dataset includes source images and target images; The registration model module is used to input the image dataset into a pre-built registration model to calculate the registration field based on back mapping; The spatial transformation module is used to register the source image to the target image space based on the registration field to obtain a pre-registered image; And the images after initial registration, optimized using loss functions; The sampling frequency map estimation module is used to obtain a preliminary sampling frequency map based on the registration field through a pre-built sampling frequency estimator. Furthermore, the initial sampling frequency map is optimized using a loss function; The process includes: determining the sampling frequency based on the number of times points located at grid positions in the source image are sampled; the sampling frequency value is determined by the sum of interpolation weights of an uncertain number of surrounding sampling points; performing vectorization construction of the initial sampling frequency map; the sampling frequency in the sampling frequency map is calculated as follows: ;in, It is a sampling frequency diagram; It is the sampling frequency of the sampling frequency map at the grid position points in the source image; It appears at the grid location point. A set consisting of neighboring sampling points at a distance of no more than 1; the elements of this set are sampling points. The elements of this set and When the positions coincide, they are grid position points, and Points with a distance greater than 0 are considered non-grid locations. This represents the registration field defined in the target image space; These are the three spatial dimensions of the registered image. When the image is 2D, the set of spatial dimensions is... When the image is 3D, the set of spatial dimensions is: ; Sampling points Grid position points during interpolation operation Contributed to sampling points Interpolation weights; The model convergence module is used to repeat all the above steps until the registration model converges; based on the converged registration model, the final registration field, the final registered image, and the final sampling frequency map are obtained.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the smooth image sampling registration method based on the sampling frequency map as described in any one of claims 1 to 12.
15. An electronic terminal, characterized in that, include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory to cause the terminal to perform the smooth image sampling registration method based on the sampling frequency map as described in any one of claims 1 to 12.
