A training method of a blood vessel segmentation model, and a blood vessel segmentation method and device thereof
Patent Information
- Application Number
- CN202610994038.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-03
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本申请从多个方面提供一种血管分割模型的训练方法及其血管分割方法和装置,用于解决现有技术对细小血管分支的识别能力不足,导致影响血管结构的分割精度和临床辅助诊断的可靠性的问题
[0013] The training method for the blood vessel segmentation model provided in this application constructs an adaptive depth residual-Transformer hybrid segmentation network that includes an encoder, a decoder, and a transformer module embedded between the two. It utilizes a loss method based on cross-entropy, cross-union, and focus loss. The network is trained using a joint loss function comprised of Tversky coefficient losses. A configurable depth residual block dynamically adjusts the number of residual units via a power-law parameter, allowing the network depth to adapt to changes in vessel thickness and branch complexity. This enhances the feature extraction capability for multi-scale vascular structures, especially small branches, and reduces breakage and missed detections. The transformer module captures global contextual information through a self-attention mechanism, compensating for the insufficient local receptive field of convolution, thereby strengthening the continuity of vascular topology. The focal point of the joint loss function...
The Tversky coefficient loss differentiates the penalty weights for missed detections and false detections through the first and second penalty parameters, respectively, and strengthens the learning weights of hard-to-classify samples by using the focusing parameter. At the same time, it combines cross-entropy loss to ensure pixel-level classification accuracy and intersection-union ratio loss to constrain the overlap of regions. Thus, during the training process, it synergistically improves the overall segmentation accuracy and connectivity of the blood vessel foreground region of the model, and finally obtains a blood vessel segmentation model with higher segmentation accuracy.
Smart Images

Figure CN122928901A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of deep learning medical image processing technology, and in particular to a training method for a blood vessel segmentation model, as well as a blood vessel segmentation method and apparatus. Background Technology
[0002] Medical imaging vascular segmentation is a core component of computer-aided diagnostic (CAD) systems, with significant applications in clinical scenarios such as coronary angiography, retinal vascular analysis, and 3D reconstruction of cerebral vessels. By automatically and accurately extracting vascular topology from images, it can effectively assist doctors in disease screening, surgical planning, and efficacy evaluation.
[0003] Currently, deep learning-based blood vessel segmentation methods have become the mainstream approach. U-Net and its variants (such as Residual U-Net and Attention U-Net) are widely used. These methods typically employ an encoder-decoder symmetric structure, fusing shallow detail features with deep semantic features through skip connections. Regarding loss function design, common approaches include binary cross-entropy loss, Dice loss, and weighted combinations of both. Some studies have attempted to introduce Transformer modules to enhance global feature modeling capabilities, or use activation functions such as ReLU and GELU for nonlinear transformations.
[0004] However, the aforementioned schemes are severely inadequate in identifying small blood vessel branches. Specifically, the fixed network depth, which cannot adaptively adjust, makes it easy for small blood vessels to be overlooked; the loss function lacks an effective penalty mechanism for missed detections, further exacerbating the phenomenon of blood vessel breakage and missed detections. This problem directly affects the segmentation accuracy of vascular structures and the reliability of clinical auxiliary diagnosis. Summary of the Invention
[0005] This application provides a training method for a blood vessel segmentation model, as well as a blood vessel segmentation method and apparatus, from multiple perspectives to address the problem that the existing technology is insufficient in recognizing small blood vessel branches, which affects the segmentation accuracy of blood vessel structures and the reliability of clinical auxiliary diagnosis.
[0006] This application provides a method for training a blood vessel segmentation model, including: Obtain a training dataset of medical images labeled with vascular regions; An adaptive depth residual-Transformer hybrid segmentation network is constructed, which includes an encoder, a decoder, and a transformer module embedded between the encoder and the decoder; wherein, both the encoder and the decoder contain configurable depth residual blocks, and the number of residual units in the configurable depth residual blocks is dynamically adjusted by a power parameter. The deep residual network architecture is trained using a joint loss function to obtain a trained blood vessel segmentation model; The joint loss function is composed of cross-entropy loss, cross-union ratio loss, and focus-Tversky coefficient loss. The focus-Tversky coefficient loss integrates the focus mechanism and the Tversky coefficient, and differentiates the penalty weights of missed and false positive samples in the medical image training dataset through the first penalty parameter and the second penalty parameter, respectively, and strengthens the learning weights of hard-to-distinguish samples in the medical image training dataset through the focus parameter.
[0007] This application also provides a method for segmenting blood vessels, including: Acquire the medical images to be segmented; The medical image to be segmented is input into the blood vessel segmentation model to obtain the blood vessel segmentation result of the medical image to be segmented.
[0008] This application embodiment also provides a training device for a blood vessel segmentation model, comprising: The acquisition module is used to acquire a training dataset of medical images with labeled vascular regions. A construction module is used to construct an adaptive depth residual-Transformer hybrid segmentation network. The hybrid segmentation network includes an encoder, a decoder, and a transformer module embedded between the encoder and the decoder. The encoder and decoder each contain configurable depth residual blocks, and the number of residual units in the configurable depth residual blocks is dynamically adjusted by a power parameter. The training module is used to train the deep residual network architecture using a joint loss function to obtain a trained blood vessel segmentation model. The joint loss function is composed of cross-entropy loss, cross-union ratio loss, and focus-Tversky coefficient loss. The focus-Tversky coefficient loss integrates the focus mechanism and the Tversky coefficient, and differentiates the penalty weights of missed and false positive samples in the medical image training dataset through the first penalty parameter and the second penalty parameter, respectively, and strengthens the learning weights of hard-to-distinguish samples in the medical image training dataset through the focus parameter.
[0009] This application also provides a blood vessel segmentation device, including: The acquisition module is used to acquire the medical images to be segmented; The segmentation module is used to input the medical image to be segmented into the blood vessel segmentation model to obtain the blood vessel segmentation result of the medical image to be segmented.
[0010] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. The processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform steps in the training method or blood vessel segmentation method of the blood vessel segmentation model provided in this application.
[0011] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the training method or blood vessel segmentation method of the blood vessel segmentation model provided in this application.
[0012] This application also provides a computer program product, which stores instructions that, when executed by a computer, cause the computer to implement the steps in the training method or the blood vessel segmentation method of the blood vessel segmentation model provided in this application.
[0013] The training method for the blood vessel segmentation model provided in this application constructs an adaptive depth residual-Transformer hybrid segmentation network that includes an encoder, a decoder, and a transformer module embedded between the two. It utilizes a loss method based on cross-entropy, cross-union, and focus loss. The network is trained using a joint loss function comprised of Tversky coefficient losses. A configurable depth residual block dynamically adjusts the number of residual units via a power-law parameter, allowing the network depth to adapt to changes in vessel thickness and branch complexity. This enhances the feature extraction capability for multi-scale vascular structures, especially small branches, and reduces breakage and missed detections. The transformer module captures global contextual information through a self-attention mechanism, compensating for the insufficient local receptive field of convolution, thereby strengthening the continuity of vascular topology. The focal point of the joint loss function... The Tversky coefficient loss differentiates the penalty weights for missed detections and false detections through the first and second penalty parameters, respectively, and strengthens the learning weights of hard-to-classify samples by using the focusing parameter. At the same time, it combines cross-entropy loss to ensure pixel-level classification accuracy and intersection-union ratio loss to constrain the overlap of regions. Thus, during the training process, it synergistically improves the overall segmentation accuracy and connectivity of the blood vessel foreground region of the model, and finally obtains a blood vessel segmentation model with higher segmentation accuracy. Attached Figure Description
[0014] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a training method for a blood vessel segmentation model provided as an exemplary embodiment of this application; Figure 2 A schematic diagram of the system architecture of the blood vessel segmentation model provided in an exemplary embodiment of this application; Figure 3 A schematic diagram of the structure of a configurable depth residual block in a blood vessel segmentation model provided for an exemplary embodiment of this application; Figure 4 A schematic diagram comparing the FocalTversky Loss curves of the blood vessel segmentation model provided in the exemplary embodiments of this application in a real-world scenario. Figure 5 A schematic diagram of the multi-head attention module structure in the blood vessel segmentation model provided as an exemplary embodiment of this application; Figure 6 A schematic diagram of the converter module in the blood vessel segmentation model provided as an exemplary embodiment of this application; Figure 7 A schematic diagram of the encoder-decoder structure in the blood vessel segmentation model provided as an exemplary embodiment of this application; Figure 8 A schematic diagram illustrating the implementation process of a blood vessel segmentation method provided for an exemplary embodiment of this application; Figure 9 A schematic diagram of the structure of a training device for a blood vessel segmentation model provided as an exemplary embodiment of this application; Figure 10 A schematic diagram of a blood vessel segmentation device provided for an exemplary embodiment of this application; Figure 11 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] As described in the background section, the relevant technologies have the following problems in practical applications: First, the network depth is fixed and its adaptability is poor. The depth of the standard residual block is fixed during the design phase and cannot be dynamically adjusted according to changes in blood vessel thickness and branch complexity. The encoder and decoder only use single-layer residual connections, resulting in limited feature extraction capabilities and insufficient ability to identify small blood vessel branches, easily leading to breaks and missed detections.
[0017] Second, the loss function design is unreasonable. Single cross-entropy loss cannot effectively handle the severe class imbalance between foreground (blood vessels) and background in medical images; Dice Loss is not sensitive to small blood vessels with a very small foreground proportion; existing loss functions generally lack differentiated penalty mechanisms for false negatives (with more serious consequences) and false positives; in addition, the weights of each loss function in multi-task learning scenarios are usually fixed and cannot be adaptively adjusted according to the training progress.
[0018] Third, long-range capture capability is insufficient. Traditional convolutional neural networks are limited by the size of the receptive field, making it difficult to capture the global contextual information and topological features of blood vessels. Blood vessels have continuous and complex branching characteristics, requiring global perception capabilities for accurate segmentation. While the pure Transformer structure has strong global modeling capabilities, it has high computational complexity, is difficult to train, and its positional encoding design is not fully adapted to the characteristics of medical images.
[0019] Fourth, the activation function has weak expressive power. The ReLU activation function suffers from neuron death and is insufficient for fine-grained segmentation tasks in medical images. Furthermore, there is relatively little research on activation functions specifically optimized for segmentation networks.
[0020] To address the aforementioned issues, this application proposes a training method for a blood vessel segmentation model. By constructing an adaptive depth residual-Transformer hybrid segmentation network, the number of residual units is dynamically adjusted using power-law parameters, allowing the network depth to adapt to the complexity of the blood vessel segmentation task. Simultaneously, a dual residual block cascade structure is employed to enhance feature extraction capabilities, addressing the problem of small blood vessels being easily broken and missed due to a fixed network depth. A multi-head self-attention transformer module is embedded between the encoder and decoder to capture the global contextual information and long-distance dependencies of blood vessels, overcoming the limitations of traditional convolutional receptive fields and the difficulty in maintaining the topological continuity of blood vessels. A joint loss function composed of cross-entropy loss, cross-union ratio loss, and focus-Tefsky coefficient loss is constructed, using a first and second penalty parameter to differentiate the penalty weights for missed and falsely detected samples, respectively. Furthermore, a focus parameter is used to strengthen the learning weights for difficult-to-classify samples, addressing the problems of class imbalance and the inability to adaptively adjust loss weights.
[0021] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0022] Figure 1 This is a flowchart illustrating a training method for a blood vessel segmentation model provided as an exemplary embodiment of this application. Figure 1 As shown, the method includes: Step 110: Obtain the medical image training dataset with labeled vascular regions.
[0023] The medical image training dataset is derived from hospital PACS systems or publicly available datasets, typically including vascular images of various modalities such as coronary CTA, fundus color images, or TOF-MRA. Each sample corresponds to an original grayscale or color image and a binary label image manually annotated pixel by pixel by experts (vascular regions are labeled 1, and background is labeled 0), used to provide the input-output ground truth pairs required for supervised training of the deep learning model. In this embodiment, the acquired training dataset is specifically a coronary angiography grayscale image with an input size of 512×512×1 (512 and 512 are spatial dimensions, and 1 is the number of channels). The label image is a binary segmentation mask with the same resolution as the input, used for end-to-end training of the subsequently constructed adaptive deep residual-Transformer hybrid segmentation network.
[0024] Step 120: Construct an adaptive depth residual-Transformer hybrid segmentation network. The hybrid segmentation network includes an encoder, a decoder, and a transformer module embedded between the encoder and the decoder. Both the encoder and the decoder contain configurable depth residual blocks, and the number of residual units in the configurable depth residual blocks can be dynamically adjusted by power parameters.
[0025] Figure 2 A schematic diagram of the system architecture of a blood vessel segmentation model provided for an exemplary embodiment of this application. (See diagram below.) Figure 2As shown in the system architecture diagram, the data processing flow is as follows: The input layer receives the coronary angiography grayscale image (size 512×512×1), which is first sent to the encoder module. This module consists of cascaded dual residual blocks (specifically ADRB1→ADRB2→DRB×2, i.e., the first two stages use configurable depth residual blocks ADRB, and the last two stages use dual residual blocks DRB, each DRB containing a cascaded structure of two residual branches). Multi-scale features are extracted through step-by-step downsampling. The deepest feature map output by the encoder enters the Transformer enhancement module, which sequentially performs layer normalization (LayerNorm), multi-head self-attention (MHSA), and random deactivation (Dropo). The system uses a combination of a coronary angiography image and a feedforward network (FFN, with GELU activation function) to capture global contextual information and long-range dependencies of blood vessels through a self-attention mechanism. Subsequently, the feature map enhanced by the Transformer enters the decoder module, which refines the features sequentially through DRB×2 and ADRB, gradually restores the spatial resolution with upsampling operations, and then fused with the corresponding layer features of the encoder through skip connections. Finally, the output is a blood vessel segmentation probability map with the same resolution as the input (512×512×1) after passing through the Sigmoid activation function. Each pixel value in the map represents the probability that the location belongs to the blood vessel region, thus completing the end-to-end mapping from the coronary angiography image to the blood vessel segmentation mask.
[0026] Specifically, the encoder can use a VGG-like convolutional structure to downsample layer by layer to extract multi-scale semantic features, and the decoder can gradually restore spatial resolution through upsampling. Skip connections concatenate the outputs of each layer of the encoder with the corresponding layers of the decoder to fuse details and semantic information. Configurable depth residual blocks are the basic building blocks of the encoder and decoder, and the number of residual units connected in series inside is determined by power parameters.
[0027] The larger the power-order parameter, the more cascaded residual units, resulting in a deeper network, a progressively larger receptive field, and stronger nonlinear fitting ability. This allows the network capacity to adaptively adjust according to the complexity of the vessel segmentation task (such as variations in vessel thickness and branch density). For cases with densely packed small vessels and complex structures, a larger power-order parameter can be used to enhance feature extraction capabilities, while for cases with thicker vessels and simpler structures, a smaller power-order parameter can be used to reduce computation and avoid overfitting. This mechanism addresses the shortcomings of fixed-depth residual networks that cannot flexibly adapt to segmentation tasks of varying complexity, enabling a single network architecture to cover diverse clinical scenarios.
[0028] In some exemplary embodiments, configurable depth residual blocks are constructed in the following manner: The input tensor is reduced to one-quarter of its original number of channels through a 1×1 convolution; Based on the value of the power parameter, the feature extraction operation is performed a number of times corresponding to the value of the power parameter. Each feature extraction operation includes sequential 3×3 convolution, batch normalization and activation function processing. The original number of channels is restored using 1×1 convolution; The restored output is concatenated with the original input along the channel dimension to output a feature tensor.
[0029] The power parameter, ranging from 1 to 4, controls the number of residual units in the configurable depth residual block, thereby adapting to the complexity of different blood vessel segmentation tasks.
[0030] In this embodiment, within the configurable depth residual block, the input tensor is first compressed to one-quarter of its original number of channels by a 1×1 convolution to reduce computation. Then, a feature extraction operation is performed iteratively, with the number of iterations equal to the power parameter values. Each operation includes a 3×3 convolution, batch normalization, and an activation function to progressively extract local features, accelerate convergence, and introduce nonlinearity. The input is then restored to its original number of channels by another 1×1 convolution. Finally, the restored output is concatenated with the original input along the channel dimension for output. This allows for flexible adaptation to vessel segmentation tasks of varying complexity while controlling the number of parameters. The encoder's feature channel number increases progressively with 64, 128, 256, and 512 channels to gradually expand feature representation capabilities and capture multi-level semantic information ranging from simple textures to complex vascular structures. It should be noted that the above channel number configuration and 1×1 convolution compression ratio are a specific implementation method provided in this embodiment. Those skilled in the art can make corresponding adjustments based on actual task requirements and computational resources; this application does not impose specific limitations on this.
[0031] Specifically, in this construction method, the input tensor is first compressed to one-quarter of the original number of channels by 1×1 convolution. The direct effect of this dimensionality reduction operation is to significantly reduce the number of parameters and computation of the subsequent 3×3 convolution (for example, the number of channels is reduced from 256 to 64, and the number of parameters of the 3×3 convolution is reduced to 1 / 16 of the original), making the computational cost of concatenating multiple residual units controllable.
[0032] Subsequently, feature extraction is performed d times according to the value of the power parameter d. Each operation consists of three parts: 3×3 convolution to extract local spatial features, batch normalization to accelerate convergence and stabilize training, and activation function to introduce nonlinearity. Executing the operation d times means that the features are repeatedly refined in the depth dimension. That is, each 3×3 convolution further captures higher-order abstract patterns based on the features extracted in the previous operation, enabling the network to gradually transition from shallow simple textures (such as blood vessel edges) to deep complex structures (such as blood vessel bifurcation and orientation).
[0033] Finally, the number of channels is restored by 1×1 convolution, and the restored output is concatenated with the original input along the channel dimension. This concatenation operation allows the output features to retain both the low-level details (edges, brightness, etc.) of the original input and the high-level semantic information (structure, category, etc.) after multi-level nonlinear transformation, realizing cross-layer feature reuse. This not only alleviates the gradient vanishing problem but also enhances the integrity of the transmission of fine blood vessel features.
[0034] Figure 3 The specific structure of Configurable Deep Residual Block (ADRB) is shown. Its data processing flow is as follows: The input feature map is first compressed by 1×1 convolution (reducing the dimensionality to one-quarter of the original number of channels), and then normalized and nonlinearly transformed by batch normalization (BN) and activation function (ReLU or GELU) to obtain the bottleneck layer output x0. Then, it enters the loop, which repeatedly performs the feature extraction operation a corresponding number of times according to the power degree parameter (value 1~4). Each operation includes 3×3 convolution to extract local spatial features, batch normalization to accelerate convergence, and activation function to introduce nonlinearity. Each loop performs residual connection (adding the input and output of the current loop), so that the output of each residual unit is equal to the sum of the current input and the features after convolution, thereby realizing the progressive refinement of features in the depth dimension. After the loop ends, the number of channels is restored to the original dimension by 1×1 convolution. Finally, the restored output is concatenated with the original input feature map (i.e., the previous layer feature map marked as input in the figure) according to the channel dimension to output the final feature tensor. This structure flexibly controls the number of loop executions through power parameters, allowing the depth of the residual block to be adaptively adjusted according to the complexity of the blood vessel segmentation task. At the same time, the strategy of channel compression and restoration controls the growth of computational load while increasing network depth.
[0035] In some exemplary embodiments, to further enhance feature extraction capabilities and achieve two-level feature extraction from coarse-grained to fine-grained, the encoder and decoder also include a dual residual block cascade structure. The dual residual block cascade structure connects two residual blocks in series and adds skip connections on each residual path. The input features pass through both the main path and the branch simultaneously. The main path performs two residual operations, the branch passes the original input, and the outputs of the main path and the branch are added together to activate the input.
[0036] In some exemplary embodiments, the dual residual block cascade structure includes a first residual branch and a second residual branch, and the dual residual block cascade structure is constructed in the following manner: The input feature tensor enters the first residual branch, and after passing through 3×3 convolution, batch normalization, activation function, 3×3 convolution, batch normalization, it is added to the original input. The output of the first residual branch enters the second residual branch, and after passing through a 3×3 convolution, batch normalization, activation function, 3×3 convolution, and batch normalization, it is added to the output of the first residual branch. The original input is transformed by a 1×1 convolution and then added to the output of the second residual branch to obtain the fusion result; The final feature is output based on the fusion result through the activation function.
[0037] The first residual branch performs two 3×3 convolutions on the original input. Each 3×3 convolution has a receptive field of 3×3. After concatenation, the equivalent receptive field is expanded to 5×5. The output is the local structural features extracted within the 5×5 window. This is then added to the original input, so that the output of this level carries both the detailed information of the original input and the medium-scale structural information extracted after one convolution (at this point, the network's receptive field is still limited, and the extracted features are mainly shallow coarse features such as the edges and brightness of blood vessels). The second residual branch takes the output of the first level as input and performs two more 3×3 convolutions. This time, the two convolutions from the previous level are superimposed, further expanding the total equivalent receptive field. This allows it to capture a wider range of structural patterns (while maintaining the resolution of the first level features, it can focus on more refined topological structural features such as the connection relationships and trends between blood vessel branches, such as the overall morphology of blood vessel bifurcation). This is then added to the output of the first level, so that the output of the second level carries both the medium-scale structural information of the first level and the large-scale morphological information of the second level.
[0038] Finally, the original input is processed through a 1×1 convolution to match the number of channels, and then added to the output of the second residual branch. This results in a final output that integrates information from three different scale levels: fine-grained edge details of the original input, medium-scale local structures at the first level, and large-scale overall morphology at the second level. This multi-scale feature accumulation method ensures that the feature map retains both the edge localization accuracy of small blood vessels and the connection topology information of blood vessel branches, thereby improving the continuity and integrity of the segmentation mask.
[0039] Meanwhile, each of the two residual blocks is equipped with a skip connection (i.e., the main path is added to the input), which ensures that the original input features and the first-level intermediate features are directly transmitted to the output of their respective branches. Even if both levels of convolution use a relatively deep network structure, the gradient can still propagate back to the shallow layer through the skip connection, which alleviates the gradient vanishing problem and enables both levels of feature extraction to be effectively trained.
[0040] In some exemplary embodiments, the transformer module is a multi-head self-attention transformer module, which is set between the deepest layer of the encoder and the corresponding layer of the decoder to capture the global context information and long-distance dependencies of blood vessels. The transformer module processes the feature maps in the following ways: The input feature map is divided into multiple image blocks; After flattening each image patch, linear projection is used to obtain the query matrix, key matrix, and value matrix; Attention weights are calculated based on the similarity between the query matrix and the key matrix. The value matrix is weighted and summed using attention weights to obtain an output feature map that incorporates global contextual information.
[0041] Since the feature map corresponding to the deepest layer of the encoder has the lowest spatial resolution, the largest receptive field, and the richest semantic information, a transformer module is inserted at this position. The self-attention mechanism can cover the entire feature map with a small computational cost, so that each image block is associated with all image blocks in the world. Then, the feature map that has fused global information is passed to the corresponding layer of the decoder, which guides the decoder to use global context information to correct local features when upsampling to restore resolution, thereby maintaining the continuity and topological structure of blood vessels.
[0042] The transformer module processes the feature map in the following way: it divides the input feature map into multiple image blocks; it flattens each image block and obtains a query matrix, a key matrix, and a value matrix through linear projection; it calculates attention weights based on the similarity between the query matrix and the key matrix; and it uses the attention weights to perform a weighted summation on the value matrix to obtain an output feature map that integrates global context information.
[0043] In this processing method, the feature map is divided into multiple image blocks of a fixed size, and each image block is regarded as a basic processing unit. After flattening, the query matrix (Q), key matrix (K), and value matrix (V) are obtained through linear projection. Q is used to express what the current image block "focuses on", and K is used to express what features other image blocks "possess". The similarity between Q and K is calculated (usually by scaling after dot product and then normalizing by Softmax) to obtain the attention weight matrix. Each element in the weight matrix represents the degree of relevance of one image block to another. Then, the weight matrix is used to perform a weighted summation on V, so that the output feature of each image block is a weighted aggregation of the features of all global image blocks according to their relevance.
[0044] In this way, even if two vascular branches are far apart on the feature map, as long as their QK similarity is high (e.g., they belong to the upstream and downstream segments of the same blood vessel), a strong association can be established in the attention weights, enabling the model to see the global vascular connectivity relationships. The multi-head mechanism calculates multiple sets of attention weights in parallel through multiple independent Q, K, and V projection matrices, allowing the model to capture multiple long-distance dependency patterns from different perspectives (such as morphological similarity, positional proximity, texture consistency, etc.), thus enhancing the richness of the global contextual expression.
[0045] Figure 5The specific processing flow of the Multi-Head Self-Attention (MHSA) module is demonstrated: the input feature map is first linearly projected to obtain the query matrix, key matrix, and value matrix; then, Q, K, and V are evenly divided into n independent heads (Head 1 to Head n) along the channel dimension, and each head computes attention in parallel in its own subspace: the similarity between the query matrix and the key matrix is normalized using Softmax (i.e., ...). Where d is the dimension of the key vector and the scaling factor. To prevent the dot product from becoming too large and causing Softmax gradient saturation, the attention weight distribution is obtained, and then this weight is multiplied by the value matrix (Attention(Q,K,V)=Softmax( The new features of each image patch are weighted aggregates of the global image patch features according to the attention weights. After the parallel computation of each head is completed, the outputs of all heads are concatenated along the channel dimension to merge into a complete feature tensor. After linear transformation, the output is a feature map that incorporates global context information.
[0046] The multi-head mechanism, by distributing features to multiple independent subspaces, enables the model to simultaneously capture various long-range dependency patterns (such as morphological similarity, location proximity, and texture consistency of blood vessels) from different perspectives. This enhances the richness of the global contextual representation and solves the problem of limited local receptive fields and difficulty in capturing distal vascular branch connections in pure convolutional structures while maintaining computational efficiency. It should be noted that... Figure 5 In the “Head n”, n is a symbol commonly used by those skilled in the art, representing the total number of heads for multi-head self-attention, and is not limited to a specific value. In the embodiments of this application, it can be flexibly set according to specific task requirements and computing resources, such as n=8 or n=16. This application does not make a specific limitation in this regard.
[0047] Figure 6The specific structure of the Transformer block is shown. Its data processing flow is as follows: The input feature map is first normalized by LayerNorm to standardize the features in order to stabilize the training process and accelerate convergence. Then it is fed into the Multi-Head Self-Attention Module (MHSA). The global dependencies between image blocks in the feature map are captured by multiple attention heads in parallel calculation. After being regularized by Dropout, the MHSA output is added to the original input features through residual connection (+) to form the first residual structure. This operation ensures that the output of the self-attention module retains the local feature information of the original input, avoiding the loss of details during global modeling. Subsequently, the fusion result is normalized again and fed into the feedforward neural network (FFN). This network sequentially executes a fully connected layer (Dense) to map the features to a higher-dimensional space to enhance expressive power, the GELU activation function to introduce non-linearity, and a second fully connected layer to restore the features to the original dimension. The FFN output is then regularized by Dropout and added to the output of the first residual structure through residual connections to form the second residual structure. The final output is a feature map that fuses global context information and retains the original local details.
[0048] This Transformer block effectively addresses the limited receptive field of pure convolutional structures by alternately applying MHSA (responsible for global dependency modeling) and FFN (responsible for pointwise feature transformation), combined with layer normalization to stabilize the training distribution, Dropout to prevent overfitting, and dual residual connections to ensure smooth gradient propagation. It also avoids the excessively high computational complexity of pure Transformer structures, enabling the network to capture global contextual information and long-range dependencies of blood vessels while maintaining computational efficiency. It should be noted that... Figure 6 The "+" symbol in the text represents a residual connection, which is a skip connection added to the main path output so that the gradient can propagate directly across layers.
[0049] In some exemplary embodiments, the activation function in the deep residual network architecture uses Gaussian error linear units instead of modified linear units; the output expression of the Gaussian error linear unit is: GELU(x)=x·Φ(x), where x is the input value and Φ(x) is the cumulative distribution function of the standard normal distribution.
[0050] The ReLU function always outputs 0 when the input is less than or equal to 0, resulting in a gradient of 0 for that neuron. If a large number of neurons remain in the negative range for an extended period, they will die, and the neuron will no longer be activated regardless of the input data, leading to a decrease in the network's effective capacity. The differentiated advantage of GELU lies in its approach: instead of using a hard threshold (0 for inputs less than 0, linear output for inputs greater than 0), it probabilistically scales the output based on the input value. That is, the smaller the input value, the stronger the suppression of the output (but not completely zero); the larger the input value, the closer the output is to linear propagation. This characteristic allows GELU to retain weak gradient information in the negative range, and dead neurons can still regain activity through small gradient updates. Simultaneously, it provides a smoother transition curve near zero than ReLU, avoiding the loss of edge information caused by hard truncation of the feature map, thus more delicately depicting the blurred boundaries and minute branches of blood vessels.
[0051] Step 130: The deep residual network architecture is trained using a joint loss function to obtain a trained blood vessel segmentation model. The joint loss function consists of cross-entropy loss, cross-union ratio loss, and focus-Tversky coefficient loss. The focus-Tversky coefficient loss integrates the focus mechanism and the Tversky coefficient, and differentiates the penalty weights of missed and false positive samples in the medical image training dataset through the first penalty parameter and the second penalty parameter, respectively. The learning weights of difficult-to-distinguish samples in the medical image training dataset are strengthened through the focus parameter.
[0052] Specifically, the embodiments of this application employ three loss functions for collaborative optimization, with each loss function addressing a different level of the problem: (1) Cross-entropy loss calculates the classification error independently for each pixel, ensuring that the model has basic classification driving force for all pixels, avoiding gradient vanishing in the early stage of training due to the extremely small proportion of blood vessel region. Its role is to maintain the basic training signal for pixel-level classification accuracy.
[0053] (2) Intersection over Union (IoU Loss) calculates the ratio of the intersection and union of the predicted segmented region and the real labeled region, directly optimizing the region overlap. This loss is sensitive to the overall shape and boundary of the segmented region, and can drive the model to generate a continuous region that is more consistent with the real blood vessel region, rather than just pursuing pixel-level accuracy.
[0054] (3) The focus-Tversky coefficient loss controls the penalty weights for missed detections (predicting blood vessels as background) and false detections (predicting background as blood vessels) through the first penalty parameter α and the second penalty parameter β, respectively. Since the clinical risk of missing blood vessels in medical diagnosis is much higher than that of false detection of background areas, this application sets α to be greater than β (e.g., α=0.7, β=0.3), so that missed samples receive higher penalty weights, driving the model to favor a segmentation strategy that would rather detect more than miss; at the same time, by reducing the loss contribution of easily segmented samples (background areas and large blood vessels) through the focus parameter γ, the training focus is on difficult samples (small blood vessel edges, branch tips), so that the model still maintains the optimization momentum for difficult regions in the later stage of training.
[0055] The three losses are weighted and summed to form the final joint loss function. The weight coefficients of each loss are determined by grid search or adaptive weighting algorithm, so that the model is optimized simultaneously on three dimensions: pixel-level accuracy, region overlap, and hard sample mining. This avoids the problem of a single loss function being over-optimized on one metric at the expense of other metrics.
[0056] In some exemplary embodiments, the expression for the focus-Tversky coefficient loss is: L = (1-TI) γ ×(-log(TI)); Where γ is the focal length factor, TI is the Tversky exponent of the predicted probability P and the true label Y, TI=Σ(Y·P) / Σ(Y·P+α·Y·(1-P)+β·P·(1-Y)), α is the first penalty parameter, β is the second penalty parameter, α+β=1; When the proportion of blood vessel regions in the medical image training dataset is less than a preset threshold, the focal length factor γ is adjusted to a higher preset value to enhance the learning weight of hard-to-distinguish samples in the medical image training dataset.
[0057] The design of this loss function incorporates a two-layer progressive mechanism. The first layer is reflected in the denominator structure of the Terversky index (TI): the numerator Σ(Y·P) represents the number of pixels correctly predicted as blood vessels (i.e., true positives), and the denominator adds two terms to the numerator: α·ΣY·(1-P) is the product of the missed detection term (predicting blood vessels as background, i.e., false negatives) and α, and β·Σ(1-Y)·P is the product of the false detection term (predicting background as blood vessels, i.e., false positives) and β.
[0058] By setting the relative values of α and β, the contribution of missed detections and false detections to the loss value can be controlled differentially. When α > β, the missed detection term is given a larger penalty coefficient, and the model will prioritize reducing missed detections during training. Even at the cost of increasing a small number of false detections, this asymmetric penalty mechanism has important clinical significance for blood vessel segmentation. Missing a small blood vessel may cause doctors to miss lesions, while false detections of a small number of background areas can usually be eliminated through post-processing or doctor review, and its clinical risk is relatively low. Therefore, this application realizes the loss design of clinical risk perception through the asymmetric configuration of α and β.
[0059] The second layer is reflected in the focus mechanism (1-TI). γ In the model: the closer the TI value is to 1, the more accurate the prediction (for easily separable samples). When (1-TI) approaches 0, the loss of the sample is greatly reduced. The closer the TI value is to 0, the less accurate the prediction (for difficult samples). When (1-TI) approaches 1, the loss of the sample is preserved or even amplified. The focal length factor γ controls the weighting intensity. The larger γ is, the stronger the loss suppression of easily separable samples, and the more the model focuses on difficult samples.
[0060] Furthermore, in the expression of the Teversi index, the true positive term Σ(Y·P) is essentially the set of all correctly predicted blood vessel pixels, the false positive term Σ(1-Y)·P is essentially the set of background pixels misclassified as blood vessels, and the false negative term ΣY·(1-P) is essentially the set of blood vessel pixels misclassified as background. These three terms reflect the segmentation bias of the model from different perspectives. By weighting and combining these three coefficients with α and β, the joint focus mechanism achieves targeted optimization for difficult-to-separate samples under imbalanced data.
[0061] Through the above dual mechanism, when the proportion of blood vessel region is extremely small (e.g., less than 5%), the background pixels are far more than the blood vessel pixels. Traditional loss functions are easily dominated by the background and ignore small blood vessel regions. However, the focus-Tversky coefficient loss of this application highlights the cost of missed detection by α>β on the one hand, and reduces the loss weight of a large number of easily distinguishable background samples by the γ factor on the other hand, so that the model always focuses on optimizing small blood vessel branches that are not easy to segment during training.
[0062] Optionally, when the proportion of vascular regions in the medical image training dataset is detected to be less than a preset threshold, the focal length factor γ can be adjusted to a higher preset value to enhance the learning weight of difficult-to-distinguish samples in the medical image training dataset. For example, if the preset threshold is 5%, when the proportion of vascular regions is less than 5%, the focal length factor γ is increased from 0.75 to 1.0.
[0063] Because the lower the proportion of the vascular region, the more severe the class imbalance, and the greater the proportion of easily distinguishable background samples relative to difficult-to-distinguish vascular samples, the more likely the model is to get stuck in a local optimum where it can achieve low loss even if all predictions are of the background. When the detected proportion of the vascular region is less than 5%, it means that the vascular region of the training sample is extremely sparse, with most of the region being background. In this case, increasing γ from 0.75 to 1.0 makes (1-TI) γ The attenuation effect on TI values is enhanced, meaning that poorly distinguished blood vessel pixels with low TI (inaccurate prediction) have (1-TI) higher TI values. γ The value increases relatively as γ increases, thus improving the contribution to the loss; a large number of background pixels with high TI (accurate prediction) have (1-TI) values. γ As the value approaches 0, the loss contribution is further suppressed.
[0064] Clearly, for samples with a normal proportion of blood vessels, γ=0.75 provides moderate focus on difficult samples; for samples with an extremely low proportion of blood vessels, increasing γ to 1.0 provides stronger focus on difficult samples, enabling the model to maintain sensitivity to fine vascular structures in sparse blood vessel segmentation scenarios and avoid model degradation caused by extreme class imbalance.
[0065] Figure 4 The figure shows the Focal-Tversky loss curves for different focal length coefficients γ. The horizontal axis represents 1 minus the Tversky exponent (1-TI, where a larger value indicates less accurate prediction and more difficult sample differentiation), and the vertical axis represents the loss function value. The three curves in the figure correspond to γ=0.5 (a relatively flat curve with smaller differences in loss weights for samples of different difficulty levels), γ=0.75 (a moderately steep curve, the default value recommended in this application, achieving a balance between suppressing easily differentiated samples and retaining difficult samples), and γ=1.0 (degenerating to the original Tversky loss with no focus modulation effect). As the γ value increases, the vertical axis value of the curve relatively increases to the right of the horizontal axis (where 1-TI is larger, i.e., difficult-to-distinguish sample regions), and relatively decreases to the left of the horizontal axis (where 1-TI is smaller, i.e., easily distinguishable sample regions). This indicates that the model assigns a higher loss contribution to difficult-to-distinguish samples (such as blood vessel edge pixels and small branch tips) during training, while significantly reducing the loss weight of easily distinguishable samples (such as background regions and the center of large blood vessels). When the detected blood vessel region accounts for less than 5%, the focal length factor γ automatically increases from 0.75 to 1.0, changing the shape of the loss curve from moderately steep to extremely steep, in order to meet the reinforcement learning requirements for small blood vessel regions in scenarios of extreme class imbalance. The figure also shows that the Loss value remains positive throughout, and the curve monotonically increases, which meets the basic requirements of loss function design. It should be noted that... Figure 3 The values on the vertical axis are only illustrative relative magnitudes; the specific values depend on the calculated value of TI and the actual weight coefficients of the regularization term. This application does not limit the specific scale of the vertical axis values. Figure 3 The aim is to qualitatively demonstrate the relative trend of loss values as a function of sample difficulty under different γ values.
[0066] For example, the Adam optimizer is used for training with a learning rate set to 1×10⁻⁶. -4 The batch size is set to an integer value between 12 and 24 based on the graphics processor's video memory capacity.
[0067] The Adam optimizer combines the advantages of momentum optimization and adaptive learning rate. It maintains first-order moment estimates (mean gradient) and second-order moment estimates (variance gradient) for each parameter, achieving parameter-level adaptive adjustment of the learning rate. A smaller learning rate is used for parameters with drastic gradient changes to avoid oscillations, while a larger learning rate is used for parameters with gentle gradient changes to accelerate convergence. This feature is particularly advantageous for blood vessel segmentation tasks because the gradients at the network's lower layers (encoder) are typically smaller, requiring a larger learning rate, while the gradients at the network's upper layers (decoder) are larger, requiring a smaller learning rate. Adam's parameter-level adaptive mechanism precisely meets this differentiated need. The learning rate is set to 1×102. -4 This is a balanced value that has been experimentally verified. Too large a value may cause loss oscillations and non-convergence, while too small a value may cause training to converge too slowly. The batch size is set between 12 and 24. Too small a batch size may cause excessive gradient estimation noise and unstable training, while too large a batch size may be limited by the GPU memory capacity and may also reduce the generalization ability of the model. This application selects this range based on the memory capacity of commonly used GPUs (such as NVIDIA RTX 3090, 24GB of memory) to achieve the best balance between training stability and memory limitations.
[0068] Optionally, an early stopping mechanism is also set during training: training is stopped when the crossover ratio loss metric on the validation set does not improve for 10 consecutive training cycles.
[0069] The purpose of this early stopping mechanism is to prevent model overfitting. During training, as the training epochs increase, the training set loss continuously decreases, but the validation set loss gradually increases after reaching its minimum, indicating that the model begins to overfit the noise in the training data rather than learning general features. When the validation set IoU shows no improvement for 10 consecutive epochs, it means that the model's generalization performance has reached its peak. Continuing training will not only fail to improve segmentation accuracy but will also lead to a decline in performance on real clinical data due to overfitting. The 10-epoch tolerance window avoids premature stopping due to fluctuations in the validation set in a single instance, while also preventing the waste of training resources due to an excessively long window, thus saving training time while ensuring the model's convergence quality.
[0070] Optionally, the encoder uses a VGG series network as its backbone network and replaces the ordinary convolutional blocks therein with configurable depth residual blocks.
[0071] The VGG network is characterized by its structure consisting of multiple stacked VGG blocks (each block containing 2-3 3×3 convolutional layers). In the original VGG block, the convolutional layers are sequentially connected, requiring gradients to propagate backward layer by layer, which can easily lead to gradient vanishing in deep networks. By replacing the ordinary convolutional blocks in the VGG block with the configurable depth residual blocks of this application, cross-layer connections are established within each residual block by adding the original input and output. Gradients can then propagate directly backward to shallower layers via these paths, eliminating the need for layer-by-layer propagation and effectively mitigating the gradient vanishing problem. This allows the encoder to support deeper network structures without training degradation. Furthermore, the power-law parameters in the configurable depth residual blocks allow the depth of each layer in the encoder to be flexibly adjusted according to the feature extraction requirements of different levels.
[0072] Optionally, the decoder gradually recovers the spatial resolution through upsampling operations, and concatenates it with the corresponding layer feature maps with the same spatial resolution in the encoder through skip connections, and then uses dual residual blocks for feature fusion.
[0073] The decoder's upsampling operation (usually transposed convolution or bilinear interpolation) progressively restores the low-resolution feature map to the original input resolution. After each upsampling, the spatial size of the feature map doubles, while the number of channels is halved. Skip connections concatenate the high-resolution feature map of the encoder's corresponding layer (preserving rich spatial details, such as the location of blood vessel edges and diameter) with the upsampled feature map of the decoder's current layer (carrying deep semantic information, such as blood vessel type and overall structural orientation) along the channel dimension, forming a fused feature that contains both details and semantics. This fused feature is then input into a dual residual block for two-stage feature refinement. The first-stage residual operation fuses the detailed information from the encoder and the semantic information from the decoder in the concatenated feature, outputting a preliminary fusion result that takes into account the advantages of both. The second-stage residual operation further extracts higher-order joint features based on the first stage, achieving a more complete fusion of details and semantics. The features after dual refinement are then fed into the next decoding layer for further upsampling and fusion until the original resolution is restored. This design ensures that the edge localization accuracy of small blood vessels (from the detailed information of the encoder skip connections) and the topological coherence of the vascular network (from the semantic information of the decoder) are preserved simultaneously in the final output segmentation mask. Especially for coronary artery terminal vessels with a diameter of only a few pixels, the high-resolution edge information provided by the encoder skip connections is the key to accurate localization.
[0074] Optionally, in the encoder of the deep residual network architecture, the number of feature channels increases progressively from 64 to 512.
[0075] The design of progressively increasing feature channels in the encoder corresponds to progressively decreasing spatial resolution: the shallow layer (first level) feature map has the highest resolution and contains rich spatial details, but the semantic abstraction level is low. 64 channels are sufficient to retain enough texture and edge information, and too many channels will lead to computational redundancy. As downsampling proceeds, the feature map resolution decreases and spatial information is gradually compressed. In order to make up for the loss of spatial information and enhance the semantic expressive power, it is necessary to continuously increase the number of channels to expand the feature dimension, so that the network can encode richer structural information with a higher channel capacity at low resolution.
[0076] For example, when the resolution is reduced to 1 / 16 of the original image, 512 channels can provide 512-dimensional feature descriptions for each location, which is sufficient to encode the complex topological structure of vascular branches. The doubling pattern of 64→128→256→512 is an empirical configuration that has been verified by a large number of experiments. It ensures that each level has sufficient feature representation capabilities while avoiding the explosion of computational load caused by excessive growth in the number of channels.
[0077] Optionally, the medical image is a coronary angiography grayscale image with an input size of 512×512×1, where 512 and 512 are spatial dimensions and 1 is the number of channels; the output is a binary classification segmentation mask with the same resolution as the input, which is mapped to the 0 to 1 interval by the Sigmoid function, representing the probability that each pixel belongs to the blood vessel region.
[0078] In practical applications, a probability threshold is set (usually 0.5, but can be adjusted according to clinical requirements for sensitivity / specificity, such as lowering the threshold to increase sensitivity or raising the threshold to increase specificity) to control the probability. Figure 2 Value-based methods can generate vascular segmentation masks that doctors can view intuitively or import into 3D reconstruction systems.
[0079] Figure 7 The detailed structure and data flow of the encoder-decoder hybrid architecture provided in this application embodiment are illustrated: The input image (size 512×512) first enters the encoder and passes through four encoder blocks (Block1 to Block4) in sequence. Each encoder block consists of a 3×3 convolution and a double residual block (DRB). Features are extracted and downsampled step by step, and the size of the output feature map is halved step by step (256×256→128×128→64×64→32×32), while the number of channels is doubled step by step (64→128→256→512). The encoder output feature map enters the bottleneck layer (ADRB), which uses a configurable depth residual block to further refine the features and downsample them to 16×16×512. Then, it passes through N stacked Transformer blocks (each Transformer block contains a multi-head self-attention network MHSA and a feedforward network FFN, with FFN using the GELU activation function) to perform global context modeling and capture the long-range dependencies of blood vessels.
[0080] The bottleneck feature map enters the decoder and passes through four decoder blocks (Block 1 to Block 4) sequentially. Each decoder block restores its spatial resolution (32×32→64×64→128×128→256×256) through transposed convolution upsampling. These blocks are then concatenated with the corresponding layer feature maps (Block 4 to Block 1) in the encoder using skip connections. Finally, the DRB performs feature fusion and refinement, achieving a full fusion of detailed and semantic information. The DRB depth in the encoder changes from 16 to 14 to 12. The depth is progressively decreased from 10 to 8 (the depths of Block 1 to Block 4 are 16, 14, 12, and 10 respectively, and the bottleneck layer has a depth of 8). This progressive depth-decreasing design allows shallow layers (high resolution) to use deeper residual blocks to extract rich detailed features, while deep layers (low resolution) use shallower residual blocks to avoid overparameterization and control computational load. Finally, the number of channels is adjusted by 1×1 convolution and combined with the Sigmoid activation function to output a blood vessel segmentation probability map with the same resolution as the input image (512×512×1), completing the end-to-end mapping from the coronary angiography image to the segmentation mask.
[0081] The training method for the blood vessel segmentation model provided in this application constructs an adaptive depth residual-Transformer hybrid segmentation network that includes an encoder, a decoder, and a transformer module embedded between the two. It utilizes loss methods consisting of cross-entropy loss, intersection-union loss, and focus loss. The network is trained using a joint loss function comprised of Tversky coefficient losses. A configurable depth residual block dynamically adjusts the number of residual units via a power-law parameter, allowing the network depth to adapt to changes in vessel thickness and branch complexity. This enhances the feature extraction capability for multi-scale vascular structures, especially small branches, and reduces breakage and missed detections. The transformer module captures global contextual information through a self-attention mechanism, compensating for the insufficient local receptive field of convolution, thereby strengthening the continuity of vascular topology. The focal point of the joint loss function... The Tefers coefficient loss differentiates the penalty weights for missed detections and false detections through the first and second penalty parameters, respectively, and strengthens the learning weights of hard-to-classify samples by using the focusing parameter. At the same time, it combines cross-entropy loss to ensure pixel-level classification accuracy and intersection-union ratio loss to constrain the overlap of regions. Thus, during the training process, it synergistically improves the overall segmentation accuracy and connectivity of the model for the blood vessel foreground region, and finally obtains a blood vessel segmentation model with higher segmentation accuracy.
[0082] Figure 8 This is a schematic diagram illustrating the implementation process of a blood vessel segmentation method provided in an embodiment of this application, as shown below. Figure 8 As shown, the method includes: Step 810: Obtain the medical image to be segmented.
[0083] Step 820: Input the medical image to be segmented into the blood vessel segmentation model to obtain the blood vessel segmentation result of the medical image to be segmented.
[0084] Among them, the blood vessel segmentation model is based on Figures 1-7 The aforementioned blood vessel segmentation model was trained using a specific training method. Figure 8 Able to achieve Figures 1-7 For details of the method implementation examples, please refer to [link / reference]. Figures 1-7 The training method for the blood vessel segmentation model in the illustrated embodiment will not be described in detail here.
[0085] Figure 9 This is a schematic diagram of the structure of a training device 900 for a blood vessel segmentation model provided as an exemplary embodiment of this application. Figure 9 As shown, the device 900 includes: an acquisition module 910, a construction module 920, and a training module 930, wherein: Module 910 is used to acquire a medical image training dataset with labeled vascular regions. Module 920 is used to construct an adaptive deep residual-Transformer hybrid segmentation network. The hybrid segmentation network architecture includes an encoder, a decoder, and a transformer module embedded between the encoder and the decoder. Both the encoder and the decoder contain configurable deep residual blocks, and the number of residual units in the configurable deep residual blocks is dynamically adjusted by a power parameter. Training module 930 is used to train the deep residual network architecture using a joint loss function to obtain a trained blood vessel segmentation model; The joint loss function is composed of cross-entropy loss, cross-union ratio loss, and focus-Tversky coefficient loss. The focus-Tversky coefficient loss integrates the focus mechanism and the Tversky coefficient, and differentiates the penalty weights of missed and false positive samples in the medical image training dataset through the first penalty parameter and the second penalty parameter, respectively, and strengthens the learning weights of hard-to-distinguish samples in the medical image training dataset through the focus parameter.
[0086] The training device 900 for the blood vessel segmentation model can achieve Figures 1-7 For details of the method implementation examples, please refer to [link / reference]. Figures 1-7 The training method for the blood vessel segmentation model in the illustrated embodiment will not be described in detail here.
[0087] Figure 10 This is a schematic diagram of the structure of a blood vessel segmentation device 1000 provided for an exemplary embodiment of this application. (See diagram below.) Figure 10 As shown, the device 1000 includes: an acquisition module 1010 and a segmentation module 1020, wherein: The acquisition module 1010 is used to acquire the medical image to be segmented; The segmentation module 1020 is used to input the medical image to be segmented into the blood vessel segmentation model to obtain the blood vessel segmentation result of the medical image to be segmented.
[0088] Among them, the blood vessel segmentation model is based on Figures 1-7 The blood vessel segmentation model was trained using the aforementioned training method.
[0089] The blood vessel segmentation device 1000 can achieve Figure 8 For details of the method implementation examples, please refer to [link / reference]. Figure 8 The blood vessel segmentation method shown in the embodiment will not be described in detail again.
[0090] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0091] like Figure 11 As shown, the electronic device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded into a random access memory (RAM) 1103 from a storage unit 1108. The RAM 1103 may also store various programs and data required for the operation of the electronic device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0092] Multiple components in electronic device 1100 are connected to I / O interface 1105, including: input unit 1106, such as keyboard, mouse, etc.; output unit 1107, such as various types of displays, speakers, etc.; storage unit 1108, such as disk, optical disk, etc.; and communication unit 1109, such as network card, modem, wireless transceiver, etc. Communication unit 1109 allows electronic device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0093] The computing unit 1101 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above, such as methods for training a blood vessel segmentation model and methods for blood vessel segmentation. For example, in some embodiments, the methods for training a blood vessel segmentation model and methods for blood vessel segmentation can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the methods for training a blood vessel segmentation model and methods for blood vessel segmentation described above can be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured by any other suitable means (e.g., by means of firmware) for training the above-described blood vessel segmentation model and blood vessel segmentation method.
[0094] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments.
[0095] Accordingly, this application also provides a computer program product, which stores instructions that, when executed by a computer, cause the computer to perform the steps in the method embodiments provided in this application.
[0096] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0097] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0099] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0100] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0101] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0102] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other classes of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0103] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0104] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A training method for a blood vessel segmentation model, characterized in that, include: Obtain a training dataset of medical images labeled with vascular regions; An adaptive deep residual-Transformer hybrid segmentation network is constructed, which includes an encoder, a decoder, and a multi-head self-attention transformer module embedded between the encoder and the decoder; wherein, both the encoder and the decoder contain configurable deep residual blocks, and the number of residual units in the configurable deep residual blocks is dynamically adjusted by a power parameter; The deep residual network architecture is trained using a joint loss function to obtain a trained blood vessel segmentation model; The joint loss function is composed of cross-entropy loss, cross-union ratio loss, and focus-Tefsky coefficient loss. The focus-Tefsky coefficient loss integrates the focus mechanism and the Tefsky coefficient, and differentiates the penalty weights of missed and false positive samples in the medical image training dataset through the first penalty parameter and the second penalty parameter, respectively, and strengthens the learning weights of hard-to-distinguish samples in the medical image training dataset through the focus parameter.
2. The method as described in claim 1, characterized in that, The configurable depth residual block is constructed in the following manner: The input tensor is reduced to one-quarter of its original number of channels through a 1×1 convolution; Based on the value of the power parameter, the feature extraction operation is performed cyclically a number of times corresponding to the value of the power parameter. Each feature extraction operation includes sequential 3×3 convolution, batch normalization, and activation function processing. The original number of channels is restored using 1×1 convolution; The restored output is concatenated with the original input along the channel dimension to output a feature tensor.
3. The method as described in claim 1, characterized in that, The transformer module is a multi-head self-attention transformer module, which is located between the deepest layer of the encoder and the corresponding layer of the decoder, and is used to capture the global context information and long-distance dependencies of blood vessels. The converter module processes the feature map in the following manner: The input feature map is divided into multiple image blocks; After flattening each image block, the query matrix, key matrix, and value matrix are obtained through linear projection. Attention weights are calculated based on the similarity between the query matrix and the key matrix; The value matrix is weighted and summed using the attention weights to obtain an output feature map that incorporates global context information.
4. The method as described in claim 1, characterized in that, The expression for the focal-Tversky coefficient loss is: L = (1 - TI) γ ; Where γ is the focal length factor, TI is the Tversky exponent of the predicted probability P and the true label Y, and TI = Σ(Y·P) / Σ(Y·P+α·Y·(1-P)+β·(1-Y)·P), α is the first penalty parameter, β is the second penalty parameter, and α+β=1; When the proportion of blood vessel regions in the medical image training dataset is less than a preset threshold, the focal length factor γ is adjusted to a higher preset value to enhance the learning weight of difficult-to-distinguish samples in the medical image training dataset.
5. The method as described in claim 1, characterized in that, The activation function in the deep residual network architecture uses Gaussian error linear units instead of modified linear units; the output expression of the Gaussian error linear unit is: GELU(x)=x·Φ(x), where x is the input value and Φ(x) is the cumulative distribution function of the standard normal distribution.
6. The method as described in claim 1, characterized in that, The encoder and decoder also include a dual residual block cascade structure; the dual residual block cascade structure connects two residual blocks in series and adds a skip connection on each residual path. The input feature passes through the main path and the branch simultaneously, wherein the main path performs two residual operations, the branch passes the original input, and the outputs of the main path and the branch are added together to activate the signal.
7. The method as described in claim 6, characterized in that, The dual residual block cascade structure includes a first residual branch and a second residual branch, and the dual residual block cascade structure is constructed in the following manner: The input feature tensor enters the first residual branch, and after passing through 3×3 convolution, batch normalization, activation function, 3×3 convolution, batch normalization, it is added to the original input. The output of the first residual branch enters the second residual branch, and after passing through a 3×3 convolution, batch normalization, activation function, 3×3 convolution, and batch normalization, it is added to the output of the first residual branch. The original input is subjected to a 1×1 convolution transformation and then added to the output of the second residual branch to obtain the fusion result; The final feature is output based on the fusion result through an activation function.
8. A method for segmenting blood vessels, characterized in that, include: Acquire the medical images to be segmented; The medical image to be segmented is input into the blood vessel segmentation model trained by the method described in any one of claims 1 to 7 to obtain the blood vessel segmentation result of the medical image to be segmented.
9. A training device for a blood vessel segmentation model, characterized in that, include: The acquisition module is used to acquire a training dataset of medical images with labeled vascular regions. A building module is used to construct a configurable adaptive depth residual-Transformer hybrid segmentation network, wherein the hybrid segmentation network includes an encoder, a decoder, and a transformer module embedded between the encoder and the decoder; wherein the encoder and the decoder both contain configurable depth residual blocks, and the number of residual units in the configurable depth residual blocks is dynamically adjusted by a power parameter; The training module is used to train the deep residual network architecture using a joint loss function to obtain a trained blood vessel segmentation model. The joint loss function is composed of cross-entropy loss, cross-union ratio loss, and focus-Tefsky coefficient loss. The focus-Tefsky coefficient loss integrates the focus mechanism and the Tefsky coefficient, and differentiates the penalty weights of missed and false positive samples in the medical image training dataset through the first penalty parameter and the second penalty parameter, respectively, and strengthens the learning weights of hard-to-distinguish samples in the medical image training dataset through the focus parameter.
10. An electronic device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the training method for the blood vessel segmentation model as claimed in any one of claims 1 to 7 or the blood vessel segmentation method as claimed in claim 8.