Brain MRI landmark detection method based on self-supervised learning and geometric constraints
By combining self-supervised learning and geometric constraints in brain MRI anatomical landmark detection, using template geometric information and deep learning models, we solve the problems of low anatomical landmark detection accuracy and large computational complexity in the existing technology, and achieve an efficient and easy-to-use method. Extended anatomical landmark detection.
Patent Information
- Application Number
- CN202410885573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Existing brain MRI anatomical landmark detection methods are difficult to effectively utilize geometric information, resulting in low detection accuracy and difficulty in rapid expansion. In addition, existing self-supervised learning methods require a large amount of calculation in three-dimensional image processing and are difficult to expand.
A method based on self-supervised learning and geometric constraints is used to optimize anatomical landmark detection through template geometric information. The deep learning model is combined with the spatial combination determination method and the local outlier factor algorithm to create distance and direction consistency constraints, and iteratively optimizes the positioning of anatomical landmark points. .
It improves the accuracy and efficiency of anatomical landmark detection, reduces the amount of calculation, facilitates expansion to diverse detection needs and other image data sets, and reduces the training cost of deep learning models.
Smart Images

Figure CN118447016B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a brain MRI landmark detection method based on self-supervised learning and geometric constraints. Background Art
[0002] Anatomical landmarks are used in medicine to accurately identify specific parts of the human body, with stability, universality and easy recognition as the criteria. Anatomical landmarks in brain MRI are widely used in image processing, surgical assistance, neuroscience research and disease diagnosis.
[0003] Existing methods for detecting anatomical landmarks in brain MRI (magnetic resonance imaging) are mainly based on supervised learning in deep learning, and most of the existing methods focus on a few specific anatomical landmarks, such as the anterior commissure and posterior commissure on the central sagittal plane of the brain, and fail to effectively utilize the geometric information between these landmarks to optimize the positioning and detection process. In addition, whenever faced with new anatomical landmark detection needs, experts need to re-label a large amount of training data to train supervised neural networks, a process that is both time-consuming and laborious. This makes it difficult for existing methods to expand quickly and adapt to the diverse detection needs that may arise in the future.
[0004] There are also some existing methods that use self-supervised learning to detect anatomical landmarks in two-dimensional medical images, such as computed tomography slices. However, this method requires too much computation and is limited by hardware constraints, making it difficult to extend to anatomical landmark detection in three-dimensional images. Summary of the invention
[0005] Based on the technical problems existing in the background technology, the present invention proposes a brain MRI landmark point detection method based on self-supervised learning and geometric constraints, which uses template geometric information to improve detection accuracy and achieve efficient and easily scalable anatomical landmark detection.
[0006] The present invention proposes a method for detecting anatomical landmarks of brain MRI based on self-supervised learning and geometric constraints, comprising the following steps:
[0007] Step 1: preprocessing the verification MRI image of the template anatomical landmark to be located and the template MRI image, and performing three-dimensional slicing on the preprocessed verification MRI image with the verification feature point as the center, and performing three-dimensional slicing on the preprocessed template MRI image with the template anatomical landmark as the center;
[0008] Step 2: input all the verification feature point blocks of the verification MRI image and all the template anatomical landmark point blocks of the template MRI image into the trained deep learning model to output a one-dimensional feature vector corresponding to each block;
[0009] Step 3: Take the coordinates of each template anatomical landmark as the center and the radius as Make a circle, obtain all the verification feature points in the circle, calculate the cosine similarity between the one-dimensional feature vector of the verification feature points in the circle and the one-dimensional feature vector of the template anatomical landmark points, and arrange them in descending order. The verification feature points constitute candidate points of the template anatomical landmark points, thereby constituting a candidate point set based on the candidate points of all template anatomical landmark points;
[0010] Step 4: Use the first column in the candidate point set as the first temporary set for locating anatomical landmarks, and replace the abnormal verification feature points in the first temporary set to obtain an updated first temporary set. At the same time, calculate the mutual information between the template MRI image and the verification MRI image. ;
[0011] Step 5: creating a distance consistency constraint according to the geometric information of the template anatomical landmark points and the updated first temporary set, synchronously transforming the template anatomical landmark points and the template MRI image to obtain the transformed template anatomical landmark points;
[0012] Step 6: Create a direction consistency constraint based on the transformed template anatomical landmark points and the geometric information of the updated first temporary set, and replace all verification feature points in the updated first temporary set that do not meet the direction consistency constraint to form a second temporary set;
[0013] Step 7: creating a distance consistency constraint according to the transformed template anatomical landmark points and the geometric information of the second temporary set, and synchronously transforming the transformed template anatomical landmark points and the template MRI image to obtain a transformed template MRI image;
[0014] Step 8: Calculate the mutual information between the transformed template MRI image and the verification MRI image ,like , return to step 5 and proceed to the next round of iteration. In the next round of iteration, Assigned to , assign the first temporary set of the next iteration to the second temporary set obtained in the current iteration; if , or the maximum number of iterations is reached, the iteration is terminated, and the second temporary set of the previous iteration is used as the final positioning anatomical landmark points for verifying the MRI image.
[0015] Furthermore, in step 1: performing three-dimensional slicing of the preprocessed verification MRI image with the verification feature point as the center, specifically:
[0016] Based on the spatial combination determination method, the verification feature points of the preprocessed verification MRI image are detected, and the detected verification feature points are augmented, and the augmented points are added as verification feature points to the verification feature point set;
[0017] Three-dimensional cutting is performed on the downsampled verification MRI image with the verification feature point in the verification feature point set as the center, and the size of the verification feature point cutting of the verification MRI image is equal to the template anatomical landmark point cutting of the template MRI image.
[0018] Furthermore, the spatial combination determination method is specifically as follows:
[0019] The preprocessed validation MRI images were Downsampling is performed to obtain voxel data, and all voxels except the edges in the voxel data are subjected to multiple spatial voxel combination methods to determine whether they are feature points, and voxels with basic geometric features are screened out as verification feature points based on the spatial voxel combination methods, wherein the spatial voxel combination methods include cross type, corner U type, and corner T type;
[0020] When the spatial voxel combination mode is a corner T-type, any voxel combination mode in the spatial voxel combination mode , and the opening direction is toward the upper right, the 27 voxels are divided into two groups according to a specific spatial distribution. and , express The first distribution method, express The first The 27 voxels are in the local neighborhood with a side length of 3 and one voxel as the center in the downsampled verification MRI image, for a total of 27 voxels; the voxel combination method The specific determination formula is as follows:
[0021]
[0022]
[0023] in, Represents the voxel combination method Determination result, express The first Individual elements, express Group Individual elements, express The corresponding voxel value, express The corresponding voxel value, represents the voxel mean of the data set to which the validation MRI image belongs, express The total number of voxels in the group, express The total number of voxels in the group, and Corresponding to the voxel combination method The voxel threshold, Is a judgment function, when the input condition Returns 1 if true, otherwise returns 0.
[0024] Furthermore, in step 4, the generation process of the updated first temporary set is as follows:
[0025] The first column in the candidate set is used as a temporary set of anatomical landmarks for final positioning. , for temporary set The temporary positioning points of each anatomical landmark in the image are used to determine abnormal points based on the candidate point set and the local outlier factor algorithm;
[0026] The local outlier factor algorithm is as follows: the number of local neighbors of each temporary positioning point is less than the set number of neighbors , it is considered as an abnormal point, and the candidate point with the second highest similarity to the anatomical landmark point in the candidate point set where the temporary positioning point is located is used to replace it, replacing all abnormal points in the temporary set to form the updated first temporary set.
[0027] Furthermore, in step 5, the distance consistency constraint is as follows:
[0028] Calculate the distance matrix between each template anatomical landmark point , and the distance matrix between each temporary point in the first temporary set after update ;
[0029] Calculate the distance matrix With the distance matrix The ratio between them gives the scaling matrix , the scaling matrix Remove all elements on the diagonal Calculate the z-score for all The elements with z-score values less than 2 are calculated to get the scaling factor ;
[0030] Based on the scaling factor Synchronously scaling the template anatomical landmarks and the template MRI image to obtain the scaled template MRI image and the scaled template anatomical landmarks;
[0031] Using quaternion method to perform registration parameter fitting on the scaled template anatomical landmark points and the updated first temporary set to obtain a rotation matrix and a translation vector;
[0032] The scaled template MRI image and the scaled template anatomical landmark points are synchronously rotated and translated using a rotation matrix and a translation vector to obtain transformed template anatomical landmark points.
[0033] Furthermore, in step six, the directional consistency constraint is as follows:
[0034] Calculate each transformed template anatomical landmark point and candidate point set The distance between each verification feature point in the distance matrix , and the distance matrix The distances in are arranged in descending order;
[0035] The candidate point set The verification feature points in are re-sorted according to the distance in descending order to obtain the updated candidate point set , the updated candidate point set The first column is used as the first temporary set after the update ;
[0036] Calculate the direction vector between each transformed template anatomical landmark point to form a direction vector matrix , and calculate the updated first temporary set The direction vectors between the temporary points in to form a direction vector matrix ;
[0037] Calculate the direction vector matrix With the direction vector matrix The angle matrix of the corresponding position direction vector, adding all the elements of each row of the angle matrix to get the direction consistency error;
[0038] If the first If the z-score value of an element exceeds 2, the first temporary set after the update is determined Middle Verification feature points do not satisfy the direction consistency constraint;
[0039] Replace the verification feature points that do not meet the directional consistency constraint with the candidate points with the smallest geometric distance directional weighted consistency error, thereby replacing all updated first temporary sets The verification feature points that do not satisfy the direction consistency constraint constitute the second temporary set.
[0040] Furthermore, in step 2, the training process of the deep learning model is as follows:
[0041] Collect a training dataset of training MRI images And preprocess to obtain the preprocessed training data set List of feature points ;
[0042] For the training data set Each training MRI image is augmented to obtain an augmented dataset And the list of augmented feature points ;
[0043] For the training data set And the augmented dataset The feature point blocks of all training MRI images are obtained, and the three-dimensional coordinates of the feature points corresponding to each block are obtained. The feature point blocks and the corresponding three-dimensional coordinates are used as the self-supervised training data set of the deep learning model;
[0044] In each training round, the self-supervised training dataset The training samples are randomly sorted and the batch size of the model parameter update is set to , the entire self-supervised training dataset is divided into Training data , , Indicates the data index, Represents the number of feature point blocks in the self-supervised training dataset;
[0045] Deep learning model training uses a contrastive learning method that uses momentum to update sample dictionaries to maintain a sample dictionary queue and a sample coordinate queue of the same length as the sample dictionary queue. After each parameter update, the current batch of training data Any augmented block in the feature point block is updated with the sample dictionary queue in the first-in-first-out principle, and the coordinates of the current batch of training data are updated synchronously with the sample coordinate queue. The augmented block is the feature point block composed of the augmented data set. The resulting cut pieces;
[0046] Deep learning model training uses noise contrast estimation loss to train the training data Any sample in , anchor point , positive example , all samples in the sample dictionary queue are regarded as negative examples , is the training data set A training MRI image Feature points of cut pieces, To expand the dataset Training MRI images The augmented image Feature points after image augmentation transformation of cut pieces, Representing feature points No. An augmented cut;
[0047] The following loss function is performed Calculate and adjust the model parameters of the deep learning model based on the back propagation of the loss function:
[0048]
[0049] in, is the length of the sample dictionary queue, Express and Perform inner product operation, Express and Perform inner product operation, is the temperature hyperparameter, For feature points The number of augmented blocks corresponds to the number of positive examples. Indicates The suppression weight of negative examples, For the The loss weight of a positive example, Indicates A positive example, Indicates negative examples, and .
[0050] The advantages of the brain MRI landmark point detection method based on self-supervised learning and geometric constraints provided by the present invention are: the brain MRI landmark point detection method based on self-supervised learning and geometric constraints provided in the structure of the present invention uses a self-supervised learning mechanism to train a deep learning model, and only a small number of template images need to be manually labeled, which effectively reduces the training cost of the deep learning model; the geometric constraints are created using template geometric information, which further improves the detection accuracy of anatomical landmarks; and image blocks are used as input for training deep learning models, which greatly reduces the amount of calculation compared to existing methods under limited hardware conditions. In summary, this method can be easily extended to any number of anatomical landmark point detections, can be easily migrated to other image data set feature point detection tasks, and can effectively assist in actual anatomical landmark labeling work. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of the process of the present invention;
[0052] Figure 2 A schematic diagram of the spatial voxel combination form and its numbering of the spatial combination determination method;
[0053] Figure 3 This is a diagram of the training process of the deep learning model;
[0054] Figure 4 Flowchart for iteratively determining the final detected anatomical landmarks through geometric consistency constraints and image transformation. DETAILED DESCRIPTION
[0055] Below, the technical solution of the present invention is described in detail through specific embodiments. Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific implementation disclosed below.
[0056] like Figures 1 to 4 As shown, the brain MRI landmark detection method based on self-supervised learning and geometric constraints proposed in the present invention comprises the following steps:
[0057] Step 1: preprocessing the verification MRI image of the template anatomical landmark to be located and the template MRI image, and performing three-dimensional slicing on the preprocessed verification MRI image with the verification feature point as the center, and performing three-dimensional slicing on the preprocessed template MRI image with the template anatomical landmark as the center;
[0058] The preprocessing steps include standardizing voxel intensity, unifying the direction of the image anatomical coordinate system, adjusting the image size, and translating the image centroid to the image center. The preprocessing process of the verification MRI image and the template MRI image is consistent. The following is a specific description of the verification MRI image:
[0059] Standardized voxel intensity is to first standardize the deviation of all voxel intensities of the validation MRI image, and then multiply all voxel values by 255 to obtain a standardized voxel image with a voxel value range of 0-255;
[0060] The unified image anatomical coordinate system uses the ToCanonical function of the python third-party library torchio to reorder the voxel data of the verification MRI image in the dimension to make it closest to the canonical (RAS+) direction, where R represents the positive direction of the x-axis, the x-axis points from left to right, A represents the positive direction of the y-axis, the y-axis points from posterior to anterior, and S represents the positive direction of the z-axis, the z-axis points from inferior to superior.
[0061] Adjust the image size. First, verify that the spatial resolution of the MRI image voxel data is: . Then trim and fill it to the specified size: .
[0062] The image centroid is translated to the center of the image. First, the coordinate mean of all voxels whose voxel values in the MRI image data are greater than 0 is calculated as the image centroid; secondly, the centroid is calculated to the image center, and the coordinates are , the offset ( ); finally, the verification MRI image data is translated according to the offset.
[0063] The above preprocessing methods are all commonly used algorithms, the purpose of which is to ensure consistency between images and provide accurate input for subsequent feature extraction and positioning. No further explanation will be given here, and the parameters used can be changed according to actual conditions.
[0064] As a preferred solution, the preprocessed verification MRI image is three-dimensionally sliced with the verification feature point as the center, specifically:
[0065] (a1) Detecting verification feature points of the preprocessed verification MRI image based on a spatial combination determination method, augmenting the detected verification feature points, and adding the augmented points as verification feature points to the verification feature point set;
[0066] Detect the verification feature points of the preprocessed verification MRI image. The number of verification feature points of a verification MRI image ranges from 30,000 to 40,000. The detection method is the spatial combination determination method. The spatial combination form is as follows: Figure 2 As shown, the verified feature points after detection are expanded. For each verified feature point, take it as the center and the radius Random sampling within the range points and add them to the feature point set. The value should be determined according to actual needs and the positioning accuracy of anatomical landmarks; for example, with each verification feature point as the center and a radius of Voxel units ( ) range, random sampling The number of verification feature points of the final verification MRI image is 210,000 on average.
[0067] The spatial combination determination method is as follows:
[0068] (a1-1) Perform the preprocessed verification MRI image Downsample by multiple times to obtain voxel data, and use multiple spatial voxel combination methods to determine whether all voxels in the voxel data except the edge are feature points, and screen out voxels with basic geometric features as verification feature points based on the spatial voxel combination method;
[0069] Specifically, the preprocessed verification MRI images are Downsample by times, and the size is: The voxel data is then removed from the edges. All candidate voxels of units, dimension is , a variety of spatial voxel combinations are used to determine whether they are feature points. The spatial voxel combination method selects voxels with basic geometric features as verification feature points.
[0070] For each voxel, on the downsampled verification MRI image, there are 26 voxels in a local neighborhood with a side length of 3 and a total of 27 voxels in the local neighborhood with a side length of 3, and multiple spatial voxel combination modes are determined.
[0071] In order to facilitate the description of the spatial voxel combination method, the 27 voxels are numbered according to the spatial position. The anatomical coordinate system direction is not distinguished. The front of the cube is the side facing the observer. For any voxel with a side length of 3, the volume of the cube is 27, and the voxel numbers inside it increase from front to back, from left to right, and from top to bottom. Specifically:
[0072] At the top level, the voxels are numbered from back to front and from left to right:
[0073]
[0074] In the middle layer, the voxels are numbered from back to front and from left to right:
[0075]
[0076] At the bottom layer, the voxels are numbered from back to front and from left to right:
[0077]
[0078] like Figure 2 As shown, the various spatial voxel combination methods of this embodiment include cross, corner U, and corner T. The spatial voxel combination method can be designed in a similar manner according to the characteristics of the detected image.
[0079] The cross-shaped spatial voxel combination method does not distinguish between directions and divides the 27 voxels into Two groups, including Group( Figure 2 The voxel numbers are: , the remaining 16 numbers are Group voxels.
[0080] The corner U-shaped space voxel combination mode distinguishes six opening directions: upward, downward, left, right, forward, and backward. The forward opening direction mode divides the 27 voxels into Two groups, including Group voxel ( Figure 2 The voxels marked in black in the figure are numbered as follows: , the remaining 21 numbered voxels are Group( Figure 2 The same goes for the other opening directions.
[0081] The corner T-shaped space voxel combination mode distinguishes eight opening directions: upper right, lower left, lower right, upper left, lower back, upper front, lower front, and upper back. The opening direction is upper right, and the 27 voxels are divided into Two groups, including Group voxel ( Figure 2 The voxels marked in black in the figure are numbered as follows: , the remaining 15 numbered voxels are The same applies to the other opening directions.
[0082] For any voxel combination , the 27 voxels are divided into two groups according to their spatial distribution and , express The first distribution method, express The first Distribution method, voxel combination method The specific determination formula is as follows:
[0083]
[0084]
[0085] in, Represents the voxel combination method Determination result, express The first Individual elements, express Group Individual elements, express The corresponding voxel value, express The corresponding voxel value, represents the voxel mean of the data set to which the validation MRI image belongs, express The total number of voxels in the group, express The total number of voxels in the group, and Corresponding to the voxel combination method The voxel threshold, Is a judgment function, when the input condition It returns 1 when true, otherwise it returns 0. For different data sets, different detection space voxel combinations and threshold and other parameters are determined according to the real anatomical landmark annotations before verifying the feature point detection.
[0086] This formula divides the 27 voxels into two groups based on a specific combination of spatial voxels, and then compares the value differences of these voxels to determine whether the conditions are met according to the set threshold, and then outputs the judgment result.
[0087] The formula can be extended to:
[0088]
[0089]
[0090]
[0091] in, Corresponding to the voxel combination method middle The judgment result of the group, Corresponding to the voxel combination method middle The judgment result of the group, and for The voxel threshold set when determining the group, and for The voxel threshold set when determining the group.
[0092] The spatial combination detection criterion described by the above formula is: In the group Voxels, for each voxel its value is greater than Group Any The value of the voxel, and the difference in voxel value needs to be greater than ;or, In the group Voxels, for each voxel its value is greater than Group Any The value of the voxel, and the difference in voxel value needs to be greater than ; If either of the two conditions is met, the voxel is determined as a verification feature point.
[0093] When experimenting on the public dataset HCP ;
[0094] For the cross-shaped space voxel combination method, set , , cross type Not proceeding determination;
[0095] U-shaped corner ( ) Space voxel combination method, setting , , , the set of detected verification feature points is In order to reduce the number of verification feature points, the detection and verification feature points are required to be more general. , , , the set of detected verification feature points is , the final verification feature point set detected by the U-shaped space voxel combination method is ;
[0096] For the corner-T space voxel combination method, set , , , the set of detected verification feature points is In order to reduce the number of feature points, the detection and verification feature points are required to be more general. , , , the set of detected verification feature points is , the final verification feature point set detected by T-shaped space voxel combination method is .
[0097] Combination of U-shaped or T-shaped space voxels for various opening directions , the calculation formula is as follows:
[0098]
[0099] in, Represents spatial combination The calculation formula for each opening orientation type is as follows: calculate.
[0100] The calculation formula for determining multiple spatial voxel combinations is as follows:
[0101]
[0102] in, represents the number of all possible combinations, Indicates Space voxel combination The result of the judgment. When it is True, the candidate voxel is determined to be a verification feature point of the verification MRI image, and all voxels that pass the above determination constitute the verification feature point set detected by the final spatial combination detection method.
[0103] (a1-2) Perform three-dimensional slicing on the downsampled verification MRI image with the verification feature point in the verification feature point set as the center. The size of the verification feature point slicing of the verification MRI image is equal to the template anatomical landmark slicing of the template MRI image. In this embodiment, the slicing is selected to have a side length of of cube.
[0104] Step 2: input all the verification feature point blocks of the verification MRI image and all the template anatomical landmark point blocks of the template MRI image into the trained deep learning model to output a one-dimensional feature vector corresponding to each block;
[0105] The deep learning model consists of a convolution Conv3dblock module, multiple Resnet Basic3d blocks, an average pooling avgpool3d layer, and a fully connected Linear layer. The trained deep learning model inputs a three-dimensional block and outputs its one-dimensional feature vector for subsequent similarity comparison and anatomical landmark location.
[0106] like Figure 3 As shown in Figure 1, the training process of the deep learning model is as follows:
[0107] (b1) Collect training dataset of training MRI images And preprocess to obtain the preprocessed training data set List of feature points ;
[0108] Collect a training dataset of training MRI images , perform preprocessing according to the operations recorded in step 1, such as standardizing voxel intensity, unifying the image anatomical coordinate system direction, adjusting the image size, and translating the image centroid to the image center, and then perform feature point detection on the preprocessed training MRI image according to the record in step 1 (a1). The preprocessed training data set List of feature points .
[0109] (b2) For the training data set Each training MRI image is augmented to obtain an augmented dataset And the list of augmented feature points ;
[0110] For the training data set Each training MRI image in is augmented by 1-4 methods, including random rotation, random scaling, random elastic deformation, and random masking, to obtain 1-4 The augmented dataset , , and the corresponding augmented feature point list that changes synchronously with the image augmentation ; Among them, random rotation is to rotate the training MRI image around the three axis centers by random angles, and the range of rotation angle is Random scaling is to randomly scale the center of the training MRI image. The range of the scaling factor is ; Degree; the range of the number of control points used for random elastic deformation: , the maximum translation distance range is: Voxel unit; random mask is to randomly create 400 mask blocks in the training MRI image voxel space, and the side length range of the mask block is: Voxel unit.
[0111] (b3) For the training data set And the augmented dataset The feature point blocks of all training MRI images are obtained, and the three-dimensional coordinates of the feature points corresponding to each block are obtained. The feature point blocks and the corresponding three-dimensional coordinates are used as the self-supervised training data set of the deep learning model;
[0112] The feature point blocks and the three-dimensional coordinates of the feature points corresponding to the blocks can be obtained based on the solution recorded in step (a1-2). A training sample in the self-supervised training data set includes ,in, The maximum value of is 4 (because this embodiment performs 4 transformations, The maximum value of is 4, and so on. If e transformations are performed, then The maximum value is ), is the training data set A training MRI image Feature points The same goes for the cut pieces. To expand the dataset Medium Image The augmented image Feature points after image augmentation transformation of which , Representing feature points No. An augmented cut block.
[0113] (b4) In each training round, The training samples are randomly sorted and the batch size of the model parameter update is set to , the entire self-supervised training dataset is divided into Training data , , Indicates the data index, Represents the number of feature point blocks in the self-supervised training dataset;
[0114] (b5) Deep learning model training uses a contrastive learning method that uses momentum to update the sample dictionary to maintain a sample dictionary queue and a sample coordinate queue of the same length as the sample dictionary queue. After each parameter update, the current batch of training data Any augmented slice in , the sample dictionary queue is updated according to the first-in-first-out principle, the coordinates of the current batch of training data are updated synchronously with the sample coordinate queue, and the augmented block is the feature point block composed of the augmented data set The resulting cut pieces;
[0115] (b6) Deep learning model training uses noise contrast estimation loss for training data Any sample in , anchor point , positive example , all samples in the sample dictionary queue are regarded as negative examples ; Perform the following loss function Calculate and adjust the model parameters of the deep learning model based on the back propagation of the loss function:
[0116]
[0117] in, is the length of the sample dictionary queue, Express and Perform inner product operation, Express and Perform inner product operation, preferably in this embodiment , is the temperature hyperparameter, and in this embodiment, , For feature points The number of augmented blocks corresponds to the number of positive examples. For the The loss weight of positive examples, and .
[0118] In order to prevent the false negative cases in the sample dictionary queue in the loss function calculation from adversely affecting the loss convergence, the training data used for a parameter update , for any anchor point, take its coordinates as the center and the radius is The range of is the possible range of false negative samples of the anchor point. When calculating the loss, all the samples at the anchor point are The inner product of all negative examples in the range and the anchor point is multiplied by the suppression weight, the formula is as follows
[0119]
[0120] in, Indicates The suppression weight of negative examples, Indicates The coordinates corresponding to the negative examples in the sample coordinate queue, represents the two-norm; in this embodiment, it is preferably set Voxel units. Accordingly, the loss calculation formula for any sample is updated as follows:
[0121]
[0122] Step 3: Take the coordinates of each template anatomical landmark as the center and the radius as Make a circle, obtain all the verification feature points in the circle, calculate the cosine similarity between the one-dimensional feature vector of the verification feature points in the circle and the one-dimensional feature vector of the template anatomical landmark points, and arrange them in descending order. The verification feature points constitute candidate points of the template anatomical landmark points, thereby constituting a candidate point set based on the candidate points of all template anatomical landmark points;
[0123] in, The choice of should be determined according to the distribution of the template anatomical landmarks and the image resolution. In this embodiment, the OASIS dataset is used to set Voxel units, set on dataset HCP Voxel units,
[0124] The value should be determined according to actual needs and the positioning accuracy of anatomical landmarks. All template anatomical landmarks (number of ) constitutes a candidate point set In this embodiment , detected The template anatomical landmarks are from the public annotations of the HCP and OASIS datasets by the AFID annotation protocol. .
[0125] like Figure 4 As shown, the final positioning anatomical landmark points of the verification MRI image are selected from the candidate point set through the geometric consistency constraints of the template anatomical landmarks and the template MRI image transformation, which specifically includes steps four to eight.
[0126] Step 4: Use the first column in the candidate point set as the first temporary set for locating anatomical landmarks, and replace the abnormal verification feature points in the first temporary set to obtain an updated first temporary set. At the same time, calculate the mutual information between the template MRI image and the verification MRI image. ;
[0127] (c1) taking the first column in the candidate point set as the first temporary set for locating anatomical landmark points;
[0128] The first column in the candidate set is used as the first temporary set of anatomical landmarks for final positioning. .
[0129] (c2); Use the first column in the candidate set as a temporary set for the final positioning of anatomical landmarks , for temporary set The temporary positioning points of each anatomical landmark in the image are used to determine abnormal points based on the candidate point set and the local outlier factor algorithm;
[0130] For each temporary positioning point of the template anatomical landmark, an outlier is determined based on the candidate set of the template anatomical landmark. The determination method is the local outlier factor algorithm. The number of local neighbors of each point is less than If an abnormal point is determined, it will be replaced with the point in the candidate point set with the second highest similarity to the template anatomical landmark point. All abnormal points in the temporary set are replaced to form the updated first temporary set. At the same time, the mutual information between the template MRI image and the verification MRI image is calculated. ,In order to judge the effect of algorithm execution, the ,optimal image registration evaluation method can be selected according to the ,actual conditions, such as the normalized correlation coefficient.
[0131] Among them, mutual information The calculation process of refers to the following record of mutual information calculation, as follows:
[0132] 1) Voxel value quantization. In order to reduce the amount of calculation and improve robustness, the voxel values of the image are usually quantized, that is, the continuous voxel values are mapped to discrete voxel levels, ranging from: , a total of 256 levels.
[0133] 2) Calculate the edge probability distribution and joint probability distribution of image voxels. First, for each image, calculate the frequency of each voxel level within the range. The calculation formula is as follows:
[0134]
[0135] in, Representing 3D images The voxel level is The frequency of occurrence of all voxel levels constitutes the marginal distribution of the image; secondly, the joint probability distribution between the two images is calculated, and the calculation formula is as follows:
[0136]
[0137] in, Representing images The voxel level is Voxels and images The voxel level is The joint probability of voxels appearing simultaneously.
[0138] 3) Calculation Mutual Information of Images , the formula is as follows:
[0139]
[0140] For 3D images The voxel level is The marginal probability of .
[0141] Step 5: Create a distance consistency constraint based on the geometric information of the template anatomical landmarks and the updated first temporary set, synchronously transform the template anatomical landmarks and the template MRI image to obtain the transformed template anatomical landmarks; increase the distance between the template anatomical landmarks and the updated first temporary set;
[0142] The distance consistency constraints are as follows:
[0143] (d1) Scaling of template anatomical landmarks in template MRI image;
[0144] First, calculate the initial template anatomical landmarks The distance matrix between the anatomical landmarks in each template , and calculate the updated first temporary set The distance matrix between each temporary point inside ,in , Indicates Template anatomical landmarks, Indicates Template anatomical landmarks, for and The distance between Indicates the first temporary set after update A temporary point, Indicates the first temporary set after update A temporary point, for and The distance between.
[0145] Calculate the distance matrix With the distance matrix The ratio between them gives the scaling matrix ,in , the scaling matrix Remove all elements on the diagonal Calculate the z-score for all The elements with z-score values less than 2 are calculated to get the scaling factor ; Based on the scaling factor The template anatomical landmarks and the template MRI image are synchronously scaled to obtain the scaled template MRI image and the scaled template anatomical landmarks. .
[0146] (d2) Scaled template MRI image and scaled template anatomical landmarks Perform rotation and translation transformation;
[0147] Use the quaternion method to fit the registration parameters of the scaled template anatomical landmarks and the updated first temporary set to obtain the rotation matrix and the translation vector ;
[0148] Using the rotation matrix and the translation vector Perform synchronous rotation and translation transformation on the scaled template MRI image and the scaled template anatomical landmark points to obtain the transformed template anatomical landmarks , For the The transformed template anatomical landmarks.
[0149] Step 6: Create a direction consistency constraint based on the transformed template anatomical landmark points and the geometric information of the updated first temporary set, and replace all verification feature points in the updated first temporary set that do not meet the direction consistency constraint to form a second temporary set;
[0150] Create a directional consistency constraint based on the geometric information of the transformed template anatomical landmarks and the updated first temporary set. For each point in the first temporary set that does not meet the directional consistency constraint, calculate the geometric distance direction weighted error value of each point in the corresponding candidate point set, and replace the point with the smallest error value in the candidate point set. Replace all points in the updated first temporary set that do not meet the directional consistency constraint to form a second temporary set.
[0151] (e1) Calculate the anatomical landmarks of the template after replacement Each transformed template anatomical landmark point is converted to its corresponding candidate point set The distance between each verification feature point , all distances constitute the template anatomical landmarks The distance matrix to its candidate point ,in , The candidate point set The points in the set of candidate points According to distance Sort from small to large to get the updated candidate point set , the updated candidate point set The first column is used as the first temporary set after the update ;
[0152] (e2) Check the points in the updated first temporary set that do not satisfy the direction consistency. First, calculate the anatomical landmarks of the transformed template The direction vector between each transformed template anatomical landmark point , to form the direction vector matrix , and calculate the updated first temporary set The direction vector between the temporary points in , to form the direction vector matrix , the calculation formula is as follows:
[0153]
[0154] Then, calculate and The angle matrix corresponding to the position direction vector ,in Next, the angle matrix The directional consistency error is obtained by adding all elements in each row of ,in express and Middle Directional consistency error of corresponding points.
[0155] Finally, if The If the z-score value of an element exceeds 2, the first temporary set after the update is determined Middle feature points do not satisfy the direction consistency constraint.
[0156] (e3) Replace all updated first temporary sets The points that do not satisfy the direction consistency constraint. For any of the points , first, calculate the updated candidate point set Distance consistency error ,in is the distance matrix The normalized value, Represents the distance matrix Middle The normalized value of candidate points, , Indicates The total number of candidate points of the template anatomical landmark points, the candidate point set The corresponding All candidate points of the template anatomical landmarks, including candidate points.
[0157] Secondly, calculate the updated candidate point set Directional consistency error Specifically, for Candidate points for template anatomical landmarks , replace it with Then, follow the steps in step (e2) to calculate The z-score value is Directional consistency error , No. The directional consistency errors of all candidate points of the template anatomical landmarks constitute a set After normalization, we get , Representing a collection Middle The normalized direction consistency error of the candidate points.
[0158] Again, calculate the updated candidate point set The geometric distance direction weighted consistency error ,in Indicates The total number of candidate points for the template anatomical landmarks, , is the balance parameter, ; Finally, Replaced by geometric distance direction weighted consistency error The smallest candidate point ,in, . Thus, all verification feature points in the updated first temporary set that do not satisfy the direction consistency constraint are replaced to form a second temporary set.
[0159] Step 7: creating a distance consistency constraint according to the transformed template anatomical landmark points and the geometric information of the second temporary set, and synchronously transforming the transformed template anatomical landmark points and the template MRI image to obtain a transformed template MRI image;
[0160] The distance consistency constraint in step seven is consistent with the constraint scheme used in the distance consistency constraint in step five. The distance consistency constraint here can refer to the relevant records of step five and will not be repeated here. In addition, it should be noted that when the distance consistency constraint in step five is applied to step seven, step five uses the template anatomical landmark points and the geometric information of the updated first temporary set, while step seven uses the transformed template anatomical landmark points and the geometric information of the second temporary set. The inputs of the two constraints are different, but the specific settings of the constraints are the same.
[0161] Step 8: Calculate the mutual information between the transformed template MRI image and the verification MRI image ,like , return to step 5 and proceed to the next round of iteration. In the next round of iteration, Assigned to , assign the first temporary set of the next iteration to the second temporary set obtained in the current iteration; if , or the maximum number of iterations is reached, the iteration is terminated, and the second temporary set of the previous iteration is used as the final positioning anatomical landmark points for verifying the MRI image.
[0162] According to steps one to eight, the anatomical landmark detection method provided in this embodiment uses a self-supervised learning mechanism to train a deep learning model. Only a small number of template images need to be manually labeled, which effectively reduces the training cost of the deep learning model; uses template geometry information to create geometric constraints, further improving the detection accuracy of anatomical landmarks; uses image blocks as input for training deep learning models, which greatly reduces the amount of calculation compared to existing methods under limited hardware conditions. In summary, this method can be easily extended to detect any number of anatomical landmark points, can be easily migrated to other image data set feature point detection tasks, and can effectively assist in actual anatomical landmark labeling work.
[0163] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A brain MRI landmark detection method based on self-supervised learning and geometric constraints, characterized in that: The steps include: Step 1: preprocessing the verification MRI image of the template anatomical landmark to be located and the template MRI image, and performing three-dimensional slicing on the preprocessed verification MRI image with the verification feature point as the center, and performing three-dimensional slicing on the preprocessed template MRI image with the template anatomical landmark as the center; Step 2: Input all the verification feature point blocks of the verification MRI image and all the template anatomical landmark point blocks of the template MRI image into the trained deep learning model to output a one-dimensional feature vector corresponding to each block; Step 3: Take the coordinates of each template anatomical landmark as the center and the radius as Make a circle, obtain all the verification feature points in the circle, calculate the cosine similarity between the one-dimensional feature vector of the verification feature points in the circle and the one-dimensional feature vector of the template anatomical landmark points, and arrange them in descending order. The verification feature points constitute candidate points of the template anatomical landmark points, thereby constituting a candidate point set based on the candidate points of all template anatomical landmark points; Step 4: Use the first column in the candidate point set as the first temporary set for locating anatomical landmarks, and replace the abnormal verification feature points in the first temporary set to obtain an updated first temporary set. At the same time, calculate the mutual information between the template MRI image and the verification MRI image. ; Step 5: creating a distance consistency constraint according to the geometric information of the template anatomical landmark points and the updated first temporary set, synchronously transforming the template anatomical landmark points and the template MRI image to obtain the transformed template anatomical landmark points; Step 6: Create a direction consistency constraint based on the transformed template anatomical landmark points and the geometric information of the updated first temporary set, and replace all verification feature points in the updated first temporary set that do not meet the direction consistency constraint to form a second temporary set; Step 7: creating a distance consistency constraint according to the transformed template anatomical landmark points and the geometric information of the second temporary set, and synchronously transforming the transformed template anatomical landmark points and the template MRI image to obtain a transformed template MRI image; Step 8: Calculate the mutual information between the transformed template MRI image and the verification MRI image ,like , return to step 5 and proceed to the next round of iteration. In the next round of iteration, Assigned to , assign the first temporary set of the next iteration to the second temporary set obtained in the current iteration; if , or the maximum number of iterations is reached, the iteration is terminated, and the second temporary set of the previous iteration is used as the final positioning anatomical landmark points for verifying the MRI image; Among them, in step 5, the distance consistency constraint is as follows: Calculate the distance matrix between each template anatomical landmark point , and the distance matrix between each temporary point in the first temporary set after update ; Calculate the distance matrix With the distance matrix The ratio between them gives the scaling matrix , the scaling matrix Remove all elements on the diagonal Calculate the z-score for all The elements with z-score values less than 2 are calculated to get the scaling factor ; Based on the scaling factor Synchronously scaling the template anatomical landmarks and the template MRI image to obtain the scaled template MRI image and the scaled template anatomical landmarks; Using quaternion method to perform registration parameter fitting on the scaled template anatomical landmark points and the updated first temporary set to obtain a rotation matrix and a translation vector; Using a rotation matrix and a translation vector, synchronously rotating and translating the scaled template MRI image and the scaled template anatomical landmark points, to obtain transformed template anatomical landmark points; In step six, the directional consistency constraints are as follows: Calculate each transformed template anatomical landmark point and candidate point set The distance between each verification feature point in the distance matrix , and the distance matrix The distances in are arranged in descending order; The candidate point set The verification feature points in are re-sorted according to the distance in descending order to obtain the updated candidate point set , the updated candidate point set The first column is used as the first temporary set after the update ; Calculate the direction vector between each transformed template anatomical landmark point to form a direction vector matrix , and calculate the updated first temporary set The direction vectors between the temporary points in to form a direction vector matrix ; Calculate the direction vector matrix With the direction vector matrix The angle matrix of the corresponding position direction vector, adding all the elements of each row of the angle matrix to get the direction consistency error; If the first If the z-score value of an element exceeds 2, the first temporary set after the update is determined Middle Verification feature points do not satisfy the direction consistency constraint; Replace the verification feature points that do not meet the directional consistency constraint with the candidate points with the smallest geometric distance directional weighted consistency error, thereby replacing all updated first temporary sets The verification feature points that do not satisfy the direction consistency constraint constitute the second temporary set.
2. The brain MRI landmark detection method based on self-supervised learning and geometric constraints according to claim 1, characterized in that: In step 1, the pre-processed verification MRI image is cut into three dimensions with the verification feature point as the center, specifically: Based on the spatial combination determination method, the verification feature points of the preprocessed verification MRI image are detected, and the detected verification feature points are augmented, and the augmented points are added as verification feature points to the verification feature point set; Three-dimensional cutting is performed on the downsampled verification MRI image with the verification feature point in the verification feature point set as the center, and the size of the verification feature point cutting of the verification MRI image is equal to the template anatomical landmark point cutting of the template MRI image.
3. The brain MRI landmark detection method based on self-supervised learning and geometric constraints according to claim 2, characterized in that: The spatial combination determination method is specifically as follows: The preprocessed validation MRI images were Downsampling is performed to obtain voxel data, and all voxels except the edges in the voxel data are subjected to multiple spatial voxel combination methods to determine whether they are feature points, and voxels with basic geometric features are screened out as verification feature points based on the spatial voxel combination methods, wherein the spatial voxel combination methods include cross type, corner U type, and corner T type; When the spatial voxel combination mode is a corner T-type, any voxel combination mode in the spatial voxel combination mode , and the opening direction is toward the upper right, the 27 voxels are divided into two groups according to the spatial distribution. and , express The first distribution method, express The first The 27 voxels are in the local neighborhood with a side length of 3 and one voxel as the center in the downsampled verification MRI image, for a total of 27 voxels; the voxel combination method The specific determination formula is as follows: in, Represents the voxel combination method Determination result, express The first Individual elements, express Group Individual elements, express The corresponding voxel value, express The corresponding voxel value, represents the voxel mean of the data set to which the validation MRI image belongs, express The total number of voxels in the group, express The total number of voxels in the group, and Corresponding to the voxel combination method The voxel threshold, Is a judgment function, when the input condition Returns 1 if true, otherwise returns 0.
4. The method for detecting brain MRI landmarks based on self-supervised learning and geometric constraints according to claim 2, characterized in that: In step 4, the generation process of the updated first temporary set is as follows: The first column in the candidate set is used as a temporary set of anatomical landmarks for final positioning. , for temporary set The temporary positioning points of each anatomical landmark in the image are used to determine abnormal points based on the candidate point set and the local outlier factor algorithm; The local outlier factor algorithm is as follows: the number of local neighbors of each temporary positioning point is less than the set number of neighbors , it is considered as an abnormal point, and the candidate point with the second highest similarity to the anatomical landmark point in the candidate point set where the temporary positioning point is located is used to replace it, replacing all abnormal points in the temporary set to form the updated first temporary set.
5. The brain MRI landmark detection method based on self-supervised learning and geometric constraints according to claim 1, characterized in that: In step 2, the training process of the deep learning model is as follows: Collect a training dataset of training MRI images And preprocess to obtain the preprocessed training data set List of feature points ; For the training data set Each training MRI image is augmented to obtain an augmented dataset And the list of augmented feature points ; For the training data set And the augmented dataset The feature point blocks of all training MRI images are obtained, and the three-dimensional coordinates of the feature points corresponding to each block are obtained. The feature point blocks and the corresponding three-dimensional coordinates are used as the self-supervised training data set of the deep learning model; In each training round, the self-supervised training dataset The training samples are randomly sorted and the batch size of the model parameter update is set to , the entire self-supervised training dataset is divided into Training data , , Indicates the data index, Represents the number of feature point blocks in the self-supervised training dataset; Deep learning model training uses a contrastive learning method that uses momentum to update sample dictionaries to maintain a sample dictionary queue and a sample coordinate queue of the same length as the sample dictionary queue. After each parameter update, the current batch of training data Any augmented block in the feature point block is updated with the sample dictionary queue in the first-in-first-out principle, and the coordinates of the current batch of training data are updated synchronously with the sample coordinate queue. The augmented block is the feature point block composed of the augmented data set. The resulting cut pieces; Deep learning model training uses noise contrast estimation loss to train the training data Any sample in , anchor point , positive example , all samples in the sample dictionary queue are regarded as negative examples , is the training data set A training MRI image Feature points of cut pieces, To expand the dataset Training MRI images The augmented image Feature points after image augmentation transformation of cut pieces, Representing feature points No. An augmented cut block; The following loss function is performed Calculate and adjust the model parameters of the deep learning model based on the back propagation of the loss function: in, is the length of the sample dictionary queue, Express and Perform inner product operation, Express and Perform inner product operation, is the temperature hyperparameter, For feature points The number of augmented blocks corresponds to the number of positive examples. Indicates The suppression weight of negative examples, For the The loss weight of a positive example, Indicates A positive example, Indicates negative examples, and .
