A small sample three-dimensional medical image segmentation system

By using supervoxel generation, 3D pre-trained feature extraction, and 3D double cross-interference mining modules, the problem of 3D medical image segmentation under resource constraints was solved, improving the model's representation ability and segmentation accuracy on small sample data, and in particular, preserving the spatial information and edge features of 3D medical images.

CN118470322BActive Publication Date: 2026-11-24ZHONGSHAN INST OF MODERN IND TECH SOUTH CHINA UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410647152.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2026-11-24
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

Existing medical image segmentation models struggle to effectively utilize small sample data for 3D medical image segmentation under resource constraints. Furthermore, existing models are deficient in medical image feature extraction and feature correlation, resulting in poor representation capabilities and noise generation.

Method used

We employ a supervoxel generation module, a 3D pre-trained feature extraction module, and a 3D double cross-attention mining module, combined with a few-shot prototype learning network, to improve the feature representation and spatial information preservation capabilities of 3D medical images through pseudo-label training and bidirectional cross-attention mining.

Benefits of technology

Under resource constraints, this method achieves efficient small-sample 3D medical image segmentation, improves the model's representation ability and segmentation accuracy on medical images, reduces noise generation, and preserves the spatial information and edge features of 3D medical images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470322B_ABST
    Figure CN118470322B_ABST
Patent Text Reader

Abstract

This invention discloses a few-sample 3D medical image segmentation system. It utilizes a pre-trained model and a 3D cross-attention mining module to achieve 3D medical image segmentation under resource-constrained conditions. The system includes a supervoxel generation module, a 3D pre-trained feature extraction module, a 3D double cross-attention mining module, and a few-sample prototype learning network module. Specifically, this invention uses a 3D pre-trained feature extraction module based on medical images as the backbone of the model, solving the problem of insufficient representation in few-sample scenarios and fully utilizing the 3D spatial information of medical images. Building upon this, the invention designs a 3D double cross-attention mining module to mine the global cross-attention between supporting features and query features, thereby eliminating interference from image background information, capturing subtle features of the target category, improving the model's prototype representation ability, and achieving excellent segmentation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of image segmentation, and in particular to a small-sample three-dimensional medical image segmentation system. Background Technology

[0002] Segmenting regions of interest from biomedical images plays a crucial role in clinical research and forms the foundation for subsequent disease diagnosis and treatment. In recent years, deep network-based models have achieved great success in various tasks related to semantic segmentation of medical images, such as tumor segmentation and organ segmentation. However, most existing medical image segmentation models are fully supervised, requiring large amounts of pixel-level labeled data for training, thus lacking flexibility. In the medical field, medical image annotation is highly specialized; it is a laborious and time-consuming task for radiologists, and annotation is even more difficult for 3D data, requiring annotators to annotate hundreds of 2D slices of a 3D image layer by layer. Therefore, researching 3D medical image segmentation under conditions of limited data resources is crucial.

[0003] To address the issue of limited resources, numerous techniques have been researched. In recent years, few-shot learning based on meta-learning has attracted widespread attention. Its basic idea is to extract feature correlations between query images and support images, learn from support images to obtain representational prototypes, and use these prototypes for task prediction on query images. This allows the model to use a small amount of support image annotation information to analogize the query image, thereby extracting and annotating similar information within the query image. However, typical meta-learning-based few-shot learning methods require training on large labeled datasets to generalize the model to images of unseen categories. Since large-scale labeled data is scarce for medical images, it is difficult to apply few-shot learning to the medical image domain. To address this problem, a self-supervised training method for few-shot models has been proposed. This method uses superpixels to generate pseudo-labels to construct the training set, enabling model training without annotations.

[0004] However, existing few-shot models in the field of medical imaging also face common problems: First, data-level issues: Existing feature extraction networks generally use models pre-trained on natural images. However, natural images and medical images differ significantly, leading to poor model representation capabilities on medical images. Specifically, compared to natural images, medical images suffer from unclear edge texture information, unbalanced foreground and background distribution, and complex gradients, requiring more high-resolution information. However, with a very small number of samples, the model struggles to fully represent the data. Furthermore, medical images captured by advanced medical equipment (e.g., MRI, CT) are three-dimensional data, but existing models often slice and process the three-dimensional data layer by layer, neglecting the spatial relationships between layers in three-dimensional medical image data. Second, feature-level issues: Existing few-shot prototype learning models generally focus on how to unidirectionally transfer knowledge from supporting images to query images, often ignoring the bidirectional global feature relationships between supporting and query images. This results in the inability to generate sufficiently representative representation prototypes, leading to a large amount of noise in the model. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and provide a small-sample three-dimensional medical image segmentation system under resource-constrained conditions, thereby alleviating the dependence of existing fully supervised models on a large amount of data resources.

[0006] To achieve the above objectives, the technical solution provided by this invention is: a small-sample 3D medical image segmentation system, which uses a pre-trained model and a 3D cross-attention mining module to achieve 3D medical image segmentation under resource-constrained conditions, including:

[0007] The supervoxel generation module aggregates perceptually similar voxels based on local image features to provide a compact representation of image data. Each cluster can serve as a pseudo-label for similar voxels to guide model training.

[0008] The 3D pre-trained feature extraction module uses pseudo-labels generated by the hypervoxel generation module, and randomly generates support images and query images through intensity and geometric transformations to obtain information representations of support images and query images;

[0009] The 3D double cross-interference attention mining module takes the original image features obtained by the 3D pre-trained feature extraction module as input, mines the correlation between the supporting image and the query image, and further highlights the relevant spatial and contextual information in the image.

[0010] The few-shot prototype learning network module is used to calculate the similarity between the support image and the query image, and uses the calculated similarity score to generate the final segmentation output. The segmentation result and the original label are then used to calculate the model loss and backpropagate to update the model parameters.

[0011] Furthermore, the specific details of the supervoxel generation module are as follows:

[0012] Initialize seed points and set the number of supervoxels N′. Uniformly select N′ voxels in the image as seed points. Calculate the gradient values ​​of all voxels in the neighborhood of the seed point. Move the seed point to the location with the minimum gradient in the neighborhood. Assign a class label to each voxel in the neighborhood around each seed point. Then perform distance measurement, including color distance and spatial distance. For each searched voxel, calculate its distance to the seed point. Finally, perform multiple iterations of optimization until the error converges.

[0013] Furthermore, the specific details of the 3D pre-trained feature extraction module are as follows:

[0014] To improve the model's ability to represent small-sample 3D medical images and to make full use of spatial information, the pre-trained medical model Swin-UNETR was modified. The output layer of Swin-UNETR was removed as the 3D pre-training feature extraction module of the model, and its feature extraction function was used to enhance the small-sample segmentation task.

[0015] First, a hypervoxel generation module is used to generate pseudo-labels for the training samples. Simultaneously, the samples and pseudo-labels are transformed using intensity and geometry to generate reference copies. Before the training phase, either the samples or reference copies are randomly selected as support and query images for model training to perform meta-learning. The model's 3D pre-training feature extraction module is defined as f(.). During the encoding phase, the input 3D support image I... S and query image I Q , Representing a set of numbers, D, W, and H represent the depth, length, and width of a feature, respectively. The 3D image is decomposed into patches for computation, with each patch having a depth, length, and width of D′, W′, and H′, respectively. A patch of size [size missing] is created. The three-dimensional patch sequence is mapped to the feature space, the input volume blocks are divided into non-overlapping windows, and local self-attention is calculated within each patch region. For the output Z of the l-th layer in the encoding stage... l and the output Z of the (l+1)th layer l+1 It can be obtained from the following formula:

[0016]

[0017]

[0018]

[0019]

[0020] In the formula, MSM represents a multi-head self-attention module, W-MSM represents a windowed multi-head self-attention module, and Zl represents the output of the l-1 layer of the model. and represents the outputs of MSM and W-MSM respectively, Norm represents layer normalization, MLP represents multilayer perceptron, which contains two GELU linear activation functions, and self-attention is a parameterized function used to learn the representation mappings of Q and the corresponding K and V in sequence Z. The self-attention calculation is defined by the following formula: Q, K, and V represent queries, keys, and values, respectively; T represents transpose; and d′ represents the size of K and Q.

[0021] The 3D pre-trained feature extraction module is a U-shaped network formed by a Swin-transformer-based feature encoding network and a CNN-based feature decoding network. This U-shaped network can expand the receptive field and focus on the global features of the image. By fusing pixel and semantic features through skip connections, it can fully preserve edge information. The bottleneck in the 3D pre-trained feature extraction module and the output of each stage are input into the residual module, which is composed of two normalized 3×3×3 three-dimensional convolutions. In the subsequent process, the features of each stage are upsampled by the deconvolution module and merged with the features of the previous stage to finally obtain the features extracted by the U-shaped network.

[0022] Furthermore, the specific details of the 3D double cross-shaped attention mining module are as follows:

[0023] Two 3D cross-attention mining modules are used to extract image features from the supporting image and the query image, respectively, as Q. cc and K cc Through the numerical vector V cc To extract bidirectional cross attention;

[0024] The 3D cross-attention mining module consists of three 1×1×1 convolutional blocks, an affinity module, and a feature aggregation module. The input image features are reduced in dimensionality by the three 1×1×1 convolutional blocks, and then the affinity module is used to calculate the attention score. Finally, the feature aggregation module is used to aggregate the original features to obtain the final cross-attention output matrix.

[0025] The 3D cross-attention mining module captures the feature associations between support images and query images, collecting contextual information in the horizontal and vertical directions between pixels to enhance bidirectional knowledge representation capabilities. A set of 3D medical images first obtains the original support features F of the support images through a 3D pre-trained feature extraction module. s And the original query features Fx of the query image, C represents the number of feature channels, and F s With supporting image tags Dot product is performed to obtain strong representational features of the supporting image, and 1×1×1 convolution is used to obtain the dimensionality-reduced query vector Q. cc For F q Then, directly input a 1×1×1 convolution to obtain the dimensionality-reduced key vector K. cc , C′ represents the number of channels in the feature vector, after obtaining Q cc and K cc Then, an attention-related graph is generated through the Affinity operation. Y represents the dimension of the feature vector obtained after the Affinity operation, since Q cc As a multi-channel 3D feature, therefore for each Q cc For any position u∈(d, w, h), a representation vector can be obtained. j, w, and h represent Q cc The depth, length, and width, obtained from K cc Extract two feature vectors with coordinate value u to obtain the set. Ω u The i-th element is defined as The Affinity formula in the model is: d i,u =Q u Ω i,u , where d i,u ∈T′ represents the feature correlation between two features, i∈[1,2,...,Y], T′ represents the set of vector correlations, and then T′ is output to the softmax layer to compute the attention correlation graph A;

[0026] F q The numerical vector is obtained again through a 1×1×1 convolution. Similarly, for V cc Each position u′ has a vector and set Φ u′ With position u′ as the center point in V ccThe set of vectors intersecting in the three directions of depth, length, and width is used, and finally, aggregation is used to aggregate the contextual relationships. F′ s,u′ Corresponding to F s The output of each position u′, F s,u′ Corresponding to F s The output Φ at each position u′ i,u ′ represents the i-th set Φ u′ A i′,u′ Let A be a scalar value representing A at channel i′ and position u′, where i′∈[0,1,...,C-1].

[0027] Furthermore, the specific details of the few-shot prototype learning network module are as follows:

[0028] The support image and query image are input into the 3D pre-trained feature extraction module f(·) for feature extraction, resulting in the original support features F. s and the original query feature F g F s and F q The cross-input 3D double cross-attention mining module obtains the support features and query features F after bidirectional knowledge transfer. s ′ and F q The few-shot prototype learning network module extracts only one foreground feature prototype to reduce computation and eliminate interference from other extra prototypes. It generates support image labels M for a specific category using supervoxels. s Multiply with the feature map and then perform masked average pooling (MAP) to obtain the foreground prototype representation. The specific formula is as follows: (d, w, h) represent the three dimensions of depth, length, and width, and ⊙ represents the Hadamard product.

[0029] A threshold-based metric learning method is used to segment the query image: First, the negative cosine similarity between the feature vector of the query image and the foreground prototype p is calculated. The scaling factor is used, and then a soft thresholding process is performed using a shifted sigmoid. The learned threshold parameter T″ is then combined to obtain the foreground mask of the query image. and background mask fg and bg represent the foreground and background of the predicted query image;

[0030] Three loss functions were used: cross-entropy loss L q Threshold loss L Thres Prototype alignment regularization loss LPAR Among them, the cross-entropy loss L q Threshold loss is used to calculate the difference between the foreground and background of the query image and the label. The prototype alignment regularization loss L is used to minimize the learned threshold. PAR The formula used to align similar features between the supporting image and the query image is as follows:

[0031]

[0032]

[0033] In the formula, Represents the background and foreground of the queried image tag. and Represents the background and foreground of the image that supports the tag; and The calculation method is the same as and Similarly, represents the foreground and background of the supporting image; the overall model loss is the sum of the three losses mentioned above.

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

[0035] 1. This invention designs a few-sample prototype learning network module based on supervoxels, which alleviates the problem of medical image segmentation under resource-constrained conditions.

[0036] 2. This invention addresses the problem of insufficient representation of small sample data in three-dimensional medical images by using a pre-trained model for fine feature extraction, which can preserve the unique spatial information of three-dimensional medical images and refine local features while preserving edge information.

[0037] 3. This invention proposes a 3D double cross-attention mining module, which captures subtle features of the target category and eliminates irrelevant information of surrounding pixels by exploring the bidirectional global correlation between the features of the supporting image and the query image. Attached Figure Description

[0038] Figure 1 This is a structural diagram of a small-sample prototype learning network module.

[0039] Figure 2 This is a structural diagram of the 3D pre-trained feature extraction module.

[0040] Figure 3 This is a structural diagram of the 3D double cross-shaped attention mining module. Detailed Implementation

[0041] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0042] See Figure 1 As shown, this embodiment provides a small-sample 3D medical image segmentation system. The first step involves aggregating the image into multiple similar regions based on its local features, using these superpixel aggregators as the pseudo-label dataset for model training. The second step utilizes a 3D pre-trained feature extraction module to extract the original supporting features and original query features from the supporting and query images. The third step uses a 3D double cross-attention mining module to calculate the feature correlation between the original supporting features and original query features, and outputs the final supporting and query features. The fourth step calculates the feature similarity between the supporting and query features and outputs the segmentation result and the original pseudo-label calculation model's loss. The system includes the following modules:

[0043] The supervoxel generation module aggregates perceptually similar voxels based on local image features to provide a compact representation of image data. Each cluster can serve as a pseudo-label for similar voxels to guide model training.

[0044] The 3D pre-trained feature extraction module uses pseudo-labels generated by the hypervoxel generation module, and randomly generates support images and query images through intensity and geometric transformations to obtain information representations of support images and query images;

[0045] The 3D double cross-interference attention mining module takes the original image features obtained by the 3D pre-trained feature extraction module as input, mines the correlation between the supporting image and the query image, and further highlights the relevant spatial and contextual information in the image.

[0046] The few-shot prototype learning network module is used to calculate the similarity between the support image and the query image, and uses the calculated similarity score to generate the final segmentation output. The segmentation result and the original label are then used to calculate the model loss and backpropagate to update the model parameters.

[0047] Specifically, the details of the supervoxel generation section are as follows:

[0048] Initialize seed points and set the number of supervoxels N'. Uniformly select N' voxels in the image as seed points. Calculate the gradient values ​​of all voxels in the neighborhood of the seed point. Move the seed point to the location with the minimum gradient in the neighborhood. Assign a class label to each voxel in the neighborhood around each seed point. Then perform distance measurement, including color distance and spatial distance. For each searched voxel, calculate its distance to the seed point. Finally, perform multiple iterations of optimization until the error converges.

[0049] Specifically, see Figure 2 As shown, the specific details of the 3D pre-trained feature extraction module are as follows:

[0050] To improve the model's ability to represent small-sample 3D medical images and to make full use of spatial information, the pre-trained medical model Swin-UNETR was modified. The output layer of Swin-UNETR was removed as the 3D pre-training feature extraction module of the model, and its feature extraction function was used to enhance the small-sample segmentation task.

[0051] First, a hypervoxel generation module is used to generate pseudo-labels for the training samples. Simultaneously, the samples and pseudo-labels are transformed using intensity and geometry to generate reference copies. Before the training phase, either the samples or reference copies are randomly selected as support images and query images for model training to perform meta-learning. The model's 3D pre-training feature extraction module is defined as f(·). During the encoding phase, the input 3D support image I... S and query image I Q , Representing a set of numbers, D, W, and H represent the depth, length, and width of a feature, respectively. The 3D image is decomposed into patches for computation, with each patch having a depth, length, and width of D', W', and H'. A patch of size [missing information] is created. The three-dimensional patch sequence is mapped to the feature space, the input volume blocks are divided into non-overlapping windows, and local self-attention is calculated within each patch region. For the output Z of the l-th layer in the encoding stage... l and the output Z of the (l+1)th layer l+1 It can be obtained from the following formula:

[0052]

[0053]

[0054]

[0055]

[0056] In the formula, MSM represents a multi-head self-attention module, and W-MSM represents a windowed multi-head self-attention module. This represents the output of layer l-1 of the model. and represents the outputs of MSM and W-MSM respectively, Norm represents layer normalization, MLP represents multilayer perceptron, which contains two GELU linear activation functions, and self-attention is a parameterized function used to learn the representation mappings of Q and the corresponding K and V in sequence Z. The self-attention calculation is defined by the following formula: Q, K, and V represent queries, keys, and values, respectively; T represents transpose; and d' represents the size of K and Q.

[0057] The 3D pre-trained feature extraction module is a U-shaped network formed by a Swin-transformer-based feature encoding network and a CNN-based feature decoding network. This U-shaped network can expand the receptive field and focus on the global features of the image. By fusing pixel and semantic features through skip connections, it can fully preserve edge information. The bottleneck in the 3D pre-trained feature extraction module and the output of each stage are input into the residual module, which is composed of two normalized 3×3×3 three-dimensional convolutions. In the subsequent process, the features of each stage are upsampled by the deconvolution module and merged with the features of the previous stage to finally obtain the features extracted by the U-shaped network.

[0058] Specifically, see Figure 3 As shown, the specific details of the 3D double cross-shaped attention mining module are as follows:

[0059] Two 3D cross-attention mining modules are used to extract image features from the supporting image and the query image, respectively, as Q. cc and K cc Through the numerical vector V cc To extract bidirectional cross attention;

[0060] The 3D cross-attention mining module consists of three 1×1×1 convolutional blocks, an affinity module, and a feature aggregation module. The input image features are reduced in dimensionality by the three 1×1×1 convolutional blocks, and then the affinity module is used to calculate the attention score. Finally, the feature aggregation module is used to aggregate the original features to obtain the final cross-attention output matrix.

[0061] The 3D cross-attention mining module captures the feature associations between support images and query images, collecting contextual information in the horizontal and vertical directions between pixels to enhance bidirectional knowledge representation capabilities. A set of 3D medical images first obtains the original support features F of the support images through a 3D pre-trained feature extraction module. s And the original query features F of the query image q , C represents the number of feature channels, and F s With supporting image tags Dot product is performed to obtain strong representational features of the supporting image, and 1×1×1 convolution is used to obtain the dimensionality-reduced query vector Q. cc For F qThen, directly input a 1×1×1 convolution to obtain the dimensionality-reduced key vector K. cc , C' represents the number of channels in the eigenvector, which is obtained when Q is obtained. cc and K cc Then, an attention-related graph is generated through the Affinity operation. Y represents the dimension of the feature vector obtained after the Affinity operation, since Q cc As a multi-channel 3D feature, therefore for each Q cc For any position u∈(d,w,h), a representation vector can be obtained. d, w, h represent Q cc The depth, length, and width, obtained from K cc Extract two feature vectors with coordinate value u to obtain the set. Ω u The i-th element is defined as The Affinity formula in the model is: d i,u =Q u Ω i,u , where d i,u ∈T′ represents the feature correlation between two features, i∈[1,2,...,Y], T′ represents the set of vector correlations, and then T′ is output to the softmax layer to compute the attention correlation graph A;

[0062] F q The numerical vector is obtained again through a 1×1×1 convolution. Similarly, for V cc Each position u′ has a vector and set Φ u′ It is the position u ' As the center point in V cc The set of vectors intersecting in the three directions of depth, length, and width is used, and finally, aggregation is used to aggregate the contextual relationships. F′ s,u' Corresponding to F s The output of each position u', F s,u' Corresponding to F s The output Φ at each position u' i,u' Represents the i-th set Φ u' A i’,u' Represents the scalar value of A at channel i' and position u', where i'∈[0,1,...,C-1].

[0063] Specifically, the details of the few-shot prototype learning network module are as follows:

[0064] The support image and query image are input into the 3D pre-trained feature extraction module f(·) for feature extraction, resulting in the original support features F. s and the original query feature F q F s and F q The cross-input 3D double cross-attention mining module obtains the support features and query features F after bidirectional knowledge transfer. s 'and F q The few-shot prototype learning network module extracts only one foreground feature prototype to reduce computation and eliminate interference from other extra prototypes. It generates support image labels M for a specific category using supervoxels. s Multiply with the feature map and then perform masked average pooling (MAP) to obtain the foreground prototype representation. The specific formula is as follows: (d,w,h) represent the three dimensions of depth, length and width, and ⊙ represents the Hadamard product.

[0065] A threshold-based metric learning method is used to segment the query image: First, the negative cosine similarity between the feature vector of the query image and the foreground prototype p is calculated. The scaling factor is used, and then a soft thresholding process is performed using a shifted sigmoid. The learned threshold parameter T″ is then combined to obtain the foreground mask of the query image. and background mask fg and bg represent the foreground and background of the predicted query image;

[0066] Three loss functions were used: cross-entropy loss L q Threshold loss L Thres Prototype alignment regularization loss L PAR Among them, the cross-entropy loss L q Threshold loss is used to calculate the difference between the foreground and background of the query image and the label. The prototype alignment regularization loss L is used to minimize the learned threshold. PAR The formula used to align similar features between the supporting image and the query image is as follows:

[0067]

[0068]

[0069] In the formula, Represents the background and foreground of the queried image tag. and Represents the background and foreground of the image that supports the tag; and The calculation method is the same as and Similarly, represents the foreground and background of the supporting image; the overall model loss is the sum of the three losses mentioned above.

[0070] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A small-sample three-dimensional medical image segmentation system, characterized in that, Using a pre-trained model and a 3D cross-attention mining module to achieve 3D medical image segmentation under resource-constrained conditions, including: The supervoxel generation module aggregates perceptually similar voxels based on local image features to provide a compact representation of image data. Each cluster can serve as a pseudo-label for similar voxels to guide model training. The 3D pre-trained feature extraction module uses pseudo-labels generated by the hypervoxel generation module, and randomly generates support images and query images through intensity and geometric transformations to obtain information representations of support images and query images; The 3D double cross-interference attention mining module takes the original image features obtained by the 3D pre-trained feature extraction module as input, mines the correlation between the supporting image and the query image, and further highlights the relevant spatial and contextual information in the image. The few-shot prototype learning network module is used to calculate the similarity between the support image and the query image, and uses the calculated similarity score to generate the final segmentation output. The segmentation result and the original label are then used to calculate the model loss and backpropagate to update the model parameters. The specific details of the 3D pre-trained feature extraction module are as follows: To improve the model's ability to represent small-sample 3D medical images and to make full use of spatial information, the pre-trained medical model Swin-UNETR was modified. The output layer of Swin-UNETR was removed as the 3D pre-training feature extraction module of the model, and its feature extraction function was used to enhance the small-sample segmentation task. First, a hypervoxel generation module is used to generate pseudo-labels for the training samples. Simultaneously, the samples and pseudo-labels are transformed using intensity and geometry to generate reference copies. Before the training phase, either the samples or the reference copies are randomly selected as support and query images for model training to perform meta-learning. The model's 3D pre-training feature extraction module is defined as... During the encoding stage, the input 3D support image and query images , , Representing a set of numbers, D, W, and H represent the depth, length, and width of the feature, respectively. The 3D image is decomposed into patches for computation, and the depth, length, and width of each patch are... Create a size of The three-dimensional patch sequence is mapped to the feature space, the input volume blocks are divided into non-overlapping windows, and local self-attention is computed within each patch region. For the output of the l-th layer in the encoding stage... and the output of layer l+1 It can be obtained from the following formula: ; ; ; ; In the formula, MSM represents a multi-head self-attention module, and W-MSM represents a windowed multi-head self-attention module. This represents the output of layer l-1 of the model. and represents the outputs of MSM and W-MSM respectively, Norm represents layer normalization, MLP represents multilayer perceptron, which contains two GELU linear activation functions, and self-attention is a parameterized function used to learn the representation mappings of Q and the corresponding K and V in sequence Z. The self-attention calculation is defined by the following formula: Q, K, and V represent queries, keys, and values, respectively. Represents transpose. Represents the magnitudes of K and Q; The specific details of the few-shot prototype learning network module are as follows: Input the support image and query image into the 3D pre-trained feature extraction module. Feature extraction is performed to obtain the original support features. and original query features , and The cross-input 3D double cross-attention mining module obtains support features and query features after bidirectional knowledge transfer. and The few-shot prototype learning network module extracts only one foreground feature prototype to reduce computation and eliminate interference from other extra prototypes, generating support image labels for a specific category through supervoxels. Multiply with the feature map and then perform masked average pooling (MAP) to obtain the foreground prototype representation. The specific formula is as follows: , Representing the three dimensions of depth, length, and width. Represents Hadamard product; A threshold-based metric learning method is used to segment the query image: First, the negative cosine similarity between the feature vector of the query image and the foreground prototype p is calculated. , The scaling factor is then used, followed by soft thresholding using a Shifted Sigmoid, and combined with the learned threshold parameters. To obtain the foreground mask of the query image and background mask : , fg and bg represent the foreground and background of the predicted query image; Three loss functions were used: cross-entropy loss Threshold loss Prototype-aligned regularization loss Among them, cross-entropy loss Threshold loss is used to calculate the difference between the foreground and background of the query image and the label. The prototype alignment regularization loss is used to minimize the learned threshold. The formula used to align similar features between the supporting image and the query image is as follows: ; ; In the formula, , Represents the background and foreground of the queried image tag. and Represents the background and foreground of the image that supports the tag; and The calculation method is the same as and Similarly, represents the background mask and foreground mask of the supporting image; the overall model loss Loss is the sum of the three losses mentioned above.

2. The small-sample three-dimensional medical image segmentation system according to claim 1, characterized in that, The specific details of the hypervoxel generation module are as follows: Initialize seed points and set the number of hypervoxels. Select uniformly within the image Each voxel is used as a seed point. The gradient values ​​of all voxels in the neighborhood of the seed point are calculated. The seed point is moved to the place with the minimum gradient in the neighborhood. Class labels are assigned to each voxel in the neighborhood around each seed point. Then, distance metrics are performed, including color distance and spatial distance. For each searched voxel, the distance between it and the seed point is calculated. Finally, multiple iterations of optimization are performed until the error converges.

3. The small-sample three-dimensional medical image segmentation system according to claim 2, characterized in that, The 3D pre-trained feature extraction module is a U-shaped network formed by a Swin-transformer-based feature encoding network and a CNN-based feature decoding network. This U-shaped network can expand the receptive field and focus on the global features of the image. By fusing pixel and semantic features through skip connections, it can fully preserve edge information. The bottleneck in the 3D pre-trained feature extraction module and the output of each stage are input into the residual module, which is composed of two normalized 3×3×3 three-dimensional convolutions. In the subsequent process, the features of each stage are upsampled by the deconvolution module and merged with the features of the previous stage to finally obtain the features extracted by the U-shaped network.

4. The small-sample three-dimensional medical image segmentation system according to claim 3, characterized in that, The specific details of the 3D double cross-shaped attention mining module are as follows: Two 3D cross-attention mining modules were used to extract image features from the supporting image and the query image, respectively. and , through numerical vectors To extract bidirectional cross attention; The 3D cross-attention mining module consists of three 1×1×1 convolutional blocks, an affinity module, and a feature aggregation module. The input image features are reduced in dimensionality by the three 1×1×1 convolutional blocks, and then the affinity module is used to calculate the attention score. Finally, the feature aggregation module is used to aggregate the original features to obtain the final cross-attention output matrix. The 3D cross-attention mining module captures the feature associations between support images and query images, and collects contextual information between pixels in the horizontal and vertical directions to enhance bidirectional knowledge representation capabilities. A set of 3D medical images first obtains the original support features of the support images through a 3D pre-trained feature extraction module. and the original query features of the query image , C represents the number of feature channels. With supporting image tags Dot product is performed to obtain strong representational features of the support image, and 1×1×1 convolution is used to obtain the dimensionality-reduced query vector. For Then, directly input a 1×1×1 convolution to obtain the dimensionality-reduced key vector. , , The number of channels representing the feature vector, after obtaining and Then, an attention-related graph is generated through the Affinity operation. Y represents the dimension of the feature vector obtained after the Affinity operation. As a multi-channel 3D feature, therefore for each Location Both can obtain the representation vector. d, w, h represent The depth, length, and width, through from Extract two feature vectors with coordinate value u to obtain the set. , The i-th element is defined as The Affinity formula in the model is: ,in This represents the feature correlation between two features. , , The set representing vector correlation, then... Output a softmax layer to compute the attention-related graph A; Will The numerical vector is obtained again through a 1×1×1 convolution. Similarly, for those in Each position Each has a vector and set , Based on position As the central point The set of vectors intersecting in the three directions of depth, length, and width is used, and finally, aggregation is used to aggregate the contextual relationships. , correspond Each position The output, correspond Each position The output, Represents the i-th set , Represents A in the channel and location scalar value, .