Placenta implantation image segmentation method and imaging method based on magnetic resonance data
By constructing a feature extraction network and using a multi-instance learning method, combined with prior geometric information about placental shape, the accuracy and robustness issues of placental implantation image segmentation in MRI data were resolved, achieving more efficient placental implantation detection.
Patent Information
- Application Number
- CN202311258229.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Existing image segmentation methods for placental implantation based on MRI data have low accuracy, low robustness, poor segmentation results, and rely on the doctor's experience, making it difficult to achieve efficient placental implantation detection.
We employ a placental implantation image segmentation method based on magnetic resonance imaging (MRI) data. By constructing a feature extraction network, a candidate box generation network, a region of interest alignment, and a target classification and regression network, and combining a multi-instance learning paradigm, we utilize the geometric prior information of the placental shape to guide the detection model in generating predicted boxes. Furthermore, by correcting inaccurate bounding box labels, we reduce our reliance on manual labels.
It improves the accuracy and robustness of placental implantation image segmentation, reduces reliance on manual labels, and enhances segmentation results and reliability, making it suitable for addressing the challenge of labeling placental implantation regions in MRI images.
Smart Images

Figure CN117274598B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image processing, and particularly relates to a placenta accreta image segmentation method based on magnetic resonance data and an imaging method. BACKGROUND
[0002] Placenta accreta is a common disease of pregnant women in clinical practice, which can cause serious clinical harm. Magnetic resonance imaging (MRI) has the advantages of high soft tissue resolution, multi-slice imaging, and no limitation on placental position and pregnant woman body type, and can provide better auxiliary examination image data of placenta accreta for clinical application and scientific research.
[0003] At present, the placenta accreta image segmentation method based on MRI data is mainly used to complete the classification task, that is, to judge whether the pregnant woman has placenta accreta and the type of placenta accreta; in the MRI image, the sign of placenta accreta is not obvious, and the contrast with the surrounding tissue is low; the placenta is in the shape of a disc with middle thick and both sides thin, which leads to a large height-width ratio of the placenta accreta rectangular detection box, affecting the segmentation performance; in clinical practice, the implementation of the placenta accreta technology mainly depends on the experience of doctors, which increases the difficulty of accurate labeling.
[0004] In summary, the current image segmentation method has low accuracy, relies on the experience of doctors, and has low robustness and poor segmentation effect. SUMMARY
[0005] One of the purposes of the application is to provide a placenta accreta image segmentation method based on magnetic resonance data with improved accuracy, enhanced robustness and improved segmentation effect.
[0006] The second purpose of the application is to provide an imaging method comprising the placenta accreta image segmentation method based on magnetic resonance data.
[0007] The placenta accreta image segmentation method based on magnetic resonance data provided by the application comprises the following steps:
[0008] S1. Obtain pelvic magnetic resonance image data;
[0009] S2. Construct a placenta accreta image segmentation original model as an initial current round of to-be-trained model;
[0010] S3. Select one data in the data obtained in step S1 and input it into the to-be-trained model of the current round to complete the training of the current round, output a placenta accreta prediction box, and use the model obtained by the training of the current round as the to-be-trained model of the next round;
[0011] S4. Screening is performed on the placenta implantation prediction frame output in step S3, and is used to correct the boundary frame label;
[0012] S5. The label corrected in step S4 is used to participate in the next round of training of the model;
[0013] S6. Steps S3-S5 are repeated until all data in step S1 is input into the model, and a final placenta implantation image segmentation model is obtained;
[0014] S7. The placenta implantation image segmentation model obtained in step S6 is used to complete placenta implantation image segmentation based on actual magnetic resonance image data;
[0015] The construction of the placenta implantation image segmentation original model in step S2 is used as an initial current round of to-be-trained model, and specifically includes:
[0016] The placenta implantation image segmentation original model includes a feature extraction network, a candidate frame generation network, a region of interest alignment, a target classification and regression network;
[0017] (2-1) Construction of the feature extraction network:
[0018] The feature extraction network is used to extract features;
[0019] The feature extraction network includes a ResNet50 network part and a feature pyramid network (FPN) part; the ResNet50 network part includes five stages, each of which includes convolution, downsampling and batch normalization; the ResNet50 network part obtains a feature map through model processing, processes the feature map through the FPN part, and unifies the channel number through a convolution kernel with a size of 1×1; the upper layer feature map is sequentially adjusted in size through downsampling, fused with the lower layer feature map, and four fused feature maps are obtained in total, wherein the uppermost layer obtains a fifth feature map through maximum pooling; the five feature maps are respectively subjected to a convolution to obtain five layers of final feature maps;
[0020] (2-2) Construction of the candidate frame generation network:
[0021] The candidate box generation network comprises an anchor generator part and an RPN head part, wherein the anchor generator generates candidate boxes at each point of each layer feature map through hyperparameters, and the RPN head comprises three convolutional layers; the hyperparameters adopted by the anchor generator comprise scales, ratios and strides; the scales represent the scaling ratio of the candidate boxes in a single scale; the ratios represent the height-width ratio of the candidate boxes in a single scale; and the strides represent the down-sampling rate of each scale feature map, representing the base size of the candidate boxes generated on each layer feature map corresponding to the original image; the first convolutional layer of the RPN head is used to adjust the number of channels, the second convolutional layer represents a classification branch and is used to distinguish foreground and background, and the third convolutional layer represents a regression branch and is used to represent the coordinates of the candidate boxes;
[0022] The candidate box generation network dynamically adjusts the threshold value through the height-width ratio of the region real box to filter the candidate boxes; specifically comprising:
[0023] According to the feature map extracted in step (2-1), the placenta implantation region candidate box is generated through the candidate box generation network, specifically comprising:
[0024] (1) The candidate box generation network generates a series of candidate boxes according to the feature map;
[0025] (2) The intersection over union of each bounding box real label and the candidate box is calculated, and the calculation formula is as follows:
[0026]
[0027] Wherein, A represents the area of the real label; B represents the area of the candidate box; ∩ represents the intersection; and ∪ represents the union;
[0028] (3) For each real bounding box g i , the candidate box with the intersection over union greater than or equal to the IOU threshold value is selected as the positive sample; and the candidate box with the intersection over union less than the IOU threshold value is selected as the negative sample;
[0029] The IOU threshold value is dynamically adjusted according to the height-width ratio of the real bounding box, and the calculation formula is as follows:
[0030]
[0031] Wherein, τ i represents the threshold value corresponding to g i ; α represents a hyperparameter; r i represents the height-width ratio of g i ; and τ represents a predefined threshold value;
[0032] (2-3) Constructing ROI alignment:
[0033] The ROI alignment first selects a feature layer for cropping according to the size of the ROI, and obtains a fixed-size feature map through pooling processing;
[0034] The pooling processing includes: traversing each candidate region, keeping the floating-point boundary unquantized; dividing the candidate region into k x k units, and the boundary of each unit is also unquantized; dividing each unit into four squares, calculating the coordinate position of the center of each square through the bilinear interpolation method; and then completing the maximum pooling operation processing;
[0035] The calculation process of the ROI alignment is as follows:
[0036] According to the candidate box generated in step (2-2), the mapping processing is performed through the ROI alignment, and is mapped into the feature map obtained in step (2-1), and the multi-scale features are fused to generate a fixed-size candidate box feature map, which specifically includes:
[0037] 1) The candidate box is mapped to the feature layer according to the following calculation formula:
[0038]
[0039] Wherein, k i represents the mapped feature layer; L represents the number of feature layers; w i represents the width of the i th candidate box; h i represents the height of the i th candidate box; W represents the width of the original image; H represents the height of the original image; represents the floor function;
[0040] 2) Count the number of candidate boxes with a height-to-width ratio greater than r0 in each feature layer Wherein, r0 represents a custom parameter;
[0041] 3) The fusion weight of each feature layer is calculated by the following formula:
[0042] ω=sigmoid(N1,N2,…,N L )
[0043] Wherein, ω represents the fusion weight; sigmoid(·) represents the activation function; N i represents the number of candidate boxes with a height-to-width ratio greater than r0 in the i th feature layer, i = 1, 2, …, L;
[0044] 4) Weighted fusion of multi-scale features to obtain the final candidate box feature map, as shown in the following formula:
[0045]
[0046] wherein, f i represents the feature map of the final candidate frame; ω l represents the weight of the lth layer; f i l represents the feature map of the lth layer;
[0047] (2-4) Constructing the target classification and regression network:
[0048] The target classification and regression network is used for classification and regression.
[0049] The target classification and regression network includes an MLP, a classification branch, and a regression branch; the MLP includes a Flatten layer, two fully connected layers, and two ReLU activation layers; the classification branch includes a fully connected layer and a Softmax layer; the regression branch includes a fully connected layer; the classification branch and the regression branch output the category and coordinates predicted by the model, which correspond to the placenta implantation prediction frame.
[0050] The selecting step S1 in step S3 selects one data from the data obtained in step S1 and inputs it into the to-be-trained model of the current round, completes the training of the current round, outputs the placenta implantation prediction frame, and takes the model obtained in the current round of training as the to-be-trained model of the next round, and specifically includes:
[0051] (3-1) All candidate frames output by the model are sorted in descending order of confidence and a set is constructed;
[0052] (3-2) The candidate frame with the highest confidence is selected and moved to the final prediction frame set;
[0053] (3-3) The IOU between the bounding box selected in step (3-2) and other unprocessed candidate frames is calculated, and the calculation formula is as follows:
[0054]
[0055] wherein, A represents the area of the real label; B represents the area of the candidate frame; ∩ represents the intersection; and ∪ represents the union.
[0056] (3-4) If the IOU between the candidate frame and the current selected frame is greater than the threshold, the candidate frame is removed from the candidate frame set;
[0057] (3-5) Repeat the above steps (3-2) to (3-4) until all detection frames are processed, and the prediction frame set represents the final detection result.
[0058] The screening process for the placenta implantation prediction frame output by step S3 in step S4 is used to correct the bounding box label, and specifically includes:
[0059] The prediction box output by the model is screened to select the highest quality bounding box for correcting inaccurate bounding box labels; specifically including:
[0060] (4-1) Convert the placenta implantation detection under the inaccurate label into a multiple-instance learning problem, specifically including:
[0061] Adopting a bag B i represents the target, and the instances in the bag represent the prediction box of the corresponding area, where N represents the number of instances; represents the jth instance in the ith bag;
[0062] Each bag corresponds to a label y i ={1,-1}; y i =1, indicating a positive bag, indicating that the target is a placenta implantation area, and at least containing one positive instance; y i =-1, indicating a negative bag, indicating that the target is a background box;
[0063] (4-2) Construct an instance generator μ(θ d ), an instance selector φ(θ s ), and an instance classifier ψ(θ c ); θ d represents the parameters of the instance generator, θ s represents the parameters of the instance selector, and θ c represents the parameters of the instance classifier;
[0064] The instance generator is used to generate a prediction result;
[0065] The instance selector is used to select the highest quality instance;
[0066] The instance classifier takes the selected instance as a new label to judge the positive and negative of each existing instance, and then calculates the classification loss;
[0067] (4-3) The instance generator obtains the confidence of each instance
[0068] (4-4) The instance selector selects the highest confidence prediction instance j * according to the obtained confidence, and the calculation formula is as follows:
[0069]
[0070] Where j * represents the index of the instance ;
[0071] (4-5) Fuse the examples obtained in step (4-4) and the inaccurate true example labels to obtain revised examples, and the calculation formula is as follows:
[0072]
[0073] wherein g i represents the confidence of the example corresponding to the true example; represents the confidence of the example ; δ s (·) represents a weight function, and the calculation formula is as follows:
[0074] δ s (x) = min (e β·x , γ)
[0075] wherein β and γ represent hyperparameters; x represents the input value of the function δ s (x);
[0076] (4-6) Classify the revised examples into positive examples and negative examples by taking the revised example labels as new true labels through the example classifier, and obtain the classification result of the bag;
[0077] The label revised in step S4 is used in step S5 to participate in the training of the next round of the model, and specifically includes:
[0078] The instance generator, the instance selector and the instance classifier constructed in the collaborative training step S4 are used to calculate the classification and regression loss of the detection model;
[0079] The loss of the highest quality instance is selected through the instance selector; the classification loss of the prediction box or the instance is calculated through the instance classifier; the regression loss of the prediction box or the instance is calculated through the instance generator;
[0080] The total loss function L is calculated by using the following formula:
[0081]
[0082] wherein L s (B i , φ (θ s )) represents the loss of the instance selector; represents the loss of the instance classifier; represents the loss of the instance detector; specifically including:
[0083] ① The hinge loss function is used to calculate the loss of the instance selector, and the calculation formula is as follows:
[0084]
[0085] wherein y i denotes the label of the i-th bag; denotes the highest confidence in the j-th instance of the i-th bag;
[0086] ②The binary classification loss function is used to calculate the loss of the instance classifier, and the calculation formula is as shown in the following:
[0087]
[0088] wherein, denotes the possibility of the containing region; denotes the label of the i-th instance, and the calculation formula is as shown in the following:
[0089]
[0090] wherein, denotes the dynamic IOU threshold corresponding to the real label; denotes the IOU between and , and the calculation formula is as shown in the following:
[0091]
[0092] wherein, A denotes the area of ; B denotes the area of ; ∩ denotes the intersection; and ∪ denotes the union;
[0093] ③The loss of the instance generator is calculated by using the following calculation formula:
[0094]
[0095] wherein, I(x) denotes an indicator function, I(x)=1 when x=1, and I(x)=0 in other cases; L reg (·) denotes the regression loss, which is calculated by using the L1 loss function.
[0096] The application further provides an imaging method comprising the placental implantation image segmentation method based on magnetic resonance data, and specifically comprising:
[0097] A1. Obtain magnetic resonance image data;
[0098] A2. Segment the placental implantation region in the image data obtained in step A1 by using the placental implantation image segmentation method based on magnetic resonance data;
[0099] A3. Label the placental implantation segmentation result on the magnetic resonance image obtained in step A1 according to the segmentation result obtained in step A2, and perform secondary imaging processing.
[0100] A4. Output magnetic resonance images with placental implantation area markers to complete imaging processing.
[0101] The placental implantation image segmentation and imaging method provided by this invention utilizes prior geometric information about the placental shape to guide the detection model in generating predicted bounding boxes. Through a multi-instance learning paradigm, it corrects inaccurate bounding box labels based on the high-quality predicted bounding boxes generated by the model, thereby reducing reliance on the accuracy of manual labels and improving network robustness. This invention improves model accuracy even when using inaccurate detection box labels, making it more suitable for real-world scenarios where labeling of placental implantation regions in MRI images is difficult. The method of this invention demonstrates improved accuracy, enhanced robustness, significant segmentation results, and improved reliability. Attached Figure Description
[0102] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0103] Figure 2 This is a schematic diagram of the network model of the segmentation model in the method of the present invention.
[0104] Figure 3 This is a visual diagram illustrating the segmentation results of the method of the present invention.
[0105] Figure 4 This is a schematic diagram of an imaging method including the method of the present invention. Detailed Implementation
[0106] like Figure 1 The diagram shown is a flowchart of the method of the present invention: The placental implantation image segmentation method based on magnetic resonance data provided by the present invention includes the following steps:
[0107] S1. Acquire pelvic magnetic resonance imaging data;
[0108] S2. Construct the original model for placental implantation image segmentation, and use it as the initial model to be trained in the current round; specifically including:
[0109] The original model for placental implantation image segmentation includes a feature extraction network, a candidate box generation network, a region of interest alignment network, an object classification network, and a regression network.
[0110] (2-1) Constructing a feature extraction network:
[0111] Feature extraction networks are used to extract features;
[0112] The feature extraction network comprises a ResNet50 network part and a feature pyramid network (FPN) part; the ResNet50 network part comprises five stages, each stage comprising convolution, down-sampling and batch normalization; the ResNet50 network part processes the feature map obtained through the model, and processes the feature map through the FPN part, and unifies the channel number through a convolution kernel with a size of 1x1; the upper layer feature map is sequentially adjusted in size through down-sampling, and is fused with the lower layer feature map, and four fused feature maps are obtained in total, wherein the uppermost layer obtains a fifth feature map through maximum pooling; the five feature maps are subjected to a convolution respectively, and five final layer feature maps are obtained;
[0113] In the method, the convolution kernel with a size of 1x1 unifies the channel number to 256;
[0114] (2-2) Constructing a candidate box generation network
[0115] The candidate box generation network comprises an anchor generator (Anchor Generator) part and a region proposal network (RPN Head) part, wherein the Anchor Generator generates candidate boxes at each point of each layer feature map through hyperparameters, and the RPN Head comprises three convolution layers; the hyperparameters adopted by the Anchor Generator comprise scales, ratios and strides; the scales represent the scaling ratio of the candidate boxes in a single scale; the ratios represent the height-width ratio of the candidate boxes in a single scale; and the strides represent the down-sampling rate of the feature maps of each scale, and represent the basic size of the candidate boxes generated on each layer feature map corresponding to the original image; the first convolution layer of the RPN Head is used to adjust the number of channels, the second convolution layer represents a classification branch and is used to distinguish foreground and background, and the third convolution layer represents a regression branch and is used to represent the coordinates of the candidate boxes;
[0116] In the method, the value corresponding to the scales is 8; the value corresponding to the ratios is [0.5, 1.0, 2.0]; the value corresponding to the strides is [4, 8, 16, 32, 64]; if the size of the feature map is h x w, h x w x 3 candidate boxes are generated; and the third convolution layer of the RPN Head fixedly outputs four values;
[0117] The candidate box generation network dynamically adjusts the threshold value through the height-width ratio of the region ground truth, and filters the candidate boxes; specifically comprising:
[0118] According to the feature map extracted in step (2-1), the placenta implantation region candidate box is generated through the candidate box generation network, and specifically comprising:
[0119] (1) The candidate box generation network generates a series of candidate boxes according to the feature map;
[0120] (2) Calculate the intersection over union of each real label and the candidate box, and the calculation formula is as follows:
[0121]
[0122] Wherein, A represents the area of the real label; B represents the area of the candidate box; ∩ represents the intersection; ∪ represents the union;
[0123] (3) For each real boundary box g i , select the candidate box with intersection over union greater than or equal to IOU threshold as positive sample; select the candidate box with intersection over union less than IOU threshold as negative sample;
[0124] According to the real boundary box height-width ratio, the IOU threshold is dynamically adjusted, and the calculation formula is as follows:
[0125]
[0126] Wherein, τ i represents the threshold corresponding to g i ; α represents the hyperparameter; r i represents the height-width ratio of g i ; τ represents the predefined threshold;
[0127] (2-3) Construct region of interest alignment:
[0128] The region of interest alignment first selects the feature layer according to the size of the ROI, and obtains a fixed size feature map through pooling processing;
[0129] The pooling processing includes: traversing each candidate region, keeping the floating point boundary not quantized; dividing the candidate region into k×k units, and the boundary of each unit is also not quantized; dividing each unit into four squares, and calculating the coordinate position of the center of each square through the method of bilinear interpolation; and then completing the maximum pooling operation processing;
[0130] The calculation process of the region of interest alignment is as follows:
[0131] According to the candidate box generated in step (2-2), the mapping processing is carried out through the region of interest alignment, which is mapped into the feature map obtained in step (2-1), and the multi-scale features are fused by weighting to generate a fixed size candidate box feature map, which specifically includes:
[0132] 1) According to the following calculation formula, the candidate box is mapped to the feature layer:
[0133]
[0134] Wherein, k irepresents the mapped feature layer; L represents the number of feature layers; w i represents the width of the i-th candidate box; h i represents the height of the i-th candidate box; W represents the width of the original image; H represents the height of the original image; represents the floor function;
[0135] 2) Count the number of candidate boxes with an aspect ratio greater than r0 in each feature layer wherein r0 represents a custom parameter;
[0136] 3) Calculate the fusion weight of each feature layer using the following formula:
[0137] ω = sigmoid (N1, N2, …, N L )
[0138] wherein ω represents the fusion weight; sigmoid(·) represents an activation function; N i represents the number of candidate boxes with an aspect ratio greater than r0 in the i-th feature layer, i = 1, 2, …, L;
[0139] 4) Weighted fusion of multi-scale features to obtain the final candidate box feature map, as shown in the following formula:
[0140]
[0141] wherein f i represents the feature map of the final candidate box; ω l represents the weight of the l-th layer; f i l represents the l-th layer feature map;
[0142] (2-4) Construct the target classification and regression network:
[0143] The target classification and regression network is used for classification and regression.
[0144] The target classification and regression network includes an MLP, a classification branch, and a regression branch; the MLP includes a Flatten layer, two fully connected layers, and two ReLU activation layers; the classification branch includes a fully connected layer and a Softmax layer; the regression branch includes a fully connected layer; the classification branch and the regression branch output the predicted class and coordinates of the model, which correspond to the placenta implantation prediction box.
[0145] S3. Select one of the data obtained in step S1 and input it into the model to be trained in the current round, complete the training in the current round, output the placenta implantation prediction box, and use the model trained in the current round as the model to be trained in the next round; specifically comprising:
[0146] For example,Figure 2 Fig. 1 shows a schematic diagram of a network model for detecting a model in the method of the present application;
[0147] (3-1) All candidate boxes output by the model are sorted in descending order of confidence and a set is constructed;
[0148] (3-2) The candidate box with the highest confidence is selected and moved to the final prediction box set;
[0149] (3-3) The IOU between the bounding box selected in step (3-2) and other unprocessed candidate boxes is calculated, and the calculation formula is as follows:
[0150]
[0151] Wherein, A represents the area of the true label; B represents the area of the candidate box; ∩ represents the intersection; ∪ represents the union;
[0152] (3-4) If the IOU of the candidate box and the currently selected box is greater than the threshold, the candidate box is removed from the candidate box set;
[0153] (3-5) Repeat steps (3-2) to (3-4) above until all detection boxes are processed, and the prediction box set represents the final detection result;
[0154] In the method of the present application, the threshold value is 0.5;
[0155] S4. Screening processing is performed on the placenta implantation prediction box output in step S3, and is used to correct the bounding box label; specifically including:
[0156] The prediction box output by the model is screened and the highest quality bounding box is selected to correct the inaccurate bounding box label; specifically including:
[0157] (4-1) The placenta implantation detection under the inaccurate label is converted into a multi-instance learning problem, specifically including:
[0158] A bag B i represents a target, and the instances in the bag represent the prediction boxes of the corresponding regions, wherein N represents the number of instances; represents the jth instance in the ith bag;
[0159] Each bag corresponds to a label y i ={1,-1}; y i =1, indicating a positive bag, indicating that the target is a placenta implantation region and containing at least one positive instance; y i =-1, indicating a negative bag, indicating that the target is a background box;
[0160] (4-2) Constructing the instance generator μ(θ) d ), instance selector φ(θ) s ), instance classifier ψ(θ) c );θ d The parameters of the instance generator, θ s The parameters of the instance selector, θ c The parameters represent the instance classifier;
[0161] The instance generator is used to generate prediction results;
[0162] The instance selector is used to select the instance with the highest quality.
[0163] The instance classifier uses the selected instance as the new label, determines the positive or negative status of each existing instance, and then calculates the classification loss.
[0164] (4-3) The instance generator obtains each instance based on the instances generated in the above steps. confidence level
[0165] (4-4) The instance selector selects the predicted instance with the highest confidence based on the obtained confidence score. j * The calculation formula is as follows:
[0166]
[0167] Where, j * Representation of instances Index;
[0168] (4-5) Merge the instances obtained in step (4-4) with the inaccurate real instance labels to obtain the corrected instances. The calculation formula is as follows:
[0169]
[0170] Among them, g i express Corresponding real-world examples; Representation of instances Confidence level; δ s (·) represents the weighting function, and the calculation formula is shown below:
[0171] δ s (x)=min(e β·x ,γ)
[0172] Where β and γ both represent hyperparameters; x represents the function δ s The input value of (x);
[0173] (4-6) The corrected instance labels are used as new real labels by the instance classifier to classify the instances into positive instances and negative instances, and the classification results of the package are obtained.
[0174] S5. Use the labels corrected in step S4 to participate in the next round of model training; specifically including:
[0175] The instance generator, instance selector, and instance classifier constructed in the collaborative training step S4 are used to calculate the classification and regression losses of the detection model.
[0176] The loss for selecting the highest quality instance is calculated using an instance selector; the classification loss for the predicted bounding box or instance is calculated using an instance classifier; and the regression loss for the predicted bounding box or instance is calculated using an instance generator.
[0177] The total loss function L is calculated using the following formula:
[0178]
[0179] Among them, L s (B i ,φ(θ s )) represents the loss of the instance selector; This represents the loss of the instance classifier; This represents the loss of the instance detector; specifically, it includes:
[0180] ① The loss of the instance selector is calculated using the hinge loss function, and the calculation formula is as follows:
[0181]
[0182] Among them, y i This represents the label of the i-th package; This represents the highest confidence level among the j instances of the i-th package;
[0183] ② The loss of the instance classifier is calculated using the binary classification loss function, and the calculation formula is as follows:
[0184]
[0185] in, express The possibility of including a region; express The formula for calculating the label is as follows:
[0186]
[0187] in, This represents the dynamic IOU threshold corresponding to the actual label; Indicates calculation and The IOU between them is calculated using the following formula:
[0188]
[0189] Where A represents The area; B represents The area of ; ∩ represents the intersection; ∪ represents the union;
[0190] ③ Calculate the loss of the instance generator using the following formula:
[0191]
[0192] Where I(x) represents the indicator function, I(x) = 1 when x = 1, and I(x) = 0 otherwise; L reg (·) represents the regression loss, calculated using the L1 loss function;
[0193] S6. Repeat steps S3 to S5 until all data from step S1 has been input into the model and the final placental implantation image segmentation model is obtained.
[0194] S7. Using the placental implantation image segmentation model obtained in step S6, and based on the actual magnetic resonance image data, complete the placental implantation image segmentation;
[0195] The present invention provides the following embodiments, through which the segmentation effect of the present invention method and the prior art method are compared;
[0196] The method proposed in this invention is compared with existing segmentation methods: under accurate and inaccurate labels, it is compared with two-stage target segmentation methods and single-stage target segmentation methods, with segmentation results, mAP, and sensitivity as evaluation criteria; specific detection results are shown in Table 1.
[0197] Table 1. Schematic diagram of MRI placenta accreta detection results
[0198]
[0199] As can be seen from Table 1, the method of this invention outperforms the two existing methods in both metrics, achieving more accurate segmentation results through geometric prior guidance and multi-instance learning; for example... Figure 3 The image shown is a visualization of the detection results of the method of the present invention. Figure 3 The results of two-stage, single-stage object detection methods and the method of the present invention were compared. From left to right, the results are the original image, the ground truth label, the two-stage object detection method, the single-stage object detection method, and the method of the present invention. As can be seen from the figure, the method of the present invention performs better in terms of the geometry of the bounding box.
[0200] As Figure 4 Fig. 1 shows a flowchart of an imaging method including the method of the present application:
[0201] The present application also provides an imaging method including the method of the present application, specifically including:
[0202] A1. Obtain magnetic resonance image data;
[0203] A2. Use the method of the present application to segment the placental implantation region in the image data obtained in step A1;
[0204] A3. According to the segmentation result obtained in step A2, mark the placental implantation segmentation result on the magnetic resonance image obtained in step A1, and perform secondary imaging processing;
[0205] A4. Output the magnetic resonance image with the placental implantation region marked, and complete the imaging processing.
[0206] The imaging method provided by the present application can be applied to existing magnetic resonance image acquisition equipment; in specific application, the imaging method provided by the present application is applied to the equipment; in operation, the equipment first acquires actual magnetic resonance image according to the normal working mode, then according to the acquired magnetic resonance image, uses the imaging method provided by the present application which has been applied to the equipment to perform secondary imaging on the acquired magnetic resonance image, thereby obtaining a magnetic resonance image in which the placental implantation region has been highlighted (such as marked with different colors, etc.); then, the equipment simultaneously outputs the original magnetic resonance image and the magnetic resonance image with the placental segmentation and marking result, thereby greatly facilitating the staff and the detected person.
Claims
1. A method for segmenting placental implantation images based on magnetic resonance imaging data, comprising the following steps: S1. Acquire pelvic magnetic resonance imaging data; S2. Construct the original model for placental implantation image segmentation and use it as the initial model to be trained in the current round; S3. Select one data point from the data obtained in step S1, input it into the model to be trained in the current round, complete the training of the current round, output the placental implantation prediction box, and use the model trained in the current round as the model to be trained in the next round; specifically including: (3-1) Use all candidate boxes output by the model, sort them in descending order of confidence and construct a set; (3-2) Select the candidate box with the highest confidence and move it into the final set of predicted boxes; (3-3) Calculate the IOU between the bounding box selected in step (3-2) and other unprocessed candidate boxes. The calculation formula is as follows: Where A represents the area of the true label; B represents the area of the candidate box; ∩ represents the intersection; ∪ represents the union; (3-4) If the IOU between the candidate box and the current selection box is greater than the threshold, remove the candidate box from the candidate box set; (3-5) Repeat steps (3-2) to (3-4) above until all detection boxes have been processed, and the set of predicted boxes represents the final detection result; S4. The placental implantation prediction bounding boxes output in step S3 are filtered and used to correct the bounding box labels. S5. Use the labels corrected in step S4 to participate in the next round of model training; S6. Repeat steps S3 to S5 until all data from step S1 has been input into the model and the final placental implantation image segmentation model is obtained. S7. Using the placental implantation image segmentation model obtained in step S6, and based on the actual magnetic resonance image data, complete the placental implantation image segmentation.
2. The placental implantation image segmentation method based on magnetic resonance data according to claim 1, characterized in that... Step S2, which involves constructing the original image segmentation model for placental implantation and using it as the initial model to be trained in the current round, specifically includes: The original model for placental implantation detection includes a feature extraction network, a candidate box generation network, a region of interest alignment network, an object classification network, and a regression network. Feature extraction networks are used to extract features; Based on the extracted feature maps, candidate bounding boxes for the placental implantation region are generated using a candidate bounding box generation network. Based on the generated candidate boxes, a mapping process is performed by aligning with the region of interest, mapping them onto the acquired feature map, and multi-scale features are weighted and fused to generate a fixed-size candidate box feature map. Target classification and regression networks are used for classification and regression.
3. The placental implantation image segmentation method based on magnetic resonance data according to claim 2, characterized by the following features Extracting the network specifically includes: The feature extraction network consists of a ResNet50 network and a feature pyramid network. The ResNet50 network comprises five stages, each including convolution, downsampling, and batch normalization. The feature maps obtained by the ResNet50 network are then processed by the feature pyramid network, with the number of channels unified by a 1×1 convolution kernel. The upper-layer feature maps are downsampled and resized, then fused with the lower-layer feature maps, resulting in a total of four fused feature maps. The top layer is max-pooled to obtain the fifth feature map. Each of the five feature maps is then convolved to obtain the final five-layer feature map.
4. The placental implantation image segmentation method based on magnetic resonance data according to claim 3, characterized in that... Candidate box generation network, specifically including: The candidate box generation network consists of a candidate box generator and a region proposal network. The candidate box generator generates candidate boxes at each point of each feature map layer using hyperparameters. The region proposal network consists of three convolutional layers. The hyperparameters used in the candidate box generator include scales, ratios, and strides. Scales represents the scaling ratio of the candidate boxes at a single scale; ratios represents the aspect ratio of the candidate boxes at a single scale; and strides represents the downsampling rate of the feature maps at each scale, indicating the base size of the candidate boxes generated at each feature map layer corresponding to the original image. The region proposal network consists of a first convolutional layer used to adjust the number of channels, a second convolutional layer representing a classification branch to distinguish between foreground and background, and a third convolutional layer representing a regression branch to represent the coordinates of the candidate boxes. The candidate bounding box generation network dynamically adjusts a threshold based on the aspect ratio of the ground truth bounding boxes to filter candidate boxes; specifically, it includes: Based on the extracted feature map, candidate bounding boxes for the placental implantation region are generated, specifically including: (1) The candidate box generation network generates a series of candidate boxes based on the feature map; (2) Calculate the intersection-union ratio (IUU) between the ground truth label and the candidate box for each border. The calculation formula is shown below: Where A represents the area of the true label; B represents the area of the candidate box; ∩ represents the intersection; ∪ represents the union; (3) For each real bounding box g i Candidate boxes with an intersection-union ratio (IoU) greater than or equal to the IoU threshold are selected as positive samples; candidate boxes with an IoU ratio less than the IoU threshold are selected as negative samples. The IOU threshold is dynamically adjusted based on the aspect ratio of the actual bounding box, and the calculation formula is shown below: Where, τ i Indicates the corresponding g i The threshold; α represents the hyperparameter; r i G represents i The aspect ratio; τ represents a predefined threshold.
5. The placental implantation image segmentation method based on magnetic resonance data according to claim 4, characterized in that... Region of interest alignment, specifically including: Region of Interest (ROI) alignment first involves selecting a feature layer for cropping based on the size of the ROI, and then obtaining a feature map of a fixed size through pooling. The pooling process includes: traversing each candidate region while keeping the floating-point boundaries unquantized; dividing the candidate region into k×k units while also keeping the boundaries of each unit unquantized; dividing each unit into four squares and calculating the coordinates of the center of each square using bilinear interpolation; and then completing the max pooling operation. The calculation process for region of interest alignment is as follows: Based on the generated candidate bounding boxes, a mapping process is performed using region of interest alignment, mapping the bounding boxes onto the acquired feature map. Multi-scale features are then weighted and fused to generate a fixed-size candidate bounding box feature map, specifically including: 1) Map the candidate boxes to the feature layer according to the following calculation formula: Where, k i Indicates the feature layer to which the mapping is performed; L represents the number of feature layers; w i h represents the width of the i-th candidate box. i The height of the i-th candidate box is represented by ; W represents the width of the original image; H represents the height of the original image; This represents the floor function; 2) Count the number of candidate boxes with an aspect ratio greater than r0 in each feature layer. Where r0 represents a user-defined parameter; 3) Calculate the fusion weights for each feature layer using the following formula: ω=sigmoid(N1,N2,…,N L ) Where ω represents the fusion weight; sigmoid(·) represents the activation function; N i This represents the number of candidate boxes with an aspect ratio greater than r0 in the i-th feature layer, where i = 1, 2, ..., L; 4) Weighted fusion of multi-scale features yields the final candidate bounding box feature map, as shown in the following formula: Among them, f i The feature map representing the final candidate bounding box; ω l f represents the weight of the l-th layer; i l This represents the feature map of the l-th layer.
6. The placental implantation image segmentation method based on magnetic resonance data according to claim 5, characterized in that... Target classification and regression networks, specifically including: The target classification and regression network consists of an MLP, a classification branch, and a regression branch. The MLP consists of a Flatten layer, two fully connected layers, and two ReLU activation layers. The classification branch consists of a fully connected layer and a Softmax layer. The regression branch consists of a fully connected layer. The classification and regression branches output the predicted class and coordinates of the model, which are represented as placental implantation prediction boxes.
7. The placental implantation image segmentation method based on magnetic resonance data according to claim 6, characterized in that... Step S4, which involves filtering the placental implantation prediction bounding boxes output in step S3 and correcting the bounding box labels, specifically includes: The predicted bounding boxes output by the model are filtered to select the highest quality bounding boxes, which are then used to correct inaccurate bounding box labels; specifically, this includes: (4-1) Transform placenta accreta detection under inaccurate labels into a multi-instance learning problem, specifically including: Package B i Indicates the target, an instance in the package. The bounding box represents the predicted region, where N represents the number of instances; This represents the j-th instance in the i-th package; Each package corresponds to a tag y i ={1,-1};y i =1 indicates a positive envelope, meaning the target is the placenta implantation region and contains at least one positive instance; y i =-1 indicates a negative packet, meaning the target is the background box; (4-2) Constructing the instance generator μ(θ) d ), instance selector φ(θ) s ), instance classifier ψ(θ) c );θ d The parameters of the instance generator, θ s The parameters of the instance selector, θ c The parameters represent the instance classifier; The instance generator is used to generate prediction results; The instance selector is used to select the instance with the highest quality. The instance classifier uses the selected instance as the new label, determines the positive or negative status of each existing instance, and then calculates the classification loss. (4-3) The instance generator obtains each instance based on the instances generated in the above steps. confidence level (4-4) The instance selector selects the predicted instance with the highest confidence based on the obtained confidence score. j * The calculation formula is as follows: Where, j * Representation of instances Index; (4-5) Merge the instances obtained in step (4-4) with the inaccurate real instance labels to obtain the corrected instances. The calculation formula is as follows: Among them, g i express Corresponding real-world examples; Representation of instances Confidence level; δ s (·) represents the weighting function, and the calculation formula is shown below: d s (x)=min(e β·x ,c) Where β and γ both represent hyperparameters; x represents the function δ s The input value of (x); (4-6) The corrected instance labels are used as new real labels by the instance classifier to classify the instances into positive instances and negative instances, and the classification results of the package are obtained.
8. The placental implantation image segmentation method based on magnetic resonance data according to claim 7, characterized in that... Step S5, which involves using the labels corrected in step S4 to participate in the next round of model training, specifically includes: The instance generator, instance selector, and instance classifier constructed in the collaborative training step S4 are used to calculate the classification and regression losses of the detection model. The loss is calculated by the instance selector to select the highest quality instance; the classification loss of the predicted box or instance is calculated by the instance classifier; and the regression loss of the predicted box or instance is calculated by the instance generator. The total loss function L is calculated using the following formula: Among them, L s (B i ,φ(θ s )) represents the loss of the instance selector; This represents the loss of the instance classifier; This represents the loss of the instance detector; specifically, it includes: ① The loss of the instance selector is calculated using the hinge loss function, and the calculation formula is as follows: Among them, y i This represents the label of the i-th package; This represents the highest confidence level among the j instances of the i-th package; ② The loss of the instance classifier is calculated using the binary classification loss function, and the calculation formula is as follows: in, express The possibility of including a region; express The formula for calculating the label is as follows: in, This represents the dynamic IOU threshold corresponding to the actual label; Indicates calculation and The IOU between them is calculated using the following formula: Where A represents The area; B represents The area of ; ∩ represents the intersection; ∪ represents the union; ③ Calculate the loss of the instance generator using the following formula: Where I(x) represents the indicator function, I(x) = 1 when x = 1, and I(x) = 0 otherwise; L reg (·) represents the regression loss, calculated using the L1 loss function.
9. An imaging method comprising the placental implantation image segmentation method based on magnetic resonance data as described in any one of claims 1 to 8, comprising the following steps: A1. Acquire magnetic resonance imaging data; A2. A placental implantation image segmentation method based on magnetic resonance data is used to segment the placental implantation region in the image data obtained in step A1; A3. Based on the segmentation results obtained in step A2, mark the placental implantation segmentation results on the magnetic resonance image obtained in step A1, and perform secondary imaging processing; A4. Output magnetic resonance images with placental implantation area markers to complete imaging processing.
Citation Information
Patent Citations
MR image placenta segmentation method of multi-task generative adversarial model
CN113160256A
MRI image tissue segmentation method and imaging method based on semi-supervision
CN116524178A