Medical image segmentation method and device based on topological constraint enhancement
By combining topological constraint enhancement and efficient deep separable convolutional neural networks, the problems of data dependency and neglect of topological constraints in medical image segmentation are solved, achieving high-precision, low-complexity medical image segmentation, which is suitable for clinical environments with limited computing resources.
Patent Information
- Application Number
- CN202510786003.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-11-04
AI Technical Summary
Existing medical image segmentation methods rely on large amounts of high-quality labeled data, which is costly and time-consuming. Furthermore, traditional data augmentation techniques ignore the topological constraints of anatomical structures, which may generate unreasonable samples and cause the model to learn incorrect feature representations.
A medical image segmentation method based on topological constraint enhancement is adopted. By using Jacobi determinant analysis and topological constraint enforcement, the generated enhanced samples are ensured to be anatomically reasonable and reliable. Combined with an efficient deep separable convolutional neural network and context-aware adaptive threshold optimization, high-precision binary segmentation results are generated.
It effectively solves the problem that traditional data augmentation may damage the integrity of anatomical structures, achieves high-precision and low-complexity medical image segmentation, reduces dependence on high-performance computing resources, and improves the accuracy and robustness of segmentation.
Smart Images

Figure CN120894549A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image segmentation, and in particular relates to a medical image segmentation method based on topology constraint enhancement, a medical image segmentation device based on topology constraint enhancement, and a computer readable storage medium and a computer device. BACKGROUND
[0002] In related technologies, medical image segmentation, as a core technology of precision medicine, plays a crucial role in disease diagnosis, treatment planning and prognosis evaluation. In recent years, deep learning technology, especially convolutional neural networks, has made significant progress in medical image segmentation, and U-Net and its variants have become the mainstream architecture in this field. However, deep learning in medical image segmentation still faces many technical challenges in clinical application, which seriously hinders its widespread deployment and application in actual medical environment. At present, although deep learning-based medical image segmentation technology has shown good performance in academic research, existing medical image segmentation methods rely heavily on a large amount of high-quality labeled data, but medical image labeling requires professional physicians' manual labeling, which is extremely costly and time-consuming. Traditional data augmentation techniques such as geometric transformation and intensity adjustment can expand the data set, but often ignore the topological constraint characteristics of medical anatomy, which may generate anatomically unreasonable samples, leading to the model learning incorrect feature representation. SUMMARY
[0003] The present application aims to at least solve one of the above technical problems. To this end, one object of the present application is to propose a medical image segmentation method based on topology constraint enhancement, which ensures that the generated augmented samples are anatomically reasonable and reliable through Jacobian determinant analysis and topology constraint enforcement, effectively solving the problem that traditional data augmentation may damage the integrity of anatomical structure.
[0004] A second object of the present application is to propose a computer readable storage medium.
[0005] A third object of the present application is to propose a computer device.
[0006] A fourth object of the present application is to propose a medical image segmentation device based on topology constraint enhancement.
[0007] To achieve the above object, the first aspect of the present application provides a medical image segmentation method based on topological constraint enhancement, which comprises the following steps: obtaining an original medical image dataset; preprocessing the original medical image dataset to obtain a preprocessed original image and a labeled mask; generating a multi-scale random field according to the size of the preprocessed original image, and performing Gaussian kernel smoothing processing to obtain a smoothed multi-scale displacement field, and performing a weighted fusion operation on the multi-scale displacement field to obtain a fused displacement field; performing topological constraint forcing through Jacobian determinant analysis according to the fused displacement field to obtain an adjusted deformation field; calculating the coordinate position after transformation according to the adjusted deformation field, and performing boundary clipping on the out-of-bound coordinates to obtain an enhanced dataset; inputting the enhanced dataset into a pre-trained efficient deep separable convolutional neural network for processing to obtain a segmented probability image; and performing context-aware adaptive threshold optimization processing on the segmented probability image to obtain a final binary segmentation result; thereby, through Jacobian determinant analysis and topological constraint forcing, it is ensured that the generated enhanced sample is anatomically reasonable and reliable, effectively solving the problem that the traditional data enhancement may damage the integrity of the anatomical structure.
[0008] In addition, the medical image segmentation method based on topological constraint enhancement according to the above-mentioned embodiments of the present application can have the following additional technical features:
[0009] Optionally, the preprocessing of the original medical image dataset to obtain a preprocessed original image and a labeled mask comprises: performing normalization processing on each image in the original medical image dataset to obtain a normalized image; performing enhancement processing on the normalized image using contrast limited adaptive histogram equalization to obtain a preprocessed original image; converting the segmentation label into a binary mask, and performing morphological opening operation on the binary mask using an elliptical morphological structure element to remove noise points to obtain a preprocessed labeled mask.
[0010] Optionally, the pre-trained efficient deep separable convolutional neural network comprises a serial path and a weighted summation path, the serial path comprises a plurality of encoding modules and a plurality of decoding modules, each encoding module is connected in series with each decoding module after being connected in series, each encoding module comprises deep convolution downsampling, channel attention enhancement and maximum pooling, each decoding module comprises upsampling, feature layer and deep convolution decoder, and the weighted summation path comprises a plurality of multi-scale feature fusion modules to integrate multi-scale features from different encoding modules.
[0011] Optionally, the segmented probability image is subjected to context-aware adaptive threshold optimization processing to obtain a final binary segmentation result, including: calculating a local adaptive threshold and a global reference threshold according to the segmented probability image; extracting context features using a multi-layer convolutional network to calculate a weight; obtaining an initialization threshold according to the weight, the local adaptive threshold and the global reference threshold; entering an iterative optimization stage, calculating a predicted entropy according to a network-predicted probability value and performing normalization processing; adjusting the initialization threshold according to the normalized predicted entropy and generating a binary result; performing connected component labeling on the binary result and calculating a connectedness loss; calculating a Bayes number according to the connected component number and the binary result, and calculating a topology loss according to the connectedness loss and the Bayes number; if the topology loss is less than a topology loss threshold or after reaching a maximum number of iterations, ending the iterative optimization, and if the topology loss is greater than or equal to the topology loss threshold and the maximum number of iterations has not been reached, continuing the iterative optimization after adaptively adjusting the threshold according to the connected component number.
[0012] To achieve the above object, the second aspect of the present application provides a computer readable storage medium, which stores a medical image segmentation program based on topology constraint enhancement, and the medical image segmentation program based on topology constraint enhancement, when executed by a processor, implements the medical image segmentation method based on topology constraint enhancement.
[0013] To achieve the above object, the third aspect of the present application provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and when the processor executes the program, implements the medical image segmentation method based on topology constraint enhancement.
[0014] To achieve the above object, the fourth aspect of the present application provides a medical image segmentation device based on topological constraint enhancement, comprising: an acquisition module for acquiring an original medical image dataset; a preprocessing module for preprocessing the original medical image dataset to obtain a preprocessed original image and a labeled mask; a multi-scale deformation module for generating a multi-scale random field according to the size of the preprocessed original image, and smoothing the multi-scale random field by Gaussian kernel smoothing to obtain a smoothed multi-scale displacement field, and performing a weighted fusion operation on the multi-scale displacement field to obtain a fused displacement field; a topological constraint module for topological constraint enforcement by Jacobian determinant analysis according to the fused displacement field to obtain an adjusted deformation field; a data enhancement module for calculating the coordinate position after transformation according to the adjusted deformation field, and performing boundary clipping on the out-of-boundary coordinates to obtain an enhanced dataset; a segmentation module for inputting the enhanced dataset into a pre-trained efficient deep separable convolutional neural network for processing to obtain a segmented probability image; and an optimization module for context-aware adaptive threshold optimization processing of the segmented probability image to obtain a final binary segmentation result.
[0015] In addition, the medical image segmentation device based on topological constraint enhancement according to the above-mentioned embodiments of the present application can have the following additional technical features:
[0016] Optionally, the preprocessing module is further configured to perform normalization processing on each image in the original medical image dataset to obtain a normalized image; perform enhancement processing on the normalized image using contrast limited adaptive histogram equalization to obtain a preprocessed original image; convert segmentation labels into a binary mask, and perform morphological opening operation on the binary mask using an elliptical morphological structure element to remove noise points to obtain a preprocessed labeled mask.
[0017] Optionally, the pre-trained efficient deep separable convolutional neural network comprises a serial path and a weighted summation path, the serial path comprises a plurality of encoding modules and a plurality of decoding modules, each encoding module is connected in series with each decoding module after being connected in series, each encoding module comprises deep convolution downsampling, channel attention enhancement and maximum pooling, each decoding module comprises upsampling, feature layer and deep convolution decoder, and the weighted summation path comprises a plurality of multi-scale feature fusion modules to integrate multi-scale features from different encoding modules.
[0018] Optionally, the optimization module is further configured to calculate a local adaptive threshold and a global reference threshold according to the segmented probability map; extract context features by using a multi-layer convolutional network to calculate a weight; obtain an initial threshold according to the weight, the local adaptive threshold and the global reference threshold; enter an iterative optimization stage, calculate a prediction entropy according to a probability value predicted by the network, and perform normalization processing; adjust the initial threshold according to the normalized prediction entropy, and generate a binary result; perform connected component labeling on the binary result, and calculate a connectivity loss; calculate a Bethe number according to the number of connected components and the binary result, and calculate a topological loss according to the connectivity loss and the Bethe number; if the topological loss is less than a topological loss threshold or the maximum number of iterations is reached, end the iterative optimization, and if the topological loss is greater than or equal to the topological loss threshold and the maximum number of iterations is not reached, continue the iterative optimization after adaptively adjusting the threshold according to the number of connected components. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A flowchart of a medical image segmentation method based on topological constraint enhancement according to an embodiment of the present application;
[0020] Figure 2 A network structure block diagram corresponding to the medical image segmentation method based on topological constraint enhancement according to an embodiment of the present application;
[0021] Figure 3 A flowchart of a multi-dimensional morphological perturbation enhancement technique (MD-PAT) algorithm according to an embodiment of the present application;
[0022] Figure 4 A network architecture diagram of an efficient deep separable convolutional neural network (ED-CNN) according to an embodiment of the present application;
[0023] Figure 5 A flowchart of a context-aware adaptive threshold optimization (CA-ATO) algorithm according to an embodiment of the present application;
[0024] Figure 6 A block diagram of a medical image segmentation device based on topological constraint enhancement according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] Embodiments of the present application are described in detail below with reference to examples thereof shown in the attached drawings, wherein the same or similar reference numerals are used throughout the drawings and identical or similar components or components having the same or similar functions are denoted by the same or similar reference numerals. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.
[0026] For a better understanding of the above technical solutions, the exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be fully conveyed to those skilled in the art.
[0027] For a better understanding of the above technical solutions, the exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be fully conveyed to those skilled in the art.
[0028] Reference Figure 1 As shown in the figure, the medical image segmentation method based on topology constraint enhancement of the embodiment of the present application includes the following steps:
[0029] S101, obtaining an original medical image data set.
[0030] That is, by loading the original medical image data set, the supported formats include DICOM, PNG, TIFF, etc.
[0031] S102, preprocessing the original medical image data set to obtain a preprocessed original image and a labeled mask.
[0032] As an embodiment, the preprocessing of the original medical image data set to obtain the preprocessed original image and the labeled mask includes: performing normalization processing on each image in the original medical image data set to obtain a normalized image; performing enhancement processing on the normalized image using contrast limited adaptive histogram equalization to obtain a preprocessed original image; converting the segmentation label into a binary mask, and using an elliptical morphological structure element to perform morphological opening operation on the binary mask to remove noise points to obtain a preprocessed labeled mask.
[0033] Specifically, taking the retinal blood vessel segmentation task as an example, first, the input image size is uniformly standardized to 512x512 pixels. Perform image normalization processing to map the pixel value range to the [0,1] interval, and the calculation formula is:
[0034]
[0035] Where I orig represents the original image, I min and I max are the minimum and maximum values of the image, respectively.
[0036] Next, CLAHE (Contrast Limited Adaptive Histogram Equalization) enhancement processing is performed on the normalized image. The clipping limit parameter clipLimit = 2.0 and the grid size tileGridSize = 8x8 are set. Then, zero-mean standardization is performed:
[0037]
[0038] where μ and σ are the mean and standard deviation of the image, respectively.
[0039] Finally, the annotation mask preprocessing is performed. The segmentation annotation is converted into a binary mask, and the foreground pixel value is set to 1 and the background pixel value is set to 0. Morphological opening operation is performed on the mask to remove noise, and an elliptical structure element SE = ellipse(3, 3) is used:
[0040]
[0041] where, represents the erosion operation, represents the dilation operation.
[0042] S103, according to the preprocessed original image size, a multi-scale random field is generated, and a Gaussian kernel smoothing processing is performed to obtain a smoothed multi-scale displacement field. The weighted fusion operation is performed on the multi-scale displacement field to obtain the fused displacement field.
[0043] Specifically, first, the basic random displacement field is generated. For the input image size HxW, two independent random fields R x (i,j) and R y (i,j) are created, where each element is sampled from a uniform distribution U(-1, 1):
[0044]
[0045] Next, Gaussian kernel smoothing processing is applied. A two-dimensional Gaussian kernel G σ is constructed, and its mathematical expression is:
[0046]
[0047] The kernel size is set to ksize = 6σ + 1 to ensure that it covers 99.7% of the Gaussian distribution. The smoothed displacement field is obtained by convolution operation:
[0048] D x = G σ *R x ,D y = G σ *R y
[0049] Then, the intensity coefficient is applied to generate the final displacement field:
[0050] Δ x = a · D x , Δ y = a · D y
[0051] wherein, is a scalar parameter controlling the intensity of deformation, usually set between 80.0 and 120.0 according to the characteristics of the medical image.
[0052] Secondly, a three-scale deformation field is generated. According to the preset parameter combination, large, medium and small scale deformations are generated, and the specific parameter settings are as follows:
[0053] Large scale deformation: σ1=15.0, α1=40.0, w1=0.5
[0054] Medium scale deformation: σ2=8.0, α2=70.0, w2=0.3
[0055] Small scale deformation: σ3=4.0, α3=110.0, w3=0.2
[0056] The displacement field calculation of each scale follows the above steps to obtain a multi-scale displacement field.
[0057] Finally, a weighted fusion operation is performed to combine the multi-scale deformations:
[0058]
[0059] wherein the weight coefficients satisfy the normalization constraint
[0060] S104, according to the fused displacement field, topological constraint is forced by Jacobian determinant analysis to obtain an adjusted deformation field.
[0061] Specifically, first, the Jacobian matrix is calculated. The partial derivative of the deformation field is calculated using the finite difference method, wherein h is the pixel spacing, and the central difference is used to improve the accuracy:
[0062]
[0063] Next, the Jacobian matrix is constructed and the determinant is calculated. The Jacobian matrix at each pixel position (i, j) is:
[0064]
[0065] The determinant is calculated as:
[0066]
[0067] Finally, topology constraint check and correction. Set threshold δ = 0.5, and adaptively correct the position that violates the constraint det(J T (i,j)) < δ:
[0068]
[0069] Apply correction factor:
[0070]
[0071] S105, calculate the transformed coordinate position according to the adjusted deformation field, and perform boundary clipping on the out-of-boundary coordinates to obtain the enhanced data set.
[0072] Specifically, the transformed coordinate position is calculated. The coordinate mapping relationship is established:
[0073]
[0074] Boundary clipping is performed on the out-of-boundary coordinates:
[0075]
[0076] In addition, as a specific embodiment, as shown in Figure 3 , the multi-dimensional morphological perturbation enhancement technique includes the following steps:
[0077] 1. Initialize coordinate grid (x, y) <- meshgrid(W, H)
[0078] 2. Perform for i = 1 to 3
[0079] 3. Generate random field R x,i ,R y,i ~ U(-1, 1), size (H, W)
[0080] 4. Construct Gaussian kernel G σi , kernel size 6σ i +1
[0081] 5. Apply Gaussian smoothing
[0082] 6. Calculate displacement Δ xi <- α i · D x,i , Δ yi <- α i · D y,i
[0083] 7. End loop
[0084] 8. Multi-scale fusion
[0085] 9. Compute Jacobian determinant using finite differences
[0086] 10. For each pixel (p,q) do
[0087] 11. If J(p,q) < δ then
[0088] 12. correction <- J(p,q) / δ
[0089] 13. Δx(p,q) <- Δx(p,q) x correction
[0090] 14. Δy(p,q) <- Δy(p,q) x correction
[0091] 15. End if
[0092] 16. End loop
[0093] 17. Compute new coordinates x' <- x + Δ x , y' <- y + Δ y
[0094] 18. Apply boundary clipping x' <- clip(x',0,W-1), y' <- clip(y',0,H-1) clip clip
[0095] 19. Apply warp I' <- warp(I,x' clip ,y' vlip ), M' <- warp(M,x' clip ,y' vlip )
[0096] 20. Return I', M' = 0
[0097] It should be noted that by the proposed multi-dimensional morphological perturbation augmentation technique (MD-PAT) through Jacobian determinant analysis and topological constraint enforcement, it is ensured that the generated augmented samples are anatomically reasonable and credible, effectively solving the problem that traditional data augmentation may damage the integrity of anatomical structures.
[0098] S106, input the augmented data set to the pre-trained efficient deep separable convolutional neural network for processing to obtain a segmented probability image.
[0099] That is, the medical image data processed by the multi-dimensional morphological perturbation augmentation technique (MD-PAT) is input to the pre-trained efficient deep separable convolutional neural network for processing to output a segmented image, i.e., a binary mask or probability map of the region of interest (such as blood vessels, tumors, etc.) in the medical image.
[0100] As an example, as shown in Figure 4 The pre-trained efficient deep separable convolutional neural network includes a serial path and a weighted summation path, the serial path includes a plurality of encoding modules and a plurality of decoding modules, each encoding module is serially connected with each decoding module after being serially connected, each encoding module includes a deep convolution down-sampling, a channel attention enhancement and a maximum pooling, each decoding module includes an up-sampling, a feature layer and a deep convolution decoder, and the weighted summation path includes a plurality of multi-scale feature fusion modules to integrate multi-scale features from different encoding modules.
[0101] Specifically, the efficient deep separable convolutional neural network (ED-CNN) is constructed to include a deep-channel decoupling convolution module design, a channel attention enhancement mechanism and a hierarchical feature path design.
[0102] The deep-channel decoupling convolution module design includes:
[0103] The deep convolution layer design. The deep convolution performs spatial filtering independently for each input channel, and the mathematical expression is:
[0104]
[0105] wherein X c represents the c-th input channel, is the deep convolution kernel corresponding to the channel, and K is the convolution kernel size. The number of parameters is K 2 ·C in , which is significantly reduced compared with the standard convolution.
[0106] The point-wise convolution layer design. A 1x1 convolution kernel is used to perform linear combination in the channel dimension:
[0107]
[0108] wherein, is the point-wise convolution weight, b d is the bias term, d represents the output channel index, and the number of parameters is C in ·C out The parameter quantity analysis of the deep separable convolution. The total number of parameters is:
[0109] Params DSC = K 2 ·C in +C in ·C out
[0110] Compared with the standard convolution, the number of parameters is std = K 2 ·C in ·C out, the parameter reduction ratio is:
[0111]
[0112] For a typical configuration K = 3, C in = C out = 64, a parameter reduction of about 87.3% can be achieved.
[0113] Standard convolution parameters: K 2 × C in × C out = 9 × 64 × 64 = 36864
[0114] Depthwise separable convolution parameters: K 2 × C in + C in × C out = 9 × 64 + 64 × 64 = 576 + 4096 = 4672 Actual reduction ratio: Wherein, the channel attention enhancement mechanism includes:
[0115] Global average pooling operation. The spatial features of each channel are compressed into a single descriptor:
[0116]
[0117] Wherein, X c represents the cth feature channel, H and W are the height and width of the feature map, respectively.
[0118] Bottleneck structure design. Learn the nonlinear relationship between channels through two layers of fully connected networks:
[0119] Z1 = ReLU (W1·GAP + b1), Z2 = Sigmoid (W2·Z1 + b2)
[0120] Wherein r is the reduction ratio (usually set to 16).
[0121] Channel recalibration operation. Apply attention weights to the original features:
[0122] Y c (i,j) = Z 2,c ·X c (i,j)
[0123] Wherein, Z 2,c is the attention weight of the cth channel.
[0124] Wherein, the hierarchical feature path design includes:
[0125] Feature integration module design. Combine the series path and weighted sum path:
[0126] F concat = Conv 1×1 Concat[F1, F2,.., F n ]
[0127]
[0128] where the weights w i are learned by training, and the final output is:
[0129] F out = F concat + F weighted
[0130] Multi-scale feature fusion module. A three-stage processing procedure is performed:
[0131] First stage: channel alignment
[0132]
[0133] Second stage: feature refinement
[0134]
[0135] Third stage: adaptive fusion
[0136]
[0137] where w i is a learnable fusion weight parameter.
[0138] It should be noted that the current mainstream segmentation network such as U-Net, Attention U-Net, etc. usually contains tens of millions of parameters, and the calculation complexity is extremely high, which requires a large amount of GPU memory and computing resources; such high computing demand is difficult to meet in resource-limited clinical environments, especially in primary medical institutions and remote medical scenarios, which lack high-performance computing hardware support, seriously hindering the practical application and promotion of the technology; therefore, the proposed deep separable convolutional neural network architecture significantly reduces the parameter quantity and calculation complexity, compared with the traditional U-Net, greatly reduces the parameter size and floating point operation amount, and realizes the real-time processing capability on the standard clinical hardware.
[0139] S107, the context-aware adaptive threshold optimization processing is performed on the segmented probability image to obtain the final binary segmentation result.
[0140] As an embodiment, the segmented probability image is subjected to context-aware adaptive threshold optimization processing to obtain a final binary segmentation result, including: calculating a local adaptive threshold and a global reference threshold according to the segmented probability image; extracting context features by using a multi-layer convolutional network to calculate a weight; obtaining an initialization threshold according to the weight, the local adaptive threshold and the global reference threshold; entering an iterative optimization stage, calculating a prediction entropy according to a probability value predicted by the network, and performing normalization processing; adjusting the initialization threshold according to the normalized prediction entropy, and generating a binary result; performing connected component labeling on the binary result, and calculating a connectedness loss; calculating a Bayes number according to the number of connected components and the binary result, and calculating a topological loss according to the connectedness loss and the Bayes number; if the topological loss is less than a topological loss threshold or after reaching a maximum number of iterations, ending the iterative optimization, and if the topological loss is greater than or equal to the topological loss threshold and the maximum number of iterations has not been reached, continuing the iterative optimization after adaptively adjusting the threshold according to the number of connected components.
[0141] Specifically, the context-aware adaptive threshold optimization (CA-ATO) includes hierarchical feature integrated threshold calculation, uncertainty-guided refinement, and iterative refinement of topological feedback.
[0142] The hierarchical feature integrated threshold calculation includes:
[0143] Local adaptive threshold calculation. A sliding window strategy is used, with a window size of 64x64 and an overlapping step size of 32 pixels. For each window W i,j The Otsu method is applied:
[0144]
[0145] where w0(t) and w1(t) are the pixel proportions of the background and foreground, respectively, and μ0(t) and μ1(t) are the corresponding mean values.
[0146] Global reference threshold calculation. The Otsu algorithm is applied to the entire image to obtain a global threshold T global .
[0147] Context-related weight function design. Context features are extracted by a multi-layer convolutional network:
[0148] f(i,j)=CNN(P window (i,j))
[0149] where P window (i,j) is a 7x7 neighborhood window centered at (i,j). The weight function is calculated as:
[0150] α(i,j)=Sigmoid(W α ·f(i,j)+b α )
[0151] Hierarchical threshold fusion. Combining local and global information:
[0152] T(i,j) = a(i,j) · T local (i,j) + (1 - a(i,j)) · T global
[0153] where the uncertainty-guided refinement includes:
[0154] Prediction entropy computation. Quantifying the prediction uncertainty at each pixel position:
[0155] H(i,j) = -P(i,j)logP(i,j) - (1 - P(i,j))log(1 - P(i,j))
[0156] where P(i,j) is the probability value predicted by the network. To prevent numerical instability, the probability value is clipped: P Cl p = clip(P,∈,1-∈),∈=10 -8 .
[0157] Entropy value normalization:
[0158]
[0159] Uncertainty-based threshold dynamic adjustment:
[0160] T final (i,j) = T(i,j) · (1 - η · H norm (i,j))
[0161] where η = 0.2 is the adjustment coefficient, used to control the degree of influence of uncertainty on the threshold.
[0162] where the iterative refinement of topological feedback includes:
[0163] Connectedness analysis. Perform connected component labeling on the binarized result, and compute the connectedness loss:
[0164]
[0165] where S i represents the number of pixels in the i-th connected component, and N is the total number of connected components.
[0166] Betti number computation. Compute topological invariants:
[0167] β0= connected component number - 1
[0168] β1= hole number
[0169] Estimate holes using morphological closing operation: holes = Close(B) - B, where B is the binary segmentation result.
[0170] Synthesis topology loss computation:
[0171]
[0172] Weight coefficients are set as λ1=0.4, λ2=0.3, λ3=0.3.
[0173] Iterative optimization algorithm. Set the maximum number of iterations T max = 5, topology loss threshold τ = 0.1:
[0174] When , adjust the threshold value adaptively according to the number of connected components:
[0175] If N > 10 (too many separated components), then T new = T old + 0.02
[0176] If N < 3 (too few components), then T new = T old - 0.02
[0177] The final threshold is limited to the range [0.1, 0.9].
[0178] In addition, as a specific embodiment, as shown in Figure 5 , context-aware adaptive threshold optimization (CA-ATO) includes the following steps:
[0179] 1. Initialization phase
[0180] 2. Calculate the local threshold map T local ← LocalOtsu(P, window_size = 64)
[0181] 3. Calculate the global threshold T global ← GlobalOtsu(P)
[0182] 4. Extract context features f ← ContextNet(P) using a 7x7 receptive field
[0183] 5. Calculate the weight α ← Sigmoid(W·f+b)
[0184] 6. Initialize the threshold T ← α ⊙ T local + (1-α) ⊙ T global
[0185] 7. Iterative optimization phase
[0186] 8. For t = 1 to Tmax Perform
[0187] 9. Compute prediction entropy H <- -P log P - (1-P) log (1-P)
[0188] 10. Normalize entropy H norm <- H / log2
[0189] 11. Adjust threshold T <- T ⊙ (1 - η · H norm )
[0190] 12. Generate binary result B <- (P > T)
[0191] 13. Connected component analysis N, {S i} <- ConnectedComponents(B)
[0192] 14. Compute connectedness loss L conn <- Var({S i}) / (Mean({S i}) + ε)
[0193] 15. Compute Beta parameters β0 <- N-1, β1 <- CountHoles(B)
[0194] 16. Compute topology loss L topo <- 0.4 · L conn + 0.3 · |β0 - 1| + 0.3 · β1
[0195] 17. If L topo < τ then
[0196] 18. Exit
[0197] 19. End if
[0198] 20. / / Adaptive threshold adjustment
[0199] 21. If N > 10 then
[0200] 22. T <- T + 0.02 {Too many components, increase threshold}
[0201] 23. Else if N < 3 then
[0202] 24. T <- T - 0.02 {Too few components, decrease threshold}
[0203] 25. End if
[0204] 26. T <- clip(T, 0.1, 0.9) {Threshold range constraint}
[0205] 27. End loop
[0206] 28. Return B = 0
[0207] It should be noted that the anatomical structure in the medical image often has complex morphological features, with blurred boundaries and low contrast, especially the segmentation of small structures such as blood vessels and nerve fibers is extremely challenging. The existing methods mostly use fixed global threshold for post-processing, which cannot effectively adapt to the local feature changes in different regions of the medical image, resulting in loss of small structures and inaccurate boundary positioning; moreover, medical anatomical structures span multiple spatial scales, from large-scale features at the organ level to microscopic structures at the cellular level, and existing segmentation methods often lack effective multi-scale information integration mechanisms when fusing features, which cannot fully utilize the complementary information of different scales, affecting the accuracy and robustness of segmentation; in addition, existing methods are usually optimized for specific imaging devices, imaging protocols or pathological types, and lack generalization ability when facing medical images from different sources, requiring a lot of retraining and parameter adjustment, limiting the universality and practical application value of the method; therefore, the proposed context-aware adaptive threshold optimization algorithm can dynamically adjust the segmentation threshold according to multi-scale context information and uncertainty estimation, significantly improving the boundary positioning accuracy and small structure preservation ability.
[0208] In addition, in the model training setting, the AdamW optimizer is used, and the parameter settings are: learning rate lr = 10 -3 , weight decay weight_decay = 10 -4 , momentum parameters β1 = 0.9, β2 = 0.999.
[0209] Learning rate scheduling strategy. The cosine annealing scheduler is used:
[0210]
[0211] Where lr max = 10 -3 , lr min = 10 -6 , T max = 200 is the total number of training rounds.
[0212] Composite loss function design:
[0213]
[0214] Where the Dice loss is:
[0215]
[0216] P is the prediction result, G is the true label, ∈ = 10 -6 is the smoothing term.
[0217] In summary, asFigure 2 As shown, according to the medical image segmentation method based on topology constraint enhancement, first, the original medical image dataset is acquired; then, the original medical image dataset is preprocessed to obtain the preprocessed original image and the annotation mask; second, the multi-scale random field is generated according to the size of the preprocessed original image, and the multi-scale displacement field is obtained by Gaussian kernel smoothing processing, and the weighted fusion operation is performed on the multi-scale displacement field to obtain the fused displacement field; then, the topology constraint is forced by Jacobian determinant analysis according to the fused displacement field to obtain the adjusted deformation field; then, the coordinate position after transformation is calculated according to the adjusted deformation field, and the boundary clipping is performed on the out-of-boundary coordinates to obtain the enhanced dataset; then, the enhanced dataset is input into the pre-trained efficient deep separable convolutional neural network for processing to obtain the segmented probability image; finally, the context-aware adaptive threshold optimization processing is performed on the segmented probability image to obtain the final binary segmentation result; thus, starting from the topology characteristics of the anatomical structure, the multi-dimensional morphological disturbance enhancement technology, the efficient deep separable convolutional neural network and the context-aware adaptive threshold optimization are synergistically integrated to realize the high-precision and low-complexity medical image segmentation.
[0218] In addition, the present application also provides a computer readable storage medium having a medical image segmentation program based on topology constraint enhancement stored thereon, and the medical image segmentation program based on topology constraint enhancement, when executed by a processor, implements the medical image segmentation method based on topology constraint enhancement as described above.
[0219] In addition, the present application also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the medical image segmentation method based on topology constraint enhancement as described above is implemented.
[0220] Figure 6 A block schematic diagram of the medical image segmentation device based on topology constraint enhancement according to the embodiment of the present application is shown. As shown, the medical image segmentation device comprises an acquisition module 10, a preprocessing module 20, a multi-scale deformation module 30, a topology constraint module 40, a data enhancement module 50, a segmentation module 60 and an optimization module 70. Figure 6
[0221] The acquisition module 10 is configured to acquire an original medical image dataset; the preprocessing module 20 is configured to preprocess the original medical image dataset to obtain a preprocessed original image and a label mask; the multi-scale deformation module 30 is configured to generate a multi-scale random field according to the size of the preprocessed original image, and to obtain a smoothed multi-scale displacement field through Gaussian kernel smoothing processing, and to perform a weighted fusion operation on the multi-scale displacement field to obtain a fused displacement field; the topological constraint module 40 is configured to perform topological constraint forcing through Jacobian determinant analysis according to the fused displacement field to obtain an adjusted deformation field; the data enhancement module 50 is configured to calculate a transformed coordinate position according to the adjusted deformation field, and to perform boundary clipping on the out-of-bound coordinates to obtain an enhanced dataset; the segmentation module 60 is configured to input the enhanced dataset into a pre-trained efficient deep separable convolutional neural network for processing to obtain a segmented probability image; and the optimization module 70 is configured to perform context-aware adaptive threshold optimization processing on the segmented probability image to obtain a final binary segmentation result.
[0222] As an embodiment, the preprocessing module 20 is further configured to perform normalization processing on each image in the original medical image dataset to obtain a normalized image; perform enhancement processing on the normalized image using contrast limited adaptive histogram equalization to obtain a preprocessed original image; convert a segmentation label into a binary mask, and perform morphological opening operation on the binary mask using an elliptical morphological structure element to remove noise points to obtain a preprocessed label mask.
[0223] As an embodiment, the pre-trained efficient deep separable convolutional neural network includes a serial path and a weighted summation path, the serial path includes a plurality of encoding modules and a plurality of decoding modules, each encoding module is connected in series with each decoding module connected in series, each encoding module includes deep convolution downsampling, channel attention enhancement, and maximum pooling, each decoding module includes upsampling, a feature layer, and a deep convolution decoder, and the weighted summation path includes a plurality of multi-scale feature fusion modules to integrate multi-scale features from different encoding modules.
[0224] As an embodiment, the optimization module 70 is further configured to calculate a local adaptive threshold and a global reference threshold according to the segmented probability map; extract context features by using a multi-layer convolutional network to calculate a weight; obtain an initial threshold according to the weight, the local adaptive threshold and the global reference threshold; enter an iterative optimization stage, calculate a prediction entropy according to a probability value predicted by the network, and perform normalization processing; adjust the initial threshold according to the normalized prediction entropy, and generate a binary result; perform connected component labeling on the binary result, and calculate a connectedness loss; calculate a Bethe number according to the number of connected components and the binary result, and calculate a topology loss according to the connectedness loss and the Bethe number; if the topology loss is less than a topology loss threshold or the maximum number of iterations is reached, end the iterative optimization, and if the topology loss is greater than or equal to the topology loss threshold and the maximum number of iterations is not reached, continue the iterative optimization after adaptively adjusting the threshold according to the number of connected components.
[0225] It should be noted that the foregoing description of the embodiment of the medical image segmentation method based on topology constraint enhancement is also applicable to the embodiment of the medical image segmentation device based on topology constraint enhancement, which will not be repeated here.
[0226] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0227] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as a combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The device that implements the functions specified in one or more flows and / or blocks.
[0228] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 the function specified in the one or more blocks or blocks.
[0229] These computer program instructions can also be loaded into a computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable devices to generate a computer-implemented process, so that the instructions executed on the computer or other programmable devices provide a process for implementing the flow Figure 1 one or more processes and / or blocks Figure 1 the function specified in the one or more blocks or blocks.
[0230] It is noted that in the claims the reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps not listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unitary claim, the features of the different embodiments can be combined with each other if not incompatible. The use of the word 'a' or 'an' does not exclude the presence of a plurality of these elements, nor does it imply that each has to be considered separately. The word 'comprise' and variations such as 'comprising', 'comprises' and 'comprised of' should not be interpreted as limiting the step or steps, the function or functions, the means or the means by which the step or steps are carried out, the function or functions are carried out, or the means by which the function or functions are carried out, to the specific steps, functions, means, or steps, functions, means described in the claim or claims.
[0231] Although preferred embodiments of the application have been described, a person of ordinary skill in the art can make additional changes and modifications to these embodiments once armed with the present disclosure. Therefore, the appended claims are intended to cover all such changes and modifications that fall within the scope of the application.
[0232] It is clear that a person skilled in the art can make various modifications and variations to the application without departing from the spirit and scope of the application. Thus, the application is intended to embrace all such modifications and variations as fall within the scope of the appended claims and their equivalents.
[0233] In the description of the application, it should be understood that the terms "first", "second", etc. are used only for descriptive purposes and are not to be construed as indicating or implying relative importance or an indicated order of steps. Thus, features defined with "first", "second" can include one or more of the features. In the description of the application, the meaning of "a plurality" is two or more, unless explicitly specifically defined otherwise.
[0234] In the present application, unless specifically defined otherwise, the terms "mounting", "connected", "connection", "fixed", and the like should be construed broadly and do not necessarily mean fixedly connected, but can mean removably connected, or integral; can mean mechanical connection, or electrical connection; can mean direct connection, or indirect connection via an intermediate medium; can mean internal communication between two elements, or interaction between two elements. Those skilled in the art can understand the specific meaning of the above terms in the present application according to the specific circumstances.
[0235] In the present application, unless specifically defined otherwise, the first feature is "on" or "under" the second feature can be that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, the first feature "above", "over" and "on" the second feature can be that the first feature is directly above or obliquely above the second feature, or only means that the horizontal height of the first feature is higher than that of the second feature. The first feature "below", "under" and "under" the second feature can be that the first feature is directly below or obliquely below the second feature, or only means that the horizontal height of the first feature is less than that of the second feature.
[0236] In the description of the present application, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the present application and the features of the different embodiments or examples without contradiction.
[0237] Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A medical image segmentation method based on topological constraint enhancement, characterized in that, Includes the following steps: Obtain the raw medical image dataset; The original medical image dataset is preprocessed to obtain preprocessed original images and annotation masks; A multi-scale random field is generated based on the size of the preprocessed original image, and a smoothed multi-scale displacement field is obtained by smoothing it with a Gaussian kernel. A weighted fusion operation is then performed on the multi-scale displacement field to obtain the fused displacement field. Based on the fused displacement field, topological constraints are enforced through Jacobian determinant analysis to obtain the adjusted deformation field; The transformed coordinate positions are calculated based on the adjusted deformation field, and boundary clipping is performed on out-of-bounds coordinates to obtain the enhanced dataset. The enhanced dataset is input into a pre-trained, high-efficiency deep separable convolutional neural network for processing to obtain a segmented probability image; The segmented probability image is subjected to context-aware adaptive threshold optimization to obtain the final binary segmentation result.
2. The medical image segmentation method based on topological constraint enhancement as described in claim 1, characterized in that, The original medical image dataset is preprocessed to obtain preprocessed original images and annotation masks, including: Each image in the original medical image dataset is normalized to obtain a normalized image; The normalized image is enhanced by contrast-limited adaptive histogram equalization to obtain the preprocessed original image. The segmentation labels are converted into binary masks, and morphological opening operations are performed on the binary masks using elliptical morphological structuring elements to remove noise, so as to obtain the preprocessed label mask.
3. The medical image segmentation method based on topological constraint enhancement as described in claim 1, characterized in that, The pre-trained high-efficiency deep separable convolutional neural network includes a concatenated path and a weighted summation path. The concatenated path includes multiple encoding modules and multiple decoding modules. Each encoding module is concatenated with each of the concatenated decoding modules. Each encoding module includes deep convolutional downsampling, channel attention enhancement, and max pooling. Each decoding module includes upsampling, a feature layer, and a deep convolutional decoder. The weighted summation path includes multiple multi-scale feature fusion modules to integrate multi-scale features from different encoding modules.
4. The medical image segmentation method based on topological constraint enhancement as described in claim 1, characterized in that, The segmented probability image is subjected to context-aware adaptive threshold optimization to obtain the final binary segmentation result, including: Calculate the local adaptive threshold and the global baseline threshold based on the segmented probability map; A multi-layer convolutional network is used to extract contextual features to calculate weights; The initial threshold is obtained based on the weights, the local adaptive threshold, and the global baseline threshold. Entering the iterative optimization stage, the prediction entropy is calculated based on the probability values predicted by the network and then normalized. The initial threshold is adjusted based on the normalized prediction entropy, and a binary result is generated. The binary results are labeled with connected components, and the connectivity loss is calculated. The Betti number is calculated based on the number of connected components and the binary result, and the topology loss is calculated based on the connectivity loss and the Betti number; If the topology loss is less than the topology loss threshold or the maximum number of iterations is reached, the iterative optimization ends. If the topology loss is greater than or equal to the topology loss threshold but the maximum number of iterations has not been reached, the threshold is adaptively adjusted according to the number of connected components and the iterative optimization continues.
5. A computer-readable storage medium, characterized in that, It stores a medical image segmentation program based on topology constraint enhancement, which, when executed by a processor, implements the medical image segmentation method based on topology constraint enhancement as described in any one of claims 1-4.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the medical image segmentation method based on topological constraint enhancement as described in any one of claims 1-4.
7. A medical image segmentation device based on topological constraint enhancement, characterized in that, include: The acquisition module is used to acquire the raw medical image dataset; The preprocessing module is used to preprocess the original medical image dataset to obtain the preprocessed original images and annotation masks; The multi-scale deformation module is used to generate a multi-scale random field based on the size of the preprocessed original image, and to obtain a smoothed multi-scale displacement field by smoothing it with a Gaussian kernel. Then, a weighted fusion operation is performed on the multi-scale displacement field to obtain a fused displacement field. The topology constraint module is used to enforce topology constraints based on the fused displacement field through Jacobian determinant analysis to obtain the adjusted deformation field. The data augmentation module is used to calculate the transformed coordinate positions based on the adjusted deformation field and to perform boundary clipping on out-of-bounds coordinates to obtain the augmented dataset. The segmentation module is used to input the enhanced dataset into a pre-trained, high-efficiency deep separable convolutional neural network for processing to obtain a segmented probability image; The optimization module is used to perform context-aware adaptive threshold optimization on the segmented probability image to obtain the final binary segmentation result.
8. The medical image segmentation device based on topological constraint enhancement as described in claim 7, characterized in that, The preprocessing module is further configured to: normalize each image in the original medical image dataset to obtain a normalized image; enhance the normalized image using contrast-limited adaptive histogram equalization to obtain a preprocessed original image; convert the segmentation labels into a binary mask and perform morphological opening operations on the binary mask using elliptical morphological structuring elements to remove noise, thereby obtaining a preprocessed label mask.
9. The medical image segmentation device based on topological constraint enhancement as described in claim 7, characterized in that, The pre-trained high-efficiency deep separable convolutional neural network includes a concatenated path and a weighted summation path. The concatenated path includes multiple encoding modules and multiple decoding modules. Each encoding module is concatenated with each of the concatenated decoding modules. Each encoding module includes deep convolutional downsampling, channel attention enhancement, and max pooling. Each decoding module includes upsampling, a feature layer, and a deep convolutional decoder. The weighted summation path includes multiple multi-scale feature fusion modules to integrate multi-scale features from different encoding modules.
10. The medical image segmentation apparatus based on topological constraint enhancement as described in claim 7, characterized in that, The optimization module is further configured to: calculate a local adaptive threshold and a global baseline threshold based on the segmented probability map; extract contextual features using a multi-layer convolutional network to calculate weights; and obtain an initial threshold based on the weights, the local adaptive threshold, and the global baseline threshold. Entering the iterative optimization phase, the prediction entropy is calculated based on the network's predicted probability values and normalized. The initialization threshold is adjusted based on the normalized prediction entropy, and a binary result is generated. Connected components are marked on the binary result, and connectivity loss is calculated. The Betti number is calculated based on the number of connected components and the binary result, and the topology loss is calculated based on the connectivity loss and the Betti number. If the topology loss is less than the topology loss threshold or the maximum number of iterations is reached, the iterative optimization ends. If the topology loss is greater than or equal to the topology loss threshold but the maximum number of iterations has not been reached, the threshold is adaptively adjusted based on the number of connected components, and iterative optimization continues.
Citation Information
Cited By
Multi-time-point neural image comparative analysis method and system
CN121544675A