Semi-supervised medical image segmentation method based on cross-layer topology consistency

By employing a semi-supervised medical image segmentation method based on cross-layer topological consistency, and utilizing 2.5D multi-slice stacking input and uncertainty-aware pseudo-label filtering, the discontinuity and structural breakage problems in 3D medical image segmentation under sparse annotation conditions are solved, achieving higher quality 3D segmentation results.

CN122336282APending Publication Date: 2026-07-03盐城市第三人民医院

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
盐城市第三人民医院
Filing Date
2026-04-02
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies for 3D medical image segmentation under sparse labeling conditions suffer from problems such as discontinuous prediction along the Z-axis, structural breaks, and unstable topological relationships. Furthermore, semi-supervised pseudo-labeling methods do not fully utilize the connectivity information of unlabeled slices, resulting in poor segmentation performance.

Method used

A semi-supervised medical image segmentation method based on cross-layer topological consistency is adopted. By using 2.5D multi-slice stacked input, uncertainty-aware pseudo-label screening, and cross-layer connected component graph matching, cross-layer consistency loss and supervision loss are constructed to optimize the network and improve the segmentation quality.

Benefits of technology

While reducing annotation costs, it significantly improves the coherence and topological consistency of 3D structures, and enhances the quality and robustness of 3D segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336282A_ABST
    Figure CN122336282A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of medical image processing and discloses a semi-supervised medical image segmentation method based on cross-layer topological consistency. To address the problems of insufficient supervision information, difficulty in utilizing unlabeled slices, and easy occurrence of cross-layer discontinuities and structural breaks in the segmentation results of 3D medical images under sparse Z-axis annotation, this invention obtains a predicted probability map by constructing a 2.5D stacked input of K adjacent slices, generates a connected component map, and establishes a cross-layer fusion map with the connected component maps of adjacent slices. A graph neural network is used to complete cross-layer node matching and correct the probability of connected regions accordingly. During training, uncertainty-aware pseudo-label screening and topological consistency loss are combined to jointly optimize the network, thereby achieving the technical effects of improving Z-axis consistency and 3D segmentation quality and reducing annotation costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing, and more particularly to a semi-supervised medical image segmentation method based on cross-layer topological consistency. Background Technology

[0002] Three-dimensional medical image segmentation (such as CT and MRI) is a crucial step in computer-aided diagnosis and treatment planning. In recent years, deep learning segmentation models have developed rapidly: two-dimensional convolutional networks, represented by U-Net, are widely used for slice-by-slice segmentation due to their ease of training and deployment; subsequently, three-dimensional segmentation networks (such as 3DU-Net and V-Net) directly model the spatial context of volumetric data through three-dimensional convolution, achieving better results in terms of structural integrity. To balance the efficiency of two-dimensional methods with the spatial utilization of three-dimensional methods, the industry has also proposed a 2.5D approach, which involves stacking the target slice and adjacent slices in the channel dimension and inputting them into the network to introduce limited inter-layer information. Furthermore, in clinical scenarios where annotation costs are high, semi-supervised segmentation methods have gradually become a research hotspot. Common approaches include self-training based on pseudo-labels, perturbation training based on consistency regularization, and introducing uncertainty estimation to screen reliable pseudo-label regions.

[0003] However, existing technologies still have shortcomings in sparsely labeled 3D medical image segmentation:

[0004] 1. Two-dimensional or 2.5D slice-by-slice segmentation focuses on pixel-level prediction, lacks explicit constraints on the structural coherence and topological consistency between adjacent slices, and is prone to prediction jumps, breaks or discontinuities in the Z-axis direction.

[0005] 2. 3D segmentation networks typically rely on relatively complete volume data annotations and have high computational costs. Training is unstable and deployment is difficult when only a small number of slices are annotated.

[0006] 3. Existing semi-supervised pseudo-labeling methods mainly rely on pixel consistency, which does not make full use of the connectivity information in unlabeled slices. Furthermore, pseudo-label noise is prone to propagate between layers, making it difficult to guarantee the consistency of cross-layer structural correspondences and morphological changes (such as splitting / merging).

[0007] Therefore, there is a need for a semi-supervised medical image segmentation method based on cross-layer topological consistency that can overcome the shortcomings of the existing technologies. Summary of the Invention

[0008] One objective of this invention is to propose a semi-supervised medical image segmentation method based on cross-layer topological consistency. Addressing the problems of insufficient supervision information, difficulty in effectively incorporating unlabeled slices into training, and the tendency for slice-by-slice segmentation to suffer from Z-axis prediction discontinuities, structural breaks, and unstable topological relationships, this invention proposes a technical solution combining 2.5D multi-slice stacked input, uncertainty-aware pseudo-label screening, and cross-layer connected component graph matching. For each target slice, K adjacent slice channels are stacked and input into the segmentation network to obtain a prediction probability map. Based on the prediction results, a connected component graph is constructed, and cross-layer candidate connections are established with the connected component graphs of adjacent slices to form a cross-layer fusion graph. A graph neural network is used to learn node representations and determine cross-layer node matching relationships. Based on these matching relationships, cross-layer consistency correction is applied to the probabilities of connected regions to obtain a topologically consistent segmentation mask. During the training phase, random inactivation is used for unlabeled slices to generate uncertainty maps through multiple inferences, and reliable regions are selected to generate pseudo-labels. Simultaneously, cross-layer node matching is used to construct a network that jointly optimizes topological consistency loss, supervision loss, and pseudo-label loss. This invention achieves the technical effects of significantly reducing annotation costs while fully utilizing unlabeled slices, enhancing Z-axis structural coherence and topological consistency, and improving the quality of 3D segmentation.

[0009] This invention provides a semi-supervised medical image segmentation method based on cross-layer topological consistency, comprising:

[0010] S1. For the target slice image in the 3D medical image volume data to be segmented, select K adjacent slice images, including the target slice image, along the Z-axis, and stack the K adjacent slice images in the channel dimension to obtain a multi-slice stacked input of the target slice image; S2. Input the multi-slice stacked input into the segmentation network to obtain the prediction probability map of the target slice image; S3. Generate an initial segmentation mask based on the prediction probability map, perform connected component labeling to obtain multiple connected regions, and construct a connected component graph corresponding to the target slice image. The nodes of the connected component graph represent connected regions and include category attributes, and the edges of the connected component graph represent the intra-slice spatial relationships between connected regions; S4. For adjacent slice images adjacent to the target slice image in the Z-axis direction, construct the connected component graph corresponding to the adjacent slice images, and based on the target slice image... S1) Establish cross-layer candidate connectivity relationships between the corresponding connected component graph and the connected component graphs of adjacent slice images to form a cross-layer fusion graph. Input the graph neural network to obtain the node representation of each node, and determine the cross-layer node matching relationship based on the node representation and the spatial relationship of the nodes; S2) Based on the cross-layer node matching relationship, determine the cross-layer consistency constraints between the connected regions in the target slice image and the matching connected regions in the adjacent slice images, and correct the prediction probabilities belonging to each connected region in the prediction probability graph accordingly to obtain the corrected prediction probability graph; S3) Discretize the corrected prediction probability graph to obtain the topologically consistent segmentation mask of the target slice image; S4) Repeat S1 to S6 for each slice image of the three-dimensional medical image volume data to be segmented, and combine them in the slice order to obtain the segmentation result of the three-dimensional medical image volume data.

[0011] Optionally, S1 includes:

[0012] Set the preset quantity K to an odd number;

[0013] For any target slice image in the three-dimensional medical image volume data to be segmented, select K adjacent slice images along the Z-axis with the target slice image as the center, so that the target slice image is located in the middle position of the K adjacent slice images.

[0014] When the target slice image is located at the Z-axis boundary of the three-dimensional medical image data to be segmented, resulting in an insufficient number of adjacent slice images, the boundary slice images are repeatedly used to fill in the K adjacent slice images.

[0015] The K adjacent slice images are stacked in the channel dimension according to their Z-axis order to generate the multi-slice stacked input corresponding to the target slice image.

[0016] Optionally, S2 includes:

[0017] The multi-slice stacked input is subjected to intensity normalization; the segmentation network performs feature extraction and decoding reconstruction on the intensity-normalized multi-slice stacked input to generate a score map corresponding to the target slice image; when the spatial resolution of the score map is inconsistent with the spatial resolution of the target slice image, the score map is upsampled to obtain an upsampled score map with the same spatial resolution as the target slice image; and the upsampled score map is subjected to probability normalization to output a predicted probability map corresponding to the target slice image, wherein the predicted probability map includes a probability value corresponding to at least one segmentation category at each pixel position.

[0018] Optionally, S3 includes:

[0019] The predicted probability map is discretized to obtain an initial segmentation result. The discretization process includes at least one of the following: (1) binary classification discretization: the pixels are divided into foreground pixels and background pixels according to a preset probability threshold; (2) mutually exclusive multi-class discretization: the segmentation category with the highest predicted probability is selected as the category label of the pixel; (3) multi-label multi-class discretization: for each segmentation category, the foreground pixels of the segmentation category are determined according to the corresponding category threshold for the probability channel of each segmentation category; an initial segmentation mask of at least one segmentation category is generated based on the initial segmentation result; connected component labeling is performed based on the pixel connectivity of the initial segmentation mask, a region identifier is assigned to each connected region and the pixel set of the connected region is determined; the center point coordinates and pixel count of the connected region are calculated according to the pixel set of each connected region, and each connected region is used as a node of the connected component graph, and a category attribute is assigned to the node; when any two connected regions have a shared boundary in the initial segmentation mask, an edge of the connected component graph is established between the nodes corresponding to the two connected regions to obtain the connected component graph corresponding to the target slice image.

[0020] Optionally, S4 includes:

[0021] For the target slice image, the adjacent slice image adjacent to the target slice image in the Z-axis direction is determined to be at least one of the previous adjacent slice image and the next adjacent slice image, and the connected component graph corresponding to the adjacent slice image is generated according to S3 respectively; a cross-layer candidate connection relationship is established based on the nodes of the connected component graph corresponding to the target slice image and the nodes of the connected component graph corresponding to the adjacent slice image. The cross-layer candidate connection relationship is used to establish cross-layer candidate edges between the nodes of the two connected component graphs. The establishment rules of the cross-layer candidate edges include at least one of the following: (1) the distance between the center point of the target node and the adjacent slice node is less than a preset distance threshold; (2) the degree of overlap between the bounding box of the connected region of the target node and the bounding box of the connected region of the adjacent slice node after the projected bounding box of the connected region of the target node is projected onto the coordinate system of the adjacent slice is greater than a preset overlap threshold; (3) For each target node, select the M nearest neighboring slice nodes with the closest center point distance to establish cross-layer candidate edges, where M is a positive integer; combine the connected component graph corresponding to the target slice image, the connected component graph corresponding to the neighboring slice images, and the cross-layer candidate edges to form a cross-layer fusion graph, and input the cross-layer fusion graph into a graph neural network. Through message passing and aggregation processing of the graph neural network, output the node feature vector of each node in the cross-layer fusion graph; for each node in the connected component graph corresponding to the target slice image, determine the cross-layer node matching relationship only between the node and nodes with the same category attribute in the connected component graph corresponding to the neighboring slice image, based on the similarity of node feature vectors and the center point distance, and determine node pairs with similarity lower than a preset similarity threshold or center point distance greater than a preset distance threshold as mismatched;

[0022] Furthermore, to adapt to the splitting and / or fusion morphological changes of the target structure in the Z-axis direction, a target slice image node is allowed to establish a one-to-many matching relationship and / or a many-to-one matching relationship with multiple nodes in adjacent slice images. The one-to-many matching relationship and / or the many-to-one matching relationship are filtered and confirmed based on the degree of overlap of the bounding box, the area ratio threshold and / or the distance to the center point.

[0023] Optionally, S5 includes:

[0024] For each connected region, adjacent slice image connected regions matching the connected region are determined based on cross-layer node matching relationships. When the adjacent slice image connected regions include a previous adjacent slice image connected region and a next adjacent slice image connected region, the mean probability of the region corresponding to the previous adjacent slice image connected region and the mean probability of the region corresponding to the next adjacent slice image connected region are obtained in the probability channel corresponding to the category attribute of the connected region, and the two are aggregated to obtain the mean probability of the matching region. In the prediction probability map, the mean probability of the region corresponding to the connected region is calculated in the probability channel corresponding to the category attribute of the connected region. Based on the connected region... The difference between the mean probability of the corresponding region and the mean probability of the matching region determines the cross-layer consistency weight of the connected region, wherein the smaller the difference, the larger the cross-layer consistency weight; and according to the cross-layer consistency weight, the predicted probability of each pixel in the connected region in the probability channel corresponding to the category attribute is updated to the weighted average of the original predicted probability and the mean probability of the matching region, to obtain the corrected predicted probability map; when there is no matching adjacent slice image connected region in the connected region, the cross-layer consistency weight is set to a preset default value, and the predicted probability of each pixel in the connected region in the probability channel corresponding to the category attribute is updated with weights based on the preset default value.

[0025] Optionally, S6 includes:

[0026] Discretization is performed on the corrected prediction probability map to obtain a topologically consistent segmentation mask for the target slice image. The discretization process includes at least one of the following: (1) binary classification discretization: the pixels are divided into foreground pixels and background pixels according to a preset output threshold; (2) mutually exclusive multi-class discretization: the segmentation category with the highest prediction probability is selected as the category label for each pixel; (3) multi-label multi-class discretization: the foreground pixels of each segmentation category are determined according to the corresponding category threshold for the probability channel of each segmentation category; and hole filling and small connected region removal are performed on the topologically consistent segmentation mask according to the segmentation category to obtain a topologically consistent segmentation mask after morphological post-processing.

[0027] Optionally, the S7 includes:

[0028] Following the slicing order of the three-dimensional medical image volume data to be segmented along the Z-axis, the multi-slice stack corresponding to each target slice image is sequentially input into the segmentation network to obtain a prediction probability map. Based on the connected component graph, adjacent connected component graph pairs, cross-layer node matching relationships, and the corrected prediction probability map, a topologically consistent segmentation mask corresponding to each target slice image is obtained. The topologically consistent segmentation masks are stacked and combined along the Z-axis according to the slicing order to generate a three-dimensional segmentation mask with the same spatial size as the three-dimensional medical image volume data to be segmented, which is used as the volume data segmentation result. When the topologically consistent segmentation mask is inconsistent with the three-dimensional medical image volume data to be segmented in terms of spatial resolution, the three-dimensional segmentation mask is resampled to align the volume data segmentation result with the three-dimensional medical image volume data to be segmented.

[0029] Optionally, the segmentation network and the graph neural network are trained using the following method:

[0030] T1. Acquire training 3D medical image volume data, and obtain pixel-level segmentation annotations for some slice images in the training 3D medical image volume data. Divide the slice images into an annotated slice set and an unannotated slice set based on whether they have pixel-level segmentation annotations. T2. For each training target slice image in the annotated slice set and the unannotated slice set, select a predetermined number of K adjacent slice images, including the training target slice image, along the Z-axis direction, and stack the K adjacent slice images in the channel dimension to generate a training multi-slice stacked input corresponding to the training target slice image. T3. Input the training multi-slice stacked input into the segmentation network to be trained, output the training prediction probability map corresponding to the training target slice image, and for the training multi-slice stacked input corresponding to the unannotated slice set, in the segmentation network to be trained... The process involves: 1) enabling random deactivation and performing a preset number of forward inferences (N times). 2) calculating the mean of the N training prediction probability maps obtained from the N forward inferences to obtain the training prediction probability map, and generating an uncertainty map based on the variance of the N training prediction probability maps at pixel locations; 3) generating a reliable region mask corresponding to the unlabeled slice set based on the comparison result of the uncertainty map and a first threshold, and combining this with the comparison result of the training prediction probability map and a second threshold. 4) discretizing the training prediction probability map within the range defined by the reliable region mask to generate pseudo-labels corresponding to the unlabeled slice set; 5) calculating the supervised segmentation loss using the training prediction probability map corresponding to the labeled slice set and pixel-level segmentation labels, and calculating the pseudo-label segmentation loss using the training prediction probability map corresponding to the unlabeled slice set and pseudo-labels within the range defined by the reliable region mask.T6. Discretize the training prediction probability map to generate initial training segmentation results. Based on the initial training segmentation results, generate initial training segmentation masks for at least one segmentation category and perform connected component labeling to generate training connected regions. Construct a training connected region graph based on the training connected regions. For each unlabeled slice image in the unlabeled slice set, select adjacent slice images that are adjacent to the unlabeled slice image in the Z-axis direction, and generate training connected region graphs corresponding to the adjacent slice images. Establish cross-layer candidate connection relationships between the nodes of the training connected region graphs corresponding to the unlabeled slice images and the nodes of the training connected region graphs corresponding to the adjacent slice images to establish cross-layer candidate edges between the two training connected region graphs. The rules for establishing cross-layer candidate edges include center point distance threshold rules, bounding box overlap threshold rules, and / or the nearest M nodes. The rules are as follows: The two training connected component graphs and the cross-layer candidate edges are combined to form a training cross-layer fusion graph, which is then input into the graph neural network to be trained. The graph neural network outputs node feature vectors through message passing and aggregation processing. Cross-layer node matching relationships are determined only between nodes with the same category attribute based on the similarity of node feature vectors and the distance between the center points of the training connected regions. A topological consistency loss is calculated based on the cross-layer node matching relationship. This topological consistency loss is used to constrain the number of training connected regions in adjacent slice images and the smoothness of the changes in the attributes of the training connected regions along the Z-axis. T7. A total loss function is constructed based on the supervised segmentation loss, the pseudo-labeled segmentation loss, and the topological consistency loss. The network parameters of the segmentation network and the graph neural network to be trained are updated through backpropagation to obtain the segmentation network and the graph neural network.

[0031] The beneficial effects of this invention are:

[0032] 1. Improve the coherence of 3D structures under sparse labeling conditions: By constructing a connected domain graph of adjacent slices and performing cross-layer node matching, establishing cross-layer consistency constraints and correcting the probability of connected regions, the prediction jumps, breaks and structural discontinuities in the Z-axis direction can be significantly suppressed, thereby improving the integrity and topological stability of 3D structures.

[0033] 2. Make full use of unlabeled slices and reduce labeling costs: During the training phase, an uncertainty-aware pseudo-label screening is introduced to generate pseudo-labels in reliable regions and calculate pseudo-label segmentation loss, so that a large number of unlabeled slices can effectively participate in training, while maintaining or improving segmentation accuracy while reducing the number of manually labeled slices.

[0034] 3. Balancing effectiveness and feasibility: The 2.5D stacked input of K-adjacent slices utilizes interlayer contextual information, which is less dependent on overall annotation and computing power compared to pure 3D segmentation; at the same time, by modeling cross-layer correspondences at the connected domain level through graph neural networks, it can adapt to the splitting / fusion changes of the target structure in the Z-axis direction, thereby improving robustness and generalization ability on actual clinical data. Attached Figure Description

[0035] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0036] Figure 1 This is a flowchart of the semi-supervised medical image segmentation method based on cross-layer topological consistency proposed in this invention;

[0037] Figure 2 This is a flowchart of the method for constructing, fusing, and matching nodes across connected domains in step S4 of the present invention.

[0038] Figure 3 This is a flowchart of the segmentation network and graph neural network training method of the present invention. Detailed Implementation

[0039] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0040] refer to Figure 1 A semi-supervised medical image segmentation method based on cross-layer topological consistency includes:

[0041] S1. For the target slice image in the 3D medical image volume data to be segmented, select K adjacent slice images, including the target slice image, along the Z-axis, and stack the K adjacent slice images in the channel dimension to obtain a multi-slice stacked input of the target slice image; S2. Input the multi-slice stacked input into the segmentation network to obtain the prediction probability map of the target slice image; S3. Generate an initial segmentation mask based on the prediction probability map, perform connected component labeling to obtain multiple connected regions, and construct a connected component graph corresponding to the target slice image. The nodes of the connected component graph represent connected regions and include category attributes, and the edges of the connected component graph represent the intra-slice spatial relationships between connected regions; S4. For adjacent slice images adjacent to the target slice image in the Z-axis direction, construct the connected component graph corresponding to the adjacent slice images, and based on the target slice image... S1) Establish cross-layer candidate connectivity relationships between the corresponding connected component graph and the connected component graphs of adjacent slice images to form a cross-layer fusion graph. Input the graph neural network to obtain the node representation of each node, and determine the cross-layer node matching relationship based on the node representation and the spatial relationship of the nodes; S2) Based on the cross-layer node matching relationship, determine the cross-layer consistency constraints between the connected regions in the target slice image and the matching connected regions in the adjacent slice images, and correct the prediction probabilities belonging to each connected region in the prediction probability graph accordingly to obtain the corrected prediction probability graph; S3) Discretize the corrected prediction probability graph to obtain the topologically consistent segmentation mask of the target slice image; S4) Repeat S1 to S6 for each slice image of the three-dimensional medical image volume data to be segmented, and combine them in the slice order to obtain the segmentation result of the three-dimensional medical image volume data.

[0042] In this specific embodiment, S1 includes:

[0043] According to the fixed window The axial direction is used to construct a multi-slice stacked input for each target slice image;

[0044] The three-dimensional medical image volume data to be segmented is denoted as y = ... A sequence of two-dimensional slice images arranged in ascending order of slice number. ,in Indicates the slice number is A single-channel two-dimensional slice image with a pixel matrix size of Indicates the image height in pixels. Indicates the image width in pixels. Indicates the total number of slices;

[0045] Preset number of adjacent slices Take an odd number and in this embodiment set it as And determine the half-window width accordingly. ,in This indicates the number of adjacent slices used on each side of the target slice.

[0046] For any target slice image, let its slice number be . ,in and This indicates the position index of the target slice in the volume data, selected centered on the target slice in order from the upper layer to the lower layer. Draw adjacent slices and use repeated padding at the boundaries to make up for the number of slices. Repeated padding means that when the required index exceeds the limit, the number of slices is increased. When the scope is defined, the nearest boundary slice image is used instead of the superboundary slice image;

[0047] Under this selection rule, multi-slice stacked input Determined in the following ways:

[0048] ;

[0049] in Indicates the target slice The corresponding multi-slice stacked input, This indicates a stacking operator that cascades along the channel dimension. Indicates the stacking sequence number and From small to large corresponds to from The slicing order from one adjacent direction on the axis to the next adjacent direction. Indicates the valid slice number after boundary refilling. and These represent the operations of finding the minimum and maximum values, respectively, and are used to restrict the index to... Inside;

[0050] From this, we obtain Slices are sequentially included along the channel dimension. to The pixel intensity matrix, and the target slice Constantly located at the first Each channel ensures cross-layer context symmetry of the input, enabling subsequent segmentation networks to obtain stable contextual information of the layers before and after the target slice without introducing 3D convolution, and providing a consistent slice index benchmark for cross-layer topological consistency constraints.

[0051] In this specific embodiment, S2 includes:

[0052] right Intensity normalization is performed to eliminate grayscale differences caused by different volumetric data and different scanning conditions. The intensity normalization is performed by... The global mean and global standard deviation are calculated for all pixels and all channels. Then, a linear transformation is performed on the intensity value of each pixel, subtracting the mean and dividing by the standard deviation, to obtain the normalized input. ,in and Having the same tensor size Indicates the height in pixels. Indicates the width in pixels. This indicates the number of channels in the stacked slices and is set to [value] in step S1. ;

[0053] Then Input the segmentation network to generate a score map corresponding to the target slice. The segmentation network adopts a two-dimensional U-shaped encoder-decoder structure and uses... The network encoder takes the channel image as input and contains four downsampling levels, with each level consisting of two downsampling operations. Convolution is combined with batch normalization and ReLU activation and used at the end of the layer. Max pooling is used for downsampling, with the number of channels starting at 32 in the first level and increasing sequentially according to a doubling rule after each downsampling. The network bottleneck layer has 512 channels and is also composed of two... The network consists of convolution, batch normalization, and ReLU activation. The decoding end contains four upsampling levels symmetrical to the encoding end, and each level employs... The transposed convolution is upsampled and concatenated with the feature map of the corresponding encoding layer by channel dimension to form a skip connection, and then executed twice. Convolution, batch normalization, and ReLU activation are applied once at the network end. Convolution maps the number of channels to the number of segmentation categories. Obtain the score chart ,in This indicates the number of segmentation categories, including the background category. and These represent the height and width of the score image, respectively.

[0054] when Spatial resolution and spatial resolution of target slice image When there is inconsistency, bilinear interpolation is used to correct it. Upsampling is the upsampling score graph. and at each pixel location Perform probability normalization by category channel to output the predicted probability map. Its calculation satisfies:

[0055] ;

[0056] in Represents the pixel row index, Indicates the pixel column index. Indicates category index, This represents the category traversal index used for summation. This indicates exponentiation. This represents the summation operation along the category dimension. Indicates the upsampling score map at the pixel level. Category The score, Indicates the predicted probability map in pixels This belongs to the category The probability value and satisfying the condition for the same pixel have This yields the target slice prediction probability map used for subsequent connected component construction and cross-layer topology consistency correction.

[0057] In this specific embodiment, S3 includes:

[0058] Based on target slice prediction probability map Generate an initial segmentation mask and construct the connected component graph of the target slice;

[0059] in Indicates the target slice number. Indicates the height of the target slice image in pixels. Indicates the width of the target slice image in pixels. This indicates the number of segmentation categories, including the background category. Indicates pixel position Category The probability value, Represents the pixel row index, Indicates the pixel column index. Indicates a category index;

[0060] First of all Perform mutually exclusive multi-class discretization to obtain the initial segmentation result. The discretization output is defined as a pixel-level class label map. The calculation is as follows:

[0061] ;

[0062] in Represents pixels Category tags, This indicates the operation of taking the index of the argument that maximizes the expression within the parentheses;

[0063] Then, for each foreground category Generate the initial segmentation mask for this category. ,in If and only if And set pixels outside this category to 0 to obtain a binary mask;

[0064] In each Connectivity component labeling is performed to obtain multiple connected regions. The connectivity is determined using a two-dimensional 8-neighborhood connectivity criterion, and the connectivity component labeling uses a breadth-first search to traverse all pixels with a value of 1 that have not yet been visited, assigning a unique region identifier to each connected region. Simultaneously record the pixel set of the connected region. ,in Includes all regional identifiers pixel coordinates ;

[0065] For each connected region Calculate the number of pixels Used as the area of ​​the region and used to calculate the coordinates of the center point. As the geometric location of the region, Pick The number of pixel coordinate pairs Pick All pixel row indexes within The arithmetic mean, Pick Index of all pixels The arithmetic mean of the connected components is used, and the category to which the connected region belongs is recorded as the node category attribute. And let This is equal to the category corresponding to the initial segmentation mask used to generate the connected region. ;

[0066] Based on this, construct the connected component graph of the target slice. Each connected region Corresponding to a node and for nodes Storage node attribute collection To respectively represent the category, the location of the center point, and the size of the region;

[0067] Finally, edges are created within the slice to represent the spatial relationships between connected regions. If two different connected regions... and If a shared boundary exists, then it is in the corresponding node. and Establish undirected edges between The determination of shared boundaries adopts the two-dimensional 4-neighborhood boundary contact criterion, and the determination process is traversal. The boundary pixel is then used to detect whether its four adjacent pixels (upper, lower, left, and right) belong to the boundary pixel. If a pixel exists, then it is considered... and By sharing boundaries, we obtain the connected component graph corresponding to the target slice image for subsequent cross-layer fusion and matching. .

[0068] In this specific embodiment, S4 includes:

[0069] In the connected component graph of the target slice Based on this, an adjacent slice connected domain graph is introduced and a cross-layer fusion graph is constructed to determine the cross-layer node matching relationship;

[0070] when When the adjacent slice image is determined to be the previous adjacent slice image, Image with the next adjacent slice ,when Adjacent slice images are determined as ,when Adjacent slice images are determined as ,in Indicates the target slice number. This represents the total number of volume data slices, and for each adjacent slice image, a corresponding connected component graph is generated according to S3. ;

[0071] set up The node is The corresponding set of connected pixels is The node category attribute is The coordinates of the node center point are The number of nodes is And further calculate the bounding box for each node:

[0072] );

[0073] in express The minimum value of all pixel row indices in the array. express The maximum value of all pixel row indices in the array. express The minimum value of all pixel column indices. express The maximum value of all pixel column indices in the slice; the bounding box is used to describe the minimum enclosing rectangle of the connected region in the slice coordinate system.

[0074] Subsequently With each Cross-layer candidate connections are established between layers to generate cross-layer candidate edges. The establishment of cross-layer candidate edges adopts the union of three rules with the parameter fixed as the distance threshold between the center point. Outline overlap threshold Nearest neighbor count The center point distance is calculated using Euclidean distance in pixels, and the bounding box overlap is defined as two bounding boxes on the same surface. Calculation of intersection-union ratio in coordinate system and Indicates the number of pixels at slice height. This represents the slice width in pixels. The nearest neighbor rule sorts the slices by their center point distance in ascending order and then selects the nearest neighbor. Adjacent slice nodes;

[0075] When the target node With adjacent slice nodes The distance between the center points is not greater than Or its bounding box intersection-union ratio is not less than or Belonging to For reference When there are two nearest neighbor nodes, an undirected cross-layer candidate edge is established between them. ;

[0076] After obtaining cross-layer candidate edges, ,each Together with all cross-layer candidate edges, they form a cross-layer fusion graph. and for For each node in the algorithm, an initial node feature vector of fixed dimensions is constructed. ,in By category attribute One-dimensional heat vector, normalized value of center point coordinates and Normalized area values Normalized value of bounding box width Normalized value of bounding box height It is assembled in a fixed order. The number of segmentation categories includes the background category;

[0077] Will and The input graph neural network is represented by the output node vector. The graph neural network uses a two-layer graph attention network. The first layer has 4 attention heads, each with an output dimension of 32, and the heads are concatenated to obtain a 128-dimensional intermediate representation. The second layer has 4 attention heads, each with an output dimension of 128, and the average of the heads is taken to obtain the final node representation. Both layers use LeakyReLU activation with a negative slope of 0.2, and the slice inner edges and cross-layer candidate edges in the fusion graph are used as the adjacency relationship for message passing.

[0078] After obtaining the node representation, only in the target slice nodes With adjacent slice nodes Satisfying the consistency of category attributes Furthermore, there are cross-layer candidate edges between the two. Under the given conditions, the matching score is calculated and the cross-layer node matching relationship is determined. The matching score is defined as:

[0079] ;

[0080] in Represents node pairs Match score, Representing vectors and The cosine similarity is calculated by dividing the vector dot product by the product of their magnitudes. and Let represent the node representation vectors of the target node and its adjacent slice nodes, respectively. Represents the distance penalty coefficient and is taken in this embodiment. Describes the Euclidean distance between the centers of two nodes and is given by and Calculations show that Indicates the center point distance threshold;

[0081] For each target node Within the sets of candidate nodes of the same type in the previous adjacent slice and the next adjacent slice, respectively, by... Sort by size from largest to smallest and select those with a cosine similarity of not less than [value missing]. And the distance between the center points is no greater than The node pairs are used as the basic matching, where Indicates the similarity threshold. This represents the matching distance threshold. If the first-ranked node pair does not meet any threshold, then the node pair is determined to be a mismatch.

[0082] Based on basic matching, in order to adapt to the target structure along The axial splitting and fusion morphological changes allow for the formation of one-to-many and many-to-one matching relationships, and the matching confirmation rule is fixed as the bounding box intersection-union ratio not less than 1. Area ratio between And the distance between the center points is no greater than ,in The bounding box overlap threshold for split-fusion filtering is represented by the area ratio, which is defined as the number of pixels between adjacent slice nodes. Number of pixels of the target node The ratio, and These represent the lower and upper limits of the area ratio, respectively. This indicates the threshold distance from the center point in the split-fusion screening process;

[0083] When the same target node When multiple nodes within the same adjacent slice satisfy the above split-fusion screening rules, the matching score is used. Retain the largest from smallest. There are matching nodes to form a one-to-many matching relationship, where This represents the maximum number of nodes that a single target node is allowed to match. When multiple target nodes determine that the same adjacent slice node is a matching node that meets the threshold, they are directly retained to form a many-to-one matching relationship, resulting in a set of cross-layer node matching relationships for subsequent cross-layer consistency constraints and probability correction.

[0084] In this specific embodiment, S5 includes:

[0085] Predicting probability map of target slices based on cross-layer node matching relationship Perform cross-layer consistency correction to generate a corrected prediction probability map superscript Indicates after correction, Indicates the target slice number. and Represents pixels Category The predicted probability value, Indicates the slice height in pixels. Indicates the width of the slice in pixels. Indicates the number of segmentation categories;

[0086] Connected component graph of the target slice Each node in Process them one by one, among which Indicates a connected component index. The corresponding set of connected region pixels is The category attribute of this node is ;

[0087] First of all Category Channel Calculate the regional mean probability of the connected region. Regional mean probability The calculation method is for all of Summing and dividing by Number of pixels ,in express The number of pixel coordinate pairs;

[0088] Subsequently, the node was determined based on the cross-layer node matching relationship. The set of the previous adjacent slice nodes of the matching set of next adjacent slice nodes And predict probability maps in adjacent slices Category Channel Calculate the mean probability of the connected regions corresponding to each matched node, where... Indicates the adjacent slice number and is consistent with the boundary conditions;

[0089] when and When at least one is not empty, the mean probability of the matching regions is obtained by weighting the mean probability of all matching connected regions according to the number of pixels in the corresponding connected regions. The superscript "match" indicates the statistics obtained by matching connected regions. The weighted average is specifically calculated by first averaging within the same adjacent slices... The mean match value of adjacent slices is obtained by weighting all matched connected regions by pixel count. Then, when both the previous and next adjacent slices have matches, the arithmetic mean match values ​​of the two adjacent slices are calculated to obtain the mean match value. Thus, a unique match is obtained in both one-to-many and many-to-one matching relationships. ;

[0090] when and When both are empty, set the default matching region's average probability. Equal to adjacent slices at pixel coordinates place Neighborhood Intrinsic Category Channel The probability mean is calculated by taking the arithmetic mean of the neighborhood means of the two adjacent slices when there are both a previous adjacent slice and a next adjacent slice. The coordinates of the center point of the connected region are obtained from S3 and rounded to the nearest integer pixel coordinates to locate the neighborhood.

[0091] In obtaining and Then, define the difference quantity. The absolute difference between the two is used to determine the cross-layer consistency weight. ,in Through the conduct Interval truncation yields and Represents the difference normalization coefficient, thus satisfying The smaller The larger the value, the more likely it is to cause problems when no matching connected component exists. Fixed as default value ;

[0092] Finally, Perform probability correction by connected components to obtain The correction rule is:

[0093] ;

[0094] in Indicates the corrected prediction probability map at the pixel Category The probability value, Represents connected regions Cross-layer consistency weights This represents the mean probability of the matching region corresponding to the connected region. Represents the set of connected pixels. Indicates the category attribute of connected regions. Represents the pixel row index, Indicates the pixel column index. Represents the category index, and updates each pixel position after updating all connected regions. Along the category dimension Normalization is performed to make the sum equal to 1 to maintain the semantic consistency of the probability graph, thus obtaining the corrected prediction probability graph for discretization processing. .

[0095] In this specific embodiment, S6 includes:

[0096] Correct the prediction probability map Discretize and perform morphological post-processing to obtain a topologically consistent segmentation mask for the target slice image;

[0097] in Indicates the target slice number. Indicates the height of the target slice image in pixels. Indicates the width of the target slice image in pixels. This indicates the number of segmentation categories, including the background category. Indicates pixel position Category The correction probability value, Represents the pixel row index, Indicates the pixel column index. Indicates a category index;

[0098] The discretization process employs mutually exclusive multi-class discretization and outputs pixel-level label maps. The calculation is as follows:

[0099] ;

[0100] in Represents pixels Discrete category labels, This operation represents the category index that maximizes the expression within the parentheses;

[0101] Then for each foreground category From respectively Generate a binary mask ,in If and only if And all other pixels are set to 0;

[0102] For each Perform hole filling processing. A hole is defined as a connected region of background pixels that is completely surrounded by foreground pixels of that category and is not connected to the image boundary. The hole filling is implemented by first constructing a background mask. And then The above uses a two-dimensional 8-neighborhood connectivity criterion to perform connected component labeling and identifies all background connected regions connected to the four boundary pixels of the image as the external background. The remaining background connected regions are determined as holes, and the corresponding pixels are placed in... The center position is set to 1 to complete the filling;

[0103] After filling the holes, for each Perform small connected region removal processing. A small connected region is defined as a foreground connected region under the two-dimensional 8-neighborhood connectivity criterion whose number of pixels is less than the area threshold. ,in Representing the minimum retained area in pixels, the implementation of small connected region removal is as follows: Perform connected component labeling and calculate the number of pixels in each foreground connected region. For regions with a pixel count less than [a certain value], [the text continues with further details about the process]. The connected regions set all pixels to 0;

[0104] When post-processing binary masks of different categories overlap at the same pixel location, to ensure mutually exclusive multi-class classification output, the pixel is reassigned a value that makes... The maximum value of the category label is obtained, and pixels not covered by any foreground category mask are assigned the background category. A topologically consistent segmentation mask for the target slice image, obtained after hole filling and small connected region removal processing, is obtained. .

[0105] In this specific embodiment, S7 includes:

[0106] All slices of the three-dimensional medical image volume data to be segmented are... The axes are executed sequentially from S1 to S6, and the topologically consistent segmentation masks of each target slice are combined into a three-dimensional segmentation mask.

[0107] The slice sequence of the three-dimensional medical image volume data to be segmented is denoted as ,in Indicates the slice number is Two-dimensional slice image and Indicates the total number of slices;

[0108] For each slice number Using this slice as the target slice image, and generating multi-slice stacked input according to S1. ,Will The predicted probability map is obtained by inputting the segmentation network. Then, the connected component graph construction, cross-layer fusion graph and cross-layer node matching, cross-layer consistency probability correction, and discretization and morphological post-processing are performed sequentially to obtain the topologically consistent segmentation mask corresponding to the slice. ,in Slice In pixels Category marker at the location, This indicates the number of segmentation categories, including the background category. Indicates the slice height in pixels. Indicates the width of the slice in pixels. Represents the pixel row index, Indicates the pixel column index;

[0109] After completing all the slices After generation, sort the slices in ascending order. A three-dimensional segmentation mask is obtained by stacking and combining the axial directions. The combination relationship is defined as follows:

[0110] ;

[0111] in This represents the 3D segmentation mask in voxel coordinates. Category marker at the location, This indicates the slice dimension index and is consistent with the slice sequence number;

[0112] when When the corresponding spatial resolution is inconsistent with the spatial resolution of the three-dimensional medical image volume data to be segmented, the voxel spacing of the three-dimensional medical image volume data to be segmented is denoted as... And The voxel spacing is denoted as ,in and These represent the pixel spacing of the original volume data in the plane. This represents the layer thickness spacing between adjacent slices of the original body data. These represent the voxel spacing of the 3D segmentation mask in the corresponding directions;

[0113] Based on this, a resampling transform is constructed with the original volume data grid as the target grid, and then... To preserve the discreteness of the class labels, three-dimensional nearest neighbor interpolation resampling is performed. During resampling, the position of each target voxel is back-calculated using the voxel coordinate system of the original volume data as a reference. Take the nearest corresponding continuous coordinates in the coordinate system. The voxel category is used as the output to obtain the volume data segmentation result that is consistent with the spatial size and voxel spacing of the volume data of the 3D medical image to be segmented and is aligned voxel by voxel.

[0114] In this specific embodiment, the segmentation network and the graph neural network are jointly trained using the following method:

[0115] The training set of 3D medical image data is denoted as , Each set of volume data in the data is generated by Zhang 2D slice image The slices are arranged according to their sequence numbers, and each slice image has a size of [size missing]. ,in Indicates the total number of slices. Indicates the height in pixels. Indicates the width in pixels;

[0116] right For each set of volume data, the labeled slice set is denoted as... Unlabeled slice sets are denoted as Extracted from the body data at equal intervals according to slice number The slices are composed of pixels, and each labeled slice has pixel-level segmentation annotations. ,in Indicates the slice number is The labeled slice in pixels The true category label at the location, It consists of the remaining slices that do not have pixel-level segmentation annotations. This indicates the number of segmentation categories, including the background category;

[0117] Training is performed iteratively using slices as the sample unit, for each training target slice. Take according to the rules of S1 The training multi-slice stacked input is obtained by repeatedly filling adjacent slices with boundary slices. ,in Indicated by slice number A multi-slice stacked input is constructed around the central element;

[0118] Will The training prediction probability map is obtained by inputting the segmentation network. , category The predicted probability value, the segmentation network parameters are denoted as Furthermore, to achieve random inactivation and multiple inferences, a second inference is performed at each upsampling level on the decoding end of the segmentation network. After convolution, a random deactivation layer is inserted with a fixed deactivation probability. ,in This represents the probability that the feature element will be set to zero in the randomly deactivated layer;

[0119] right The training target slice is executed while the randomly deactivated layer remains enabled. The next forward reasoning yields ,in Indicates the first The prediction probability graph of the next forward inference and and to The mean prediction probability map is obtained by calculating the mean value pixel by pixel and category by category. As the training prediction probability map for the unlabeled slice, the variance is calculated pixel-by-pixel and class-by-class, and the mean is obtained over the class dimension to obtain the uncertainty map. ,in Represents pixels Uncertainty in forecasting;

[0120] Based on uncertainty threshold With probability threshold Generate reliable region mask ,in If and only if and and in Position Perform mutually exclusive multi-class discretization to generate pseudo-labels ,in This indicates unlabeled slices. Pixels within the reliable area The pseudo-category label at the location and in The location is not included in the calculation of pseudo-label loss;

[0121] Supervision of the division of losses exist Up by and The pixel-level cross-entropy loss and the soft Dice loss were calculated and used as the sum of the pseudo-label segmentation loss. exist Up by and Calculated and only The sum of accumulated pixel-level cross-entropy loss and soft Dice loss within a defined reliable region;

[0122] Topology consistency loss exist The above calculation involves performing the calculation on each unlabeled slice. Will Discretize and generate training connected component graphs according to S3. At the same time, regarding its Adjacent slices in the axial direction Generate corresponding training connected component graphs Then, according to the center point distance threshold rule of S4, the bounding box overlap threshold rule, and the nearest neighbor rule, Each node rule establishes cross-layer candidate edges, which are then used to train a cross-layer fusion graph and input into a graph neural network to determine cross-layer node matching relationships. The parameters of the graph neural network are denoted as follows: Furthermore, the structure is consistent with S4 and outputs node representation vectors for matching;

[0123] For each pair of matching nodes, the absolute value of the difference in the regional mean probability of their corresponding connected regions in the category attribute channel is used as the consistency term, and the average is taken over all matching pairs to constrain the structural attributes of adjacent slices along the path. The smoothness of axis changes is improved, while a fixed penalty term proportional to the area of ​​the region is introduced for nodes that fail to find a matching node in an adjacent slice to suppress abrupt changes in the number of connected regions between adjacent slices.

[0124] The total loss function is as follows:

[0125] ;

[0126] in Indicates the total loss. Indicates the loss of supervision and division. This represents the segmentation loss due to pseudo-labeling. This represents the loss of topological consistency. This represents the weighting coefficient of the pseudo-label segmentation loss. This represents the weighting coefficient for topology consistency loss;

[0127] Using the Adam optimizer and Perform joint updates and set the learning rate to The weight decay coefficient is set to The first-order moment estimation coefficients are set to 0.9, and the second-order moment estimation coefficients are set to 0.999. The training is iterated using training target slices with a batch size of 8, and each batch contains slices from... Two labeled slices and from The training used 6 unlabeled slices, with 200 training iterations and an exponential decay of the learning rate multiplied by 0.98 after each iteration. Backpropagation is performed to update the parameters of the segmentation network and the graph neural network, thus obtaining the segmentation network and the graph neural network.

[0128] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

[0129] This invention addresses the technical problems of limited slice annotation in clinical 3D medical images, easily broken Z-axis interlayer structures, and difficulty in forming effective training constraints from unannotated slices. It synergistically combines 2.5D segmentation with multiple stacked slices, uncertainty-aware pseudo-label screening, and a cross-layer topological consistency mechanism: the 2.5D backbone utilizes contextual information from adjacent layers without introducing high-cost 3D convolution; during training, uncertainty is obtained through multiple forward inferences with random deactivation on unannotated slices, and reliable regions are selected to generate pseudo-labels, allowing a large number of unannotated slices to participate in optimization with low-noise supervision; simultaneously, cross-layer topological consistency constraints are established based on the connectivity structure of adjacent slices, and corresponding loss terms are constructed to suppress abrupt changes in the number and attributes of interlayer structures, thereby improving the continuity of Z-axis prediction and the integrity of the 3D structure, reducing annotation costs while improving segmentation quality and robustness.

[0130] In terms of algorithm structure, this invention makes a structure-oriented improvement to address the root causes of interlayer breaks and jumps: instead of directly aligning adjacent slices at the pixel level, it generates a connected component graph from the prediction results, uses connected regions as nodes to represent target structural units, and establishes cross-layer candidate connections based on center point distance, bounding box overlap, and nearest neighbor selection to form a cross-layer fusion graph. Then, a graph neural network is used to learn node representations and determine cross-layer node matching relationships. Based on this, the target connected region is weighted and corrected using the mean probability of the matching region, and one-to-many and many-to-one matching relationships are allowed to adapt to splitting and fusion changes in the Z-axis direction. These improvements transform cross-layer consistency from pixel-level constraints to structure-level correspondence-driven processes, which is more conducive to the stable use of unlabeled slices and obtaining smoother, more coherent 3D segmentation results.

Claims

1. A semi-supervised medical image segmentation method based on cross-layer topology consistency, characterized in that, include: S1. For the target slice image in the three-dimensional medical image volume data to be segmented, select K adjacent slice images along the Z-axis, including the target slice image, and stack the K adjacent slice images in the channel dimension to obtain the multi-slice stacked input of the target slice image; S2. Input the multi-slice stacked input into the segmentation network to obtain the prediction probability map of the target slice image. S3. Generate an initial segmentation mask based on the predicted probability map, perform connected component labeling to obtain multiple connected regions, construct a connected component graph corresponding to the target slice image, the nodes of the connected component graph represent connected regions and include category attributes, and the edges of the connected component graph represent the intra-slice spatial relationship between connected regions. S4. For adjacent slice images that are adjacent to the target slice image in the Z-axis direction, construct the connected component graph corresponding to the adjacent slice image. Based on the connected component graph corresponding to the target slice image and the connected component graph corresponding to the adjacent slice image, establish cross-layer candidate connection relationship to form a cross-layer fusion graph. Input the graph neural network to obtain the node representation of each node, and determine the cross-layer node matching relationship based on the node representation and the spatial relationship of the nodes. S5. Based on the cross-layer node matching relationship, determine the cross-layer consistency constraints between the connected regions in the target slice image and the matching connected regions in the adjacent slice images, and correct the prediction probabilities belonging to each connected region in the prediction probability map accordingly to obtain the corrected prediction probability map; S6. Discretize the corrected prediction probability map to obtain the topologically consistent segmentation mask of the target slice image; S7. Repeat S1 to S6 for each slice image of the three-dimensional medical image volume data to be segmented, and combine them in the slice order to obtain the segmentation result of the three-dimensional medical image volume data.

2. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S1 includes: Set the preset quantity K to an odd number; For any target slice image in the three-dimensional medical image volume data to be segmented, select K adjacent slice images along the Z-axis with the target slice image as the center, so that the target slice image is located in the middle position of the K adjacent slice images. When the target slice image is located at the Z-axis boundary of the three-dimensional medical image data to be segmented, resulting in an insufficient number of adjacent slice images, the boundary slice images are repeatedly used to fill in the K adjacent slice images. The K adjacent slice images are stacked in the channel dimension according to their Z-axis order to generate the multi-slice stacked input corresponding to the target slice image.

3. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S2 include: Intensity normalization is performed on the multi-slice stacked input; The segmentation network performs feature extraction and decoding reconstruction on the multi-slice stacked input after intensity normalization to generate a score map corresponding to the target slice image. When the spatial resolution of the score map is inconsistent with the spatial resolution of the target slice image, the score map is upsampled to obtain an upsampled score map with the same spatial resolution as the target slice image. The upsampled score map is then subjected to probability normalization processing to output a predicted probability map corresponding to the target slice image, wherein the predicted probability map includes a probability value corresponding to at least one segmentation category at each pixel position.

4. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S3 include: The predicted probability map is discretized to obtain an initial segmentation result. The discretization process includes at least one of the following: (1) binary classification discretization: the pixels are divided into foreground pixels and background pixels according to a preset probability threshold; (2) mutually exclusive multi-class discretization: the segmentation category with the highest predicted probability is selected as the category label of the pixel; (3) multi-label multi-class discretization: for each segmentation category, the foreground pixels of the segmentation category are determined according to the corresponding category threshold for the probability channel of each segmentation category; an initial segmentation mask of at least one segmentation category is generated based on the initial segmentation result; connected component labeling is performed based on the pixel connectivity of the initial segmentation mask, a region identifier is assigned to each connected region and the pixel set of the connected region is determined; the center point coordinates and pixel count of the connected region are calculated according to the pixel set of each connected region, and each connected region is used as a node of the connected component graph, and a category attribute is assigned to the node; when any two connected regions have a shared boundary in the initial segmentation mask, an edge of the connected component graph is established between the nodes corresponding to the two connected regions to obtain the connected component graph corresponding to the target slice image.

5. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S4 includes: For the target slice image, the adjacent slice image adjacent to the target slice image in the Z-axis direction is determined to be at least one of the previous adjacent slice image and the next adjacent slice image, and the connected component graph corresponding to the adjacent slice image is generated according to S3 respectively; a cross-layer candidate connection relationship is established based on the nodes of the connected component graph corresponding to the target slice image and the nodes of the connected component graph corresponding to the adjacent slice image. The cross-layer candidate connection relationship is used to establish cross-layer candidate edges between the nodes of the two connected component graphs. The establishment rules of the cross-layer candidate edges include at least one of the following: (1) the distance between the center point of the target node and the adjacent slice node is less than a preset distance threshold; (2) the degree of overlap between the bounding box of the connected region of the target node and the bounding box of the connected region of the adjacent slice node after the projected bounding box of the connected region of the target node is projected onto the coordinate system of the adjacent slice is greater than a preset overlap threshold; (3) For each target node, select the M nearest neighboring slice nodes with the closest center point distance to establish cross-layer candidate edges, where M is a positive integer; combine the connected component graph corresponding to the target slice image, the connected component graph corresponding to the neighboring slice images, and the cross-layer candidate edges to form a cross-layer fusion graph, and input the cross-layer fusion graph into a graph neural network, outputting the node feature vector of each node in the cross-layer fusion graph through message passing and aggregation processing of the graph neural network; for each node in the connected component graph corresponding to the target slice image, determine the cross-layer node matching relationship only between the node and nodes with the same category attribute in the connected component graph corresponding to the neighboring slice image, based on the similarity of node feature vectors and the center point distance, and determine the node pairs with similarity lower than a preset similarity threshold or center point distance greater than a preset distance threshold as mismatched.

6. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S5 include: For each connected region, adjacent slice image connected regions matching the connected region are determined based on cross-layer node matching relationships. When the adjacent slice image connected regions include a previous adjacent slice image connected region and a next adjacent slice image connected region, the mean probability of the region corresponding to the previous adjacent slice image connected region and the mean probability of the region corresponding to the next adjacent slice image connected region are obtained in the probability channel corresponding to the category attribute of the connected region, and the two are aggregated to obtain the mean probability of the matching region. In the prediction probability map, the mean probability of the region corresponding to the connected region is calculated in the probability channel corresponding to the category attribute of the connected region. Based on the connected region... The difference between the mean probability of the corresponding region and the mean probability of the matching region determines the cross-layer consistency weight of the connected region, wherein the smaller the difference, the larger the cross-layer consistency weight; and according to the cross-layer consistency weight, the predicted probability of each pixel in the connected region in the probability channel corresponding to the category attribute is updated to the weighted average of the original predicted probability and the mean probability of the matching region, to obtain the corrected predicted probability map; when there is no matching adjacent slice image connected region in the connected region, the cross-layer consistency weight is set to a preset default value, and the predicted probability of each pixel in the connected region in the probability channel corresponding to the category attribute is updated with weights based on the preset default value.

7. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S6 include: Discretization is performed on the corrected prediction probability map to obtain a topologically consistent segmentation mask for the target slice image. The discretization process includes at least one of the following: (1) binary classification discretization: the pixels are divided into foreground pixels and background pixels according to a preset output threshold; (2) mutually exclusive multi-class discretization: the segmentation category with the highest prediction probability is selected as the category label of the pixel for each pixel. (3) Multi-label multi-class discretization: For each segmentation category, the foreground pixel of the segmentation category is determined according to the corresponding category threshold; and the topologically consistent segmentation mask is subjected to hole filling and small connected region removal processing according to the segmentation category to obtain the topologically consistent segmentation mask after morphological post-processing.

8. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, S7 includes: Following the slicing order of the three-dimensional medical image volume data to be segmented along the Z-axis, the multi-slice stack corresponding to each target slice image is sequentially input into the segmentation network to obtain a prediction probability map. Based on the connected component graph, adjacent connected component graph pairs, cross-layer node matching relationships, and the corrected prediction probability map, a topologically consistent segmentation mask corresponding to each target slice image is obtained. The topologically consistent segmentation masks are stacked and combined along the Z-axis according to the slicing order to generate a three-dimensional segmentation mask with the same spatial size as the three-dimensional medical image volume data to be segmented, which is used as the volume data segmentation result. When the topologically consistent segmentation mask is inconsistent with the three-dimensional medical image volume data to be segmented in terms of spatial resolution, the three-dimensional segmentation mask is resampled to align the volume data segmentation result with the three-dimensional medical image volume data to be segmented.

9. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 1, characterized in that, The segmentation network and the graph neural network are trained using the following method: T1. Acquire training 3D medical image volume data, and acquire pixel-level segmentation annotations for some slice images in the training 3D medical image volume data. Divide the slice images into an annotated slice set and an unannotated slice set according to whether they have pixel-level segmentation annotations. T2. For each training target slice image in the annotated slice set and the unannotated slice set, select a preset number of K adjacent slice images, including the training target slice image, along the Z-axis direction, and stack the K adjacent slice images in the channel dimension to generate the training multi-slice stacked input corresponding to the training target slice image. T3. Input the training multi-slice stacked input into the segmentation network to be trained, and output the training prediction probability map corresponding to the training target slice image. For the training multi-slice stacked input corresponding to the unlabeled slice set, enable random deactivation in the segmentation network to be trained and perform forward inference a preset number of N times. Calculate the mean of the N training prediction probability maps obtained from the N forward inferences to obtain the training prediction probability map, and generate an uncertainty map based on the variance of the N training prediction probability maps at the pixel position. T4. Based on the comparison result between the uncertainty map and the first threshold, and combined with the comparison result between the training prediction probability map and the second threshold, a reliable region mask corresponding to the unlabeled slice set is generated. Within the range defined by the reliable region mask, the training prediction probability map is discretized to generate pseudo labels corresponding to the unlabeled slice set. T5. Calculate the supervised segmentation loss using the training prediction probability map corresponding to the labeled slice set and the pixel-level segmentation annotations. Within the range defined by the reliable region mask, calculate the pseudo-labeled segmentation loss using the training prediction probability map corresponding to the unlabeled slice set and the pseudo-labels. T6. Discretize the training prediction probability map to generate initial training segmentation results. Based on the initial training segmentation results, generate initial training segmentation masks for at least one segmentation category and perform connected component labeling to generate training connected regions. Construct a training connected region graph based on the training connected regions. For each unlabeled slice image in the unlabeled slice set, select adjacent slice images that are adjacent to the unlabeled slice image in the Z-axis direction, and generate training connected region graphs corresponding to the adjacent slice images. Establish cross-layer candidate connection relationships between the nodes of the training connected region graphs corresponding to the unlabeled slice images and the nodes of the training connected region graphs corresponding to the adjacent slice images to establish cross-layer candidate edges between the two training connected region graphs. The rules for establishing cross-layer candidate edges include center point distance threshold rules, bounding box overlap threshold rules, and / or the nearest M nodes. The rules are as follows: the two training connected component graphs and the cross-layer candidate edges are combined to form a training cross-layer fusion graph, which is then input into the graph neural network to be trained. The graph neural network outputs node feature vectors through message passing and aggregation processing. Cross-layer node matching relationships are determined only between nodes with the same category attributes based on the similarity of node feature vectors and the distance between the center points of the training connected regions. The topology consistency loss is calculated based on the cross-layer node matching relationships. The topology consistency loss is used to constrain the number of training connected regions in adjacent slice images and the smoothness of the changes in the attributes of the training connected regions in the Z-axis direction. T7. A total loss function is constructed based on the supervised segmentation loss, the pseudo-labeled segmentation loss, and the topology consistency loss. The network parameters of the segmentation network and the graph neural network to be trained are updated through backpropagation to obtain the segmentation network and the graph neural network.

10. The semi-supervised medical image segmentation method based on cross-layer topological consistency according to claim 5, characterized in that, To adapt to the splitting and / or fusion morphological changes of the target structure in the Z-axis direction, a target slice image node is allowed to establish a one-to-many matching relationship and / or a many-to-one matching relationship with multiple nodes in adjacent slice images. The one-to-many matching relationship and / or the many-to-one matching relationship are filtered and confirmed based on the degree of overlap of the bounding box, the area ratio threshold and / or the distance to the center point.