Cerebral vessel segmentation method and device based on physical guidance and pyramid vision transformer

By employing a physics-guided and pyramidal visual Transformer-based brain vessel segmentation method, utilizing a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module, the method addresses the issues of complex curvature variations and insufficient attention mechanisms in traditional brain vessel segmentation methods, achieving high-precision brain vessel segmentation.

CN121746409BActive Publication Date: 2026-05-12THE FIRST AFFILIATED HOSPITAL OF XIAMEN UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
THE FIRST AFFILIATED HOSPITAL OF XIAMEN UNIV
Filing Date
2026-02-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing cerebral vessel segmentation methods cannot effectively capture the complex curvature changes and long-distance spatial consistency of cerebral vessels when processing OCT data. Furthermore, traditional models suffer from high computational complexity and insufficient attention mechanisms when handling OCT-specific properties, resulting in low segmentation accuracy.

Method used

We employ a physics-guided and pyramidal visual Transformer-based brain vessel segmentation method. By combining a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module with polar coordinate transformation, deformable convolution, and edge detection, we optimize the loss function to improve segmentation accuracy.

Benefits of technology

It significantly improves the accuracy and boundary continuity of cerebral blood vessel segmentation, solves the problems of high computational complexity and insufficient attention mechanism in traditional methods, and achieves high-precision segmentation of cerebral blood vessels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746409B_ABST
    Figure CN121746409B_ABST
Patent Text Reader

Abstract

The application discloses a cerebral vascular segmentation method and device based on physical guidance and pyramid vision Transformer, relates to the field of medical image data, and comprises the following steps: constructing a cerebral vascular segmentation model and using a loss function in training, the loss function comprising a boundary intersection-over-union loss, a focal Tversky loss and a Dice loss; obtaining an optical coherence tomography image of a brain to be processed and inputting the image into the trained cerebral vascular segmentation model, and first passing through an encoder module of the pyramid vision Transformer, wherein output features of a first Transformer encoding layer are input into a radial intensity module to obtain radial enhancement features; output features of a second, a third and a fourth Transformer encoding layer are input into a deformable cross-scale fusion module to obtain enhanced fusion features; and the radial enhancement features and the enhanced fusion features are input into a boundary perception attention module to obtain corresponding cerebral vascular prediction segmentation masks and cerebral vascular prediction segmentation images. The application solves the problems of low segmentation accuracy and boundary precision in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image processing, specifically to a method and apparatus for brain blood vessel segmentation based on physical guidance and pyramid visual Transformer. Background Technology

[0002] Optical coherence tomography (OCT) has become a revolutionary intracranial vascular imaging technique, offering significant advantages over traditional angiography. Its ability to observe the microscopic structure of the vessel wall at a resolution of 10-15 micrometers using near-infrared interferometry marks a major leap forward in neurovascular diagnostics. The clinical potential of intravascular OCT was first established through landmark coronary artery imaging studies. In recent years, its application in the cerebrovascular field has further demonstrated its unique capabilities, including radiation-free operation, immunity to metal artifacts from intracranial implants, and real-time three-dimensional image acquisition during catheter withdrawal.

[0003] The imaging physics of OCT introduces characteristic noise patterns that fundamentally distinguish it from other imaging modalities. Speckle noise originates from the multiplicative interference of backscattered coherent light waves, producing a granular texture that masks subtle anatomical boundaries. This phenomenon is significantly different from additive Gaussian noise in magnetic resonance imaging (MRI) or Poisson noise in computed tomography (CT) systems. Speckle noise presents a particular challenge in cerebrovascular applications due to the intricate structure of intracranial vessel walls, where membrane thickness can be only 100–200 micrometers. The spectral characteristics of this speckle noise follow a Rayleigh distribution, and its spatial correlation is influenced by the coherence length of the laser source and scanning protocol parameters.

[0004] While current vessel segmentation methods have achieved success in other medical imaging fields, they still face significant limitations when applied to neurovascular optical coherence tomography (OCT) analysis. Traditional PVT-based models, such as PVT-Cascade, while demonstrating strong performance in general medical image segmentation tasks, exhibit several key shortcomings when processing OCT data. The fundamental problem stems from their architecture's incompatibility with the unique physical characteristics of OCT. Most notably, these models employ standard RGB input processing, incurring unnecessary computational overhead when processing OCT data, which is essentially single-channel grayscale data (where the three color channels contain identical information). More importantly, they lack specialized mechanisms to effectively capture the unique radial intensity patterns of OCT, particularly the consistent configuration of cerebral vascular anatomy characterized by dark lumens surrounded by bright concentric wall gradients.

[0005] Recent state-of-the-art segmentation models, such as ADCFormer (2025) and SAM-OCTA2 (2024), while incorporating complex Transformer architectures, still suffer from key shortcomings in cerebrovascular OCT applications. These excellent methods fail to adequately address two crucial aspects of neurovascular OCT analysis. First, their fixed geometric constraints and rigid multi-scale fusion mechanisms cannot adequately adapt to the inherent complex curvature variations in the cerebrovascular system. Second, their attention mechanisms remain insufficient in maintaining long-range spatial consistency, which is crucial for accurately delineating ultrathin boundary structures essential for accurate clinical HD95 assessment. Furthermore, traditional channel-spatial attention modules exhibit significant limitations in handling OCT-specific properties, proving ineffective in suppressing characteristic speckle noise patterns and addressing extreme class imbalances where the lumen region occupies less than 3% of the image area.

[0006] Using OCT imaging to analyze the intracranial vascular system presents several fundamental challenges to traditional convolutional neural networks. First, the fixed receptive field in standard architectures has proven insufficient to capture the dramatic scale variations observed clinically, where vessel diameters range from millimeters in proximal segments to just a few hundred micrometers in distal branches. Second, the inherent resolution anisotropy of OCT systems—with axial resolution superior to lateral resolution—introduces directional bias in feature learning, particularly impairing the detection of small vessels with tilted imaging planes. Third, conventional pooling operations often reduce the visualization of fine vessel wall layers, and the thin media layer is typically damaged during spatial downsampling. These technical limitations collectively constrain the performance of current methods in vascular OCT analysis.

[0007] The ViT (Vision Transformer) architecture has demonstrated particular effectiveness in capturing global contextual relationships throughout the entire pull-back sequence, overcoming the limited receptive field of convolutional neural networks (CNNs). However, pure Transformer models face two key challenges in OCT applications: the quadratic computational complexity relative to image size becomes prohibitively large for high-resolution OCT volumes (typically 1024×1024 pixels per frame), and the lack of translation invariance inductive bias degrades performance on small training datasets. Summary of the Invention

[0008] The purpose of this application is to propose a method and device for brain vessel segmentation based on physical guidance and pyramid visual Transformer to address the aforementioned technical problems.

[0009] In a first aspect, the present invention provides a brain blood vessel segmentation method based on physical guidance and pyramid visual Transformer, comprising the following steps:

[0010] A brain blood vessel segmentation model was constructed and trained to obtain a trained brain blood vessel segmentation model. The brain blood vessel segmentation model includes an encoder module, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module of the pyramid vision Transformer. The loss functions used during training include boundary intersection-union loss, focus Tversky loss, and Dice loss.

[0011] Optical coherence tomography (OCT) images of the brain to be processed are input into a trained cerebral blood vessel segmentation model. The images first pass through the encoder module of a pyramid vision transformer. The output features of the first Transformer encoding layer of the pyramid vision transformer's encoder module are input into a radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the pyramid vision transformer's encoder module are input into a deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and enhanced fusion features are then input into a boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. Based on the cerebral blood vessel prediction segmentation mask, the corresponding cerebral blood vessel prediction segmentation image is obtained.

[0012] Preferably, the radial intensity module includes a polar coordinate transformation layer, an angle-depth convolution layer, an attention layer based on discrete cosine transform, and a coordinate inverse mapping layer;

[0013] The calculation process for the radial strength module is as follows:

[0014] The output features of the first Transformer encoding layer of the pyramid vision Transformer are input into the polar coordinate transformation layer, mapping them from Cartesian coordinates to polar coordinates to obtain polar coordinate parameters, including radial distance. and angle As shown in the following formula:

[0015] ;

[0016] ;

[0017] in, The center point of the lumen is indicated, and D represents the estimated diameter of the vessel used for normalization. This represents the spatial coordinate index of each pixel in the output feature of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer.

[0018] To fill the polar coordinate representation, for each target polar coordinate point in the polar coordinate representation... Calculate the sampling position in the output features of the first Transformer encoding layer of the encoder module in the pyramid vision Transformer. and As shown in the following formula:

[0019] ;

[0020] ;

[0021] According to sampling location and Using a mesh generator and sampling function The output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer are transformed into polar coordinate representations, as shown in the following equation:

[0022] ;

[0023] in, This represents the output feature of the first Transformer encoding layer in the encoder module of the pyramid vision Transformer. Representation using polar coordinates;

[0024] The polar coordinate representation is input into the angular depthwise convolutional layer for depthwise convolution along the angular direction to obtain the angular feature vector, as shown in the following equation:

[0025] ;

[0026] in, This represents a depthwise convolution operation along the angular direction. Represents the angular feature vector;

[0027] The angular feature vector is input into the attention layer based on discrete cosine transform to obtain the frequency domain attention weights, as shown in the following equation:

[0028] ;

[0029] in, Represents the discrete cosine transform. This represents a multilayer perceptron. This represents the Sigmoid activation function. Represents the frequency domain attention weights;

[0030] Polar coordinate representation using frequency domain attention weights We perform weighting to obtain the weighted polar coordinate representation. As shown in the following formula:

[0031] ;

[0032] Representing the weighted polar coordinates The input is fed into the coordinate inverse mapping layer to perform inverse polar coordinate transformation. Polar coordinate features are back-sampled according to the Cartesian coordinate grid to obtain the reconstructed features, as shown in the following formula:

[0033] ;

[0034] in, Indicates reconstruction features;

[0035] The reconstructed features are added element-wise to the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer to obtain the radial enhancement features, as shown in the following formula:

[0036] ;

[0037] in, This indicates radial enhancement characteristics.

[0038] Preferably, the deformable cross-scale fusion module includes seven deformable convolutional layers and two stitching layers, constructing a two-level fusion structure. Each level of the fusion structure includes three deformable convolutional layers and one stitching layer. The input to each level of the fusion structure is a guiding feature and a feature to be aligned. In the first level of the fusion structure, the output feature of the fourth Transformer encoding layer of the encoder module of the Pyramid Vision Transformer is used as the guiding feature, and the output feature of the third Transformer encoding layer of the encoder module of the Pyramid Vision Transformer is used as the feature to be aligned. In the second level of the fusion structure, the fusion feature output from the first level of the fusion structure is used as the guiding feature, and the output feature of the second Transformer encoding layer of the encoder module of the Pyramid Vision Transformer is used as the feature to be aligned. The fusion feature output from the second level of the fusion structure is then passed through a deformable convolutional layer to obtain the enhanced fusion feature.

[0039] As a preferred approach, the calculation process in each level of the fusion structure is as follows:

[0040] The guiding features are upsampled to the same resolution as the features to be aligned and then concatenated. The spatial offset is predicted using the convolution operation of the first convolutional layer, as shown in the following formula:

[0041] ;

[0042] in, Indicates spatial offset. Indicates guiding characteristics. Indicates the features to be aligned. Indicates upsampling, This indicates a splicing operation. Indicates the convolution operation;

[0043] The features to be aligned and the spatial offset are input into the first deformable convolutional layer in each level of the fusion structure for deformable convolution operation to obtain the corrected features, as shown in the following equation:

[0044] ;

[0045] in, Indicates the correction characteristics, This represents a deformable convolution operation;

[0046] The Sobel operator is used to extract high-frequency edge information from the features to be aligned, and then the gating coefficients are generated by passing them through a second convolutional layer and a Sigmoid activation function, as shown in the following equation:

[0047] ;

[0048] in, Represents the Sobel operator. Indicates the gating coefficient;

[0049] The gated features are obtained by multiplying the correction features element-wise with the gate coefficients, as shown in the following formula:

[0050] ;

[0051] in, Indicates gating features, This indicates element-wise multiplication;

[0052] The upsampled guiding features are passed through the second deformable convolutional layer in each fusion structure, then concatenated with the gated features, and finally passed through the third deformable convolutional layer in each fusion structure to obtain the fused features, as shown in the following equation:

[0053] ;

[0054] in, This indicates the fusion feature.

[0055] As a preferred embodiment, the calculation process of the boundary-aware attention module is as follows:

[0056] The enhanced fusion features are upsampled and concatenated with the radial enhancement features, then passed through a third convolutional layer for convolution to obtain the joint features, as shown in the following equation:

[0057] ;

[0058] in, Indicates enhanced fusion features, Indicates radial enhancement features, Indicates upsampling, This indicates a splicing operation. This represents the convolution operation. Indicates joint features;

[0059] Edge indicator features are extracted from the joint features using the Gaussian-Laplacian operator, as shown in the following equation:

[0060] ;

[0061] in, The standard deviation is expressed as The Gaussian-Laplacian operator, where * denotes convolution operation. The edge response threshold, Indicates edge indicator features;

[0062] The attention mechanism is calculated based on the joint features and edge indication features to obtain the attention features, as shown in the following formula:

[0063] ;

[0064] in, The scaling factor is T, which represents the transpose of the matrix. , and These are the query weight matrix, key weight matrix, and value weight matrix, respectively. express function, Indicates attentional characteristics;

[0065] The attention features and joint features are multiplied element-wise and the residuals are added to obtain the boundary awareness enhancement features, as shown in the following formula:

[0066] ;

[0067] in, This indicates boundary-aware enhancement features;

[0068] The boundary-aware enhancement features are processed through the fourth convolutional layer and the Sigmoid activation function to obtain the brain blood vessel prediction segmentation mask, as shown in the following equation:

[0069] ;

[0070] in, This represents a segmentation mask for predicting cerebral blood vessels.

[0071] The predicted probability value of each pixel in the cerebral blood vessel prediction segmentation mask is compared with a threshold to obtain the corresponding cerebral blood vessel prediction segmentation image.

[0072] As a preferred option, the expression for the boundary intersection-union ratio loss is:

[0073] ;

[0074] in, This is a boundary extraction operation for 2-pixel dilation. This indicates a segmentation mask for predicting cerebral blood vessels. This represents a mask for the actual segmentation of cerebral blood vessels. Indicates the boundary intersection and union ratio loss;

[0075] The expression for the focal Tversky loss is:

[0076] ;

[0077] in, This represents the predicted probability value of the i-th pixel in the cerebral blood vessel prediction segmentation mask. This is the true label for the i-th pixel, with a value of either 0 or 1. and These represent the first weight and the second weight, respectively. Indicates the focal Tversky loss;

[0078] The expression for Dice loss is:

[0079] ;

[0080] Where Y represents the actual segmented region of cerebral blood vessels. This represents the predicted cerebral blood vessel segmentation region, which consists of all pixels in the predicted cerebral blood vessel segmentation image that are identified as cerebral blood vessels. Indicates Dice loss;

[0081] The total loss function used in training the cerebral blood vessel segmentation model is a weighted sum of the boundary intersection-union ratio loss, the focal Tversky loss, and the Dice loss.

[0082] Secondly, the present invention provides a brain vessel segmentation device based on physical guidance and a pyramid visual Transformer, comprising:

[0083] The model building module is configured to build and train a brain blood vessel segmentation model, resulting in a trained brain blood vessel segmentation model. The brain blood vessel segmentation model includes an encoder module, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module of the pyramid vision Transformer. The loss functions used during training include boundary intersection-union loss, focus Tversky loss, and Dice loss.

[0084] The segmentation module is configured to acquire optical coherence tomography (OCT) images of the brain to be processed and input them into a trained cerebral blood vessel segmentation model. The images first pass through the encoder module of a pyramid visual Transformer. The output features of the first Transformer encoding layer of the pyramid visual Transformer encoder module are input into the radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the pyramid visual Transformer encoder module are input into a deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and the enhanced fusion features are then input into a boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. Based on the cerebral blood vessel prediction segmentation mask, the corresponding cerebral blood vessel prediction segmentation image is obtained.

[0085] Thirdly, the present invention provides an electronic device including one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any implementation of the first aspect.

[0086] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.

[0087] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the implementations in the first aspect.

[0088] Compared with the prior art, the present invention has the following beneficial effects:

[0089] (1) The brain vessel segmentation method based on physical guidance and pyramid visual Transformer mentioned in this invention uniquely integrates the physical priors of OCT imaging, especially the radial intensity pattern and speckle noise features, directly into the network architecture. Therefore, a radial intensity module is proposed. This radial intensity module transforms the feature processing to the polar coordinate system to directly model the annular vascular structure. It also combines depth convolution in the angular direction with an attention mechanism based on DCT to selectively suppress speckle noise while capturing the radial intensity pattern, thus solving a fundamental limitation of the traditional Cartesian coordinate processing method.

[0090] (2) The deformable cross-scale fusion module of the brain vessel segmentation method based on physical guidance and pyramid visual Transformer mentioned in this invention replaces the rigid fusion mechanism and instead achieves dynamic alignment through deformable convolution operations with learnable offsets. This design is enhanced by edge-guided gating using edge indication features extracted by the Sobel operator, thereby achieving physiologically reasonable integration of multi-scale features while preventing background contamination.

[0091] (3) The brain vessel segmentation method based on physical guidance and pyramid visual Transformer mentioned in this invention also proposes a boundary-aware attention module (BAM), which can combine Laplace edge detection with attention, and integrate pixel-level accurate edge localization and long-range contextual understanding. This hybrid method achieves the accuracy required for reliable HD95 measurement and shows a significant improvement in boundary continuity compared with traditional methods.

[0092] (4) The brain blood vessel segmentation method based on physical guidance and pyramid visual Transformer mentioned in this invention adopts a balanced combination of Dice loss, boundary intersection-union ratio loss based on morphological expansion edge and focal Tversky loss to simultaneously solve the problems of overall segmentation accuracy, boundary precision and extreme class imbalance. Attached Figure Description

[0093] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0094] Figure 1This is a flowchart illustrating the brain vessel segmentation method based on physical guidance and pyramid visual Transformer, as an embodiment of this application.

[0095] Figure 2 This is a schematic diagram of the brain vessel segmentation model of the brain vessel segmentation method based on physical guidance and pyramid visual Transformer, which is an embodiment of this application.

[0096] Figure 3 This is a schematic diagram of the processing procedure of the deformable convolutional layer in the brain blood vessel segmentation method based on physical guidance and pyramid visual Transformer, which is an embodiment of this application.

[0097] Figure 4 Examples of OCT images input to the cerebral blood vessel segmentation method based on physical guidance and pyramid visual Transformer, which are embodiments of this application, and comparison results of their corresponding labels;

[0098] Figure 5 The comparison results of the input OCT images and their corresponding enhanced images for the brain blood vessel segmentation method based on physical guidance and pyramid visual Transformer in the embodiments of this application;

[0099] Figure 6 Visual comparison of prediction results between the cerebral blood vessel segmentation method based on physical guidance and pyramid visual Transformer, an embodiment of this application, and different models;

[0100] Figure 7 Qualitative comparison diagram of the segmentation results of the ablation experiment of the cerebral blood vessel segmentation method based on physical guidance and pyramid visual Transformer, which is an embodiment of this application;

[0101] Figure 8 This is a schematic diagram of a brain vessel segmentation device based on physical guidance and pyramid visual Transformer, which is an embodiment of this application.

[0102] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0103] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0104] Figure 1This application illustrates an embodiment of a brain vessel segmentation method based on physical guidance and a pyramid visual Transformer, comprising the following steps:

[0105] S1. Construct and train a brain blood vessel segmentation model to obtain a trained brain blood vessel segmentation model. The brain blood vessel segmentation model includes an encoder module, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module of the pyramid vision Transformer. The loss functions used during training include boundary intersection-union loss, focus Tversky loss, and Dice loss.

[0106] For details, please refer to Figure 2 The embodiments of this application first construct a cerebral blood vessel segmentation model, which mainly consists of four modules: an encoder module of the pyramid vision Transformer, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module. These modules address different challenges in cerebral blood vessel image analysis, as detailed below:

[0107] (1) Radial Intensity Module (RIM): Enhances low-level features through polar coordinate transformation and frequency domain processing. This module builds on earlier work on polar coordinate CNNs but introduces novel improvements, including depthwise convolution operations along the angular direction and a discrete cosine transform-based attention mechanism for speckle suppression.

[0108] (2) Deformable Cross-scale Fusion Module (D-CFM): It uses deformable convolutional layers to improve cross-scale feature alignment. Its key innovations are offset prediction and edge-guided gating.

[0109] (3) Boundary-aware Attention Module (BAM): It combines edge detection with window-based attention mechanism, but is optimized for the refinement of the boundaries of cerebral blood vessels through Laplacian edge detection and local window processing.

[0110] First, the original DICOM images of the brain were converted to JPG format using a Python script. These optical coherence tomography (OCT) images of the brain were acquired in vivo via an intravascular approach using the ZERO neurointerventional OCT system equipped with an F2 imaging catheter. The specific steps are as follows:

[0111] 1. First, place the nerve guidewire distal to the lesion;

[0112] 2. The OCT catheter is advanced along the guidewire to the target site;

[0113] 3. Use near-infrared light to acquire axial view images;

[0114] 4. Backscattered light is processed by interferometry and Fourier transform to generate a grayscale image.

[0115] The optical coherence tomography (OCT) images of the brain are input into the brain blood vessel segmentation model. They first pass through the encoder module of the Pyramid Visual Transformer (PVT), which consists of multiple interconnected Transformer coding layers. These layers extract multi-scale features at different resolutions, including:

[0116] The highest resolution feature map generated by the first Transformer encoding layer of the PVT encoder module has a size of 1 / 4 of the input image, H / 4 × W / 4 × 64. This feature map contains rich low-level texture details and is directly fed into the Radial Intensity Module (RIM) for polar coordinate transformation and enhancement.

[0117] : The feature map output by the second Transformer encoding layer of the encoder module of PVT, with a size of 1 / 8 of the input image, H / 8 × W / 8 × 128, is the low-level input feature of the Deformable Cross-Scale Fusion Module (D-CFM).

[0118] : The feature map output by the third Transformer encoding layer of the encoder module of PVT, with a size of 1 / 16 of the input image, H / 16 × W / 16 × 320, is the mid-level input feature of the Deformable Cross-Scale Fusion Module (D-CFM).

[0119] The lowest resolution, strongest semantic feature map generated by the fourth Transformer encoding layer of the PVT encoder module, with a size of 1 / 32 of the input image, H / 32 × W / 32 × 512, is the top-level input feature of the Deformable Cross-Scale Fusion Module (D-CFM), which is responsible for providing global semantic guidance.

[0120] In a specific embodiment, the radial intensity module includes a polar coordinate transformation layer, an angle-depth convolution layer, an attention layer based on discrete cosine transform, and a coordinate inverse mapping layer;

[0121] The calculation process for the radial strength module is as follows:

[0122] The output features of the first Transformer encoding layer of the pyramid vision Transformer are input into the polar coordinate transformation layer, mapping them from Cartesian coordinates to polar coordinates to obtain polar coordinate parameters, including radial distance. and angle As shown in the following formula:

[0123] ;

[0124] ;

[0125] in, The center point of the lumen is indicated, and D represents the estimated diameter of the vessel used for normalization. This represents the spatial coordinate index of each pixel in the output feature of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer.

[0126] To fill the polar coordinate representation, for each target polar coordinate point in the polar coordinate representation... Calculate the sampling position in the output features of the first Transformer encoding layer of the encoder module in the pyramid vision Transformer. and As shown in the following formula:

[0127] ;

[0128] ;

[0129] According to sampling location and Using a mesh generator and sampling function The output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer are transformed into polar coordinate representations, as shown in the following equation:

[0130] ;

[0131] in, This represents the output feature of the first Transformer encoding layer in the encoder module of the pyramid vision Transformer. Representation using polar coordinates;

[0132] The polar coordinate representation is input into the angular depthwise convolutional layer for depthwise convolution along the angular direction to obtain the angular feature vector, as shown in the following equation:

[0133] ;

[0134] in, This represents a depthwise convolution operation along the angular direction. Represents the angular feature vector;

[0135] The angular feature vector is input into the attention layer based on discrete cosine transform to obtain the frequency domain attention weights, as shown in the following equation:

[0136] ;

[0137] in, Represents the discrete cosine transform. This represents a multilayer perceptron. This represents the Sigmoid activation function. Indicates the frequency domain attention weights;

[0138] Polar coordinate representation using frequency domain attention weights We perform weighting to obtain the weighted polar coordinate representation. As shown in the following formula:

[0139] ;

[0140] Representing the weighted polar coordinates The input is fed into the coordinate inverse mapping layer to perform inverse polar coordinate transformation. Polar coordinate features are back-sampled according to the Cartesian coordinate grid to obtain the reconstructed features, as shown in the following formula:

[0141] ;

[0142] in, Indicates reconstruction features;

[0143] The reconstructed features are added element-wise to the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer to obtain the radial enhancement features, as shown in the following formula:

[0144] ;

[0145] in, This indicates radial enhancement characteristics.

[0146] Specifically, in the embodiments of this application, the radial intensity module first uses a differentiable mapping to convert the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. The transformation to polar coordinate representation mainly utilizes the defined mesh generator. and sampling function Transform the feature into polar coordinates. To achieve the above transformation, a standardized polar coordinate grid is first constructed. This polar coordinate grid is defined by mapping geometric relationships in Cartesian space to the polar coordinate system. This is followed by the generation of the polar coordinate representation. Subsequently, to capture the continuous features of the blood vessel wall along the circumferential direction, a depthwise convolution operation along the angular direction is first performed, which maps the polar coordinate representation to an angular feature vector. Then, a frequency domain attention weight is calculated using an attention mechanism based on Discrete Cosine Transform (DCT). To suppress speckle noise, the calculated frequency domain attention weights are used. Subsequently, it was represented by polar coordinates. We perform weighting to obtain the weighted polar coordinate representation. This allows for the selective enhancement of the blood vessel wall signal in the frequency domain. To represent the weighted polar coordinates... To integrate back into the backbone network, embodiments of this application require performing an inverse polar coordinate transformation, that is, reconstructing features aligned with the original space by back-sampling polar coordinate features according to the Cartesian coordinate grid. ,in Reusing the coordinate mapping relationship defined in the previous formula, and in order to enhance radial features while preserving the original spatial topology information and promoting gradient propagation, we introduce residual skip connections. Embodiments of this application will reconstruct features. Compared with the original input features Element-wise addition is performed to obtain radially enhanced features. In this way, radially aligned features can be accurately resampled from features located in the Cartesian coordinate system, and finally combined with subsequent processing branches through skip connections to enhance boundary information.

[0147] The radial intensity module in the embodiments of this application aligns the image representation with the natural radial symmetry of blood vessels through polar coordinate transformation, providing a key advantage for cerebral vascular OCT analysis. This transformation significantly enhances the visibility and analyzability of the concentric layered structure of the vessel wall (lumen-intima-media-adventitia), which appears curved and discontinuous in a standard Cartesian coordinate system.

[0148] The polar coordinate transformation described above was applied to the original OCT intensity (before logarithmic compression) to maintain the linearity of the speckle statistics. While maintaining the original 5 μm axial resolution, the angular resolution was downsampled to 0.5° increments—a balance between detail preservation and computational efficiency. Sensitivity analysis was performed on the angular resolution. 0.25°, 0.5°, 1.0°, and 5° were tested. The results show that 0.5° provides the best trade-off; a finer resolution (0.25°) increases computational cost by 40% without significantly improving HD95, while a coarser resolution (1.0°) leads to blurring of the thin film.

[0149] In a specific embodiment, the deformable cross-scale fusion module includes seven deformable convolutional layers and two stitching layers, constructing a two-level fusion structure. Each level of the fusion structure includes three deformable convolutional layers and one stitching layer. The input to each level of the fusion structure is a guiding feature and a feature to be aligned. In the first level of the fusion structure, the output feature of the fourth Transformer encoding layer of the encoder module of the Pyramid Vision Transformer is used as the guiding feature, and the output feature of the third Transformer encoding layer of the encoder module of the Pyramid Vision Transformer is used as the feature to be aligned. In the second level of the fusion structure, the fusion feature output from the first level of the fusion structure is used as the guiding feature, and the output feature of the second Transformer encoding layer of the encoder module of the Pyramid Vision Transformer is used as the feature to be aligned. The fusion feature output from the second level of the fusion structure is then passed through a deformable convolutional layer to obtain an enhanced fusion feature.

[0150] In a specific embodiment, the calculation process in each level of the fusion structure is as follows:

[0151] The guiding features are upsampled to the same resolution as the features to be aligned and then concatenated. The spatial offset is predicted using the convolution operation of the first convolutional layer, as shown in the following formula:

[0152] ;

[0153] in, Indicates spatial offset. Indicates guiding characteristics. Indicates the features to be aligned. Indicates upsampling, This indicates a splicing operation. Indicates the convolution operation;

[0154] The features to be aligned and the spatial offset are input into the first deformable convolutional layer in each level of the fusion structure for deformable convolution operation to obtain the corrected features, as shown in the following equation:

[0155] ;

[0156] in, Indicates the correction feature, This represents a deformable convolution operation;

[0157] The Sobel operator is used to extract high-frequency edge information from the features to be aligned, and then the gating coefficients are generated by passing them through a second convolutional layer and a Sigmoid activation function, as shown in the following equation:

[0158] ;

[0159] in, Represents the Sobel operator. Indicates the gating coefficient;

[0160] The gated features are obtained by multiplying the correction features element-wise with the gate coefficients, as shown in the following formula:

[0161] ;

[0162] in, Indicates gating features, This indicates element-wise multiplication;

[0163] The upsampled guiding features are passed through the second deformable convolutional layer in each fusion structure, then concatenated with the gated features, and finally passed through the third deformable convolutional layer in each fusion structure to obtain the fused features, as shown in the following equation:

[0164] ;

[0165] in, This indicates the fusion feature.

[0166] Specifically, the deformable cross-scale fusion module proposed in the embodiments of this application enhances standard convolution operations by learning to adapt to the dynamic spatial offset of blood vessel morphology, such as... Figure 3 As shown, the deformable cross-scale fusion module takes as input the output features of the second, third, and fourth Transformer encoding layers of the pyramid vision Transformer's encoder module. By modifying the conventional sampling grid with the predicted displacement field, it allows the network to flexibly adjust its receptive field according to local anatomical structures, outputting enhanced fusion features after spatial alignment and edge-guided gating. This capability is particularly valuable for cerebral vascular OCT analysis, as blood vessels exhibit complex geometries and varying diameters.

[0167] This deformable cross-scale fusion module employs a two-level cascaded structure, utilizing deep semantic information to guide shallow detailed features for precise spatial alignment. To clearly describe each fusion structure, the guiding features in the formula are... and features to be aligned A clear correspondence is established with the output features of the second, third, and fourth Transformer encoding layers of the pyramid vision Transformer's encoder module: in the first-level fusion structure, The output feature of the fourth Transformer encoding layer in the encoder module of the pyramid vision Transformer. , The output features of the third Transformer encoding layer of the encoder module corresponding to the pyramid vision Transformer In the second stage of fusion in the lower half, The fusion features corresponding to the output of the first-level fusion structure , This refers to the output features of the second Transformer encoding layer of the encoder module in the pyramid vision Transformer. .

[0168] In each level of the fusion structure, the first spatial alignment of features in the input stage is required. At this stage, the positional differences between the two layers of features need to be learned first, by guiding the features... Upsampled to the feature to be aligned The images are stitched together with consistent resolution, and the spatial offset is predicted using a first convolutional layer with a kernel size of 1×1. Obtain offset space Then, align it with the feature to be aligned. The features are fed together into the first deformable convolutional layer. At this point, the features to be aligned... As the object being operated on, according to By dynamically adjusting the sampling position and causing deformation, a correction feature is generated that is spatially aligned with the guiding feature. To further suppress background noise contamination of the fused features, embodiments of this application introduce an edge-guided gating mechanism. First, the Sobel operator is used to start from the features to be aligned. High-frequency edge information is extracted, and gating coefficients are generated using the Sigmoid activation function. Then the correction features will be used. With gate coefficient Element-wise multiplication is performed to obtain the gating feature. This operation effectively filters out features from non-vascular regions using edge weights while suppressing background responses. Finally, the upsampled guiding features are concatenated and fused with the gated features along the channel dimension after passing through a second deformable convolutional layer, and then further processed through a third deformable convolutional layer to output the fused features. Through the design of multi-level deformable convolutional layers for transfer and correction, the receptive field of each level of features can be adaptively adjusted according to the local anatomical structure, thereby maintaining extremely high boundary delineation accuracy under complex changes in the curvature of cerebral blood vessels.

[0169] In a specific embodiment, the calculation process of the boundary-aware attention module is as follows:

[0170] The enhanced fusion features are upsampled and concatenated with the radial enhancement features, then passed through a third convolutional layer for convolution to obtain the joint features, as shown in the following equation:

[0171] ;

[0172] in, Indicates enhanced fusion features, Indicates radial enhancement features, Indicates upsampling, This indicates a splicing operation. This represents the convolution operation. Indicates joint features;

[0173] Edge indicator features are extracted from the joint features using the Gaussian-Laplacian operator, as shown in the following equation:

[0174] ;

[0175] in, The standard deviation is expressed as The Gaussian-Laplacian operator, where * denotes convolution operation. The edge response threshold, Indicates edge indicator features;

[0176] The attention mechanism is calculated based on the joint features and edge indication features to obtain the attention features, as shown in the following formula:

[0177] ;

[0178] in, The scaling factor is T, which represents the transpose of the matrix. , and These are the query weight matrix, key weight matrix, and value weight matrix, respectively. express function, Indicates attentional characteristics;

[0179] The attention features and joint features are multiplied element-wise and the residuals are added to obtain the boundary awareness enhancement features, as shown in the following formula:

[0180] ;

[0181] in, This indicates boundary-aware enhancement features;

[0182] The boundary-aware enhancement features are processed through the fourth convolutional layer and the Sigmoid activation function to obtain the brain blood vessel prediction segmentation mask, as shown in the following equation:

[0183] ;

[0184] in, This represents a segmentation mask for predicting cerebral blood vessels.

[0185] The predicted probability value of each pixel in the cerebral blood vessel prediction segmentation mask is compared with a threshold to obtain the corresponding cerebral blood vessel prediction segmentation image.

[0186] Specifically, in order to accurately recover the fine boundaries of blood vessels in the segmentation results, embodiments of this application design a boundary-aware (BAM) module. For example... Figure 2 As shown, this boundary-aware attention module acts as the decoding stage of the cerebral blood vessel segmentation model. Its input fuses two key feature streams: one is the enhanced fused feature output from the D-CFM module. One path contains geometrically corrected vascular topology information; the other path is radial enhancement features output from the RIM module. It contains rich and denoised details of blood vessel wall texture.

[0187] The two sets of features above are first aligned in terms of spatial resolution (by upsampling). Adjust to (The resolution is consistent), and then concatenation and preliminary convolution fusion are performed along the channel dimension. This step integrates semantic information and texture details into a joint feature F. The generated joint feature F is then used as the main body in subsequent edge detection and attention mechanism processing. In order to guide the network to explicitly focus on the blurred blood vessel wall boundary, the embodiments of this application first apply the Gaussian-Laplacian operator to the joint feature F to extract the edge response. This process generates an explicit edge indicator feature E through binarization. The generated E highlights the regions with sharp gradient changes in the feature map, i.e., potential blood vessel boundaries. Subsequently, the edge map E is used to adjust the self-attention mechanism, forcing the model to focus on the boundary region when calculating feature dependencies. Specifically, the joint feature F is first mapped to a key matrix K and a value matrix V, and the edge indicator feature E is multiplied element-wise with the joint feature F to enhance the boundary features, and then mapped to a query matrix Q, and then the attention weights are calculated. This step outputs a boundary-enhanced feature representation, effectively recovering edge details that might be lost in deeper features. To achieve the final feature enhancement, the generated attention features need to be... Element-wise multiplication with the joint feature F and residual summation are performed to achieve accurate activation of boundary information. Finally, to generate pixel-level segmentation results, boundary-aware enhancement features are added. First, a 1×1 fourth convolutional layer is used to compress the number of channels to 1. Then, a sigmoid activation function is used to map the feature values ​​to a probability distribution, thus obtaining a cerebral blood vessel prediction and segmentation mask. The value of each pixel in this cerebral blood vessel prediction and segmentation mask represents the confidence level that the pixel belongs to a cerebral blood vessel. Thresholding is then performed based on this cerebral blood vessel prediction and segmentation mask to obtain a binarized segmentation result, i.e., a cerebral blood vessel prediction and segmentation image.

[0188] The training process of the cerebral blood vessel segmentation model in the embodiments of this application is as follows:

[0189] First, the training data is constructed, and the specific process is as follows:

[0190] The training data consisted of ".dicom" files containing cerebrovascular data from 30 patients, with approximately 400 consecutive axial view images provided for each patient. It is important to note that the embodiments in this application were performed in accordance with the Declaration of Helsinki and approved by the hospital's institutional ethics committee. Written informed consent was obtained from all participants or their legal guardians prior to the OCT imaging procedures. All axial view images from these 30 patients were annotated, with a particular focus on the vascular lumen contours, such as... Figure 4 and 5 As shown. After annotation, a Python script is used to convert the original DICOM image and the corresponding mask into JPG format, ensuring that the filenames of the original image and the annotated image match.

[0191] After the transformation, the training data is divided into a training set and a validation set in an 8:2 ratio. Given the relatively small sample size, embodiments of this application employ various data augmentation techniques to increase the diversity and robustness of the training data, including:

[0192] (1) Gaussian noise: Add Gaussian noise (σ= 0.05, relative to the intensity range) to the image to simulate real-world imaging noise, thereby enhancing the model’s robustness to noise.

[0193] (2) Rotation and Flipping: The image is randomly rotated (±15°) and flipped to ensure that the model can handle changes in image orientation.

[0194] (3) Scaling and Translation: The image is slightly scaled ([0.9, 1.1]) and translated (±10% of the image width / height) to help the model learn to cope with differences in image size and focus.

[0195] (4) Elastic Transformations: Applying elastic deformation (α = 50, σ = 5) to simulate small anatomical variations and improve the generalization ability of the model.

[0196] (5) Intensity Adjustments: Adjust the brightness and contrast of the image to reflect different imaging conditions and further challenge the model during training.

[0197] The above enhancement techniques are applied randomly during training, generating more diverse training data. This strategy helps improve the model's generalization ability and ensures better performance on unseen data. Furthermore, it is worth noting that quantitative analysis of brain OCT images represents a novel and clinically significant task, for which there are currently no established public benchmarks. Therefore, although the datasets compiled in the embodiments of this application are limited in size, to ensure robustness of the evaluation under limited sample size, the embodiments of this application employ a strict protocol: all experiments are repeated five times using different random seeds, and the reported metrics reflect the mean and standard deviation of these runs. In addition, the embodiments of this application employ a leave-one-subject-out cross-validation strategy to evaluate generalization ability across individuals.

[0198] Training data was divided into training and validation sets at the patient level, with 10 patients used for training and 3 patients used for validation. This division maintained the balanced representativeness of vascular anatomy while preventing data leakage. Experiments were conducted on NVIDIA RTX 3090 GPUs using the PyTorch framework, employing the AdamW optimizer (initial learning rate LR=1e-4) and mixed precision training. An early stopping strategy was applied based on the validation set performance.

[0199] In a specific embodiment, the expression for the boundary intersection-union ratio loss is:

[0200] ;

[0201] in, This is a boundary extraction operation for 2-pixel dilation. This indicates a segmentation mask for predicting cerebral blood vessels. This represents a mask for the actual segmentation of cerebral blood vessels. Indicates the boundary intersection and union ratio loss;

[0202] The expression for the focal Tversky loss is:

[0203] ;

[0204] in, This represents the predicted probability value of the i-th pixel in the cerebral blood vessel prediction segmentation mask. This is the true label for the i-th pixel, with a value of either 0 or 1. and These represent the first weight and the second weight, respectively. Indicates the focal Tversky loss;

[0205] The expression for Dice loss is:

[0206] ;

[0207] Where Y represents the actual segmented region of cerebral blood vessels. This represents the predicted cerebral blood vessel segmentation region, which consists of all pixels in the predicted cerebral blood vessel segmentation image that are identified as cerebral blood vessels. Indicates Dice loss;

[0208] The total loss function used during the training of the cerebral blood vessel segmentation model The weighted sum of the boundary intersection-union ratio loss, the focal Tversky loss, and the Dice loss is used, with weighting coefficients of 0.5:0.3:0.2 in one example, as shown in the following formula:

[0209] .

[0210] Specifically, to achieve optimal blood vessel segmentation performance, embodiments of this application employ a total loss function weighted by boundary intersection-union loss, focal Tversky loss, and Dice loss. In implementation, embodiments of this application utilize a brain blood vessel prediction segmentation mask to perform the segmentation task, where each pixel... This represents the probability that the location belongs to a cerebral blood vessel, with a value range of [0, 1]. The closer it is to 1, the more confident the model is that it is a cerebral blood vessel; the closer it is to 0, the more confident it is that it is background. It is the true label of the i-th pixel, with a value of 0 or 1. 1 means that the pixel is indeed a blood vessel, and 0 means that it is the background.

[0211] In one example, setting and To impose a greater penalty on false negatives, the aim is to maximize recall for detecting subtle, discontinuous neurovascular structures. The weighting coefficients (0.5:0.3:0.2) in this example have been empirically optimized through systematic validation to balance volumetric accuracy and boundary precision. Boundary IoU components. Consistent 2-pixel dilation was employed to maintain uniform assessment across varying vessel diameters, while focal Tversky loss was avoided. This multi-component loss function is specifically designed to address the extreme class imbalance problem in vascular OCT image features. Compared to traditional segmentation losses, it demonstrates superior performance in preserving subtle vascular wall structures and maintaining topological correctness.

[0212] The performance evaluation of embodiments in this application uses the Dice score (DSC) and HD95, and statistical significance is tested using paired t-tests. DSC assesses segmentation accuracy by measuring the overlap between the predicted segmentation mask for brain vessels and the ground truth segmentation mask for brain vessels. HD95 quantifies boundary accuracy by calculating the 95th percentile of the maximum surface distance between segmented contours. This metric is crucial for evaluating performance on fine anatomical structures; lower values ​​indicate higher localization accuracy. Both metrics are calculated at the system's native 5 μm resolution to ensure clinical relevance of the evaluation.

[0213] In the embodiments of this application, six known models—FCN, U-Net, Attention UNet, SwinUnet, TransUnet, EGE-Unet, PVT-DMHFR, and Polyp-PVT—are used as base models for comprehensive benchmark testing.

[0214] To ensure a fair and unbiased comparison, all baseline models were retrained from scratch using the same preprocessing steps, data augmentation procedures, input resolution (512×512), and optimization settings (AdamW, LR=1e-4) as the methods proposed in the embodiments of this application. All methods employed matching computational budgets and the same post-processing.

[0215] The test results in Table 1 show that the cerebral blood vessel segmentation model mentioned in the embodiments of this application achieved superior performance on all evaluation metrics, establishing the excellent performance of cerebral blood vessel OCT segmentation, such as... Figure 6 As shown. With a Dice score of 0.9506 and an IoU of 0.9512, this cerebral vessel segmentation model demonstrates a significant improvement over existing methods, particularly in boundary localization, as evidenced by its superior HD95 of 0.269 mm.

[0216] Comparative analysis reveals several key observations regarding model performance. Transformer-based architectures (such as Swin-Unet and TransUnet) generally outperform traditional CNN methods, demonstrating the importance of global context modeling for vessel segmentation tasks. The current state-of-the-art vessel segmentation algorithm (EGE-Unet) exhibits strong performance with a Dice score of 0.9453 and an HD9 score of 0.967 mm, but the embodiments in this application achieve a significant 72% reduction in HD95 while maintaining comparable computational efficiency.

[0217] These improvements are attributed to several novel design elements in the methods described in the embodiments of this application. Polar coordinate processing effectively captures the radial intensity patterns specific to vascular OCT, while the boundary-aware attention mechanism specifically addresses the challenges of thin vessel wall segmentation. The results demonstrate that the methods described in the embodiments of this application successfully balance the need for global context understanding (via the Transformer component) and accurate local boundary detection (via a dedicated module), overcoming limitations observed in other architectures.

[0218] The exceptional boundary accuracy (HD95 = 0.269 mm) is particularly noteworthy, as it approaches the theoretical resolution limit of OCT systems, indicating that this cerebral vessel segmentation model is making full use of available image information. This level of performance is clinically significant because it enables reliable measurements of thin vascular layers, which are crucial for treatment planning but have traditionally been difficult to segment accurately.

[0219] Besides segmentation accuracy, clinical deployability largely depends on computational efficiency. The embodiments of this application quantitatively analyze the computational cost of the model on a single GPU. Thanks to a simplified single-channel input backbone (stem), the cerebral vessel segmentation model mentioned in the embodiments of this application runs with only 8.5 million parameters, a 66% reduction compared to the Polyp-PVT baseline (25.4M). This cerebral vessel segmentation model achieves an inference speed of 62 frames per second (FPS), with an average latency of 16 milliseconds per frame and approximately 1.2 GB of GPU memory usage during inference. These metrics demonstrate that the framework of the cerebral vessel segmentation model proposed in the embodiments of this application meets the real-time processing requirements of intraoperative guidance.

[0220] Table 1. Experimental results of benchmark tests

[0221] method Dice IoU Hd95 FCN 0.9203 ± 0.0057 0.9000 ± 0.0066 1.510 ± 0.208 Unet 0.9349 ± 0.0052 0.9147 ± 0.0084 1.248 ± 0.112 AttentionUnet 0.9400 ± 0.0093 0.9273 ± 0.0078 1.131 ± 0.139 SwinUnet 0.9478 ± 0.0086 0.9377 ± 0.0056 1.000 ± 0.118 TransUnet 0.9452 ± 0.0065 0.9352 ± 0.0064 1.053 ± 0.270 EGE-Unet 0.9453 ± 0.0084 0.9401 ± 0.0072 0.967 ± 0.093 PVT-DMHFR 0.9226 ± 0.0052 0.9102 ± 0.0058 0.356 ± 0.027 Polyp-PVT* 0.9319 ± 0.0062 0.8911 ± 0.0125 0.307 ± 0.041 This invention 0.9506 ± 0.0048 0.9512 ± 0.0050 0.269 ± 0.034

[0222] To quantitatively verify the contribution of each module, a comprehensive ablation experiment was conducted in the embodiments of this application. This application compares the complete cerebral vessel segmentation model with three ablation variants and the original Polyp-PVT baseline, as shown below:

[0223] (a) w / o RIM: Model without radial strength module;

[0224] (b) w / o D-CFM: Model without deformable cross-scale fusion module;

[0225] (c) w / o BAM: Model without boundary-aware attention module;

[0226] (d) Polyp-PVT*: Adapted from the original baseline model for polyp segmentation.

[0227] All models were trained and evaluated under the same conditions on the cerebral vascular OCT dataset mentioned in the embodiments of this application. The results are shown in Table 2. The original Polyp-PVT baseline has achieved considerable performance (Dice score of 0.9319, HD95 score of 0.307 mm), but the complete cerebral vascular segmentation model in the embodiments of this application significantly outperforms it. This performance gap highlights the necessity of the domain-specific innovation of the embodiments of this application for neurovascular OCT analysis.

[0228] Table 2 Test results of ablation experiment

[0229] method Dice IoU Hd95 This invention 0.9506 ± 0.0045 0.9512 ± 0.0078 0.269 ± 0.035 Remove RIM module 0.9409 ± 0.0032 0.8950 ± 0.0073 0.298 ± 0.044 Remove D-CFM module 0.9418 ± 0.0058 0.8954 ± 0.0031 0.316 ± 0.059 Remove BAM module 0.9449 ± 0.0054 0.8999 ± 0.0038 0.283 ± 0.026 Polyp-PVT* 0.9319 ± 0.0063 0.8911 ± 0.0041 0.307 ± 0.027

[0230] The systematic addition of the RIM module, D-CFM module, and BAM module proposed in the embodiments of this application brings clear and cumulative improvements:

[0231] (1) Compared with the complete cerebral vessel segmentation model, removing the RIM module resulted in a decrease in Dice score (0.9409 vs 0.9506) and an increase in HD95 (0.298 mm vs 0.269 mm). This demonstrates that polar coordinate transformation is essential for utilizing the radial prior of vessels, which is lacking in the original Polyp-PVT baseline.

[0232] (2) Compared with the complete cerebral vessel segmentation model, removing the D-CFM module resulted in the most significant performance degradation in boundary accuracy, with HD95 increasing to 0.316 mm. This highlights the crucial role of deformable alignment in handling the complex curvature of cerebral vessels, a challenge that rigid fusion in the Polyp-PVT baseline cannot address.

[0233] (3) Removal of the BAM module resulted in a significant decrease in boundary sharpness (0.284 mm for HD95), although the Dice score remained relatively high (0.9449). This confirms that the boundary-aware attention mechanism is tailored to achieve the subpixel accuracy required for clinical HD95 assessment, a feature that is missing in baseline.

[0234] like Figure 7As shown, the qualitative results provide visual confirmation of the quantitative findings. For example, in cases of high vascular curvature, both the Polyp-PVT baseline and the model without the D-CFM module produced misalignments and irregular boundaries. Similarly, the model without the BAM module failed to maintain the continuity of thin-walled structures as effectively as the complete cerebral vessel segmentation model. The ablation experiments conclusively demonstrate that each module contributes uniquely and essentially to the overall performance, and their combination in the complete cerebral vessel segmentation model leads to a significant improvement over the robust Polyp-PVT baseline.

[0235] S2: The optical coherence tomography (OCT) image of the brain to be processed is acquired and input into the trained cerebral blood vessel segmentation model. It first passes through the encoder module of the pyramid vision Transformer. The output features of the first Transformer encoding layer of the pyramid vision Transformer encoder module are input into the radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the pyramid vision Transformer encoder module are input into the deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and enhanced fusion features are input into the boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. The corresponding cerebral blood vessel prediction segmentation image is obtained based on the cerebral blood vessel prediction segmentation mask.

[0236] Specifically, the trained cerebral blood vessel segmentation model in the embodiments of this application is deployed. After deployment, the optical coherence tomography (OCT) image of the brain to be processed is input into the trained cerebral blood vessel segmentation model. First, it passes through the encoder module of the pyramid visual Transformer to obtain the output features of the first, second, third, and fourth Transformer encoding layers of the encoder module. The output features of the first Transformer encoding layer of the encoder module are input into the radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the encoder module are input into the deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and enhanced fusion features are input into the boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. The cerebral blood vessel prediction segmentation mask is thresholded to obtain the corresponding cerebral blood vessel prediction segmentation image.

[0237] Further reference Figure 8As an implementation of the methods shown in the above figures, this application provides an embodiment of a brain vessel segmentation device based on physical guidance and a pyramid visual Transformer. This device embodiment is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0238] This application provides a brain vessel segmentation device based on physical guidance and a pyramid visual Transformer, comprising:

[0239] Model building module 1 is configured to build and train a brain blood vessel segmentation model to obtain a trained brain blood vessel segmentation model. The brain blood vessel segmentation model includes an encoder module, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module of the pyramid vision Transformer. The loss functions used during training include boundary intersection-union loss, focus Tversky loss, and Dice loss.

[0240] Segmentation module 2 is configured to acquire optical coherence tomography (OCT) images of the brain to be processed and input them into a trained cerebral blood vessel segmentation model. The images first pass through the encoder module of a pyramid visual Transformer. The output features of the first Transformer encoding layer of the encoder module are input into the radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the encoder module are input into the deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and enhanced fusion features are then input into the boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. Based on the cerebral blood vessel prediction segmentation mask, the corresponding cerebral blood vessel prediction segmentation image is obtained.

[0241] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. For example... Figure 9 As shown, the electronic device in this embodiment includes a processor 901 and a memory 902; wherein the memory 902 is used to store computer execution instructions; and the processor 901 is used to execute the computer execution instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant descriptions in the foregoing method embodiments.

[0242] Alternatively, the memory 902 can be either standalone or integrated with the processor 901.

[0243] When the memory 902 is set up independently, the electronic device also includes a bus 903 for connecting the memory 902 and the processor 901.

[0244] This invention also provides a computer storage medium storing computer execution instructions, which, when executed by processor 901, implement the above method.

[0245] This invention also provides a computer program product, including a computer program that, when executed by a processor 901, implements the above-described method.

[0246] In the embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0247] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0248] Furthermore, the functional modules in the various embodiments of this invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit formed by the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0249] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor 901 to execute some steps of the methods of the various embodiments of this application.

[0250] It should be understood that the processor 901 described above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor, or the processor 901 can be any conventional processor 901. The steps of the method disclosed in this invention can be directly manifested as execution by the hardware processor 901, or execution by a combination of hardware and software modules within the processor 901.

[0251] The memory 902 may include high-speed RAM memory, and may also include non-volatile memory NVM, such as at least one disk storage device, and may also be a USB flash drive, portable hard drive, read-only memory, disk or optical disc, etc.

[0252] Bus 903 can be an Industry Standard Architecture (ISA), a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 903 can be divided into address bus, data bus, control bus, etc. For ease of illustration, the bus 903 in the accompanying drawings of this application is not limited to only one bus 903 or one type of bus 903.

[0253] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0254] An exemplary storage medium is coupled to a processor 901, enabling the processor 901 to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor 901. The processor 901 and the storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor 901 and the storage medium can exist as discrete components in an electronic device or a host device.

[0255] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0256] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A brain blood vessel segmentation method based on physical guidance and pyramid visual Transformer, characterized in that, Includes the following steps: A brain blood vessel segmentation model is constructed and trained to obtain a trained brain blood vessel segmentation model. The brain blood vessel segmentation model includes an encoder module of a pyramid vision Transformer, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module. The radial intensity module includes a polar coordinate transformation layer, an angle-depth convolutional layer, an attention layer based on discrete cosine transform, and a coordinate inverse mapping layer. The calculation process for the radial strength module is as follows: The output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer are input into the polar coordinate transformation layer, mapping them from the Cartesian coordinate system to the polar coordinate system to obtain polar coordinate parameters, including radial distance. and angle As shown in the following formula: ; ; in, The center point of the lumen is indicated, and D represents the estimated diameter of the vessel used for normalization. This represents the spatial coordinate index of each pixel in the output feature of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. To fill the polar coordinate representation, for each target polar coordinate point in the polar coordinate representation... Calculate the sampling position in the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. and As shown in the following formula: ; ; According to the sampling position and Using a mesh generator and sampling function The output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer are transformed into polar coordinates, as shown in the following equation: ; in, This represents the output feature of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. Representation using polar coordinates; The polar coordinate representation is input into the angle-depth convolutional layer for depth convolution along the angle direction to obtain the angle feature vector, as shown in the following equation: ; in, This represents a depthwise convolution operation along the angular direction. Represents the angular feature vector; The angular feature vector is input into the attention layer based on discrete cosine transform to obtain the frequency domain attention weights, as shown in the following formula: ; in, Represents the discrete cosine transform. This represents a multilayer perceptron. This represents the Sigmoid activation function. Represents the frequency domain attention weights; The polar coordinates are represented using the frequency domain attention weights. We perform weighting to obtain the weighted polar coordinate representation. As shown in the following formula: ; The weighted polar coordinates are represented The input is fed into the coordinate inverse mapping layer to perform an inverse polar coordinate transformation. Polar coordinate features are back-sampled according to the Cartesian coordinate grid to obtain the reconstructed features, as shown in the following formula: ; in, Indicates reconstruction features; The reconstructed features are added element-wise to the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer to obtain the radial enhancement features, as shown in the following formula: ; in, Represents radial enhancement features; the loss functions used during training include boundary intersection-union loss, focal Tversky loss, and Dice loss; An optical coherence tomography (OCT) image of the brain to be processed is input into the trained cerebral blood vessel segmentation model. The image first passes through the encoder module of the pyramid visual Transformer. The output features of the first Transformer encoding layer of the pyramid visual Transformer encoder module are input into the radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the pyramid visual Transformer encoder module are input into the deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and enhanced fusion features are then input into the boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. Based on the cerebral blood vessel prediction segmentation mask, the corresponding cerebral blood vessel prediction segmentation image is obtained.

2. The brain vessel segmentation method based on physical guidance and pyramid visual Transformer according to claim 1, characterized in that, The deformable cross-scale fusion module includes seven deformable convolutional layers and two stitching layers, and constructs a two-level fusion structure. Each level of the fusion structure includes three deformable convolutional layers and one stitching layer. The input of each level of the fusion structure is the guiding feature and the feature to be aligned. In the first-level fusion structure, the output feature of the fourth Transformer encoding layer of the encoder module of the pyramid vision Transformer is used as the guiding feature, and the output feature of the third Transformer encoding layer of the encoder module of the pyramid vision Transformer is used as the feature to be aligned; in the second-level fusion structure, the fusion feature output by the first-level fusion structure is used as the guiding feature, and the output feature of the second Transformer encoding layer of the encoder module of the pyramid vision Transformer is used as the feature to be aligned. The fused features output from the second-level fusion structure are then passed through a deformable convolutional layer to obtain enhanced fused features.

3. The brain vessel segmentation method based on physical guidance and pyramid visual Transformer according to claim 2, characterized in that, The calculation process in each level of the fusion structure is as follows: The guiding features are upsampled to the same resolution as the features to be aligned and then concatenated. The spatial offset is predicted using the convolution operation of the first convolutional layer, as shown in the following formula: ; in, Indicates spatial offset. Indicates guiding characteristics. Indicates the features to be aligned. Indicates upsampling, This indicates a splicing operation. Indicates the convolution operation; The features to be aligned and the spatial offset are input into the first deformable convolutional layer in each level of the fusion structure for deformable convolution operation to obtain the corrected features, as shown in the following formula: ; in, Indicates the correction feature, This represents a deformable convolution operation; The Sobel operator is used to extract high-frequency edge information from the features to be aligned, and then the gating coefficients are generated by sequentially passing them through a second convolutional layer and a Sigmoid activation function, as shown in the following equation: ; in, Represents the Sobel operator. Indicates the gating coefficient; The correction feature is multiplied element-wise by the gating coefficient to obtain the gating feature, as shown in the following formula: ; in, Indicates gating features, This indicates element-wise multiplication; The upsampled guiding features are passed through the second deformable convolutional layer in each fusion structure, then concatenated with the gated features, and finally passed through the third deformable convolutional layer in each fusion structure to obtain the fused features, as shown in the following equation: ; in, This indicates the fusion feature.

4. The brain vessel segmentation method based on physical guidance and pyramid visual Transformer according to claim 1, characterized in that, The calculation process of the boundary-aware attention module is as follows: The enhanced fusion feature is upsampled and then concatenated with the radial enhanced feature. This concatenation is then performed through a third convolutional layer to obtain the joint feature, as shown in the following equation: ; in, Indicates enhanced fusion features, Indicates radial enhancement features, Indicates upsampling, This indicates a splicing operation. This represents the convolution operation. Indicates joint features; Edge indicator features are extracted from the joint features using the Gaussian-Laplacian operator, as shown in the following equation: ; in, The standard deviation is expressed as The Gaussian-Laplacian operator, where * denotes convolution operation. The edge response threshold, Indicates edge indicator features; The attention mechanism is calculated based on the joint features and edge indication features to obtain the attention features, as shown in the following formula: ; in, The scaling factor is T, which represents the transpose of the matrix. , and These are the query weight matrix, key weight matrix, and value weight matrix, respectively. express function, Indicates attentional characteristics; The attention features and the joint features are multiplied element-wise and the residuals are added to obtain the boundary awareness enhancement features, as shown in the following formula: ; in, This indicates boundary-aware enhancement features; The boundary-aware enhancement features are processed through a fourth convolutional layer and a Sigmoid activation function to obtain a brain blood vessel prediction segmentation mask, as shown in the following equation: ; in, This represents a segmentation mask for predicting cerebral blood vessels. The predicted probability value of each pixel in the cerebral blood vessel prediction segmentation mask is compared with a threshold to obtain the corresponding cerebral blood vessel prediction segmentation image.

5. The brain vessel segmentation method based on physical guidance and pyramid visual Transformer according to claim 1, characterized in that, The expression for the boundary intersection-union ratio loss is: ; in, This is a boundary extraction operation for 2-pixel dilation. This indicates a segmentation mask for predicting cerebral blood vessels. This represents a mask for the actual segmentation of cerebral blood vessels. Indicates the boundary intersection and union ratio loss; The expression for the focal Tversky loss is: ; in, This represents the predicted probability value of the i-th pixel in the cerebral blood vessel prediction segmentation mask. This is the true label for the i-th pixel, with a value of either 0 or 1. and These represent the first weight and the second weight, respectively. Indicates the focal Tversky loss; The expression for the Dice loss is: ; Where Y represents the actual segmented region of cerebral blood vessels. This represents the predicted cerebral blood vessel segmentation region, which consists of all pixels in the predicted cerebral blood vessel segmentation image that are identified as cerebral blood vessels. Indicates Dice loss; The total loss function used during the training of the cerebral blood vessel segmentation model is a weighted sum of the boundary intersection-union ratio loss, the focal Tversky loss, and the Dice loss.

6. A brain blood vessel segmentation device based on physical guidance and a pyramid visual Transformer, characterized in that, include: The model building module is configured to build and train a brain blood vessel segmentation model to obtain a trained brain blood vessel segmentation model. The brain blood vessel segmentation model includes an encoder module of a pyramid vision Transformer, a radial intensity module, a deformable cross-scale fusion module, and a boundary-aware attention module. The radial intensity module includes a polar coordinate transformation layer, an angle-depth convolutional layer, an attention layer based on discrete cosine transform, and a coordinate inverse mapping layer. The calculation process for the radial strength module is as follows: The output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer are input into the polar coordinate transformation layer, mapping them from the Cartesian coordinate system to the polar coordinate system to obtain polar coordinate parameters, including radial distance. and angle As shown in the following formula: ; ; in, The center point of the lumen is indicated, and D represents the estimated diameter of the vessel used for normalization. This represents the spatial coordinate index of each pixel in the output feature of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. To fill the polar coordinate representation, for each target polar coordinate point in the polar coordinate representation... Calculate the sampling position in the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. and As shown in the following formula: ; ; According to the sampling position and Using a mesh generator and sampling function The output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer are transformed into polar coordinates, as shown in the following equation: ; in, This represents the output feature of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer. Representation using polar coordinates; The polar coordinate representation is input into the angle-depth convolutional layer for depth convolution along the angle direction to obtain the angle feature vector, as shown in the following equation: ; in, This represents a depthwise convolution operation along the angular direction. Represents the angular feature vector; The angular feature vector is input into the attention layer based on discrete cosine transform to obtain the frequency domain attention weights, as shown in the following formula: ; in, Represents the discrete cosine transform. This represents a multilayer perceptron. This represents the Sigmoid activation function. Indicates the frequency domain attention weights; The polar coordinates are represented using the frequency domain attention weights. We perform weighting to obtain the weighted polar coordinate representation. As shown in the following formula: ; The weighted polar coordinates are represented The input is fed into the coordinate inverse mapping layer to perform an inverse polar coordinate transformation. Polar coordinate features are back-sampled according to the Cartesian coordinate grid to obtain the reconstructed features, as shown in the following formula: ; in, Indicates reconstruction features; The reconstructed features are added element-wise to the output features of the first Transformer encoding layer of the encoder module of the pyramid vision Transformer to obtain the radial enhancement features, as shown in the following formula: ; in, Represents radial enhancement features; the loss functions used during training include boundary intersection-union loss, focal Tversky loss, and Dice loss; The segmentation module is configured to acquire optical coherence tomography (OCT) images of the brain to be processed and input them into the trained cerebral blood vessel segmentation model. The images first pass through the encoder module of the pyramid visual Transformer. The output features of the first Transformer encoding layer of the pyramid visual Transformer encoder module are input into the radial intensity module to obtain radial enhancement features. The output features of the second, third, and fourth Transformer encoding layers of the pyramid visual Transformer encoder module are input into the deformable cross-scale fusion module for spatial alignment and edge-guided gating to obtain enhanced fusion features. The radial enhancement features and enhanced fusion features are then input into the boundary-aware attention module to obtain the corresponding cerebral blood vessel prediction segmentation mask. Based on the cerebral blood vessel prediction segmentation mask, the corresponding cerebral blood vessel prediction segmentation image is obtained.

7. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.