A training method, storage medium, and device for a registration model.

By combining overall similarity and local topological constraints in the training of the image registration model, the problem of image distortion caused by inaccurate deformation field in existing technologies is solved, thereby improving the accuracy and stability of image registration.

CN115953439BActive Publication Date: 2026-05-26SHANGHAI UNITED IMAGING INTELLIGENCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI UNITED IMAGING INTELLIGENCE CO LTD
Filing Date
2022-12-28
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing image registration methods determine the loss based solely on overall similarity during model training, resulting in inaccurate deformation fields in the output. This leads to low registration accuracy and distorted images, especially in human image registration, where reasonable deformation of organs or morphological structures can result in unreasonable deformation.

Method used

By using the first and second images as training samples, a mask is obtained and transformed according to the deformation field. The displacement of the mask points is determined. The total loss is determined by combining the overall similarity and local topological constraints. The total loss is minimized to train the registration model, ensuring the overall accuracy of the transformed image and the accuracy of the local topological structure.

Benefits of technology

It achieves accurate deformation field output in image registration, avoids unreasonable deformation, ensures the normal topological structure of organs or morphological structures in the transformed image, and improves the accuracy and stability of registration results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115953439B_ABST
    Figure CN115953439B_ABST
Patent Text Reader

Abstract

This specification discloses a training method, storage medium, and device for a registration model. By inputting a first image and a second image as training samples into the registration model to be trained, a deformation field is obtained. The second image is then transformed according to the deformation field to obtain a transformed second image. A second mask is then transformed according to the deformation field to obtain a transformed second mask. Based on the correspondence between the transformed second mask and the corresponding points within the first mask in the first image, the displacements corresponding to at least some points of the first mask are determined. A first loss is then determined based on the similarity between the first image and the transformed second image, and a second loss is determined based on the displacements corresponding to at least some points of the first mask. A registration model is trained based on the first and second losses to output a sufficiently accurate deformation field to accurately determine the registration result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of image processing technology, and in particular to a training method, storage medium, and device for a registration model. Background Technology

[0002] Image registration has applications in many fields. For example, in the medical field, it is used to register images of the same part of different human bodies to study related organs, or to register images of the diseased area of ​​the same patient collected at different times.

[0003] Existing registration methods involve inputting the first and second images to be registered into a registration model to obtain a deformation field. After transforming the second image according to the deformation field, the transformed second image is obtained, thus achieving registration between the first and second images.

[0004] However, when training existing registration models, the loss is typically determined only based on the overall similarity between the first image and the transformed second image. This results in inaccurate deformation fields in existing registration methods, leading to low accuracy in the registration results obtained based on the deformation fields, and the transformed second image obtained through registration is prone to distortion. Summary of the Invention

[0005] This specification provides a training method, storage medium, and device for a registration model, to at least partially solve the aforementioned problems.

[0006] The following technical solution is adopted in this specification:

[0007] This manual provides a training method for a registration model, including:

[0008] The first image and the second image are used as training samples, and the training samples are input into the registration model to be trained to obtain the deformation field;

[0009] The transformed second image is obtained by transforming the second image according to the deformation field;

[0010] Obtain the first mask corresponding to the first image and the second mask corresponding to the second image;

[0011] The transformed second mask is obtained by transforming the second mask according to the deformation field, and the displacement corresponding to at least some points of the first mask is determined according to the correspondence between the transformed second mask and the points in the first mask.

[0012] A first loss is determined based on the similarity between the first image and the transformed second image, and a second loss is determined based on the displacement corresponding to at least some points of the first mask.

[0013] The registration model is trained with the goal of minimizing the total loss determined by the first loss and the second loss, resulting in the trained registration model.

[0014] The trained registration model is used to output the deformation field based on the input image to be registered, and to determine the registration result based on the obtained deformation field.

[0015] Optionally, the first image and the second image are three-dimensional images; the first mask is a mask of the target organ or morphological structure in each layer of the first image; the second mask is a mask of the target organ or morphological structure in each layer of the second image;

[0016] Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to at least some points of the first mask are determined, specifically including:

[0017] Based on the mask of the target organ in each layer of the first image, a mesh surface model of the target organ is obtained through a reconstruction algorithm;

[0018] Based on each vertex of the mesh surface model, determine each surface point of the first mask;

[0019] Based on the correspondence between the transformed second mask and the points inside the first mask, the displacements corresponding to each surface point of the first mask are determined.

[0020] Optionally, the second loss is determined based on the displacement corresponding to at least some points of the first mask, specifically including:

[0021] The second loss is determined based on the displacement corresponding to each surface point of the first mask.

[0022] Optionally, the second loss is determined based on the displacement corresponding to each surface point of the first mask, specifically including:

[0023] For each surface point of the first mask, determine the adjacent points of that surface point from the other surface points;

[0024] Determine the displacement difference between the surface point and each of its adjacent points to obtain the displacement difference corresponding to the surface point;

[0025] The second loss is determined based on the displacement difference corresponding to each surface point.

[0026] Optionally, both the first image and the second image are three-dimensional images composed of multiple layers of images; the first mask is a mask of the target organ or morphological structure in each layer of the first image; the second mask is a mask of the target organ or morphological structure in each layer of the second image.

[0027] Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to at least some points of the first mask are determined, specifically including:

[0028] Based on the mask of the target organ in each layer of the first image, a mesh surface model of the target organ is obtained through a reconstruction algorithm;

[0029] Determine several slices of the first mask in a specified direction;

[0030] Based on each vertex of the mesh surface model, the contour points corresponding to each slice of the first mask are determined, and these contour points are used as the contour points of the first mask.

[0031] Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to each contour point of the first mask are determined.

[0032] Optionally, the second loss is determined based on the displacement corresponding to at least some points of the first mask, specifically including:

[0033] The second loss is determined based on the displacement corresponding to each contour point of the first mask.

[0034] Optionally, the second loss is determined based on the displacement corresponding to each contour point of the first mask, specifically including:

[0035] For each slice of the first mask, determine the average displacement of each contour point corresponding to that slice in the specified direction;

[0036] For each contour point corresponding to the slice of this layer, the displacement difference corresponding to the contour point is determined based on the difference between the displacement of the contour point in the specified direction and the mean value.

[0037] The second loss is determined based on the displacement difference corresponding to each contour point in each slice.

[0038] Optionally, the first image and the second image are two-dimensional images; the first mask is a mask of the target organ or morphological structure in the first image; the second mask is a mask of the target organ or morphological structure in the second image;

[0039] Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to at least some points of the first mask are determined, specifically including:

[0040] Based on the correspondence between the transformed second mask and the points inside the first mask, and the displacements corresponding to the points inside the second mask, the displacements corresponding to each point inside the first mask are determined.

[0041] The second loss is determined based on the displacement corresponding to at least some points of the first mask, specifically including:

[0042] For each point within the first mask, determine each of the adjacent points of that point from the other points within the first mask;

[0043] Determine the displacement differences between this point and each of its adjacent points to obtain the corresponding displacement differences for this point;

[0044] The second loss is determined based on the displacement difference between each point within the first mask.

[0045] Optionally, the registration model is trained with the objective of minimizing the total loss determined based on the first loss and the second loss, specifically including:

[0046] For each position in the first mask, determine the difference between the mask value at that position in the first mask and the mask value at that position in the transformed second mask;

[0047] The third loss is determined based on the differences in mask values ​​at each location;

[0048] The total loss is determined based on the first loss, the second loss, and the third loss;

[0049] The registration model is trained with the goal of minimizing the total loss.

[0050] This specification provides a training apparatus for a registration model, comprising:

[0051] The input module is used to take the first image and the second image as training samples and input the training samples into the registration model to be trained to obtain the deformation field;

[0052] The registration module is used to transform the second image according to the deformation field to obtain the transformed second image;

[0053] The acquisition module is used to acquire the first mask corresponding to the first image and the second mask corresponding to the second image;

[0054] The displacement determination module is used to transform the second mask according to the deformation field to obtain the transformed second mask, and to determine the displacement corresponding to at least some points of the first mask according to the correspondence between the transformed second mask and the points in the first mask.

[0055] The loss determination module is used to determine a first loss based on the similarity between the first image and the transformed second image, and to determine a second loss based on the displacement corresponding to at least some points of the first mask;

[0056] The training module is used to train the registration model with the goal of minimizing the total loss determined by the first loss and the second loss, so as to obtain the trained registration model; wherein the trained registration model is used to output the deformation field based on the input image to be registered, so as to determine the registration result based on the obtained deformation field.

[0057] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method for the registration model described above.

[0058] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the training method of the registration model described above.

[0059] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:

[0060] In the training method of the above registration model, a deformation field is obtained by using the first image and the second image as training samples and inputting them into the registration model to be trained. The second image is then transformed according to this deformation field to obtain a transformed second image. A first mask corresponding to the first image and a second mask corresponding to the second image are obtained. The second mask is then transformed according to the deformation field to obtain a transformed second mask. Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to at least some points of the first mask are determined. Then, a first loss is determined based on the similarity between the first image and the transformed second image, and a second loss is determined based on the displacements corresponding to at least some points of the first mask. The registration model is trained with the goal of minimizing the total loss determined by the first and second losses, resulting in a trained registration model that outputs a sufficiently accurate deformation field to accurately determine the registration result.

[0061] As can be seen from the above, the training method for the registration model provided in this specification, besides determining the first loss based on the overall similarity between the first image and the transformed second image to ensure the overall accuracy of the transformed second image obtained through registration, also aims to ensure that the transformed second image obtained through registration maintains the accuracy of its local topological structure and avoids unreasonable local deformations. It determines the displacement of the midpoint of the first mask based on the deformation field, and then determines the second loss based on the displacement of the midpoint of the first mask to constrain the organ structures or morphological structures in the second image. This allows a registration model capable of outputting an accurate deformation field to be trained based on the first and second losses. Attached Figure Description

[0062] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and their descriptions, serving to explain this specification and do not constitute an undue limitation thereof.

[0063] In the picture:

[0064] Figure 1 This is a flowchart illustrating a training method for a registration model provided in this specification.

[0065] Figure 2 This is a schematic diagram of a training device for a registration model provided in this specification;

[0066] Figure 3 This is a schematic diagram of an electronic device provided in this specification. Detailed Implementation

[0067] When registering images according to a registration model, the first and second images to be registered can be input into the registration model to obtain a deformation field. Then, the second image is transformed according to the deformation field to obtain a registered, transformed second image that is similar to the first image.

[0068] The first image is a fixed reference image. The second image is an image registered with the first image by transformation according to the deformation field.

[0069] Currently, the loss is determined solely based on the similarity between the first image and the transformed second image, and the model parameters are adjusted accordingly based on the loss.

[0070] However, after obtaining a registration model trained using existing methods, the accuracy of the deformation field output by the model is low. The transformed second image obtained by transforming the second image based on the deformation field output by the model is prone to unreasonable deformations such as distortion in some areas. In particular, when the second image has reasonable deformations compared to the first image, it will lead to unreasonable deformations in the transformed second image obtained based on the deformation field output by the model.

[0071] Especially when the first and second images to be registered are human images, the presence of organs or structural features in the human body that are subject to reasonable deformation can lead to normal distortions in the transformed second image compared to the first image. For example, when the first and second images are images of the human pelvis, the bladder, rectum, and other structures will exhibit reasonable deformations. In this case, registering the first and second images based on the deformation field output by the existing model can easily result in unreasonable distortions in the transformed second image.

[0072] To address the aforementioned issues, this specification provides a training method for a registration model. In this specification, the model used to output the deformation field is used as the registration model. This training method is employed in deformable registration scenarios to train a registration model capable of outputting an accurate deformation field, thus preventing unreasonable deformations in the transformed second image obtained through registration based on the deformation field.

[0073] When training the registration model using the training method provided in this specification, in addition to determining the first loss based on the similarity between the first image and the transformed second image, in order to reduce the influence of reasonably deformable organs or morphological structures on the registration result, this specification also determines a second loss based on a mask to constrain the topological structure of organs or morphological structures in the image to be registered, so that the organs or morphological structures in the transformed second image obtained by registration can maintain their normal topological structure and avoid unreasonable deformation.

[0074] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0075] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0076] Figure 1 This is a flowchart illustrating a training method for a registration model in this specification, which specifically includes the following steps:

[0077] S100: Use the first image and the second image as training samples, and input the training samples into the registration model to be trained to obtain the deformation field.

[0078] In this specification, the training method for the registration model can be executed by the server.

[0079] The server can first acquire a first image and a second image to be registered. Then, the first image and the second image can be used as training samples and input into the registration model to be trained to obtain the deformation field.

[0080] The deformation field includes the displacement corresponding to each pixel in the second image. This deformation field is used to map each pixel in the second image to the first image based on the displacement corresponding to each pixel in the second image.

[0081] In one or more embodiments of this specification, the first image and the second image are a pair of images to be registered, which are acquired from the same part of the human body. Specifically, they can be acquired from the same part of different human bodies, or they can be acquired from the same part of the same human body.

[0082] The first image and the second image can both be grayscale images and have the same size.

[0083] Furthermore, both the first and second images can be images acquired using medical equipment. For example, the medical equipment can be a computed tomography (CT) scanner or a magnetic resonance imaging (MRI) scanner. The first and second images can be acquired using the same medical equipment, or they can be acquired using different medical equipment.

[0084] S102: The second image is transformed according to the deformation field to obtain the transformed second image.

[0085] After obtaining the deformation field output by the registration model, the server can transform the second image according to the deformation field to obtain the transformed second image. This achieves the registration of the first image and the second image.

[0086] S104: Obtain the first mask corresponding to the first image and the second mask corresponding to the second image.

[0087] During image registration, there are often local image regions within the image that require exceptional accuracy—that is, regions of interest (ROIs). To ensure the accuracy of ROI registration, the server can obtain masks corresponding to the first image and the second image. For ease of distinction, the mask corresponding to the first image is used as the first mask, and the mask corresponding to the second image is used as the second mask.

[0088] The first and second masks are obtained so that, in subsequent steps, a second loss is determined based on the first and second masks to constrain the topological structure of the target organ or morphological structure corresponding to the region of interest in the first and second images.

[0089] Among them, the first mask and the second mask are masks of the morphological structure of the same organ or human body.

[0090] In one or more embodiments of this specification, the first mask and the second mask have the same size, and may have the same size as the first image and the second image. For example, both the first mask and the second mask may be binary images composed of points with mask values ​​of 0 or 1. The mask value of the image region that needs to be of particular interest in the first image and the second image may be 1, and the mask value of other regions may be 0.

[0091] S106: The second mask is transformed according to the deformation field to obtain the transformed second mask, and the displacement corresponding to at least some points of the first mask is determined according to the correspondence between the transformed second mask and the points in the first mask.

[0092] Since the second mask is a mask for the second image, at least some of the mask points in the second mask have the same positions as the pixels in the second image. Therefore, after determining the deformation field, the server can transform the second mask according to the deformation field to obtain the transformed second mask.

[0093] For mask points in the second mask that are not located at the same position as any pixel in the second image, their displacement can be determined based on the displacement of the surrounding pixels.

[0094] Specifically, the server can treat pixels in the second mask and the second image that are at the same position as mask points as corresponding points. For each pair of corresponding points, the server can use the displacement of the pixel in that pair as the displacement of the corresponding mask point. Furthermore, the server can identify mask points in the second mask that are not at the same position as any pixel in the second image as unmatched points. For each unmatched point, the server determines its displacement through interpolation based on the displacements of the surrounding pixels. Specifically, a trilinear interpolation algorithm can be used to determine the displacement of the unmatched point.

[0095] That is, the server can determine the displacement corresponding to the point inside the second mask based on the deformation field. The point inside the mask is the mask point.

[0096] After determining the displacement corresponding to the point inside the second mask, the second mask can be transformed based on the obtained displacement to obtain the transformed second mask.

[0097] That is, the transformed second image is obtained by moving each pixel of the second image according to the displacement corresponding to each pixel in the second image within the deformation field. The transformed second mask is obtained by moving each mask point in the second mask according to the displacement corresponding to each mask point within the second mask.

[0098] After obtaining the transformed second mask, the mask points in the second mask are projected onto the first mask. Therefore, after obtaining the transformed second mask, the correspondence between the points in the transformed second mask and the points in the first mask can be determined. Points in the transformed second mask and the first mask that are at the same position are considered a pair of corresponding points.

[0099] The server can then determine, based on the established correspondence, which point in the second mask moves to that point's position and by what displacement for each point in the first mask. The displacement of the point in the second mask that has moved to that position in the first mask is then taken as the corresponding displacement of that point in the first mask.

[0100] Then, the server can determine the displacements of at least some points in the first mask based on the correspondence between the transformed second mask and the points in the first mask. This allows for the determination of the second loss used to constrain the target organ or morphological structure based on the displacement differences in subsequent steps.

[0101] S108: Determine a first loss based on the similarity between the first image and the transformed second image, and determine a second loss based on the displacement corresponding to at least some points of the first mask.

[0102] In one or more embodiments of this specification, in order to ensure the overall accuracy of the transformed second image obtained through registration, the server may determine a first loss based on the similarity between the first image and the transformed second image.

[0103] In addition, to avoid the impact of reasonably deformable organs or morphological tissues in the second image on the accuracy of registration, and to ensure that the topological structure of reasonably deformable organs or morphological tissues corresponding to the mask is consistent after registration, the server can also determine a second loss to constrain the topological structure of the target organs or morphological tissues in the transformed second image obtained by registration.

[0104] The server can determine the second loss based on the displacement corresponding to at least some points of the first mask. By determining the second loss based on the displacement corresponding to at least some points of the first mask, the orientation of the transformed second mask after overlapping with the first mask can be constrained, avoiding extreme displacement deviations from other points that could cause distortion of the transformed second mask.

[0105] As described above, the first mask and the second mask are masks corresponding to the target organ or morphological tissue. The target organ can be a reasonably deformable organ. Alternatively, the target organ can also be an organ that cannot be reasonably deformed.

[0106] For example, when the first image and the second image are pelvic images, and the prostate in the pelvis is studied by registering the first image and the second image, the target organ can be the prostate. By constraining the topological structure of the prostate, it can be ensured that the prostate in the registered second image will not be distorted.

[0107] Alternatively, local distortions in the transformed second image obtained through registration are usually caused by deformations of reasonably deformable organs (such as the bladder and rectum) or morphological structures (such as ligaments). For example, in the transformed second image obtained through registration, the prostate gland, which should not be reasonably deformable, may appear distorted due to deformations of adjacent reasonably deformable organs or morphological structures. Therefore, to ensure the accuracy of prostate registration and avoid distortions after registration, adjacent reasonably deformable organs or human structures can be used as target organs or morphological structures.

[0108] In this specification, the second loss is determined based on the displacement corresponding to the midpoint of the first mask of the target organ. This ensures that the target organ or morphological structure will not be distorted in the transformed second image obtained from the deformation field output by the registration model trained based on the second loss, and that the distortion will not cause adjacent organs or morphological structures to be distorted due to compression of the distorted structures.

[0109] This specification does not limit the target organ or its morphological structure. For example, when the first and second images to be registered are pelvic images, the specific organ could be the bladder, rectum, prostate, cervix, etc. When the first and second images to be registered are abdominal images, the specific organ could be the stomach, etc.

[0110] S110: The registration model is trained with the goal of minimizing the total loss determined by the first loss and the second loss, to obtain the trained registration model.

[0111] After determining the various losses, the server can determine the total loss based on the second loss and the first loss, and train the registration model with the goal of minimizing the total loss determined by the second loss and the first loss, thus obtaining the trained registration model.

[0112] It should be noted that the target organs or morphological structures corresponding to the masks of images in different training samples can be different. Alternatively, the organs corresponding to the masks of images in different batches of training samples can be different. For example, the first and second masks of an image in one training sample could be masks of the bladder in the first and second images, meaning the target organ could be the bladder. The first and second masks of an image in another training sample could be masks of the rectum in the first and second images, meaning the target organ could be the rectum. The masks of images in the remaining training samples could also be masks of the prostate, and so on.

[0113] That is, during training, the mask is not limited to a specific organ. It can be randomly determined with equal probability in each training iteration. Randomly determining the mask input to the registration model allows the registration model to perceive more mask information, avoids overfitting to specific organs, and makes the registration model more flexible.

[0114] The trained registration model is used to output the deformation field based on the input image to be registered, and the registration result is determined based on the obtained deformation field.

[0115] Once the registration model is trained, the server can then perform registration on the image pairs to be registered based on the trained registration model.

[0116] Therefore, the server can receive a registration request and, in response to the received registration request carrying a pair of images to be registered, obtain the deformation field of the pair of images to be registered through the trained registration model, so as to determine the registration result based on the obtained deformation field.

[0117] based on Figure 1 The method described above uses a first image and a second image as training samples, inputting these samples into a registration model to be trained to obtain a deformation field. The second image is then transformed based on this deformation field to obtain a transformed second image. A first mask corresponding to the first image and a second mask corresponding to the second image are obtained. The second mask is then transformed based on the deformation field to obtain a transformed second mask. The displacements corresponding to at least some points in the first mask are determined based on the correspondence between the transformed second mask and points within the first mask. Subsequently, a first loss is determined based on the similarity between the first image and the transformed second image, and a second loss is determined based on the displacements corresponding to at least some points in the first mask. The registration model is trained with the goal of minimizing the total loss determined by the first and second losses, resulting in a trained registration model that outputs a sufficiently accurate deformation field to accurately determine the registration result.

[0118] As can be seen from the above method, this method, in addition to determining the first loss based on the overall similarity between the first image and the transformed second image to ensure the overall accuracy of the registered transformed second image, also determines the displacement of the midpoint of the first mask based on the deformation field to ensure that the registered transformed second image maintains the accuracy of the local topology and avoids unreasonable local deformations. This second loss is then determined based on the displacement of the midpoint of the first mask. This allows a registration model that can output an accurate deformation field to be trained based on the first and second losses.

[0119] In one or more embodiments of this specification, the formula for determining the total loss may be as follows:

[0120] L = L D (I f ,T(I m ,φ))+L S (φ)

[0121] Where L represents the total loss. f Indicates the first image, I m Let represent the second image, and φ represent the deformation field. T(·) represents the spatial transformation based on φ. Then, T(I m φ) represents the transformed second image obtained by moving each pixel of the second image according to the displacement in the deformation field. D (I f ,T(I m ,φ)) represents the first loss. L S (φ) represents the second loss.

[0122] In one or more embodiments of this specification, when determining the first loss in step S108 based on the similarity between the first image and the transformed second image, the server can determine the difference between the grayscale value of that location in the first image and the grayscale value of that location in the transformed second image for each location in the first image. Then, the first loss between the first image and the transformed second image can be determined based on the differences in grayscale values ​​corresponding to each location. The differences in grayscale values ​​corresponding to each location are used to characterize the similarity between the first image and the transformed second image, and the differences in grayscale values ​​corresponding to each location are negatively correlated with the similarity between the first image and the transformed second image.

[0123] In addition, in one or more embodiments of this specification, the first image and the second image may be three-dimensional images or two-dimensional images.

[0124] When the first image and the second image are three-dimensional images, the first mask can be a mask for the target organ or morphological structure in each layer of the first image. The second mask can be a mask for the target organ or morphological structure in each layer of the second image. Therefore, the first mask and the second mask constitute a three-dimensional mask.

[0125] In this specification, when the first image and the second image are three-dimensional images, the second loss can be determined based on surface points and / or contour points in each point of the first mask. That is, by using the second loss, the surface structure and contour structure of the target organ corresponding to the first mask can be constrained, ensuring that after the registration model trained based on the second loss is used to register the first image and the second image based on the deformation field output by the registration model, the target organ or morphological structure in the transformed second image can maintain a normal topological structure and will not be distorted.

[0126] The distortion and altered topology in the transformed second image obtained through registration are usually due to inconsistent displacements of adjacent surface points. During normal registration, the displacements of adjacent surface points should be consistent or have only minor differences. Distortion occurs when the displacements of some surface points differ from those of nearby surface points, or even deviate significantly. Areas prone to distortion are those marked with a mask for special attention, such as areas with a mask value of 1.

[0127] Therefore, for the second mask, the displacements of adjacent surface points in the second mask should be consistent, or have only minor differences. Similarly, for the first mask, the displacements corresponding to adjacent surface points in the first mask should also be consistent, or have only minor differences, to ensure that the surface points in the second mask that are moved to the positions of adjacent surface points in the first mask based on their respective displacements should also be derived from adjacent positions in the second mask. That is, the adjacency relationship of each surface point should be consistent before and after moving the surface points in the second mask according to the displacement. Surface points that were adjacent before the movement should also be adjacent after being moved to align with the first mask.

[0128] Therefore, a second loss can be constructed with the aim of constraining the displacement difference between adjacent surface points in the first mask.

[0129] Therefore, in step S106, when determining the displacements corresponding to at least some points of the first mask based on the correspondence between the transformed second mask and the points within the first mask, the server can obtain the target organ mesh surface model through a reconstruction algorithm based on the target organ masks in each layer of the first image. And based on each vertex of the mesh surface model, it determines each surface point of the first mask. Thus, based on the correspondence between the transformed second mask and the points within the first mask, it determines the displacements corresponding to each surface point of the first mask.

[0130] Specifically, the reconstruction algorithm can be a surface drawing algorithm, such as the Moving Cubes (MC) algorithm.

[0131] Furthermore, in step S108, when determining the second loss based on the displacement corresponding to at least some points of the first mask, the server can determine the second loss based on the displacement corresponding to each surface point of the first mask.

[0132] Specifically, for each surface point of the first mask, the server can determine each of the adjacent points of that surface point from other surface points. It can also determine the displacement differences between that surface point and each of its adjacent points, thus obtaining the corresponding displacement differences for that surface point.

[0133] Then, the second loss can be determined based on the displacement difference corresponding to each surface point.

[0134] Therefore, in one or more embodiments of this specification, the formula for determining the second loss may be as follows:

[0135]

[0136] Among them, L S (φ) represents the second loss, R s This represents the first deformation loss used to constrain the surface structure of the target organ or morphological structure corresponding to the mask.

[0137] d j d represents the displacement of the j-th surface point among all surface points of the first mask. k Let A be the k-th neighboring point among the neighboring points of the j-th surface point. j Let S represent the set of adjacent points of the j-th surface point. Let S represent the set of surface points of the first mask. This represents the total number of adjacent points corresponding to each point in S.

[0138] Furthermore, as mentioned above, both the first image and the second image can be three-dimensional images composed of multiple layers of images. The first mask can be a mask for the target organ or morphological structure in each layer of the first image. The second mask can be a mask for the target organ or morphological structure in each layer of the second image.

[0139] In addition to constraining the surface structure of the target organ or morphological structure corresponding to the mask from the perspective of the displacement difference between adjacent points on the surface of the first mask, it is also possible to constrain it from the perspective of the contour structure of the target organ or morphological structure corresponding to the mask.

[0140] Since for contour points in the same plane, their displacement during registration should be consistent in the vertical direction of the plane, it can fluctuate within a certain range around the average value of the displacement in that vertical direction.

[0141] Therefore, in step S106, when determining the displacement corresponding to at least some points of the first mask based on the correspondence between the transformed second mask and the points within the first mask, the server can also obtain the mesh surface model of the target organ through a reconstruction algorithm based on the mask of the target organ in each layer of the first image, and determine several slices of the first mask in a specified direction.

[0142] Then, the server can determine the contour points corresponding to each slice of the first mask based on the vertices of the mesh surface model, and use these as the contour points of the first mask. Then, based on the correspondence between the transformed second mask and the points within the first mask, the displacement corresponding to each contour point of the first mask can be determined.

[0143] Furthermore, when determining the second loss based on the displacement corresponding to at least some points of the first mask, the server can determine the second loss based on the displacement corresponding to each contour point of the first mask.

[0144] Specifically, the server can determine the average displacement of each contour point corresponding to each slice of the first mask in a specified direction. Then, for each contour point corresponding to that slice, it determines the displacement difference corresponding to that contour point based on the difference between the displacement of that contour point in the specified direction and the average displacement. The second loss is then determined based on the displacement differences corresponding to each contour point in each slice.

[0145] The specified direction can be the vertical direction of the slice. For example, the vertically upward direction in a specified human body pose can be used as the specified direction.

[0146] The specified pose can be a standing pose. For example, the coordinate axis corresponding to the vertical direction can be taken as the Z-axis. Based on the constraint of this second loss, the displacement of each contour point in the same plane perpendicular to the Z-axis in the Z-axis direction can be made consistent, avoiding extreme displacement of points in the same slice to different slices.

[0147] Of course, slicing perpendicular to the Z-axis is merely an example. In one or more embodiments of this specification, the method of slicing the first mask is not limited. For example, since both the first image and the first mask are three-dimensional, a layer of the mask corresponding to the first image can be considered as a slice. Alternatively, slicing can also be performed along the X-axis or Y-axis direction perpendicular to the Z-axis. Therefore, this perpendicular direction can also be the X-axis or Y-axis direction.

[0148] In one or more embodiments of this specification, the formula for determining the second loss may also be as follows:

[0149]

[0150] Among them, L S (φ) represents the second loss, R c This represents the second deformation loss used to constrain the contour structure of the target organ or morphological structure corresponding to the mask. L represents a superset, and l is a subset of it. l consists of contour points in a slice. μ represents the displacement of the i-th contour point in l in the specified direction. l This represents the mean displacement of all contour points in line l in the specified direction. ∑ l∈L ∑ i∈l 1 represents the total number of contour points corresponding to each slice contained in L.

[0151] In one or more embodiments of this specification, a second loss may also be determined based on the first deformation loss and the second deformation loss.

[0152] Therefore, the formula for determining the second loss can also be specified as follows:

[0153] L S (φ)=αR s +βR c

[0154] Here, α and β are preset weights, and their values ​​can be set as needed. For example, α = 1 and β = 0.5.

[0155] In one or more embodiments of this specification, when the first image and the second image are two-dimensional images, the first mask may be a mask for the target organ or morphological structure in the first image. The second mask may be a mask for the target organ or morphological structure in the second image.

[0156] In step S106, when determining the displacement corresponding to at least some points of the first mask based on the correspondence between the transformed second mask and the points within the first mask, the server can determine the displacement corresponding to each point within the first mask based on the correspondence between the transformed second mask and the points within the first mask, as well as the displacement corresponding to the points within the second mask.

[0157] Therefore, when determining the second loss based on the displacements corresponding to at least some points of the first mask, for each point within the first mask, its neighboring points can be determined from the other points within the first mask. Then, the displacement differences between that point and each of its neighboring points can be determined, obtaining the corresponding displacement differences for that point. The second loss is then determined based on the determined displacement differences corresponding to each point within the first mask.

[0158] Furthermore, this specification also allows for the determination of a third loss based on the difference between the first mask and the transformed second mask. In step S110, when training the registration model with the objective of minimizing the total loss determined by the first and second losses, the server can determine the difference between the mask value at each position in the first mask and the mask value at that position in the transformed second mask. Then, the third loss can be determined based on the differences in the mask values ​​corresponding to each position.

[0159] Then, the server can determine the total loss based on the second loss, the first loss, and the third loss, and train the registration model with the goal of minimizing the total loss.

[0160] Therefore, in one or more embodiments of this specification, the formula for determining the total loss may be as follows:

[0161]

[0162] Where L represents the total loss. f Indicates the first image, I m The second image is represented by φ, and the deformation field is represented by T(·). T(·) represents the spatial transformation based on φ, and T(I m ,φ) represents the transformed second image obtained by moving each pixel of the second image according to the displacement in the deformation field.

[0163] L D (I f ,T(I m ,φ)) represents the first loss. Indicates the third loss. L S (φ) represents the second loss. This represents the first mask corresponding to the first image. This represents the second mask corresponding to the second image. This represents the transformed second mask obtained by transforming the second mask according to the displacement of each point within the second mask. λ1 and λ3 are both preset weights.

[0164] Specifically, the first loss and the third loss can be the mean-square error (MSE) loss.

[0165] Therefore, the formula for determining the first loss can be specifically as follows:

[0166]

[0167] Where D1 represents the grayscale value of the pixel at position i in the first image. D′1 represents the grayscale value of the pixel at position i in the transformed second image. N represents the total number of positions contained in the first image.

[0168] The formula for determining the third loss can be as follows:

[0169]

[0170] Where G1 represents the mask value of the i-th position in the first mask. G′1 represents the mask value of the i-th position in the transformed second mask. N represents the total number of positions contained in the first mask.

[0171] In addition, to make the transformed second image obtained after registration smooth, the server can also determine a fourth loss based on the deformation field.

[0172] Then, for each pixel in the first image, the server can determine the neighboring points of that pixel and the displacement difference between that pixel and each neighboring point, thus obtaining the displacement differences corresponding to that pixel. Then, based on the displacement differences corresponding to each pixel, a fourth loss for registering the second image with the first image can be determined. And based on the fourth loss, the second loss, the first loss, and the third loss, the total loss is determined.

[0173] The loss function for determining the total loss can be specifically described as follows:

[0174]

[0175] Where λ2 is the preset weight, λ2L R (φ) represents the fourth loss.

[0176] It should be noted that, in this specification, the mask of the target organ or morphological structure can be obtained by a trained semantic segmentation model, or it can be manually labeled.

[0177] In addition, in order to make the deformation field output by the registration model more accurate, in one or more embodiments of this specification, in step S100, the server may also use the first image and its first mask, as well as the second image and its second mask, as training samples, and input the training samples into the registration model to be trained to obtain the deformation field.

[0178] Therefore, the server can first obtain the first image to be registered and its mask, as well as the second image and its mask. Then, the server can use the first image and its first mask, and the second image and its second mask, as training samples. These training samples are then input into the registration model to be trained to obtain the deformation field.

[0179] That is, the server can first execute step S104 to obtain the first mask and the second mask, and then execute step S100 to use the first image and its first mask, as well as the second image and its second mask, as training samples, and input the training samples into the registration model to be trained to obtain the deformation field.

[0180] The first and second masks are used to enable the registration model to learn the image regions in the first and second images that need to be focused on during registration (i.e., to determine the regions of interest in the images) in order to accurately output the deformation field. This ensures that, while maintaining the overall registration accuracy of the first and second images, the image regions corresponding to the organs or morphological structures that need to be focused on also maintain sufficient registration accuracy.

[0181] Similarly, during training, the mask is not limited to a specific organ. It can be randomly determined with equal probability in each training iteration. Randomly determining the mask input to the registration model allows the registration model to perceive more mask information, avoids overfitting to specific organs, and makes the registration model more flexible.

[0182] During the testing phase, or after training is complete, masks of any organ or morphological structure can be used as one of the inputs to the registration model, depending on different needs, without the need to retrain a new registration model.

[0183] In one or more embodiments of this specification, the registration model may be a U-Net model. Alternatively, to maintain differential homeomorphism during training, the registration model may also consist of a U-Net network and an integral layer.

[0184] The above describes the training method for the registration model provided in this manual. This manual also provides a corresponding training device for the registration model, such as... Figure 2 As shown.

[0185] Figure 2 This is a schematic diagram of a training device for a registration model provided in this specification. The device includes:

[0186] The input module 200 is used to take the first image and the second image as training samples and input the training samples into the registration model to be trained to obtain the deformation field;

[0187] Registration module 201 is used to transform the second image according to the deformation field to obtain the transformed second image;

[0188] The acquisition module 202 is used to acquire the first mask corresponding to the first image and the second mask corresponding to the second image;

[0189] The displacement determination module 203 is used to transform the second mask according to the deformation field to obtain the transformed second mask, and to determine the displacement corresponding to at least some points of the first mask according to the correspondence between the transformed second mask and the points in the first mask.

[0190] The loss determination module 204 is used to determine a first loss based on the similarity between the first image and the transformed second image, and to determine a second loss based on the displacement corresponding to at least some points of the first mask;

[0191] The training module 205 is used to train the registration model with the goal of minimizing the total loss determined by the first loss and the second loss, so as to obtain the trained registration model; wherein the trained registration model is used to output the deformation field based on the input image to be registered, so as to determine the registration result based on the obtained deformation field.

[0192] Optionally, the first image and the second image are three-dimensional images; the first mask is a mask of the target organ or morphological structure in each layer of the first image; the second mask is a mask of the target organ or morphological structure in each layer of the second image; the displacement determination module 203 is further configured to obtain the target organ mesh surface model by a reconstruction algorithm based on the mask of the target organ in each layer of the first image; determine each surface point of the first mask based on each vertex of the mesh surface model; and determine the displacement corresponding to each surface point of the first mask based on the correspondence between the transformed second mask and the points inside the first mask.

[0193] Optionally, the loss determination module 204 is further configured to determine a second loss based on the displacement corresponding to each surface point of the first mask.

[0194] Optionally, the loss determination module 204 is further configured to, for each surface point of the first mask, determine each adjacent point of the surface point from other surface points; determine the displacement difference between the surface point and each adjacent point of the surface point respectively, to obtain each displacement difference corresponding to the surface point; and determine the second loss based on the determined displacement differences corresponding to each surface point.

[0195] Optionally, both the first image and the second image are three-dimensional images composed of multiple layers of images; the first mask is a mask for the target organ or morphological structure in each layer of the first image; the second mask is a mask for the target organ or morphological structure in each layer of the second image; the displacement determination module 203 is further configured to obtain a mesh surface model of the target organ based on the mask of the target organ in each layer of the first image through a reconstruction algorithm; determine several slices of the first mask in a specified direction; determine the contour points corresponding to each slice of the first mask according to each vertex of the mesh surface model, as each contour point of the first mask; and determine the displacement corresponding to each contour point of the first mask according to the correspondence between the transformed second mask and the points in the first mask.

[0196] Optionally, the loss determination module 204 is further configured to determine a second loss based on the displacement corresponding to each contour point of the first mask.

[0197] Optionally, the loss determination module 204 is further configured to: determine the average displacement of each contour point corresponding to the first mask layer slice in the specified direction for each layer slice; determine the displacement difference corresponding to each contour point based on the difference between the displacement of the contour point in the specified direction and the average value for each contour point corresponding to the first mask layer slice; and determine the second loss based on the displacement difference corresponding to each contour point in each layer slice.

[0198] Optionally, the first image and the second image are two-dimensional images; the first mask is a mask for the target organ or morphological structure in the first image; the second mask is a mask for the target organ or morphological structure in the second image; the displacement determination module 203 is further configured to determine the displacement corresponding to each point in the first mask based on the correspondence between the transformed second mask and the points in the first mask, and the displacement corresponding to the points in the second mask; the loss determination module 204 is further configured to, for each point in the first mask, determine each adjacent point of that point from other points in the first mask; determine the displacement difference between that point and each adjacent point of that point, and obtain the displacement difference corresponding to that point; and determine the second loss based on the determined displacement difference corresponding to each point in the first mask.

[0199] Optionally, the training module 205 is further configured to, for each position in the first mask, determine the difference between the mask value at that position in the first mask and the mask value at that position in the transformed second mask; determine a third loss based on the difference in mask values ​​corresponding to each position; determine a total loss based on the first loss, the second loss, and the third loss; and train the registration model with the goal of minimizing the total loss.

[0200] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the training method for the registration model described above.

[0201] This instruction manual also provides Figure 3 The diagram shows a schematic structural representation of the electronic device. Figure 3At the hardware level, the electronic device includes a processor, an internal bus, a network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the training method of the registration model described above. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.

[0202] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0203] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0204] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0205] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0206] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0207] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0208] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0209] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0210] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0211] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0212] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0213] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0214] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0215] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0216] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0217] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A training method of a registration model, characterized by, include: The first image and the second image are used as training samples, and the training samples are input into the registration model to be trained to obtain the deformation field; The transformed second image is obtained by transforming the second image according to the deformation field; Obtain the first mask corresponding to the first image and the second mask corresponding to the second image; The second mask is transformed according to the deformation field to obtain the transformed second mask, and the displacement corresponding to at least some points of the first mask is determined according to the correspondence between the transformed second mask and the points in the first mask. A first loss is determined based on the similarity between the first image and the transformed second image, and a second loss is determined based on the displacement corresponding to at least some points of the first mask. Specifically, for each position in the first image, the difference between the grayscale value at that position in the first image and the grayscale value at that position in the transformed second image can be determined. The first loss is determined based on the difference in grayscale values ​​at each position. The difference in grayscale values ​​at each position is used to characterize the similarity between the first image and the transformed second image, and the difference in grayscale values ​​at each position is negatively correlated with the similarity between the first image and the transformed second image. The registration model is trained with the goal of minimizing the total loss determined by the first loss and the second loss, resulting in the trained registration model. The trained registration model is used to output the deformation field based on the input image to be registered, and to determine the registration result based on the obtained deformation field.

2. The method of claim 1, wherein, The first image and the second image are three-dimensional images; the first mask is a mask for the target organ or morphological structure in each layer of the first image; the second mask is a mask for the target organ or morphological structure in each layer of the second image; Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to at least a portion of the points in the first mask are determined, specifically including: Based on the mask of the target organ in each layer of the first image, a mesh surface model of the target organ is obtained through a reconstruction algorithm; Based on each vertex of the mesh surface model, determine each surface point of the first mask; Based on the correspondence between the transformed second mask and the points inside the first mask, the displacements corresponding to each surface point of the first mask are determined.

3. The method as described in claim 2, characterized in that, The second loss is determined based on the displacement corresponding to at least some points of the first mask, specifically including: The second loss is determined based on the displacement corresponding to each surface point of the first mask.

4. The method as described in claim 3, characterized in that, The second loss is determined based on the displacement corresponding to each surface point of the first mask, specifically including: For each surface point of the first mask, determine the adjacent points of that surface point from the other surface points; Determine the displacement difference between the surface point and each of its adjacent points to obtain the displacement difference corresponding to the surface point; The second loss is determined based on the displacement difference corresponding to each surface point.

5. The method as described in claim 1, characterized in that, Both the first image and the second image are three-dimensional images composed of multiple layers of images; the first mask is a mask of the target organ or morphological structure in each layer of the first image; The second mask is a mask for the target organ or the morphological structure in each layer of the second image; Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to at least a portion of the points in the first mask are determined, specifically including: Based on the mask of the target organ in each layer of the first image, a mesh surface model of the target organ is obtained through a reconstruction algorithm; Determine several slices of the first mask in a specified direction; Based on each vertex of the mesh surface model, the contour points corresponding to each slice of the first mask are determined, and these contour points are used as the contour points of the first mask. Based on the correspondence between the transformed second mask and the points within the first mask, the displacements corresponding to each contour point of the first mask are determined.

6. The method as described in claim 5, characterized in that, The second loss is determined based on the displacement corresponding to at least some points of the first mask, specifically including: The second loss is determined based on the displacement corresponding to each contour point of the first mask.

7. The method as described in claim 6, characterized in that, The second loss is determined based on the displacement corresponding to each contour point of the first mask, specifically including: For each slice of the first mask, determine the average displacement of each contour point corresponding to that slice in the specified direction; For each contour point corresponding to the slice of this layer, the displacement difference corresponding to the contour point is determined based on the difference between the displacement of the contour point in the specified direction and the mean value. The second loss is determined based on the displacement difference corresponding to each contour point in each slice.

8. The method as described in claim 1, characterized in that, The registration model is trained with the objective of minimizing the total loss determined by the first loss and the second loss, specifically including: For each position in the first mask, determine the difference between the mask value at that position in the first mask and the mask value at that position in the transformed second mask; The third loss is determined based on the differences in mask values ​​at each location; The total loss is determined based on the first loss, the second loss, and the third loss; The registration model is trained with the goal of minimizing the total loss.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 8.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 8.