A method and system for tumor t-staging detection for rectal MRI images
Patent Information
- Application Number
- CN202411070334.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-08-06
AI Technical Summary
[0004]但由于直肠肿瘤形状多异、位置大小分布不均、边界复杂等因素,nnU-Net分割精度难以保证,得到的肿瘤分期精准性较低,无法进一步在T3、T4分期中确认患者属于哪一类
[0056] First, in the tumor T-staging detection method for rectal MRI images provided by this invention, based on rectal images and tumor images, an circumscribed ellipse is drawn on the rectal images, and the distance of the tumor beyond the rectal wall is calculated, which can further determine the tumor classification and improve the accuracy of tumor staging.
Smart Images

Figure CN118982526B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to a method and system for detecting tumor T-staging in rectal MRI images. Background Technology
[0002] Magnetic resonance imaging (MRI), a non-invasive brain tumor imaging technique, can produce high-resolution, non-destructive multimodal brain images, providing clinicians with comprehensive and accurate information for the diagnosis of brain tumors and is one of the important technical means for differentiating brain tumors. In the TNM staging system: T ("T" is the first letter of the English word "Tumor") refers to the condition of the primary tumor site. As the tumor volume increases and the extent of involvement of adjacent tissues increases, it is represented by T1 to T4. Depending on the different stages of the tumor, doctors will adopt different treatment methods. Treatment methods can be divided into non-surgical treatment and surgical treatment. Specifically, patients with T1 and T2 stages whose tumors have not extended beyond the rectal wall do not require surgery, while patients with T3 and T4 stages whose tumors have extended beyond the rectal wall require surgical intervention.
[0003] In the field of rectal tumor diagnosis, tumor staging is crucial. Current technologies typically improve data preprocessing. Building upon the traditional U-Net model, nnU-Net has been proposed. nnU-Net is an adaptive framework based on three models: 2DU-Net, 3DU-Net, and U-NetCascade. Users only need to input data, and nnU-Net can automatically adjust its structure according to the geometry of the rectal MRI image, achieving a fully automated segmentation process to determine the tumor stage. In existing technologies, after segmenting rectal MRI images, it is easy to see whether the tumor extends beyond the rectal wall, thus determining T1 / T2 and T3 / T4, assisting doctors in choosing different treatment methods.
[0004] However, due to the diverse shapes, uneven distribution of size and location, and complex boundaries of rectal tumors, the segmentation accuracy of nnU-Net is difficult to guarantee, resulting in low precision in tumor staging. This makes it impossible to further confirm the patient's category within the T3 and T4 stages. Therefore, it is necessary to improve the accuracy of tumor staging to assist clinicians in making pathological judgments. Summary of the Invention
[0005] The main objective of this invention is to provide a method and apparatus for detecting tumor T-staging on rectal MRI images, thereby overcoming the shortcomings of existing technologies. To achieve the aforementioned objective, the technical solution adopted by this invention includes:
[0006] The first aspect of this invention provides a method for detecting tumor T-staging on rectal MRI images, the specific steps of which include:
[0007] Acquire MRI images of the rectum to be examined;
[0008] Input the rectal MRI image to be detected into the pre-constructed segmentation model to obtain rectal image and tumor image;
[0009] Input the tumor image into a pre-built classification model to obtain the first T stage of the tumor;
[0010] Based on rectal and tumor images, an circumscribed ellipse is drawn on the rectal image to calculate the distance the tumor extends beyond the rectal wall;
[0011] The second T stage of the tumor is determined based on the distance the tumor extends beyond the rectal wall and the first T stage;
[0012] The second phase is more detailed than the first phase.
[0013] Further, the specific steps of inputting the rectal MRI image to be detected into the pre-constructed segmentation model to obtain the rectal image and tumor image include:
[0014] Define rectal labels and tumor labels;
[0015] Acquire MRI images of the rectum to be examined;
[0016] The rectal MRI image to be detected, rectal label, and tumor label are input into the nnU-Net segmentation model, which outputs rectal 3D prediction label and tumor 3D prediction label.
[0017] The 3D labels for rectum and tumor are divided into multiple sections, which are then input into the SAM segmentation model to obtain rectal and tumor images.
[0018] Furthermore, the step of inputting the rectal MRI image to be detected into the pre-constructed segmentation model to obtain the rectal image and tumor image also includes:
[0019] Multiple cross-sections of rectal 3D labels and tumor 3D labels are input into the ViT-H model, and cross-sections in which the tumor region accounts for no less than a preset ratio of the entire region are selected.
[0020] Input the cross section with a tumor region accounting for no less than a preset ratio into the SAM segmentation model to determine the smallest rectangle that can enclose the rectum or tumor.
[0021] Furthermore, the pre-built classification model is specifically constructed using the following steps:
[0022] Set up the original deep neural network and initialize its parameters;
[0023] Based on the initialization parameters, the Adam optimizer is used to input the training data into the original deep neural network and calculate the cross-entropy loss function BCE. Loss ;
[0024] The cross-entropy loss function BCE Loss By combining it with the original deep neural network, a classification model is obtained through training;
[0025] in, y represents the actual label, and y can take the value 0 or 1. For the model prediction results, The value range is 0-1.
[0026] Furthermore, before inputting the tumor image into the pre-built classification model, the method further includes:
[0027] Preset uniform values for tumor images;
[0028] Based on a uniform value, the size of the tumor image is preprocessed to make the size of the tumor image conform to the uniform value.
[0029] Further, the step of inputting the tumor image into a pre-built classification model to obtain the first T stage of the tumor includes the following specific steps:
[0030] Extract preliminary features from tumor images;
[0031] The preliminary features are sequentially input into the initial convolutional layer, multiple residual blocks, average pooling layer, and fully connected layer to output the first T stage of the tumor.
[0032] The residual block contains multiple residual units, each residual unit consists of multiple convolutional layers and a skip connection, and the number of convolutional layers contained in each residual unit increases incrementally.
[0033] Furthermore, the step of constructing an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, and calculating the distance the tumor extends beyond the rectal wall, specifically includes the following steps:
[0034] The rectal image and the tumor image are superimposed to obtain a merged image;
[0035] Extract multiple image slices from the merged image;
[0036] Based on the image cross-section, calculate the logical value of the tumor extending beyond the rectal wall on the image cross-section;
[0037] From multiple logical values indicating that the tumor extends beyond the rectal wall, select the logical value with the largest value indicating that the tumor extends beyond the rectal wall.
[0038] The distance the tumor extends beyond the rectal wall is calculated by multiplying the maximum logical value of the tumor extending beyond the rectal wall by the voxel spacing of the merged image.
[0039] Furthermore, the step of calculating the logical value of the tumor extending beyond the rectal wall on the image section based on the image section includes the following specific steps:
[0040] Construct a circumscribed ellipse for the first rectal region in the image slice;
[0041] Traverse the pixels of the tumor region in the image slice, and calculate the logical distance L from each pixel to the center of the ellipse.
[0042] Subtracting the distance from the center of the circle to the intersection point of the ellipse, we obtain a logical estimate ΔL for the distance the tumor extends beyond the rectum.
[0043] The maximum logical estimate is selected as the logical value for the tumor to extend beyond the rectal wall in the first section;
[0044]
[0045] Where (h, k) are the coordinates of the center of the ellipse, a is the major axis of the ellipse, b is the minor axis of the ellipse, (x, y) is any pixel outside the ellipse; θ1 is the angle of the major axis of the ellipse relative to the horizontal plane, and θ2 is the angle between the line connecting the center of the ellipse and the pixel (x, y) and the major axis of the ellipse.
[0046] Furthermore, the specific steps of constructing the circumscribed ellipse for the rectal region in the image section include:
[0047] In the image cross-section, identify the multiple connected components contained in the rectal region;
[0048] Connecting multiple connected components yields the second rectal region;
[0049] Draw an circumscribed ellipse over the second rectal region.
[0050] A second aspect of this invention provides a tumor T-staging detection system for rectal MRI images, comprising:
[0051] The acquisition module is used to acquire the MRI image of the rectum to be detected;
[0052] The segmentation module is used to input the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal images and tumor images;
[0053] The first classification module is used to input the tumor image into a pre-constructed classification model to obtain the first T stage of the tumor;
[0054] The second classification module is used to construct an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, calculate the distance the tumor extends beyond the rectal wall, and determine the second T stage of the tumor based on the distance the tumor extends beyond the rectal wall and the first T stage.
[0055] Compared with the prior art, the advantages of the present invention include at least the following:
[0056] First, in the tumor T-staging detection method for rectal MRI images provided by this invention, based on rectal images and tumor images, an circumscribed ellipse is drawn on the rectal images, and the distance of the tumor beyond the rectal wall is calculated, which can further determine the tumor classification and improve the accuracy of tumor staging.
[0057] Secondly, in the tumor T-staging detection method for rectal MRI images provided by this invention, the SAM segmentation model is combined with the nnU-Net segmentation framework, which can make the rectal region and tumor region in the rectal MRI image more finely segmented and improve the segmentation performance.
[0058] Third, in the tumor T-staging detection method for rectal MRI images provided by this invention, the ViT-H model is used to select a section with the tumor region accounting for no less than 35% of the entire region and input it into the SAM segmentation model. While ensuring segmentation accuracy, this reduces some processing steps for sections without concern and improves segmentation efficiency.
[0059] Fourth, in the tumor T-staging detection method for rectal MRI images provided by the present invention, by pre-setting a uniform value for the tumor image, the size of the tumor image is preprocessed, and tumor image data of different sizes are converted into a uniform size. This can reduce the time and effort spent by the classification model on dealing with the problem of inconsistent tumor image sizes and improve classification efficiency.
[0060] Fifth, in the tumor T-staging detection method for rectal MRI images provided by this invention, the classification model includes multiple residual blocks, each containing multiple residual units. Each residual unit consists of multiple convolutional layers and a skip connection, with the number of convolutional layers in each residual unit increasing progressively. By introducing residual units, problems such as vanishing and exploding gradients can be solved when training deeper neural networks, making it easier to train deep networks with more layers, and with fewer parameters and lower complexity compared to previous classification models.
[0061] Sixth, in the tumor T-staging detection method for rectal MRI images provided by this invention, based on multiple image sections, the maximum logical value of the tumor extending beyond the rectal wall is selected from multiple logical values of the tumor extending beyond the rectal wall to calculate the distance of the tumor extending beyond the rectal wall. This can avoid the problem of uniformity and obtain a more accurate distance of the tumor extending beyond the rectal wall, making the classification more precise.
[0062] Seventh, in the tumor T-staging detection method for rectal MRI images provided by this invention, multiple connected regions in the rectal region are connected to form a connected region, and then an circumscribed ellipse is drawn. When the tumor covers most of the rectum, it is not necessary to draw an circumscribed ellipse for each connected region, thus avoiding errors and making the calculation of the distance of the tumor beyond the rectal wall more accurate. This can further determine the tumor classification and improve the accuracy of tumor staging. Attached Figure Description
[0063] Figure 1 This is a flowchart of a tumor T-staging detection method for rectal MRI images provided in an embodiment of the present invention;
[0064] Figure 2 This is a schematic diagram of an circumscribed ellipse over the rectal region provided in an embodiment of the present invention;
[0065] Figure 3 This is a flowchart of a tumor T-staging detection method for rectal MRI images provided in another embodiment of the present invention;
[0066] Figure 4 This is a schematic diagram of the tumor region of the Gt-mask provided in an embodiment of the present invention;
[0067] Figure 5 This is a schematic diagram of the tumor region after processing by the nnU-Net segmentation model provided in this embodiment of the invention;
[0068] Figure 6 This is a schematic diagram of the tumor region after processing by the SAM segmentation model provided in this embodiment of the invention;
[0069] Figure 7 This is a schematic diagram of the tumor region of the Gt-mask provided in another embodiment of the present invention;
[0070] Figure 8 This is a schematic diagram of the tumor region after processing by the nnU-Net segmentation model provided in another embodiment of the present invention;
[0071] Figure 9 This is a schematic diagram of the tumor region after processing by the SAM segmentation model provided in another embodiment of the present invention;
[0072] Figure 10 This is a schematic diagram of the rectal region of the Gt-mask provided in an embodiment of the present invention;
[0073] Figure 11 This is a schematic diagram of the rectal region after processing by the nnU-Net segmentation model provided in this embodiment of the invention;
[0074] Figure 12 This is a schematic diagram of the rectal region after processing by the SAM segmentation model provided in this embodiment of the invention;
[0075] Figure 13 This is a schematic diagram of the rectal region of a Gt-mask provided in another embodiment of the present invention;
[0076] Figure 14 This is a schematic diagram of the rectal region after processing by the nnU-Net segmentation model provided in another embodiment of the present invention;
[0077] Figure 15 This is a schematic diagram of the rectal region after processing by the SAM segmentation model according to another embodiment of the present invention;
[0078] Figure 16 This is a schematic diagram of multiple connected domains circumscribed as an ellipse over the rectal region according to an embodiment of the present invention;
[0079] Figure 17 This is a schematic diagram of an ectomized ellipse around the rectum provided in an embodiment of the present invention;
[0080] Figure 18 This is a schematic diagram of an externally inscribed ellipse of the rectum provided in another embodiment of the present invention;
[0081] Figure 19 This is a schematic diagram of a tumor T-staging detection device for rectal MRI images provided in an embodiment of the present invention.
[0082] Explanation of reference numerals in the attached figures:
[0083] 100. A device for detecting tumor T-staging in rectal MRI images;
[0084] 11. Acquisition module; 12. Segmentation module; 13. First classification module; 14. Second classification module. Detailed Implementation
[0085] In view of the shortcomings of the prior art, the inventors of this invention, through long-term research and extensive practice, have proposed the technical solution of this invention. The following will further explain and illustrate this technical solution, its implementation process, and its principles.
[0086] Example 1
[0087] Please refer to Figure 1To address the technical problem of low accuracy in tumor staging, this application provides a method for detecting tumor T-staging on rectal MRI images, the specific steps of which include:
[0088] S101: Acquire the MRI image of the rectum to be examined.
[0089] Magnetic Resonance Imaging (MRI), also known as Nuclear Magnetic Resonance Imaging (NMRI) or spin imaging, utilizes the nuclear magnetic resonance phenomenon of certain atomic nuclei in human tissues. The resulting radio frequency signals are processed by a computer to reconstruct an image of a specific layer of the human body.
[0090] In this application, a human body can be placed in a special magnetic field, and radio frequency pulses can be used to excite the hydrogen nuclei within the body, causing the hydrogen nuclei to resonate and absorb energy. After the radio frequency pulses are stopped, the hydrogen nuclei emit radio signals at a specific frequency and release the absorbed energy, which is recorded by an external receiver and processed by a computer to obtain a rectal MRI image.
[0091] S102: Input the rectal MRI image to be detected into the pre-constructed segmentation model to obtain rectal image and tumor image.
[0092] Understandably, the pre-built segmentation model here can be the nnU-Net (No New-Net Unet) segmentation model. The nnU-Net segmentation model is an open-source framework for medical image segmentation. It is based on deep learning techniques, particularly neural networks, to solve medical image segmentation problems. Specifically, nnU-Net is a deep learning framework for biomedical image segmentation that aims to provide an automated and portable method for processing different datasets without requiring manual adjustments to the network structure or training strategy. nnU-Net can automatically configure preprocessing steps, network architecture, training strategies, etc., reducing the need for manual parameter tuning. It determines the optimal configuration by extracting "fingerprints" from the training dataset—a set of parameters describing the characteristics of the data. nnU-Net is based on the classic U-Net architecture but does not introduce new network structures. It improves segmentation performance by using a series of techniques, such as multi-resolution training and data augmentation.
[0093] In a more specific implementation, the step of inputting the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal images and tumor images includes the following steps:
[0094] The rectum and tumors were segmented using nnU-net, and the specific steps included:
[0095] Define rectal labels and tumor labels;
[0096] Acquire MRI images of the rectum to be examined;
[0097] The rectal MRI image to be detected, the rectal label, and the tumor label are input into the nnU-Net segmentation model to obtain the rectal image and the tumor image.
[0098] S103: Input the tumor image into the pre-built classification model to obtain the first T stage of the tumor.
[0099] Understandably, the pre-built classification model here can be a 3D ResNet deep neural network model.
[0100] S104: Based on rectal and tumor images, construct an circumscribed ellipse on the rectal image and calculate the distance the tumor extends beyond the rectal wall.
[0101] Please refer to Figure 2 The gray area represents the rectal region, and the white area represents the tumor region. Figure 2 In (a), the green ellipse is the circumscribed ellipse of the first rectal region. Figure 2 (b) Figure 2 (a) Zoom in further, the red line represents the furthest tumor region beyond the first rectum.
[0102] In a more specific implementation, the step of constructing an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, and calculating the distance the tumor extends beyond the rectal wall, includes the following specific steps:
[0103] The rectal image and the tumor image are superimposed to obtain a merged image;
[0104] Extract multiple image slices from the merged image;
[0105] Construct a circumscribed ellipse for the first rectal region in the image slice;
[0106] Traverse the pixels of the tumor region in the image slice, and calculate the logical distance L from each pixel to the center of the ellipse.
[0107] Subtracting the distance from the center of the circle to the intersection point of the ellipse, we obtain a logical estimate ΔL for the distance the tumor extends beyond the rectum.
[0108] The maximum logical estimate is selected as the logical value for the tumor to extend beyond the rectal wall in the first section;
[0109] From multiple logical values indicating that the tumor extends beyond the rectal wall, select the logical value with the largest value indicating that the tumor extends beyond the rectal wall.
[0110] The distance the tumor extends beyond the rectal wall is calculated by multiplying the maximum logical value of the tumor extending beyond the rectal wall by the voxel spacing of the merged image.
[0111] The formula is as follows:
[0112]
[0113] Where (h, k) are the coordinates of the center of the ellipse, a is the major axis of the ellipse, b is the minor axis of the ellipse, (x, y) is any pixel outside the ellipse; θ1 is the angle of the major axis of the ellipse relative to the horizontal plane, and θ2 is the angle between the line connecting the center of the ellipse and the pixel (x, y) and the major axis of the ellipse.
[0114] It is understandable that the voxel spacing is a common parameter in medical imaging, which means the straight-line distance between two adjacent voxels (i.e., two points) in the image, converted into the distance in millimeters in reality.
[0115] In this embodiment 1, there are three directions in the 3D volume calculation, so the voxel spacing is 3. For example, if an MRI dataset is (100*100*100) in size, and its voxel spacing is (2, 0.5, 0.5), then each direction can represent an actual size of (100*2, 100*0.5, 100*0.5) millimeters. As another example, if an MRI dataset is (256, 256, 64) in size, and its voxel spacing is (1.1, 1.1, 3), then it actually represents a block of (281.6mm, 281.6mm, 192mm). In actual operation, if the voxel spacing is uncertain, it can be set to (1.0, 1.0, 1.0).
[0116] S500: Determine the second T stage of the tumor based on the distance the tumor extends beyond the rectal wall and the first T stage.
[0117] It is understandable that the first T staging includes surgical treatment staging and non-surgical treatment staging. Surgical treatment staging includes T3 and T4 stages, while non-surgical treatment staging includes T1 and T2 stages. Therefore, the first T staging can only provide a binary classification, determining whether surgical treatment is necessary, but it is difficult to determine which stages are included within surgical treatment and how different degrees of surgery should be performed. Therefore, this application, by combining the distance the tumor extends beyond the rectal wall with the first T staging, can further confirm the specific stage within the T3 and T4 stages, further determining the tumor classification and improving the accuracy of tumor staging.
[0118] Example 2
[0119] Please refer to Figure 3 To address the technical problem of low accuracy in tumor staging, this application provides a method for detecting tumor T-staging on rectal MRI images, the specific steps of which include:
[0120] S201: Construct a segmentation model.
[0121] Due to the diverse shapes, uneven distribution of location and size, and complex boundaries of rectal tumors, the segmentation accuracy of the nnU-Net segmentation model is difficult to guarantee, resulting in low accuracy in tumor staging and making it impossible to further segment at the T stage.
[0122] As is understandable, SAM (Segment Anything Model) is an image segmentation model designed to accurately segment various objects in an image. Unlike traditional image segmentation models, SAM is designed to handle multiple types of objects, not just specific categories or objects. It employs deep learning techniques, such as convolutional neural networks, to learn the features and boundaries of various objects in an image, thereby achieving accurate segmentation. SAM aims to provide a general and flexible image segmentation method applicable to various application scenarios. Therefore, the segmentation model used in this application is based on the nnU-Net segmentation model and the SAM segmentation model.
[0123] S202: Construct a classification model.
[0124] Understandably, the classification model here can be a 3D ResNet50 deep neural network model.
[0125] The specific construction steps of the 3D ResNet50 deep neural network model include:
[0126] Set up the original deep neural network and its initialization parameters; the initialization parameters include the number of epochs, the batch size, the initial learning rate, and the decay rate of the number of epochs.
[0127] Based on the number of epochs, batch size, initial learning rate, and decay rate of the number of epochs, the Adam optimizer is used to input the training data into the original deep neural network and calculate the cross-entropy loss function BCE. L oss;
[0128] The cross-entropy loss function BCE Loss By combining it with the original deep neural network, a classification model is obtained through training;
[0129] in, y represents the actual label, and y can take the value 0 or 1. For the model prediction results, The value range is 0-1.
[0130] Adam (Adaptive Moment Estimation) is a deep learning optimization algorithm. It aims to adjust the learning rate of each parameter by calculating the first and second moment estimates of the gradient, thereby achieving more efficient neural network training.
[0131] Preferably, in a specific embodiment, the number of epochs can be set to 200, the batch size to 4, the initial learning rate to 0.001, and the number of epochs decaying at an exponential rate of 0.99.
[0132] S203: Acquire the MRI image of the rectum to be examined.
[0133] The human body is placed in a special magnetic field, and radio frequency pulses are used to excite the hydrogen nuclei within the body, causing them to resonate and absorb energy. After the radio frequency pulses stop, the hydrogen nuclei emit radio signals at a specific frequency and release the absorbed energy, which is recorded by an external receiver and processed by a computer to obtain rectal MRI images.
[0134] S204: Input the rectal MRI image to be detected into the pre-constructed segmentation model to obtain rectal image and tumor image.
[0135] The process of inputting the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal and tumor images includes the following steps:
[0136] Define rectal labels and tumor labels;
[0137] Acquire MRI images of the rectum to be examined;
[0138] The rectal MRI image to be detected, rectal label, and tumor label are input into the nnU-Net segmentation model, which outputs rectal 3D prediction label and tumor 3D prediction label.
[0139] The rectal 3D label and tumor 3D label are divided into multiple sections;
[0140] Multiple cross-sections of rectal 3D labels and tumor 3D labels are input into the ViT-H model, and cross-sections in which the tumor region accounts for no less than 35% of the entire region are selected.
[0141] Input a section with the tumor region accounting for no less than 35% of the entire region into the SAM segmentation model to determine the smallest rectangle that can enclose the rectum or tumor.
[0142] The rectal image and tumor image are determined based on the smallest rectangle that can enclose the rectum or tumor.
[0143] Preferably, the preset ratio here is 35%.
[0144] It is understandable that the ViT (Vision Transformer) model is a visual processing model based on the Transformer architecture. Traditional computer vision tasks typically use convolutional neural networks to extract image features. ViT aims to apply the Transformer model to computer vision tasks, capturing long-range dependencies in images through a global attention mechanism. Depending on the scale and complexity, this application may choose the ViT-H model. The ViT-H model is generally suitable for processing high-resolution images or more challenging visual tasks, and can handle high-resolution images. It should be noted that the parameters in the ViT-H model can use existing pre-trained weights or be trained independently; no limitation is made here.
[0145] Using the SAM segmentation model can improve segmentation performance. Specific segmentation results can be found in Table 1.
[0146] Table 1. SAM Improvement Results for nnU-net Classification
[0147]
[0148] In this application, based on the nnU-Net segmentation model, the SAM segmentation model is combined to enable more precise segmentation of the rectal region and tumor region in rectal MRI images, thereby improving segmentation performance.
[0149] Please refer to Figures 4-6 This is a schematic diagram of the tumor area for medical record number 11930942.
[0150] As can be seen, four different cross-sections were selected. Figure 4 The four images a, b, c, and d correspond one-to-one with the four cross-sections, representing schematic diagrams of the tumor region after Gt-mask. Gt-mask (Ground truth mask) represents data annotated by the doctor and can be used as the gold standard for comparison with the output segmentation results. Figure 5 The four figures a, b, c, and d correspond one-to-one with the four cross-sections, representing schematic diagrams of the tumor region after processing by the nnU-Net segmentation model. The green area represents the tumor region, and the red area represents the rectal region. Figure 6 The four figures a, b, c, and d correspond one-to-one with the four cross-sections, representing schematic diagrams of the tumor region after processing by the SAM segmentation model. The green box represents the smallest rectangle that can enclose the tumor in the SAM segmentation model, and the blue area represents the tumor predicted by the SAM segmentation model.
[0151] Overall, the tumor region value of medical record number 11930942 increased from 0.4378021955 to 0.5834528803, indicating more refined tumor region segmentation and improved segmentation performance.
[0152] Please refer to Figures 7-9 This is a schematic diagram of the tumor area in medical record number 11913105.
[0153] Similarly, four different cross-sections were selected.
[0154] Figure 7 The four figures a, b, c, and d correspond one-to-one with the four cross-sections, representing schematic diagrams of the tumor region after Gt-mask. Figure 8 The four figures a, b, c, and d correspond one-to-one with the four cross-sections, representing schematic diagrams of the tumor region after processing by the nnU-Net segmentation model. The green area represents the tumor region, and the red area represents the rectal region. Figure 9 The four figures a, b, c, and d correspond one-to-one with the four cross-sections, representing schematic diagrams of the tumor region after processing by the SAM segmentation model. The green box represents the smallest rectangle that can enclose the tumor in the SAM segmentation model, and the blue area represents the tumor predicted by the SAM segmentation model.
[0155] Overall, the tumor region value of medical record number 11913105 increased from 0.5738452672 to 0.9125891923, indicating more refined tumor region segmentation and improved segmentation performance.
[0156] Please refer to Figures 10-12 This is a visual diagram of the rectal region for medical record number 11865637.
[0157] Specifically, five different cross-sections were selected.
[0158] Figure 10 The five figures a, b, c, d, and e correspond one-to-one with the five cross-sections, representing a schematic diagram of the rectal region after the Gt-mask. Figure 11 The five figures a, b, c, d, and e correspond one-to-one with the five cross-sections, representing schematic diagrams of the rectal region after processing by the nnU-Net segmentation model. The green area represents the tumor region, and the red area represents the rectal region. Figure 12 The five figures a, b, c, d, and e correspond one-to-one with the five cross-sections, representing schematic diagrams of the rectal region after processing by the SAM segmentation model. The green box represents the smallest rectangle that can enclose the rectum in the SAM segmentation model, and the blue area represents the rectum predicted after processing by the SAM segmentation model.
[0159] Overall, the value of the rectal region in case number 11865637 increased from 0.6548374891 to 0.7498301267, indicating more refined segmentation of the tumor region and improved segmentation performance.
[0160] Please refer to Figures 13-15 This is a schematic diagram of the rectal region in medical record number 11863481. It can be seen that five different cross-sections were used.
[0161] Figure 13 The five figures a, b, c, d, and e correspond one-to-one with the five cross-sections, representing a schematic diagram of the rectal region after the Gt-mask. Figure 14 The five figures a, b, c, d, and e correspond one-to-one with the five cross-sections, representing schematic diagrams of the rectal region after processing by the nnU-Net segmentation model. The green area represents the tumor region, and the red area represents the rectal region. Figure 15 The five figures a, b, c, d, and e correspond one-to-one with the five cross-sections, representing schematic diagrams of the rectal region after processing by the SAM segmentation model. The green box represents the smallest rectangle that can enclose the rectum in the SAM segmentation model, and the blue area represents the rectum predicted after processing by the SAM segmentation model.
[0162] Overall, the value of the rectal region in case number 11863481 increased from 0.3561675250 to 0.7422395348, indicating more refined segmentation of the tumor region and improved segmentation performance.
[0163] In a more specific implementation, before inputting the tumor image into the pre-built classification model, the method further includes:
[0164] Preset uniform values for tumor images;
[0165] Based on a uniform value, the size of the tumor image is preprocessed to make the size of the tumor image conform to the uniform value.
[0166] The uniform value of the tumor image is set to (18, 256, 256). Here, the three-dimensional array represents the size of the training data, that is, the size of the input network data.
[0167] In this scheme, by pre-setting a uniform value for tumor images, the size of tumor images is preprocessed, and tumor image data of different sizes are transformed into a uniform size. This can reduce the time and effort spent by the classification model on dealing with the problem of inconsistent tumor image sizes, and improve classification efficiency.
[0168] S205: Input the tumor image into the pre-built classification model to obtain the first T stage of the tumor.
[0169] In a more specific implementation, the step of inputting the tumor image into a pre-constructed 3DResNet50 deep neural network model to obtain the first T stage of the tumor includes:
[0170] Extract preliminary features from tumor images;
[0171] The preliminary features are sequentially input into the initial convolutional layer, multiple residual blocks, average pooling layer, and fully connected layer to output the first T stage of the tumor.
[0172] The residual block contains multiple residual units, each residual unit consists of multiple convolutional layers and a skip connection, and the number of convolutional layers contained in each residual unit increases incrementally.
[0173] Preferably, the first residual block contains 3 residual units; the second residual block contains 4 residual units; the third residual block contains 6 residual units; and the fourth residual block contains 3 residual units. In this scheme, by introducing residual units, problems such as vanishing and exploding gradients can be solved when training deeper neural networks. This makes it easier to train deep networks with more layers, and the model has fewer parameters and lower complexity compared to previous classification models.
[0174] Specifically, the extracted tumor image data size is (18, 256, 256), the batch size is 4, and it is input into the 3D ResNet50 deep neural network model. At this time, the data is 4*1*18*256*256.
[0175] Input 4*1*18*256*256 into the initial convolutional layer, and output 4*64*18*256*256.
[0176] Input 4*64*18*256*256 into the first layer residual block, and output 4*256*18*256*256.
[0177] Input 4*64*18*256*256 into the second layer residual block, and output 4*512*9*128*128.
[0178] Input 4*512*9*128*128 into the third layer residual block, and output 4*1024*4*64*64.
[0179] Inputting 4*1024*4*64*64 into the fourth layer residual block will output 4*2048*2*32*32.
[0180] Inputting 4*2048*2*32*32 into the average pooling layer will output 4*2048*1*1*1.
[0181] Inputting 4*2048*1*1*1 into a fully connected layer will output 4*2.
[0182] Based on the output of 4*2, determine the first T stage of the tumor.
[0183] S206: Based on rectal and tumor images, construct an circumscribed ellipse on the rectal image and calculate the distance the tumor extends beyond the rectal wall.
[0184] In a more specific implementation, the step of constructing an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, and calculating the distance the tumor extends beyond the rectal wall, includes the following specific steps:
[0185] The rectal image and the tumor image are superimposed to obtain a merged image;
[0186] Extract multiple image slices from the merged image;
[0187] Based on the image cross-section, calculate the logical value of the tumor extending beyond the rectal wall on the image cross-section;
[0188] From multiple logical values indicating that the tumor extends beyond the rectal wall, select the logical value with the largest value indicating that the tumor extends beyond the rectal wall.
[0189] The distance the tumor extends beyond the rectal wall is calculated by multiplying the maximum logical value of the tumor extending beyond the rectal wall by the voxel spacing of the merged image.
[0190] In practice, a tumor may cover most of the rectal area, causing the rectal region to be divided into multiple connected regions. Following the previous approach, a circumscribed ellipse would be created for each connected region, leading to errors.
[0191] Please refer to Figure 16 The gray area represents the rectal region, and the white area represents the tumor region. Figure 16 In (a), the red boxes represent multiple connected regions of the rectal region. Figure 16 In (b), the green ellipse is the circumscribed ellipse of the second rectal region.
[0192] In a more specific implementation, the step of calculating the logical value of the tumor extending beyond the rectal wall on the image section based on the image section includes:
[0193] In the image cross-section, identify the multiple connected components contained in the rectal region;
[0194] Connecting multiple connected components yields the second rectal region;
[0195] Draw an circumscribed ellipse over the second rectal region;
[0196] Traverse the pixels of the tumor region in the image slice, and calculate the logical distance L from each pixel to the center of the ellipse.
[0197] Subtracting the distance from the center of the circle to the intersection point of the ellipse, we obtain a logical estimate ΔL for the distance the tumor extends beyond the rectum.
[0198] The maximum logical estimate is selected as the logical value for the tumor to extend beyond the rectal wall in the first section;
[0199]
[0200] Where (h, k) are the coordinates of the center of the ellipse, a is the major axis of the ellipse, b is the minor axis of the ellipse, (x, y) is any pixel outside the ellipse; θ1 is the angle of the major axis of the ellipse relative to the horizontal plane, and θ2 is the angle between the line connecting the center of the ellipse and the pixel (x, y) and the major axis of the ellipse.
[0201] In this scheme, multiple connected regions in the rectal area are connected to form a single connected region, and then an circumscribed ellipse is constructed. When the tumor covers most of the rectum, it is not necessary to construct an circumscribed ellipse for each connected region, thus avoiding errors and making the calculation of the distance of the tumor beyond the rectal wall more accurate. This can further determine the tumor classification and improve the accuracy of tumor staging.
[0202] Please refer to Figure 17 The result is a visualization of the circumscribed ellipse of the rectal region for patient number 11285145.
[0203] Figure 17 (a) is a schematic diagram of the circumscribed ellipse of the rectal region after the nnU-Net segmentation model. Figure 17 (b) is a schematic diagram of the circumscribed ellipse of the rectal region after the SAM segmentation model. Figure 17 (c) is a schematic diagram of the section where the tumor extends the greatest extent visually. The gray area represents the rectal region, and the white area represents the tumor region. The green ellipse is the circumscribed ellipse over the rectal region. Here, Gt (Ground truth) is the labeled 3D data provided by the doctor. Using this labeled 3D data, personnel visually identify the section where the tumor extends the greatest extent beyond the rectal boundary.
[0204] Similarly, Figure 18 The result is a visualization of the circumscribed ellipse of the rectal region for patient number 11635831.
[0205] Figure 18 (a) is a schematic diagram of the circumscribed ellipse of the rectal region after the nnU-Net segmentation model. Figure 18 (b) is a schematic diagram of the circumscribed ellipse of the rectal region after the SAM segmentation model. Figure 18(c) is a schematic diagram of the section where Gt is visually estimated to exceed the maximum. The gray area represents the rectal region, and the white area represents the tumor region. The green ellipse is the circumscribed ellipse over the rectal region.
[0206] Both visualization results show that the tumor region obtained based on the nnU-Net segmentation model is smaller than that obtained based on the SAM segmentation model. In other words, the tumor region obtained based on the SAM segmentation model is more accurate, as it segments the previously unsegmented tumor region, making the results obtained in this embodiment more accurate and thus improving the accuracy of subsequent classification.
[0207] S207: Determine the second T stage of the tumor based on the distance the tumor extends beyond the rectal wall and the first T stage.
[0208] Understandably, the first T staging system includes surgical treatment staging and non-surgical treatment staging. Surgical treatment staging includes T3 and T4 stages, while non-surgical treatment staging includes T1 and T2 stages. Therefore, the first T staging system can only provide a binary classification, determining whether surgical treatment is necessary. It is difficult to determine which stages are included within surgical treatment and how different degrees of surgery should be performed.
[0209] Therefore, by combining the distance the tumor extends beyond the rectal wall with the first T stage, this application can further confirm the specific stage in the T3 and T4 stages, further determine the tumor classification, and improve the accuracy of tumor staging.
[0210] In this embodiment, multiple rectal MRI images were segmented and graded. Please refer to Table 2 for the specific tumor T staging results.
[0211] Table 2 shows the predicted distance of tumors beyond the rectum.
[0212] accuracy 2 / 10 6 / 10 003:11352231 T3c (5-15mm) 1.609mm(T3b)× 4.133mm(T3b)× 006:11285145 T3c (5-15mm) 2.433mm(T3b)× 5.328mm (T3c)√ 008:10549286 T3c (5-15mm) 1.203mm(T3b)× 11.87mm (T3c)√ 017:11415462 T3c (5-15mm) 0.264mm(T3a)× 3.026mm(T3b)× 024:10859412 T3c (5-15mm) 51.22mm(T3d)× 60.76mm(T3d)× 043:11295543 T3c (5-15mm) 2.371mm(T3b)× 11.56mm (T3c)√ 049:10184146 T3b (1-5mm) 3.622mm(T3b)√ 25.56mm(T3d)× 052:11212150 T3b (1-5mm) 2.708mm(T3b)√ 3.116mm(T3b)√ 056:11635831 T3c (5-15mm) 1.886mm(T3b)× 12.36mm (T3c)√ 058:11622354 T3c (5-15mm) 4.455mm(T3b)× 7.161mm (T3c)√
[0213] In Table 2, the leftmost column (first column) contains the medical record number and its sequence number in the sample data. The second column shows the Gt grading, which is the correct grading given by the doctor. The third column shows the tumor T stage obtained after nnU-Net segmentation. The fourth column shows the tumor T stage obtained after SAM segmentation. In the second row, the accuracy rate of nnU-Net segmentation followed by re-grading is 2 / 10, and the accuracy rate of combining nnU-Net segmentation with SAM segmentation followed by re-grading is 6 / 10.
[0214] Understandably, in Table 2, "√" indicates correct grading, and "×" indicates incorrect grading. Therefore, it can be intuitively concluded that, based on the nnU-Net segmentation framework and combined with the SAM segmentation model, the rectal region and tumor region in rectal MRI images can be segmented more precisely and with higher accuracy.
[0215] In summary, this application utilizes the nnU-Net segmentation model to segment the rectum and tumor from MRI data (3D). Then, the segmentation results (3D) for each patient obtained from the nnU-Net model are divided into several sections, which are then input into the SAM segmentation model to improve the segmentation results. Using the sections improved by the SAM segmentation model, circumscribed ellipses are constructed outside the rectum for each patient group. The distance from the tumor pixel to the boundary of the circumscribed ellipse is calculated, and the maximum value is taken as the distance the tumor extends beyond the rectal wall in the current section. This calculation is performed for each section of the patient, obtaining a maximum value as an estimate of the distance the tumor extends beyond the rectal wall for that patient. Finally, the patient's tumor T-staging is obtained.
[0216] Please refer to Figure 19 The present invention also provides a tumor T-staging detection system 100 for rectal MRI images, specifically comprising:
[0217] Acquisition module 11 is used to acquire the rectal MRI image to be detected;
[0218] The segmentation module 12 is used to input the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal images and tumor images;
[0219] The first classification module 13 is used to input the tumor image into a pre-constructed classification model to obtain the first T stage of the tumor;
[0220] The second classification module 14 is used to construct an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, calculate the distance of the tumor beyond the rectal wall, and also to determine the second T stage of the tumor based on the distance of the tumor beyond the rectal wall and the first T stage.
[0221] In a more specific implementation, the segmentation module 12 is used to input the rectal MRI image to be detected into a pre-constructed segmentation model to obtain a rectal image and a tumor image, including:
[0222] Define rectal labels and tumor labels;
[0223] Acquire MRI images of the rectum to be examined;
[0224] The rectal MRI image to be detected, rectal label, and tumor label are input into the nnU-Net segmentation model, which outputs rectal 3D prediction label and tumor 3D prediction label.
[0225] The 3D labels for rectum and tumor are divided into multiple sections, which are then input into the SAM segmentation model to obtain rectal and tumor images.
[0226] In a more specific implementation, the step of inputting the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal images and tumor images further includes:
[0227] Multiple cross-sections of rectal 3D labels and tumor 3D labels are input into the ViT-H model, and cross-sections in which the tumor region accounts for no less than a preset ratio of the entire region are selected.
[0228] Input the cross section with a tumor region accounting for no less than a preset ratio into the SAM segmentation model to determine the smallest rectangle that can enclose the rectum or tumor.
[0229] In a more specific implementation scheme, the pre-built classification model is constructed using the following steps:
[0230] Define the original deep neural network;
[0231] Set the number of epochs, batch size, initial learning rate, and decay rate of the number of epochs;
[0232] Based on the number of epochs, batch size, initial learning rate, and decay rate of the number of epochs, the Adam optimizer is used to input the training data into the original deep neural network and calculate the cross-entropy loss function BCE. L . ss;
[0233] The cross-entropy loss function BCE L OSS is combined with the original deep neural network to train a classification model;
[0234] in, y represents the actual label, and y can take the value 0 or 1. For the model prediction results, The value range is 0-1.
[0235] In a more specific implementation, before inputting the tumor image into the pre-built classification model, the method further includes:
[0236] Preset uniform values for tumor images;
[0237] Based on a uniform value, the size of the tumor image is preprocessed to make the size of the tumor image conform to the uniform value;
[0238] The uniform values for the tumor images were set to (18, 256, 256).
[0239] In a more specific implementation, the first classification module 13 is used to input the tumor image into a pre-constructed classification model to obtain the first T stage of the tumor, including:
[0240] Extract preliminary features from tumor images;
[0241] The preliminary features are sequentially input into the initial convolutional layer, multiple residual blocks, average pooling layer, and fully connected layer to output the first T stage of the tumor.
[0242] The residual block contains multiple residual units, each residual unit consists of multiple convolutional layers and a skip connection, and the number of convolutional layers contained in each residual unit increases incrementally.
[0243] In a more specific implementation, the second classification module 14 is used to construct an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, and to calculate the distance the tumor extends beyond the rectal wall, including:
[0244] The rectal image and the tumor image are superimposed to obtain a merged image;
[0245] Extract multiple image slices from the merged image;
[0246] Based on the image cross-section, calculate the logical value of the tumor extending beyond the rectal wall on the image cross-section;
[0247] From multiple logical values indicating that the tumor extends beyond the rectal wall, select the logical value with the largest value indicating that the tumor extends beyond the rectal wall.
[0248] The distance the tumor extends beyond the rectal wall is calculated by multiplying the maximum logical value of the tumor extending beyond the rectal wall by the voxel spacing of the merged image.
[0249] In a more specific implementation, the step of calculating the logical value of the tumor extending beyond the rectal wall on the image section based on the image section includes:
[0250] Construct a circumscribed ellipse for the first rectal region in the image slice;
[0251] Traverse the pixels of the tumor region in the image slice, and calculate the logical distance L from each pixel to the center of the ellipse.
[0252] Subtracting the distance from the center of the circle to the intersection point of the ellipse, we obtain a logical estimate ΔL for the distance the tumor extends beyond the rectum.
[0253] The maximum logical estimate is selected as the logical value for the tumor to extend beyond the rectal wall in the first section;
[0254]
[0255] Where (h, k) are the coordinates of the center of the ellipse, a is the major axis of the ellipse, b is the minor axis of the ellipse, (x, y) is any pixel outside the ellipse; θ1 is the angle of the major axis of the ellipse relative to the horizontal plane, and θ2 is the angle between the line connecting the center of the ellipse and the pixel (x, y) and the major axis of the ellipse.
[0256] In a more specific implementation, the step of constructing a circumscribed ellipse for the rectal region in the image slice includes:
[0257] In the image cross-section, identify the multiple connected components contained in the rectal region;
[0258] Connecting multiple connected components yields the second rectal region;
[0259] Draw an circumscribed ellipse over the second rectal region.
[0260] It should be understood that the above embodiments are merely illustrative of the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting tumor T-staging in rectal MRI images, characterized in that, The specific steps include: Acquire MRI images of the rectum to be examined; Input the rectal MRI image to be detected into the pre-constructed segmentation model to obtain rectal image and tumor image; Input the tumor image into a pre-built classification model to obtain the first T stage of the tumor; Based on rectal and tumor images, an circumscribed ellipse is drawn on the rectal image to calculate the distance the tumor extends beyond the rectal wall; The second T stage of the tumor is determined based on the distance the tumor extends beyond the rectal wall and the first T stage; The second T-period is more detailed than the first T-period. The method of constructing an circumscribed ellipse on the rectal image based on rectal and tumor images, and calculating the distance the tumor extends beyond the rectal wall, includes the following specific steps: The rectal image and the tumor image are superimposed to obtain a merged image; Extract multiple image slices from the merged image; Based on the image cross-section, calculate the logical value of the tumor extending beyond the rectal wall on the image cross-section; From multiple logical values indicating that the tumor extends beyond the rectal wall, select the logical value with the largest value indicating that the tumor extends beyond the rectal wall. The maximum logical value of the tumor extending beyond the rectal wall is multiplied by the voxel spacing of the merged image to calculate the distance the tumor extends beyond the rectal wall. The step of calculating the logical value of the tumor extending beyond the rectal wall on the image section based on the image section includes: Construct a circumscribed ellipse for the first rectal region in the image slice; Traverse the pixels of the tumor region in the image slice and calculate the logical distance from each pixel to the center of the ellipse. , Subtracting the distance from the center of the circle to the intersection of the ellipse, we obtain a logical estimate of the distance the tumor extends beyond the rectum. , The maximum logical estimate is selected as the logical value for the tumor to extend beyond the rectal wall in the first section; ; ; ; Where (h, k) are the coordinates of the center of the ellipse, a is the major axis of the ellipse, b is the minor axis of the ellipse, and (x, y) is any pixel outside the ellipse; The angle of deflection of the major axis of the ellipse relative to the horizontal plane. The angle between the line connecting the center of the ellipse and the pixel (x, y) and the major axis of the ellipse; The specific steps for constructing the circumscribed ellipse of the rectal region in the image section include: In the image cross-section, identify the multiple connected components contained in the rectal region; Connecting multiple connected components yields the second rectal region; Draw an circumscribed ellipse over the second rectal region.
2. The method for detecting tumor T-staging in rectal MRI images according to claim 1, characterized in that, The process of inputting the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal and tumor images includes the following steps: Define rectal labels and tumor labels; Acquire MRI images of the rectum to be examined; The rectal MRI image to be detected, rectal label, and tumor label are input into the nnU-Net segmentation model, which outputs rectal 3D prediction label and tumor 3D prediction label. The 3D labels for rectum and tumor are divided into multiple sections, which are then input into the SAM segmentation model to obtain rectal and tumor images.
3. The method for detecting tumor T-staging on rectal MRI images according to claim 2, characterized in that, The process of inputting the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal images and tumor images also includes: Multiple cross-sections of rectal 3D labels and tumor 3D labels are input into the ViT-H model, and cross-sections in which the tumor region accounts for no less than a preset ratio of the entire region are selected. Input the cross section with a tumor region accounting for no less than a preset ratio into the SAM segmentation model to determine the smallest rectangle that can enclose the rectum or tumor.
4. The method for detecting tumor T-staging in rectal MRI images according to claim 1, characterized in that, The pre-built classification model includes the following specific construction steps: Set up the original deep neural network and initialize its parameters; Based on the initialization parameters, the Adam optimizer is used to input the training data into the original deep neural network and calculate the cross-entropy loss function. ; Cross-entropy loss function By combining it with the original deep neural network, a classification model is obtained through training; in, , For real labels, The value can be 0 or 1. For the model prediction results, The value range is 0-1.
5. The method for detecting tumor T-staging in rectal MRI images according to claim 1, characterized in that, Before inputting the tumor image into the pre-built classification model, the process also includes: Preset uniform values for tumor images; Based on a uniform value, the size of the tumor image is preprocessed to make the size of the tumor image conform to the uniform value.
6. The method for detecting tumor T-staging in rectal MRI images according to claim 4, characterized in that, The process of inputting the tumor image into a pre-built classification model to obtain the first T stage of the tumor includes the following steps: Extract preliminary features from tumor images; The preliminary features are sequentially input into the initial convolutional layer, multiple residual blocks, average pooling layer, and fully connected layer to output the first T stage of the tumor. The residual block contains multiple residual units, each residual unit consists of multiple convolutional layers and a skip connection, and the number of convolutional layers contained in each residual unit increases incrementally.
7. A tumor T-staging detection system for rectal MRI images, characterized in that, Specifically, it includes: The acquisition module is used to acquire the MRI image of the rectum to be detected; The segmentation module is used to input the rectal MRI image to be detected into a pre-constructed segmentation model to obtain rectal images and tumor images; The first classification module is used to input the tumor image into a pre-constructed classification model to obtain the first T stage of the tumor; The second classification module is used to construct an circumscribed ellipse on the rectal image based on the rectal image and the tumor image, calculate the distance the tumor extends beyond the rectal wall, and also to determine the second T stage of the tumor based on the distance the tumor extends beyond the rectal wall and the first T stage. The method of constructing an circumscribed ellipse on the rectal image based on rectal and tumor images, and calculating the distance the tumor extends beyond the rectal wall, includes the following specific steps: The rectal image and the tumor image are superimposed to obtain a merged image; Extract multiple image slices from the merged image; Based on the image cross-section, calculate the logical value of the tumor extending beyond the rectal wall on the image cross-section; From multiple logical values indicating that the tumor extends beyond the rectal wall, select the logical value with the largest value indicating that the tumor extends beyond the rectal wall. The maximum logical value of the tumor extending beyond the rectal wall is multiplied by the voxel spacing of the merged image to calculate the distance the tumor extends beyond the rectal wall. The step of calculating the logical value of the tumor extending beyond the rectal wall on the image section based on the image section includes: Construct a circumscribed ellipse for the first rectal region in the image slice; Traverse the pixels of the tumor region in the image slice and calculate the logical distance from each pixel to the center of the ellipse. , Subtracting the distance from the center of the circle to the intersection of the ellipse, we obtain a logical estimate of the distance the tumor extends beyond the rectum. , The maximum logical estimate is selected as the logical value for the tumor to extend beyond the rectal wall in the first section; ; ; ; Where (h, k) are the coordinates of the center of the ellipse, a is the major axis of the ellipse, b is the minor axis of the ellipse, and (x, y) is any pixel outside the ellipse; The angle of deflection of the major axis of the ellipse relative to the horizontal plane. The angle between the line connecting the center of the ellipse and the pixel (x, y) and the major axis of the ellipse; The specific steps for constructing the circumscribed ellipse of the rectal region in the image section include: In the image cross-section, identify the multiple connected components contained in the rectal region; Connecting multiple connected components yields the second rectal region; Draw an circumscribed ellipse over the second rectal region.
Citation Information
Patent Citations
Magnetic resonance colorectal cancer T stage prediction method and system
CN114822842A
Automatic measurement method and system for rectal cancer
CN117455993A