Method for grading the degree of premature ovarian failure of ivf-et patients based on mri images
By employing a three-stage alignment and registration process and correcting edge information in T1WI images, the problem of inaccurate ovarian segmentation in T2WI images was resolved, thus achieving accuracy and reliability in grading the degree of premature ovarian failure.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI PROVINCIAL INSTITUTE OF TRADITIONAL CHINESE MEDICINE (SHAANXI PROVINCIAL TRADITIONAL CHINESE MEDICINE HOSPITAL SHAANXI PROVINCIAL INSTITUTE OF INTEGRATED TRADITIONAL CHINESE & WESTERN MEDICINE)
- Filing Date
- 2026-05-14
- Publication Date
- 2026-06-19
AI Technical Summary
Existing automatic ovarian segmentation and grading methods based on T2WI images are inaccurate when ovarian premature failure is severe. In cases of severe premature ovarian failure, ovarian atrophy and follicle disappearance result in signals similar to surrounding intestinal segments and blurred boundaries, leading to inaccurate segmentation results and affecting the reliability of ovarian function grading.
A three-stage alignment registration process was adopted, combining T1WI and T2WI images. By matching key points and filtering edges, the registration accuracy was gradually improved. The edge information of the T1WI image was used to correct the ovarian segmentation result of the T2WI image, ensuring the accuracy of ovarian region segmentation.
It improves the accuracy of ovarian region segmentation and the precision of boundary localization, ensuring the reliability of premature ovarian failure severity grading and providing more reliable ovarian function grading results.
Smart Images

Figure CN122244010A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to a method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images. Background Technology
[0002] In IVF-ET clinical practice, it is often necessary to assess ovarian function, particularly the severity of premature ovarian failure (PFO), based on the shape or size of the ovarian region. Currently, magnetic resonance imaging (MRI), due to its high soft tissue resolution, especially T2-weighted images which are advantageous in visualizing follicles within the ovary, is being explored for ovarian region segmentation and ovarian reserve assessment. However, existing automated ovarian segmentation and grading methods based on T2WI images have significant drawbacks: when a patient's PFO is severe, ovarian atrophy and follicle disappearance result in signals on T2WI images that are highly similar to surrounding tissues such as the intestines, with blurred boundaries. This makes automated segmentation models relying solely on a single T2WI sequence prone to errors, leading to inaccurate segmentation results and affecting the reliability of subsequent functional grading. Summary of the Invention
[0003] To address the aforementioned issues, this invention provides a method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images.
[0004] The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images of the present invention adopts the following technical solution: One embodiment of the present invention provides a method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images, the method comprising the following steps: During MRI scanning, T1WI and T2WI images were acquired, and the ovarian region was segmented in the T2WI image. All key points in the T1WI and T2WI images were matched, and the T1WI image was aligned to the T2WI image for the first time based on the matched key points. Based on the difference between the edge in the T1WI image after the first alignment and the contour of the ovarian region, candidate ovarian edges were selected from the edges in the T1WI image. The T1WI image was aligned to the T2WI image a second time based on the candidate edge of the ovary and the contour of the ovarian region; valid key points were selected based on the distance between the matched key points in the T1WI and T2WI images after the second alignment. All valid key points are re-matched, and the T1WI image is aligned to the T2WI image for the third time based on the matched valid key points. Ovarian candidate edges are selected again from the edges in the T1WI image after the third alignment. The ovarian region is corrected using the selected ovarian candidate edges, and the degree of premature ovarian failure is graded using the corrected ovarian region.
[0005] Preferably, the specific steps for selecting candidate ovarian edges from the edges in the T1WI image based on the difference between the edges in the first aligned T1WI image and the contour of the ovarian region are as follows: For all edges detected in the T1WI image after the first alignment, any one of these edges is designated as the target edge. The difference between the target edge and all other edges besides the target edge is calculated. Among the other edges besides the target edge, the edges with the smallest difference from the target edge are designated as control edges. The average difference between the target edge and the control edges is designated as the reference difference. The difference between the target edge and the ovarian region contour is designated as the first difference. The fit index of the target edge is calculated. The fit index is positively correlated with the reference difference and negatively correlated with the first difference. All edges are clustered based on the fit index of all edges to obtain all categories. The edges in the category with the largest average fit index are designated as ovarian candidate edges.
[0006] Preferably, the specific steps of aligning the T1WI image to the T2WI image a second time based on the candidate ovarian edge and the ovarian region contour are as follows: Pixels on the ovarian region contour are matched with pixels on the candidate ovarian edges. For any pixel on the ovarian region contour, if the pixel corresponds to one or more matching pixels from all candidate ovarian edges, the pixel is designated as the reference pixel. The mean coordinates of all pixels that match the reference pixel are calculated. The pixel in the T1WI image with the closest Euclidean distance to the mean coordinates is designated as the final matching point of the reference pixel. The T1WI image is then aligned to the T2WI image for the second time based on all pixel pairs formed by all reference pixels and final matching points.
[0007] Preferably, the specific steps for filtering valid keypoints based on the distance between the matched keypoints in the second aligned T1WI and T2WI images are as follows: For any pair of matching keypoints, the error index of any pair of keypoints is determined based on the distance between the keypoints in the T1WI and T2WI images after the second alignment. Cluster all keypoint pairs based on the error index to obtain all keypoint pair categories. Obtain the keypoint pair category with the largest average error index, delete the keypoints from the T1WI image within the keypoint pair category, and record all remaining keypoints from the T1WI and T2WI images as valid keypoints.
[0008] Preferably, the specific steps of correcting the ovarian region using the re-selected ovarian candidate edges are as follows: The candidate ovarian edges selected again are recorded as the first edge; the difference between any first edge and the ovarian region contour is recorded as the second difference; the first edge with the smallest second difference is merged into the ovarian region contour to obtain the first ovarian region; the second difference between the remaining first edges and the first ovarian region contour is calculated, and the first edge with the smallest second difference is merged into the first ovarian region contour again to obtain the second ovarian region; and so on, until all first edges are merged into the ovarian region contour to obtain the corrected ovarian region.
[0009] Preferably, the specific steps of fusing the first edge with the smallest difference into the ovarian region contour to obtain the first ovarian region are as follows: For the first edge with the smallest difference, the endpoints at both ends of the first edge are respectively designated as the first endpoint and the second endpoint. The first edge is extended from the first endpoint and the second endpoint respectively to obtain the first extended segment and the second extended segment respectively. In the T2WI image, the intersection points of the first extended segment and the second extended segment with the contour of the ovarian region are respectively designated as the first intersection point and the second intersection point. The continuous edge formed by the first extended segment between the first intersection point and the first endpoint, the first edge between the first endpoint and the second endpoint, and the second extended segment between the second endpoint and the second intersection point is taken as the new contour of the ovarian region, and the first ovarian region enclosed by the new contour is obtained.
[0010] Preferably, the specific steps of extending the first edge from the first endpoint and the second endpoint respectively to obtain the first extended segment and the second extended segment are as follows: When using the edge detection algorithm to extract edges in the T1WI image after the third alignment, the parameters of the edge detection algorithm are adjusted. Among all the edges obtained under the adjusted parameters, the edge that completely contains the first edge is recorded as an extended edge. Among the extended edges, the extended segment starting from the first endpoint is recorded as the first extended segment, and the extended segment starting from the second endpoint is recorded as the second extended segment.
[0011] Preferably, the specific steps for matching pixels on the ovarian region contour with pixels on the candidate ovarian edge are as follows: Calculate the Euclidean distance from each pixel on each candidate ovarian edge to each pixel on the ovarian region contour; for each pixel on each candidate ovarian edge to each pixel on the ovarian region contour, use nearest neighbor search to find the matching pair with the smallest Euclidean distance; the two pixels in each matching pair represent matching pixels from each candidate ovarian edge and the ovarian region contour, respectively.
[0012] Preferably, the specific steps for determining the error index of any keypoint pair based on the distance between the keypoint pair in the T1WI and T2WI images after the second alignment are as follows: In the T1WI and T2WI images after the second alignment, for any pair of matching keypoints, the Euclidean distance between the coordinates of the keypoints from the T1WI image after the second alignment and the coordinates of the keypoints from the T2WI image is denoted as the first distance of any pair of keypoints; the Euclidean distance between the coordinates of the keypoints from the T1WI image after the first alignment and the coordinates of the keypoints from the T2WI image is denoted as the second distance of any pair of keypoints; the ratio of the first distance to the second distance is denoted as the error index of any pair of keypoints.
[0013] Preferably, the specific steps for obtaining the difference between the edge and the ovarian region contour in the T1WI image are as follows: The difference is defined as the Hausdorff distance between all pixels on any edge and all pixels on the ovarian region contour.
[0014] The beneficial effects of the technical solution of the present invention are: First, this invention implements a three-stage alignment registration process. The first alignment uses global keypoints for preliminary spatial correction, addressing the basic displacement caused by the time difference in image acquisition. Based on this, by comparing the differences between the aligned T1WI image edges and the initial segmentation contour, candidate ovarian edges are selected, and a second alignment is performed based on these. This step shifts from global registration to local feature-driven fine registration, effectively compensating for deformations in the ovarian region caused by physiological micro-movements and significantly improving local registration accuracy. Next, based on the second-aligned image, effective keypoints are selected through distance comparison, eliminating mismatched points caused by differences in signal representation between sequences, providing a clean and reliable set of control points for the final alignment. The third alignment utilizes these high-quality control points to achieve high-precision and high-stability final registration of T1WI and T2WI images in the ovarian region. This progressively refined registration mechanism fundamentally ensures the accuracy of the data foundation for subsequent cross-modal information fusion.
[0015] Secondly, this invention utilizes edge information from precisely registered T1WI image sequences to iteratively filter and correct the initial segmentation results in T2WI images. After the first and third alignments, candidate ovarian edges are selected. The third selection is performed after the image reaches its highest alignment accuracy, thus ensuring the highest geometric consistency between the extracted edges and the actual ovarian contour. Using this high-confidence T1WI edge information to correct the T2WI segmentation contour essentially involves transferring and supplementing the blurred boundaries of the T2WI sequence with clear adipose-tissue boundary information across modalities and with high fidelity. This method, to some extent, compensates for the inherent deficiency of insufficient T2WI contrast in POI patients (early-onset ovarian insufficiency) due to ovarian atrophy and follicle disappearance, improving the accuracy of ovarian region segmentation and the precision of boundary localization.
[0016] Finally, the premature ovarian failure severity is graded based on the modified ovarian segmentation region. Compared with grading premature ovarian failure severity directly based on the segmented ovarian region, the extraction of morphological and textural radiomic features (such as volume and signal uniformity) relied upon by this invention is more reliable, which directly translates into more accurate and reliable ovarian function grading results. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 The flowchart illustrates the steps of a method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images, as provided in one embodiment of the present invention. Detailed Implementation
[0019] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of the MRI-based grading method for premature ovarian failure in IVF-ET patients proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0021] The following describes in detail the specific scheme of the MRI-based IVF-ET patient premature ovarian failure grading method provided by the present invention, with reference to the accompanying drawings.
[0022] Please see Figure 1 The diagram illustrates a flowchart of a method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images, according to an embodiment of the present invention. The method includes the following steps: Step S101: Acquire T1WI and T2WI images during the MRI scan, and segment the ovarian region in the T2WI image.
[0023] In this embodiment, during pelvic MRI scanning, axial high-resolution T2-weighted imaging (T2WI) and axial T1-weighted imaging (T1WI) sequences were acquired sequentially to obtain T2WI image sequences and T1WI image sequences, respectively. Each image in the T2WI image sequence and T1WI image sequence is denoted as a T1WI image and a T2WI image, respectively, and both are grayscale images.
[0024] T2WI images are extremely sensitive to free water, showing very high signal (bright white) in the follicular fluid within the ovary. It is the gold standard sequence for follicle counting (AFC) and assessing ovarian reserve. In a normal ovary, T2WI images clearly show the three layers: low signal in the cortex, slightly high signal in the medulla, and high signal in the follicles. Furthermore, it clearly distinguishes the myometrium, junctional zone, and endometrium, helping to determine the relative position of the ovary and uterus and providing rich anatomical contextual information.
[0025] In this embodiment, based on the aforementioned characteristics of T2WI images, T2WI images are used as the primary basis for segmenting the ovarian region.
[0026] As an example, methods for segmenting the ovarian region in T2WI images include: The U-Net model takes T2WI images from a T2WI image sequence as input and outputs the ovarian region in the T2WI image. In other examples, the U-Net model can be replaced with its variants, such as the nnU-Net model.
[0027] It should be noted that this embodiment only considers T2WI images with ovarian regions; T2WI images without ovarian regions are not included in this embodiment.
[0028] This embodiment takes into account that when POI patients (early-onset ovarian insufficiency) have severe ovarian atrophy, follicle disappearance, and T2 signals similar to those of the surrounding intestinal wall, the segmentation model of the ovarian region cannot make a reliable judgment based solely on T2WI information, and is prone to segmentation errors (such as including part of the intestinal segment or missing part of the ovary).
[0029] Based on this, this embodiment will subsequently utilize complementary information provided by T1WI images (such as the high signal of fat in T1WI clearly outlining the ovarian boundary) to verify and correct its own errors.
[0030] Specifically, T1WI images are sensitive to adipose tissue, with abundant adipose tissue in the pelvic cavity appearing as extremely high signal (bright white). The ovary is typically surrounded by adipose tissue; therefore, on T1WI images, the boundary between the ovary and the surrounding fat (i.e., the ovarian outline) often appears as a clear black-and-white demarcation line. In this embodiment, the characteristics of T1WI images are subsequently used to correct the ovarian region segmented from T2WI images to ensure the accuracy of the ovarian region segmentation and provide a reliable data basis for grading the degree of premature ovarian failure.
[0031] As an example, when acquiring T2WI image sequences, a fast spin echo sequence is used, with a repetition time (TR) set to 3000 ms and an echo time (TE) set to 90 ms. When acquiring T1WI image sequences, a spin echo or gradient echo sequence is used, with a repetition time (TR) set to 530 ms and an echo time (TE) set to the minimum value (18 ms). The slice thickness (e.g., 4 mm), interslice spacing, field of view (FOV), and total number of slices are kept consistent between the T1WI and T2WI image sequences.
[0032] Since acquiring T2WI and T1WI image sequences is a well-known technique, the specific parameters can be set according to the specific MRI equipment. In this embodiment, the scanning parameters will not be described one by one, that is, the scanning parameters will not be specifically limited.
[0033] Step S102: Match all key points of the T1WI and T2WI images, and align the T1WI image to the T2WI image for the first time based on the matched key points; based on the difference between the edges in the T1WI image after the first alignment and the contour of the ovarian region, select candidate edges of the ovary from the edges in the T1WI image.
[0034] MRI is a serial acquisition device, and completing the scans of the aforementioned T2WI and T1WI image sequences typically takes several minutes (e.g., 5-10 minutes). During this time, the patient's breathing, bowel movements, or even minor body movements can cause spatial deviations between the images of different sequences.
[0035] This embodiment uses a pair of T1WI and T2WI images with the same sequence number from both a T2WI and T1WI image sequences as an example. This step addresses the spatial offset between the T1WI and T2WI images due to different acquisition times by performing initial alignment (i.e., first alignment) of the two images using keypoint matching. Simultaneously, it provides information for subsequent correction of the ovarian region by initially screening edge features (i.e., candidate ovarian edges) that may be related to the actual ovarian boundary from the initially aligned (i.e., first alignment) T1WI images.
[0036] In this embodiment, the true ovarian boundary should also appear as a significant edge on the T1WI image, and this edge should have spatial proximity and geometric similarity to the contour of the ovarian region segmented from the T2WI image. Therefore, based on the difference between the edge in the T1WI image after the first alignment and the contour of the ovarian region, candidate ovarian edges are screened from the edges in the T1WI image. This process effectively filters out a large number of edges in the T1WI image that are unrelated to the ovary (such as intestinal wall folds, blood vessel walls, etc.), providing high-value, target organ-related local features for subsequent processes.
[0037] Step S103: Align the T1WI image to the T2WI image for the second time based on the candidate edge of the ovary and the outline of the ovary region; filter out effective key points based on the distance between the matched key points in the T1WI image and the T2WI image after the second alignment.
[0038] This step further considers that T1WI and T2WI images have drastically different signal responses to the same tissue, resulting in inconsistent grayscale features and even geometric shapes of the same anatomical structure in the two images, which in turn leads to errors or noise in the key points that are matched as described above.
[0039] For example, adipose tissue appears as a very high signal on T1WI images and as a moderately high signal on T2WI images. In T1WI images, the adipose region may be detected as a key point of a bright patch; however, in T2WI images, the contrast of this region is reduced, making it impossible to extract equally significant key points at the corresponding location, or instead extracting flow void edges of adjacent blood vessels, resulting in matching errors. As another example, free water / follicular fluid appears as a very low signal on T1WI images and as a very high signal on T2WI images. In T2WI images, follicular edges are easily extracted as key points due to their high contrast, but the corresponding location in the T1WI image is a dark area, where the feature point detector may fail, instead matching noise points interspersed in the dark area or the edges of adjacent tissues.
[0040] The aforementioned errors result in errors in the first alignment process and the obtained ovarian candidate edges, which in turn makes it impossible to directly and accurately correct the segmented ovarian region based on the obtained ovarian candidate edges.
[0041] In this embodiment, the T1WI image is aligned to the T2WI image a second time based on the candidate ovarian edges and the ovarian region contour. This process uses the selected candidate ovarian edges (from the T1WI image) and the initially segmented ovarian region contour from the T2WI image as a new, highly correlated feature set (compared to the matching key points mentioned above), and then re-aligns the T1WI image (i.e., the second alignment). This alignment transformation focuses more on the spatial offset of the local ovarian region, compensating for spatial offsets caused by respiration and intestinal peristalsis, thus improving the consistency of the two images in the ovarian region to a certain extent.
[0042] Furthermore, in this embodiment, valid keypoints are selected based on the distance between the matched keypoints in the T1WI and T2WI images after the second alignment. After the coarse registration in step S102 and the further registration described above, the alignment between the T1WI and T2WI images has been improved. At this point, all the initial keypoint matching pairs obtained in step S102 are re-evaluated. The Euclidean distance between each pair of matching points in the current (after the second alignment) image space is calculated. Based on the magnitude of the Euclidean distance, all keypoints are screened and filtered to obtain valid keypoints. These valid keypoints represent corresponding points with stable positions and consistent features in both images. They are not significantly affected by soft tissue deformation or signal differences, providing a cleaner and more reliable set of control points for the final registration in the next step.
[0043] Step S104: Rematch all valid key points, and align the T1WI image to the T2WI image for the third time based on the matched valid key points; select ovarian candidate edges from the edges in the T1WI image after the third alignment, and use the selected ovarian candidate edges to correct the ovarian region.
[0044] This step re-matches all valid keypoints, and aligns the T1WI image to the T2WI image for the third time based on the matched valid keypoints. This process is the final global fine registration. Using the valid keypoints selected in step S103 as control points, a more accurate alignment transformation model is recalculated. Since noise has been filtered out from the input valid keypoints, this alignment process more realistically reflects the spatial relationship between the two images, improving alignment accuracy.
[0045] Furthermore, ovarian candidate edges are selected again from the edges in the third aligned T1WI image, and the ovarian region is corrected using these newly selected candidate edges. This process is repeated on the finally aligned T1WI image, where edge detection is performed again. At this point, because the images are more precisely aligned, the newly selected ovarian candidate edges have even higher accuracy and confidence. Finally, these high-confidence T1WI image edges are fused with the initial segmentation contour of the T2WI image to generate the corrected ovarian segmentation region. This correction utilizes the contrast information unique to the T1WI sequence, effectively compensating for insufficient segmentation in T2WI images at blurred boundaries.
[0046] Step S105: Use the modified ovarian region to classify the degree of premature ovarian failure.
[0047] The above process, through correction of the ovarian region, provides accuracy for the ovarian region, thereby ensuring the reliability of the grading of premature aging.
[0048] In summary, this embodiment considers that the grading of premature ovarian failure depends on the segmentation results of the ovarian region. However, when POI patients have severe ovarian atrophy, follicle disappearance (or reduction), and T2 signals are similar to those of the surrounding intestinal wall, the ovarian region segmentation model cannot make a reliable judgment based solely on T2WI information, leading to inaccurate segmentation results from existing methods. This embodiment uses complementary information provided by T1WI images to correct the segmentation results of the ovarian region. Simultaneously, this process further addresses the spatial positional shift between T1WI and T2WI images due to different acquisition times, as well as the significant differences in signal response to the same tissue. This makes the corrected ovarian region results more reliable and accurate than the direct segmentation results of existing technologies, thereby ensuring the reliability of premature ovarian failure grading.
[0049] As a preferred example, all keypoints of the T1WI and T2WI images are matched, and the T1WI image is initially aligned to the T2WI image based on the matched keypoints. This includes the following methods: Corner detection algorithms were used to extract all corners in the T1WI image and the T2WI image, respectively. Each corner point corresponds to a descriptor, and these corner points are all recorded as key points.
[0050] The descriptors of all keypoints are matched to obtain all keypoint pairs. Each keypoint pair represents a pair of matching keypoints from T1WI and T2WI images, respectively.
[0051] A homography matrix is solved based on all keypoint pairs. The homography matrix is then used to perform an affine transformation on the T1WI image so that the transformed T1WI image is aligned with the T2WI image. This alignment process is denoted as the first alignment.
[0052] As an example, the corner detection algorithm used is the SIFT algorithm; the matching algorithm uses the nearest neighbor search algorithm (such as FLANN); and the algorithm for solving the homography matrix is the ransac algorithm.
[0053] As an example, the contrast threshold in the SIFT algorithm is set to 0.02, the number of pyramid layers is set to 3, and the maximum number of feature points is set to 500. Other examples may use different parameters in the SIFT algorithm; this embodiment does not specify or provide detailed examples.
[0054] As a preferred example, based on the difference between the edges in the first aligned T1WI image and the contour of the ovarian region, candidate ovarian edges are selected from the edges in the T1WI image. The method includes: For all edges detected in the first aligned T1WI image, calculate the difference between any edge and the ovarian region contour. The larger the difference, the more the edge deviates from the ovarian region contour.
[0055] Any one of the edges is designated as the target edge. The difference between the target edge and all other edges besides the target edge is calculated. Among the other edges besides the target edge, several edges (e.g., 3) with the smallest difference from the target edge are designated as control edges. The average difference between the target edge and the control edges is designated as the reference difference. The difference between the target edge and the ovarian region contour is designated as the first difference. The fit index of the target edge is calculated. The fit index is positively correlated with the reference difference and negatively correlated with the first difference.
[0056] In special cases, if there are fewer than three other edges, all other edges are used as control edges.
[0057] The larger the fit index (where the reference difference is larger and the first difference is smaller), the farther the target edge is from other nearby edges, but closer to the outline of the ovarian region. In this case, the target edge is more likely to be the edge of the ovary. The smaller the fit index (where the reference difference is smaller and the first difference is larger), the closer the target edge is to other nearby edges, but farther from the outline of the ovarian region. In this case, it is not reliable to determine that the target edge is the edge of the ovary.
[0058] Cluster all edges based on their fit metrics to obtain all categories. Edges within each category have the same or similar fit metrics. The category with the highest average fit metric is selected, and the edges within that category are most likely to be ovarian edges. These edges are then recorded as ovarian candidate edges.
[0059] As an example, the edge detection algorithm is the Canny edge extraction algorithm, in which the Gaussian filter kernel size is 3×3, and the high and low thresholds are 153 and 64, respectively. In this embodiment, edges with an edge length less than 15 are removed.
[0060] Other parameters may be used in other examples, and this embodiment does not impose specific limitations.
[0061] As a preferred example, the method for calculating the difference between any edge and the ovarian region contour includes: using the Hausdorff distance between all pixels on any edge and all pixels on the ovarian region contour as the difference.
[0062] This preferred example has higher computational efficiency.
[0063] As an optional example, the method for calculating the difference between any edge and the ovarian region contour includes: Calculate the Euclidean distance from each pixel on any edge to each pixel on the ovarian region contour. For each pixel on any edge to each pixel on the ovarian region contour, use nearest neighbor search to find the matching pair with the smallest Euclidean distance. The two pixels in each matching pair are: matching pixels from any edge and the ovarian region contour, respectively. The Euclidean distance between these two pixels is the matching distance for each matching pair.
[0064] The mean of the matching distances of all matching pairs is taken as the difference.
[0065] Nearest neighbor search is an existing algorithm, and will not be described in detail in this embodiment.
[0066] It should be noted that the process of calculating the difference between the target edge and any other edge besides the target edge is the same as described above, and will not be repeated in detail in this embodiment. The above method is used for subsequent calculations of the difference between any two edges or contours.
[0067] As an example, the adaptation index for calculating the target edge is calculated using the formula: F1 = m / (h + h0), where F1 represents the adaptation index, m represents the reference difference, and h represents the first difference. The purpose of introducing h0 into the denominator is to avoid a denominator of 0. h0 is a preset constant; in this example, h0 equals the Euclidean distance between any two adjacent pixels, and its value is 1.
[0068] As an example, clustering all edges based on all edge fit metrics yields all categories, including the following methods: Clustering is performed using the K-Means algorithm, with the number of clusters K1 set to one-quarter (rounded up) of the total number of edges.
[0069] In some examples, the method of obtaining K1 also includes: taking any integer between [2, n] as the number of clusters, obtaining the Xie-Beni index of the clustering result, and taking the integer with the smallest Xie-Beni index as K1; where the Xie-Beni index is a well-known technique, and n is the total number of edges.
[0070] In particular, when the number of all edges is small (e.g., less than 2), then the high and low thresholds mentioned above are reduced by 2 respectively.
[0071] As a preferred example, the T1WI image is second-aligned to the T2WI image based on the candidate ovarian edge and the ovarian region contour, including the following methods: Calculate the Euclidean distance from each pixel on the candidate ovarian edge to each pixel on the ovarian region contour; for each pixel on the candidate ovarian edge to each pixel on the ovarian region contour, use nearest neighbor search to find the matching pair with the smallest Euclidean distance; where the two pixels in each matching pair represent matching pixels from each candidate ovarian edge and the ovarian region contour respectively.
[0072] At this point, the matching of each candidate ovarian edge with the ovarian region contour is complete.
[0073] Furthermore, the matching of all candidate ovarian edges with the ovarian region contour is performed separately. For any pixel on the ovarian region contour, this pixel may correspond to multiple matching pixels. These pixels come from different candidate ovarian edges. When this pixel corresponds to one or more matching pixels from candidate ovarian edges, this pixel is recorded as the reference pixel. The mean coordinates of all pixels that match the reference pixel are calculated. The pixel in the T1WI image with the closest Euclidean distance to the mean coordinates is recorded as the final matching point of the reference pixel.
[0074] All reference pixels in the ovarian region contour and their corresponding final matching points constitute all pixel pairs. A homography matrix is solved based on all pixel pairs. The T1WI image is then subjected to an affine transformation using this homography matrix to align the transformed T1WI image with the T2WI image. This alignment process is referred to as the second alignment.
[0075] The candidate ovarian edges selected during the second alignment process are most likely to represent the true ovarian edges. Compared to the first alignment, which uses keypoint pairs with large matching errors, the second alignment is more accurate.
[0076] As a preferred example, valid keypoints are selected based on the distance between the matched keypoints in the second aligned T1WI and T2WI images, including the following method: In the T1WI and T2WI images after the second alignment, for any pair of matching keypoints, the Euclidean distance between the coordinates of the keypoints from the T1WI image after the second alignment and the coordinates of the keypoints from the T2WI image is denoted as the first distance of any pair of keypoints.
[0077] The Euclidean distance between the coordinates of keypoints from the T1WI image after the first alignment and the coordinates of keypoints from the T2WI image is denoted as the second distance of any pair of keypoints.
[0078] The ratio of the first distance to the second distance is recorded as the error index for any pair of key points.
[0079] Specifically, when the first distance or the second distance is less than or equal to 1, the first distance or the second distance is set to 1. This is to take into account that when the first distance or the second distance is less than or equal to 1, it means that the key points are very close, and the positional differences between the key points can be ignored. On the other hand, it avoids the case where the denominator is 0 when calculating the ratio.
[0080] Based on the error index of all keypoint pairs, all keypoint pairs are clustered to obtain all keypoint pair categories. Each keypoint pair category contains multiple keypoint pairs. The category with the largest average error index is selected, and keypoints from T1WI images are deleted from all keypoint pairs in that category. All remaining keypoints from T1WI and T2WI images are recorded as valid keypoints.
[0081] In this process, the larger the error index of a keypoint pair, the larger the distance between the keypoint pairs in the more accurate second alignment process compared to the first alignment process, indicating that they are more likely to be keypoint pairs with large matching errors (see the description in step S103 above). Since T2WI images can more clearly depict the ovary, this embodiment only deletes keypoints in the T1WI image to suppress the occurrence of keypoint pairs with large matching errors.
[0082] Furthermore, all valid key points are re-matched, and the T1WI image is aligned to the T2WI image for the third time based on the matched valid key points; ovarian candidate edges are screened again from the edges in the T1WI image after the third alignment; this process is the same as step S102, and will not be described in detail in this embodiment.
[0083] As an example, clustering all group keypoint pairs includes the following methods: Clustering is performed using the K-means algorithm, with the number of clusters set to one-tenth of the number of keypoint pairs (rounded up).
[0084] As a preferred example, the ovarian region is corrected using the candidate ovarian edges selected again, including the following methods: The candidate ovarian edges selected again are recorded as the first edge; any difference between the first edge and the ovarian region contour is recorded as the second difference (the method for obtaining the first difference is the same as above). The first edge with the smallest second difference is merged into the ovarian region contour to obtain the first ovarian region; Calculate the second difference between the remaining first edge and the contour of the first ovarian region, and merge the first edge with the smallest second difference into the contour of the first ovarian region to obtain the second ovarian region.
[0085] The second difference between the remaining first edge and the second ovarian region contour is calculated again, and the first edge with the smallest second difference is merged into the second ovarian region contour to obtain the third ovarian region.
[0086] This process continues until all the first edges are integrated into the outline of the ovarian region, resulting in the corrected ovarian region.
[0087] As a preferred example, before correcting the ovarian region, edges with parallel relationships are removed from the re-selected ovarian candidate edges, and the remaining ovarian candidate edges are then designated as the first edge, specifically including: Obtain the center pixel of the ovarian region, and draw rays through each pixel on the contour of the ovarian region with the center pixel as the endpoint. For the ovarian candidate edges that are filtered again, if any two ovarian candidate edges are crossed by the same ray, then these two ovarian candidate edges are recorded as two suspected parallel edges. The ratio of the number of rays that cross the two suspected parallel edges to the total number of pixels of the longest edge of the two suspected parallel edges is recorded as the parallel index.
[0088] The higher the parallelism index, the more likely the two suspected parallel edges are to have a feature of being distributed side by side with the ovarian region contour. Suspected parallel edges with a parallelism index greater than a preset threshold (e.g., 0.1) are marked as parallel edges (i.e., ovarian candidate edges with a parallel relationship). This indicates two ovarian candidate edges that clearly have the feature of being distributed side by side with the ovarian region contour. Only the edge with the smallest difference from the ovarian region contour is retained among these two parallel edges, and the other edge is discarded.
[0089] The above method is used to remove some ovarian candidate edges that have parallel relationships, so that there are no parallel relationships between the remaining ovarian candidate edges. The remaining ovarian candidate edges are then recorded as the first edge.
[0090] As an example, the method for fusing the first edge with the smallest second difference into the ovarian region contour to obtain the first ovarian region includes: For the first edge with the smallest difference, the endpoints at both ends of the first edge are designated as the first endpoint and the second endpoint, respectively. The first edge is extended from the first endpoint and the second endpoint, respectively, to obtain the first extended segment and the second extended segment. In the T2WI image, the intersection points of the first extended segment and the second extended segment with the contour of the ovarian region are designated as the first intersection point and the second intersection point, respectively. The continuous edge formed by the first extended segment between the first intersection point and the first endpoint, the first edge between the first endpoint and the second endpoint, and the second extended segment between the second endpoint and the second intersection point is taken as the new contour of the ovarian region. The new contour replaces the old contour (i.e., the shortest contour between the first intersection point and the second intersection point), thereby obtaining the first ovarian region enclosed by the new contour.
[0091] Specifically, if the first edge intersects the ovarian region contour at two or more points, and the two points with the longest edge lengths among these points are greater than 50% of the first edge, these two points are considered the first and second intersections. The first edge between these two intersections is taken as the new contour of the ovarian region, replacing the old contour (i.e., the shortest contour between the first and second intersections).
[0092] As an example, extending the first edge starting from the first endpoint and the second endpoint respectively, to obtain the first extended segment and the second extended segment, includes the following methods: When using the edge detection algorithm to extract edges in the T1WI image after the third alignment, the parameters of the edge detection algorithm are adjusted. Among all the edges obtained under the adjusted parameters, the edge that completely contains the first edge is recorded as an extended edge. Among the extended edges, the extended segment starting from the first endpoint is recorded as the first extended segment, and the extended segment starting from the second endpoint is recorded as the second extended segment.
[0093] Specifically, when there are multiple extended edges of the first edge, the difference between each extended edge and the contour of the ovarian region is obtained, and only the extended edge with the smallest difference is retained.
[0094] Specifically, if the first extended segment or the second extended segment does not intersect with the ovarian region contour, then the pixel point on the ovarian region contour closest to the endpoint of the first extended segment or the second extended segment is taken as the intersection point, and the straight line segment formed by connecting the endpoint of the first extended segment or the second extended segment to this intersection point is also considered as part of the first extended segment or the second extended segment.
[0095] Specifically, if the length of the connected straight line segment is greater than the minimum distance between the first or second endpoint and the ovarian region contour, the extended edge is deleted, and the extended edge with the smallest difference is re-obtained. The first and second extended segments are then re-obtained according to this example. If there are no other extended edges after deleting the extended edge, then the first edge is deleted, meaning that the first edge is no longer involved in the correction of the ovarian region.
[0096] As an example, adjusting the parameters of the edge detection algorithm includes adjusting the high and low thresholds of the Canny edge detection algorithm to 106 and 37, respectively.
[0097] As a preferred example, the degree of premature ovarian failure is graded using modified ovarian regions.
[0098] The modified ovarian region was extracted from each T2WI image. The gray values of pixels outside the modified ovarian region in the T2WI image were set to 0 to obtain the ovarian ROI image. All ovarian ROI images in the T2WI image sequence were input into the grading model, and the grading model outputs the grading of premature aging.
[0099] In some examples, several columns of pixels with a gray value of 0 on the left and right sides of the ovarian ROI image, as well as several rows of pixels with a gray value of 0 on the top and bottom sides, are deleted, making the size of the ovarian ROI image 512×256.
[0100] As an example, the hierarchical model uses the ResNet50 network architecture. Its training method is as follows: For all historically acquired T2WI and T1WI image sequences, the method described in this embodiment is used to obtain all ovarian ROI images in each T2WI and T1WI image sequence, which are recorded as a sample. For all samples obtained from all T2WI and T1WI image sequences, a label is manually assigned to each sample. In this embodiment, there are ten label categories: Level 1, Level 2, ..., Level 10, where Level 1 represents the lowest degree of premature aging, and Level 10 represents the highest degree of premature aging. The category labels corresponding to all samples constitute a dataset, which is used to train a grading model.
[0101] As an example, during training, the test set to training set ratio is 3:7, the loss function used is cross-entropy loss, the optimizer is Adam, the batch size is 4, the learning rate is set to 0.02, and the maximum number of training iterations is set to 10. 5 Other training parameters may be used in other embodiments, but this example does not impose specific limitations. ResNet50 and its training methods are well known, and this embodiment will not elaborate on the specific process.
[0102] In another embodiment, after obtaining all valid key points, step S104 is not executed for the time being. Instead, all valid key points are treated as all key points in step S102, and steps S102 to S103 are executed again. In other examples, steps S102 to S103 can be executed several times (e.g., 3 times) before executing step S104 and its subsequent steps.
[0103] This process involves multiple screenings of valid key points, avoiding the problem that when only one screening of valid key points is performed, the second alignment may result in a large error in the matching of valid key points due to the large screening error of ovarian candidate edges. This embodiment ensures that valid key points after multiple screenings can be accurately matched, improving the accuracy of the third alignment based on valid key points in step S104, and thus indirectly ensuring the reliability of the ovarian region correction results.
[0104] It should be noted that when repeating steps S102 to S103 in this embodiment, during the clustering of all key point pairs, the number of clusters is set to a large value (so that the number of key point pairs in each category is reduced), for example, the number of clusters is set to one-fifth of the number of key point pairs (rounded up), so that the number of key points deleted each time is reduced.
[0105] In addition, in this embodiment, during the first execution of steps S102-S103, key points from T1WI images are deleted from the category with the largest average error index. During the second execution of steps S102-S103, key points from T2WI images are deleted from the category with the largest average error index. During the third execution of steps S102-S103, key points from T1WI images are deleted from the category with the largest average error index. During the fourth execution of steps S102-S103, key points from T2WI images are deleted from the category with the largest average error index. This process is repeated, alternately removing key points from T1WI and T2WI images.
[0106] Specifically, if more than 60% of the keypoints in a T1WI or T2WI image have been removed, then no more keypoints in the T1WI or T2WI image will be removed.
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for grading the severity of premature ovarian failure in IVF-ET patients based on MRI images, characterized in that, The method includes the following steps: During MRI scanning, T1WI and T2WI images were acquired, and the ovarian region was segmented in the T2WI image. All key points in the T1WI and T2WI images were matched, and the T1WI image was aligned to the T2WI image for the first time based on the matched key points. Based on the difference between the edge in the T1WI image after the first alignment and the contour of the ovarian region, candidate ovarian edges were selected from the edges in the T1WI image. The T1WI image was aligned to the T2WI image a second time based on the candidate edge of the ovary and the contour of the ovarian region; valid key points were selected based on the distance between the matched key points in the T1WI and T2WI images after the second alignment. All valid key points are re-matched, and the T1WI image is aligned to the T2WI image for the third time based on the matched valid key points. Ovarian candidate edges are selected again from the edges in the T1WI image after the third alignment. The ovarian region is corrected using the selected ovarian candidate edges, and the degree of premature ovarian failure is graded using the corrected ovarian region.
2. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 1, characterized in that, The process of filtering candidate ovarian edges from the T1WI image based on the difference between the edges in the first aligned T1WI image and the contour of the ovarian region includes the following specific steps: For all edges detected in the T1WI image after the first alignment, any one of these edges is designated as the target edge. The difference between the target edge and all other edges besides the target edge is calculated. Among the other edges besides the target edge, the edges with the smallest difference from the target edge are designated as control edges. The average difference between the target edge and the control edges is designated as the reference difference. The difference between the target edge and the ovarian region contour is designated as the first difference. The fit index of the target edge is calculated. The fit index is positively correlated with the reference difference and negatively correlated with the first difference. All edges are clustered based on the fit index of all edges to obtain all categories. The edges in the category with the largest average fit index are designated as ovarian candidate edges.
3. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 1, characterized in that, The specific steps involved in aligning the T1WI image to the T2WI image a second time based on the candidate ovarian edge and the ovarian region contour are as follows: Pixels on the ovarian region contour are matched with pixels on the candidate ovarian edges. For any pixel on the ovarian region contour, if the pixel corresponds to one or more matching pixels from all candidate ovarian edges, the pixel is designated as the reference pixel. The mean coordinates of all pixels that match the reference pixel are calculated. The pixel in the T1WI image with the closest Euclidean distance to the mean coordinates is designated as the final matching point of the reference pixel. The T1WI image is then aligned to the T2WI image for the second time based on all pixel pairs formed by all reference pixels and final matching points.
4. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 1, characterized in that, The specific steps for filtering valid keypoints based on the distance between the matched keypoints in the second aligned T1WI and T2WI images are as follows: For any pair of matching keypoints, the error index of any pair of keypoints is determined based on the distance between the keypoints in the T1WI and T2WI images after the second alignment. Cluster all keypoint pairs based on the error index to obtain all keypoint pair categories. Obtain the keypoint pair category with the largest average error index, delete the keypoints from the T1WI image within the keypoint pair category, and record all remaining keypoints from the T1WI and T2WI images as valid keypoints.
5. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 1, characterized in that, The specific steps involved in correcting the ovarian region using the re-selected ovarian candidate edges are as follows: The candidate ovarian edges selected again are recorded as the first edge; the difference between any first edge and the ovarian region contour is recorded as the second difference; the first edge with the smallest second difference is merged into the ovarian region contour to obtain the first ovarian region; the second difference between the remaining first edges and the first ovarian region contour is calculated, and the first edge with the smallest second difference is merged into the first ovarian region contour again to obtain the second ovarian region; and so on, until all first edges are merged into the ovarian region contour to obtain the corrected ovarian region.
6. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 5, characterized in that, The specific steps involved in fusing the first edge with the smallest difference into the ovarian region contour to obtain the first ovarian region are as follows: For the first edge with the smallest difference, the endpoints at both ends of the first edge are respectively designated as the first endpoint and the second endpoint. The first edge is extended from the first endpoint and the second endpoint respectively to obtain the first extended segment and the second extended segment respectively. In the T2WI image, the intersections of the first extended segment and the second extended segment with the contour of the ovarian region are recorded as the first intersection point and the second intersection point, respectively. The continuous edge formed by the first extended segment between the first intersection point and the first endpoint, the first edge between the first endpoint and the second endpoint, and the second extended segment between the second endpoint and the second intersection point is taken as the new contour of the ovarian region, thus obtaining the first ovarian region enclosed by the new contour.
7. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 6, characterized in that, The specific steps involved in extending the first edge, starting from the first endpoint and the second endpoint respectively, to obtain the first extended segment and the second extended segment are as follows: When using the edge detection algorithm to extract edges in the T1WI image after the third alignment, the parameters of the edge detection algorithm are adjusted. Among all the edges obtained under the adjusted parameters, the edge that completely contains the first edge is recorded as an extended edge. Among the extended edges, the extended segment starting from the first endpoint is recorded as the first extended segment, and the extended segment starting from the second endpoint is recorded as the second extended segment.
8. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 3, characterized in that, The specific steps involved in matching pixels on the contour of the ovarian region with pixels on the candidate edge of the ovarian region are as follows: Calculate the Euclidean distance from each pixel on each candidate ovarian edge to each pixel on the ovarian region contour; for each pixel on each candidate ovarian edge to each pixel on the ovarian region contour, use nearest neighbor search to find the matching pair with the smallest Euclidean distance; the two pixels in each matching pair represent matching pixels from each candidate ovarian edge and the ovarian region contour, respectively.
9. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 4, characterized in that, The method for determining the error index of any keypoint pair based on the distance between the keypoint pair in the T1WI and T2WI images after the second alignment includes the following specific steps: In the T1WI and T2WI images after the second alignment, for any pair of matching keypoints, the Euclidean distance between the coordinates of the keypoints from the T1WI image after the second alignment and the coordinates of the keypoints from the T2WI image is denoted as the first distance of any pair of keypoints. The Euclidean distance between the coordinates of keypoints from the T1WI image after the first alignment and the coordinates of keypoints from the T2WI image is denoted as the second distance of any pair of keypoints; the ratio of the first distance to the second distance is denoted as the error index of any pair of keypoints.
10. The method for grading the degree of premature ovarian failure in IVF-ET patients based on MRI images according to claim 1, characterized in that, The specific steps for obtaining the difference between the edge and the ovarian region contour in the T1WI image are as follows: The difference is defined as the Hausdorff distance between all pixels on any edge and all pixels on the ovarian region contour.