Small sample lung lobe semantic segmentation method based on space consistency constraint

By constructing training samples with spatial consistency constraints and three-dimensional spatial feature prototype learning, the long-distance dependence problem in lung lobe segmentation is solved, segmentation accuracy and robustness are improved, and labeling costs are reduced, and medical image segmentation is suitable for small sample learning scenarios.

CN120374985APending Publication Date: 2025-07-25SHIHEZI UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510687351.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Existing lobe segmentation methods are inefficient when capturing relationships between different trait levels, especially when it involves long-distance dependence between different lobes and between lobes and other structures, and have limitations in complex cases.

Method used

By constructing training samples with spatial consistency constraints, three-dimensional spatial feature prototype learning is carried out, and the spatial position relationship between labeled and unlabeled data is used to enhance the spatial perception ability of the model, combining global structural information and local detailed characteristics, and improving long-distance dependence problems.

Benefits of technology

It improves the accuracy and robustness of lung lobe segmentation, reduces dependence on large-scale annotation data, reduces manual annotation costs, and is especially suitable for small sample learning scenarios, improving the efficiency of medical image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374985A_ABST
    Figure CN120374985A_ABST
Patent Text Reader

Abstract

The invention discloses a small sample lung lobe semantic segmentation method based on spatial consistency constraint, and belongs to the field of medical image semantic segmentation, and the method comprises the following steps: constructing a training sample of spatial consistency constraint based on a lung lobe image; performing three-dimensional space feature prototype learning and training on the basis of the training sample of the space consistency constraint to obtain a three-dimensional space feature prototype driving model; and inputting a verification sample into the three-dimensional space feature prototype driving model to obtain a complete semantic segmentation result. According to the method, the spatial relationship of local features is expressed through global structure consistency modeling, and the problem of long-distance dependence in lung lobe segmentation is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical image semantic segmentation, and particularly relates to a small-sample lung lobe semantic segmentation method based on spatial consistency constraints. Background Technique

[0002] Lung lobe segmentation plays an important role in the diagnosis of lung diseases. The lungs are composed of five non-overlapping lung lobes, which are separated by lung fissures. Each lung lobe, as an independent functional unit, has independent blood vessels and bronchial supplies. Since there are significant differences in the development of diseases among different lung lobes, accurately locating the lung lobe where the lesion is located is crucial for the formulation of clinical treatment plans.

[0003] Current lung lobe segmentation methods are mainly divided into two categories. One is the traditional method based on automatic lung fissure localization, which usually uses interpolation algorithms or rule-driven models to find the positions of lung fissures. This type of method highly depends on manually designed features, is difficult to handle complex cases, and is greatly limited in practical applications. The other is the lung lobe segmentation method based on multi-level cascaded convolutional neural networks that has emerged in recent years. This method extracts global and local features through multi-resolution inputs and uses convolutional neural networks to implicitly learn objects and their structural relationships from semantic segmentation tasks. However, when the existing lung lobe segmentation methods based on multi-level cascaded convolutional neural networks capture the relationships between different feature levels, especially when dealing with long-range dependencies between different lung lobes and between lung lobes and other structures, the efficiency is low due to the gradual attenuation of information in deep networks, and there are limitations in practical applications, especially in complex cases. Therefore, there is an urgent need for a simple and effective method to improve the long-range dependency problem in lung lobe segmentation to enhance the segmentation accuracy. Summary of the Invention

[0004] To solve the above technical problems, the present invention proposes a small-sample lung lobe semantic segmentation method based on spatial consistency constraints to solve the problems existing in the above prior art.

[0005] To achieve the above object, the present invention provides a small-sample lung lobe semantic segmentation method based on spatial consistency constraints, including:

[0006] Constructing training samples with spatial consistency constraints based on lung lobe images;

[0007] Performing three-dimensional spatial feature prototype learning and training based on the training samples with spatial consistency constraints to obtain a three-dimensional spatial feature prototype-driven model;

[0008] Inputting verification samples into the three-dimensional spatial feature prototype-driven model to obtain a complete semantic segmentation result.

[0009] Optionally, the process of constructing training samples with spatial consistency constraints based on lung lobe images includes:

[0010] Construct support samples based on labeled lung lobe images and query samples based on unlabeled lung lobe images;

[0011] Spatially align the support samples and the query samples to obtain the aligned support samples and query samples;

[0012] Randomly sample the aligned support samples and query samples to obtain support images and query images;

[0013] Calculate the class intersection of the support images and query images to obtain support images and query images with consistent classes;

[0014] Preprocess the support images and query images with consistent classes to obtain the preprocessed support and query sets;

[0015] Obtain training samples with spatial consistency constraints based on the preprocessed support set and query set.

[0016] Optionally, the process of obtaining support images and query images with consistent classes includes:

[0017] Calculate the class intersection of the support images and query images;

[0018] Randomly select a class from the class intersection and generate a corresponding binary mask according to the randomly selected class;

[0019] Obtain support images and query images with consistent classes based on the binary mask.

[0020] Optionally, the process of performing three-dimensional spatial feature prototype learning and training based on the training samples with spatial consistency constraints to obtain a three-dimensional spatial feature prototype-driven model includes:

[0021] Concatenate the support images of the preprocessed support set and the query images of the query set along the batch dimension to obtain a joint input tensor;

[0022] Extract query image feature maps and support image feature maps based on the joint input tensor;

[0023] Normalize the support image feature maps and query image feature maps, and extract the foreground prototype and background prototype of the support image feature maps;

[0024] Calculate the similarity between the query image feature maps and the foreground prototype and background prototype of the support image feature maps to generate a prediction map;

[0025] Calculate the segmentation loss and alignment loss based on the prediction map, and perform backpropagation and optimization to update the three-dimensional spatial feature prototype-driven model.

[0026] Optionally, the segmentation loss measures the difference between the predicted class probability distribution and the true class using the negative log-likelihood loss, where the calculation expression of the segmentation loss is:

[0027]

[0028] In the formula, is the segmentation loss, represents the probability that the pixel point (i, j) is classified as the true class Y i,j , and H and W are the height and width of the image respectively.

[0029] Optionally, the calculation expression of the alignment loss is:

[0030]

[0031] In the formula, represents the alignment loss, cos(a, b) represents the cosine similarity between features a and b, and are the foreground feature prototype and background feature prototype predicted by the query image, and are the foreground feature prototype and background feature prototype of the support sample.

[0032] Optionally, the process of inputting the validation sample into the three-dimensional spatial feature prototype-driven model to obtain the complete semantic segmentation result includes:

[0033] Initialize the three-dimensional spatial feature prototype-driven model and read the validation sample;

[0034] Input each slice in the validation sample into the backbone feature extraction network to obtain the feature map;

[0035] Perform a convolution operation on the feature map with the foreground feature prototype and background feature prototype of the slice to generate a foreground prediction map and a background prediction map;

[0036] Stitch the foreground prediction map and the background prediction map to obtain the complete lung lobe semantic segmentation map;

[0037] Obtain the complete semantic segmentation result based on the lung lobe semantic segmentation maps corresponding to several slices.

[0038] The present invention provides a small-sample lung lobe semantic segmentation system for implementing the small-sample lung lobe semantic segmentation method, and the system includes: a spatial consistency constraint training unit, a lung lobe segmentation network for three-dimensional spatial feature prototype learning, and a three-dimensional spatial feature prototype-driven validation unit;

[0039] Among them, the spatial consistency constraint training unit is used to generate effective training samples through spatial consistency constraints;

[0040] The lung lobe segmentation network for three-dimensional spatial feature prototype learning is used to perform three-dimensional spatial feature prototype learning and training based on the training samples to obtain a three-dimensional spatial feature prototype-driven model;

[0041] The three-dimensional spatial feature prototype-driven verification unit is used to perform class query and verification on the samples in the verification stage based on the trained three-dimensional spatial features.

[0042] The present invention provides a computer terminal device, including:

[0043] One or more processors;

[0044] A memory, coupled to the processor, for storing one or more programs;

[0045] When the one or more programs are executed by the one or more processors, the one or more processors implement the small-sample lung lobe semantic segmentation method based on spatial consistency constraints.

[0046] The present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the small-sample lung lobe semantic segmentation method based on spatial consistency constraints is implemented.

[0047] Compared with the prior art, the present invention has the following advantages and technical effects:

[0048] The small-sample lung lobe semantic segmentation method based on spatial consistency constraints of the present invention realizes the precise alignment of support samples and query samples in the spatial dimension by constructing training samples with spatial consistency constraints, effectively enhancing the model's spatial perception ability of the lung lobe structure. At the same time, combined with three-dimensional spatial feature prototype learning, it makes full use of global structural information and local detail features, significantly improving the long-distance dependence problem in lung lobe segmentation and enhancing the segmentation accuracy and robustness. In addition, this method can achieve high-precision segmentation with only a small amount of labeled data, greatly reducing the manual labeling cost and improving the efficiency of medical image processing. It is particularly suitable for small-sample learning scenarios and has important application value for medical image semantic segmentation tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The drawings constituting a part of this application are used to provide a further understanding of this application. The schematic embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation of this application. In the drawings:

[0050] Figure 1 is a flowchart of the small-sample lung lobe semantic segmentation training method based on spatial consistency constraints according to an embodiment of the present invention;

[0051] Figure 2 The flowchart of the small-sample lung lobe semantic segmentation verification method based on spatial consistency constraint according to the embodiment of the present invention. Detailed implementation manners

[0052] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.

[0053] It should be noted that the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than here.

[0054] Embodiment 1

[0055] In view of the above problems, the present invention explores new solutions from small-sample semantic segmentation methods. Different from traditional methods, small-sample segmentation learns more semantic information through the association between labeled data and unlabeled data in the case of less data volume. More importantly, the spatial position relationship between unlabeled data and labeled data in the sequence can provide additional spatial position information for the model, thereby enhancing the model's spatial perception ability. In this way, not only can the dependence on large-scale labeled data be reduced, but also the problem of capturing long-range dependencies encountered by traditional convolutional neural networks in lung lobe segmentation can be effectively alleviated, and the segmentation accuracy and robustness can be improved.

[0056] As Figure 1 shown, in this embodiment, a small-sample lung lobe semantic segmentation method based on spatial consistency constraint is provided to provide high-precision lung lobe semantic segmentation in medical images.

[0057] The present invention constructs a small-sample lung lobe semantic segmentation network from three aspects: First, through global structure consistency modeling, learning the spatial correspondence relationship between labeled data and unlabeled data in the spatial structure, capturing the global object relationship and spatial consistency information between lung lobes, thereby enhancing the expression of three-dimensional structures; Second, constructing a three-dimensional feature prototype with spatial structure to provide support information for local features, reducing the information loss of support data in the inference stage, and enhancing the robustness of the model; Third, through local feature matching, based on the category prototype matching between labeled data and unlabeled data, extracting local detail features in unlabeled data, thereby clarifying the category attribution and semantic information of lung lobes, and thus providing high-precision lung lobe segmentation.

[0058] This embodiment provides a small-sample lung lobe semantic segmentation method based on spatial consistency constraint, which specifically includes the following steps:

[0059] Step 1: Extraction and construction of training samples for spatial consistency constraint. The main objective of extracting and constructing training samples for spatial consistency constraint is to ensure the consistency of support samples and query samples in the spatial dimension, thereby improving the matching accuracy of the model between different slices. The extraction of training samples is divided into the following key sub-steps:

[0060] Step 1.1 Spatial alignment of support samples and query samples to obtain the aligned support samples and query samples.

[0061] Construct support samples based on annotated lung lobe images and query samples based on unannotated lung lobe images. To ensure the spatial consistency between the support image and the query image, the spatial alignment requirements of the slice indices must be met. Specifically, assume that the query sample contains N q slices, the support sample contains N s slices, and the slice index of a certain slice in the query sample is k q , then the corresponding slice index k s of the support sample is given by formula (1):

[0062]

[0063] From the above, it is possible to ensure the matching of the query sample and the support sample in the spatial position in different volume images, thereby ensuring the spatial consistency between different samples to obtain the aligned support samples and query samples.

[0064] Step 1.2 Random sampling of support images and query images.

[0065] To enhance the generalization ability and robustness of the model, random sampling needs to be performed on the aligned query samples and support samples. The specific operations are as follows:

[0066] Sampling of query images: Randomly select a sample from the training set as the query sample, and randomly select one of its slices and extract its corresponding label set;

[0067] Sampling of support images: Select a non-query sample from the training set as the support sample, and obtain the corresponding slice L of the support image based on formula (1) s and its label set

[0068] For the label sets in the query image and the support image, the non-background classes need to be filtered out, which can be specifically achieved through the following formula (2):

[0069]

[0070] Step 1.3 Calculate the class intersection and class selection.

[0071] Calculate the class intersection of the support image and the query image to obtain the support image and the query image with consistent classes. To ensure the class consistency between the query image and the support image, it is necessary to calculate the intersection of the label sets of the two. The specific operation is as shown in Equation (3):

[0072]

[0073] Next, randomly select a class c from the intersection and generate the corresponding binary mask according to the selected class, as shown in Equation (4):

[0074] L' q = 1(L q = c), L' s = 1(L s = c) (4)

[0075] This step ensures that only the lung lobe classes common to the query image and the support image are selected as the segmentation targets through the constraint based on class consistency, thereby improving the matching accuracy between the two and avoiding the influence of inconsistent classes on the segmentation results.

[0076] Step 1.3 Data preprocessing: Perform data preprocessing on the support image and the query image with consistent classes to obtain the preprocessed support set and query set.

[0077] To input the support image and the query image into the network for training, it is first necessary to perform data preprocessing on them. The specific process is as follows:

[0078] Image size adjustment: The sizes of the support image and the query image are unified to H×W, where H and W represent the height and width of the image respectively.

[0079] Dimension expansion: Stack the images along the channel dimension (i.e., the first dimension) to expand to D×H×W, where D represents the number of channels.

[0080] Batch dimension expansion: Further expand the dimensions of the images and add the batch dimension to finally obtain the shape of B×D×H×W, where B is the batch size.

[0081] For the label images of the support image and the query image, only expand them in the batch dimension to obtain the shape of B×H×W, keeping the original spatial dimensions unchanged.

[0082] Step 2: Three-dimensional spatial feature prototype learning and model training. In this step, the data trainer inputs the preprocessed support set and query set into the feature extraction network to generate the corresponding feature maps. Using the annotation information in the support set, further extract the foreground and background feature prototypes of the lung lobe classes. The specific process is as follows:

[0083] Step 2.1 Concatenate the support set and query set images.

[0084] To simultaneously pass the feature information of the support set and query set into the network, in this step, first concatenate the query image L q and the support image L s along the batch dimension (dim = 0) to form a joint input tensor X = [L q , L s . This joint input tensor is fed into the backbone feature extraction network for feature extraction. Through this step, the network can simultaneously receive the spatial information of the query image and the support image and generate corresponding feature maps for each image. Finally, obtain the feature map F q of the query image and the support image feature map F s .

[0085] Step 2.2 Foreground and background prototype extraction.

[0086] During the forward propagation of the model, first normalize the feature map F s of the support image and the feature map F q of the query image to ensure that the query image and the support image have the same scale in the feature space. Then, perform average pooling operation on the support image feature map F s to obtain a compressed feature representation. Based on the label L of the support image, extract the corresponding foreground feature prototype Similarly, perform reverse processing on the label L of the support image (i.e., select the background area) to obtain Extract the background feature prototype

[0087] Subsequently, calculate the similarity between the query image feature F q and the extracted foreground prototype and background prototype through convolution operation. This process generates two feature maps, respectively representing the responses of the query image in the foreground and background categories. Finally, concatenate these two feature maps together and determine the class label of each pixel point in the query image by applying the argmax operation to the concatenated feature map.

[0088] Step 2.3 Loss calculation and backpropagation.

[0089] Loss calculation is mainly divided into two parts, including segmentation loss and alignment loss.

[0090] Preferably, the segmentation loss adopts negative log-likelihood loss (NLLLoss), which aims to measure the difference between the predicted class probability distribution and the true class. The predicted probability of the query image is Where C is the number of categories, and H and W are the height and width of the image respectively. The actual label is Y(X) ∈ {1, …, C} H×W , representing the true category of each pixel. The calculation is as shown in Equation (5):

[0091]

[0092] Where represents the probability that the pixel point (i, j) is classified as the true category Y i,j .

[0093] The Alignment Loss imposes an alignment constraint on the segmentation result predicted by the network and the features of the support samples. Assume that

[0094] The foreground and background features predicted by the query image are and The foreground and background feature prototypes of the support samples are and Its loss is defined as shown in Equation (6):

[0095]

[0096] Where cos(a, b) represents the cosine similarity between features a and b.

[0097] The final loss function is a weighted combination of the segmentation loss and the alignment loss

[0098] Backpropagation and optimization. The gradient is calculated by the automatic differentiation framework to compute the gradient of the loss function with respect to the network parameters. The parameters are updated using an optimization algorithm. Preferably, the Adam optimizer is used to update the network parameters, and the calculation formula is as shown in Equation (7).

[0099]

[0100] Where θ represents the network parameters and η represents the learning rate.

[0101] Step 2.4 Three-dimensional spatial feature prototype learning.

[0102] The main objective of this step is to extract three-dimensional spatial feature prototypes during the training process and apply them as support sample information in the validation phase. First, define the categories of the three-dimensional spatial feature prototypes and divide them into two categories: foreground three-dimensional spatial feature prototypes and background three-dimensional spatial feature prototypes. At the same time, initialize the dimensions of the three-dimensional spatial feature prototypes. Preferably, set the length of the feature prototypes to 500 to ensure sufficient expression of the required spatial features.

[0103] The foreground feature prototype extracted in Step 2.2 and the background feature prototype They are respectively stored as corresponding three-dimensional space feature prototypes, and an index is assigned to each prototype. The setting of the index follows the following formula: Assume that the slice index corresponding to the feature prototype is k q , and the number of slice category samples corresponding to it is N q , then the slice index k s is initialized to length l, and the feature prototype type is set to the slice type, so as to assign a unique index position to each feature prototype in the three-dimensional space.

[0104] During the entire model training process, the three-dimensional space feature prototypes will be continuously updated as the training progresses. Through repeated iteration and optimization, the model can gradually adjust these feature prototypes to better represent the spatial structure and semantic information in the input images.

[0105] Step 3: Category query and verification driven by three-dimensional space feature prototypes. The goal of this step is to use the trained three-dimensional space feature prototypes, combined with the output of the model, to perform category query and verification, and finally obtain an accurate semantic segmentation result, as Figure 2 shown.

[0106] Step 3.1 Initialization of the model driven by three-dimensional space feature prototypes.

[0107] First, initialize the trained model, including the weights of the model and the three-dimensional space feature prototypes of the foreground and background. Then, read the samples in the verification stage, and verify each slice and its corresponding lung lobe category one by one according to the sample sequence. For each slice, the corresponding foreground feature prototype and background feature prototype are calculated according to the slice index through formula (1).

[0108] Step 3.2 Feature extraction and generation of prediction maps.

[0109] Next, input each slice into the backbone feature extraction network to obtain the corresponding feature map with a size of H×W. Expand the dimensions of the foreground feature prototype and the background feature prototype backward to obtain 1×1 convolution kernels with a quantity of H, respectively perform convolution operations with the feature map, and stack them to generate the foreground prediction map and the background prediction map. Finally, splice these two prediction maps to obtain the complete lung lobe semantic segmentation map. Repeat the above process until the entire sample set is verified, and finally generate the complete semantic segmentation result of the sample.

[0110] The small-sample lung lobe semantic segmentation method based on spatial consistency constraint provided by the present invention can achieve high-precision segmentation results with only a small amount of data annotation, reducing the demand for manual annotation costs; the small-sample lung lobe semantic segmentation method based on spatial consistency constraint provided by the present invention expresses the spatial relationship of local features through global structure consistency modeling, improving the long-distance dependence problem in lung lobe segmentation; the small-sample lung lobe semantic segmentation method based on spatial consistency constraint provided by the present invention improves the lung lobe segmentation accuracy in medical images through the joint representation of global features and local features; the small-sample lung lobe semantic segmentation method based on spatial consistency constraint provided by the present invention is of great significance for small-sample learning, is particularly suitable for semantic segmentation tasks in fields such as medical images, and has high application value.

[0111] Embodiment 2

[0112] This embodiment also provides a small-sample lung lobe semantic segmentation system, preferably used to implement the small-sample lung lobe semantic segmentation method based on spatial consistency constraint. The system includes a spatial consistency constraint training unit, a lung lobe segmentation network for learning three-dimensional spatial feature prototypes, and a verification unit driven by three-dimensional spatial feature prototypes. Among them,

[0113] The spatial consistency constraint training unit is used to process training data and generate effective training samples through spatial consistency constraint.

[0114] The lung lobe segmentation network for learning three-dimensional spatial feature prototypes is responsible for the learning and model training of three-dimensional spatial feature prototypes.

[0115] The verification unit driven by three-dimensional spatial feature prototypes queries and verifies the categories of samples in the verification stage based on the trained three-dimensional spatial feature prototypes.

[0116] Embodiment 3

[0117] This embodiment also provides a computer-readable storage medium. An image semantic segmentation program is stored on the storage medium, and a small-sample lung lobe semantic segmentation program is stored on the computer-readable storage medium. When the small-sample semantic lung lobe program is executed by a processor, it implements the above-mentioned small-sample lung lobe semantic segmentation method based on spatial consistency constraint. The small-sample lung lobe semantic segmentation method described in the present invention can be implemented by means of software plus a necessary general hardware platform. The software is stored in a computer-readable storage medium (including ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, network device, etc.) to execute the method described in the present invention.

[0118] The above are only the preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A small-sample lung lobe semantic segmentation method based on spatial consistency constraints, characterized in that The method includes the following steps: Construct training samples with spatial consistency constraints based on lung lobe images; Perform three-dimensional spatial feature prototype learning and training based on the training samples with spatial consistency constraints to obtain a three-dimensional spatial feature prototype-driven model; Input validation samples into the three-dimensional spatial feature prototype-driven model to obtain a complete semantic segmentation result.

2. The small-sample lung lobe semantic segmentation method based on spatial consistency constraints according to claim 1, wherein The process of constructing training samples with spatial consistency constraints based on lung lobe images includes: Construct support samples based on annotated lung lobe images and query samples based on unannotated lung lobe images; Perform spatial alignment on the support samples and the query samples to obtain aligned support samples and query samples; Randomly sample the aligned support samples and query samples to obtain support images and query images; Calculate the class intersection of the support images and the query images to obtain support images and query images with consistent classes; Perform data preprocessing on the support images and query images with consistent classes to obtain preprocessed support and query sets; Obtain training samples with spatial consistency constraints based on the preprocessed support set and query set.

3. The small-sample lung lobe semantic segmentation method based on spatial consistency constraints according to claim 2, characterized in that The process of obtaining support images and query images with consistent classes includes: Calculate the class intersection of the support images and the query images; Randomly select a class from the class intersection and generate a corresponding binary mask according to the randomly selected class; Obtain support images and query images with consistent classes based on the binary mask.

4. The small-sample lung lobe semantic segmentation method based on spatial consistency constraints according to claim 2, wherein The process of performing three-dimensional spatial feature prototype learning and training based on the training samples with spatial consistency constraints to obtain a three-dimensional spatial feature prototype-driven model includes: Concatenate the support images of the preprocessed support set and the query images of the query set along the batch dimension to obtain a joint input tensor; Extract feature maps of the query images and the support images based on the joint input tensor; Perform normalization processing on the support image feature maps and the query image feature maps, and extract the foreground prototype and background prototype of the support image feature maps; Calculate the similarity between the query image feature maps and the foreground prototype and background prototype of the support image feature maps to generate a prediction map; Calculate the segmentation loss and alignment loss based on the prediction map, and perform backpropagation and optimization to update the three-dimensional spatial feature prototype-driven model.

5. The small-sample lung lobe semantic segmentation method based on spatial consistency constraints according to claim 4, wherein The segmentation loss measures the difference between the predicted class probability distribution and the true class using negative log-likelihood loss. Among them, the calculation expression of the segmentation loss is: In the formula, is the segmentation loss, indicates the probability that the pixel point (i, j) is classified as the true class Y i,j , and H and W are the height and width of the image respectively.

6. The small-sample lung lobe semantic segmentation method based on spatial consistency constraints according to claim 5, characterized in that The calculation expression of the alignment loss is: In the formula, represents the alignment loss, and cos(a, b) represents the cosine similarity between features a and b. and are the foreground feature prototypes and background feature prototypes predicted for the query image. and are the foreground feature prototypes and background feature prototypes of the support samples.

7. The small-sample lung lobe semantic segmentation method based on spatial consistency constraints according to claim 6, wherein The process of inputting validation samples into the three-dimensional spatial feature prototype-driven model to obtain a complete semantic segmentation result includes: Initialize the three-dimensional spatial feature prototype-driven model and read the validation samples; Input each slice in the validation samples into the backbone feature extraction network to obtain feature maps; Perform convolution operations on the feature maps and the foreground feature prototype and background feature prototype of the slices to generate a foreground prediction map and a background prediction map; Concatenate the foreground prediction map and the background prediction map to obtain a complete lung lobe semantic segmentation map; Obtain a complete semantic segmentation result based on the lung lobe semantic segmentation maps corresponding to several slices.

8. A small-sample lung lobe semantic segmentation system, characterized in that, For implementing the small-sample lung lobe semantic segmentation method as described in claim 1, the system includes: a spatial consistency constraint training unit, a lung lobe segmentation network for three-dimensional spatial feature prototype learning, and a three-dimensional spatial feature prototype-driven verification unit; Among them, the spatial consistency constraint training unit is used to generate effective training samples through spatial consistency constraints; The lung lobe segmentation network for three-dimensional spatial feature prototype learning is used to perform three-dimensional spatial feature prototype learning and training based on the training samples to obtain a three-dimensional spatial feature prototype-driven model; The three-dimensional spatial feature prototype-driven verification unit is used to perform class query and verification on the samples in the verification stage based on the trained three-dimensional spatial feature prototype.

9. A computer terminal device, characterized in that, Including: One or more processors; A memory coupled to the processor for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the small-sample lung lobe semantic segmentation method based on spatial consistency constraints as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the small-sample lung lobe semantic segmentation method based on spatial consistency constraints as described in any one of claims 1-7.