OCTA image blood vessel segmentation method and system based on improved U-Net and hierarchical fusion
Patent Information
- Application Number
- CN202611094569.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-07-22
AI Technical Summary
[0022]本发明的有益效果:本发明设置 ECA-UNet 与 OCTA-Net 双分支并行完成血管分割任务,其中 ECA-UNet 负责完整分割大血管主干,OCTA-Net 专门识别末梢细血管,两路输出结果融合处理,解决了传统单类分割模型无法同步兼顾细血管检出精度、主干血管连续完整性的缺陷。
Smart Images

Figure CN122636640B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and medical image processing technology, specifically to a method and system for vessel segmentation in optical coherence tomography (OCTA) images based on improved U-Net and hierarchical fusion. Background Technology
[0002] Optical coherence tomography (OCTA) angiography, with its advantages of being non-invasive, dye-free, and high-resolution, is a key technology for observing microcirculation reconstruction in the cerebral cortex, and is of great value for exploring stroke rehabilitation mechanisms and evaluating preclinical efficacy. OCTA imaging reconstructs the microcirculation network by detecting changes in backscattering caused by erythrocyte movement.
[0003] Mainstream blood flow detection algorithms include phase-sensitive detection (PSD), amplitude decorrelation (ADA), and frequency-division amplitude decorrelation (SSADA). Among them, SSADA achieves a balance between resolution and robustness through multi-scale frequency division processing and is currently the most widely used core algorithm in OCTA imaging systems.
[0004] However, OCTA images of the cerebral cortex have the following inherent challenges:
[0005] 1. Imaging level: Low signal-to-noise ratio, speckle noise, motion artifacts and projection artifacts work together to directly lead to blurred vessel boundaries and local ruptures;
[0006] 2. Data level: Fine annotation is costly and limited by sample size; at the same time, due to the high density and intertwining of blood vessels in the cerebral cortex, it is difficult to distinguish blood vessels from the background.
[0007] 3. Task level: There is often a conflict between the integrity of small blood vessels and the topological connectivity of the main trunk during optimization.
[0008] Therefore, there is an urgent need for an OCTA image blood vessel segmentation method and system that can balance segmentation accuracy, structural integrity, and computational efficiency. Summary of the Invention
[0009] To address the aforementioned problems in existing technologies, this invention provides a method and system for OCTA image vessel segmentation based on improved U-Net and hierarchical fusion.
[0010] To achieve the above objectives, the present invention provides the following technical solution:
[0011] This invention discloses an OCTA image vessel segmentation method based on improved U-Net and hierarchical fusion, the method comprising:
[0012] S1, Obtain the original OCTA image to be segmented and perform preprocessing;
[0013] S2, the preprocessed image is input into the improved U-Net model with an embedded efficient channel attention module to obtain the first blood vessel segmentation result with complete main blood vessel topology; wherein, the efficient channel attention module is set at the jump connection between the encoder and the decoder, and local cross-channel information interaction is achieved through one-dimensional convolution with adaptively determined kernel size;
[0014] S3, input the same preprocessed image into the pre-trained two-stage blood vessel segmentation model to perform transfer inference and obtain a second blood vessel segmentation result that can detect terminal microvessels;
[0015] S4. Based on preset dynamic weighting coefficients, the first blood vessel segmentation result and the second blood vessel segmentation result are fused at the pixel level to generate the final blood vessel segmentation image.
[0016] An OCTA image vessel segmentation system based on improved U-Net and hierarchical fusion, as described in this invention, includes:
[0017] The data acquisition module is used to acquire the original OCTA image to be segmented;
[0018] The preprocessing module is used to preprocess the original image;
[0019] The first segmentation module embeds a pre-trained improved U-Net model for segmenting blood vessels in the preprocessed image, generating a first blood vessel segmentation result with a complete main blood vessel topology. The improved U-Net model embeds an efficient channel attention module at the skip connection between the encoder and decoder. The efficient channel attention module achieves local cross-channel information interaction through one-dimensional convolution that adaptively determines the kernel size.
[0020] The second segmentation module has a pre-trained two-stage blood vessel segmentation model embedded in it. It is used to perform transfer inference on the same pre-processed image and output a second blood vessel segmentation result that can detect terminal microvessels.
[0021] The layered fusion module is used to perform pixel-level weighted fusion of the first blood vessel segmentation result and the second blood vessel segmentation result based on preset dynamic weight coefficients to generate the final blood vessel segmentation image.
[0022] The beneficial effects of this invention are as follows: This invention sets up two branches, ECA-UNet and OCTA-Net, to complete the blood vessel segmentation task in parallel. ECA-UNet is responsible for the complete segmentation of the main trunk of large blood vessels, while OCTA-Net is specifically used to identify peripheral fine blood vessels. The output results of the two paths are fused and processed, which solves the defect of traditional single-class segmentation models that cannot simultaneously take into account the accuracy of fine blood vessel detection and the continuity and integrity of the main blood vessels.
[0023] The ECA attention module has a small parameter overhead, which can enhance the model's feature extraction effect on the overall vascular network structure and ensure that long main blood vessel segmentation is not interrupted. OCTA-Net is pre-trained on the publicly available fundus ROSE dataset and then transferred for use. It has a higher detection capability for neovascularization and terminal capillaries in the damaged area that are easily missed by ECA-UNet, and can completely capture weak neovascularization image signals in the defect area during the ischemic repair stage.
[0024] After combining the validation set data to select the optimal fusion weights, the advantages of the two models can be fully utilized. While retaining the ability of ECA-UNet to completely restore the topological connectivity of the vascular network, it makes up for the problem of single models missing the detection of newly formed small blood vessels in the damaged area. It can accurately segment three types of image states in rat brain temporal OCTA images: normal baseline cerebral blood vessels, ischemic injury non-perfusion areas, and microvascular reconstruction during the post-ischemic repair period.
[0025] This invention establishes a complete implementation system encompassing a dual-branch fusion segmentation algorithm and a lightweight web terminal. The system can flexibly switch between different segmentation models, archive and store multiple sets of fusion weight parameters, and simultaneously support the retrieval and visualization of historical segmentation images. It can intuitively present the vascular changes in the same injury observation area at different time points, providing a quantitative and traceable imaging analysis method for assessing the degree of cerebral ischemia injury and observing the effect of vascular repair after ischemia. Attached Figure Description
[0026] Figure 1 This is a diagram showing the overall architecture of the system of the present invention.
[0027] Figure 2 This is a schematic diagram of the structure of the high-efficiency channel attention (ECA) module of the present invention.
[0028] Figure 3 This is a schematic diagram of the structure of the ECA-UNet network of the present invention.
[0029] Figure 4 A comparison chart of model training loss functions.
[0030] Figure 5 This is a flowchart of the layered fusion method of the present invention.
[0031] Figure 6 This is the segmentation result of the layered fusion method of the present invention. Detailed Implementation
[0032] 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. This embodiment uses rat cerebral cortex OCTA images as the processing object to verify the effectiveness and superiority of the proposed method.
[0033] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0034] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0035] This invention provides an OCTA image vessel segmentation system based on an improved U-Net and hierarchical fusion, the system framework of which is as follows: Figure 1 As shown, the system includes:
[0036] The data acquisition module is used to acquire raw OCTA images of the rat cerebral cortex to be processed;
[0037] The preprocessing module is used to perform registration, normalization, and size unification processing on the original image;
[0038] The first segmentation module, which embeds a pre-trained ECA-UNet model, is used to process the pre-processed image and generate a first blood vessel segmentation result with a complete main blood vessel topology.
[0039] The ECA-UNet model is characterized by embedding an efficient channel attention (ECA) module at the skip connection between its encoder and decoder; the ECA module achieves local cross-channel information interaction through one-dimensional convolution that adaptively determines the kernel size.
[0040] The second segmentation module uses the OCTA-Net model pre-trained on the publicly available OCTA dataset ROSE to directly perform transfer inference on the same pre-processed image, outputting a second vessel segmentation result that can accurately detect peripheral microvessels.
[0041] The layered fusion module is used to perform pixel-level weighted fusion of the first blood vessel segmentation result and the second blood vessel segmentation result based on preset dynamic weight coefficients to generate the final blood vessel segmentation image.
[0042] Furthermore, the preprocessing module also includes an image registration unit for spatial alignment of the temporal OCTA image.
[0043] Furthermore, the second segmentation module also includes a connected component analysis (CCA) post-processing unit for removing discrete noise points from the segmentation results.
[0044] Furthermore, the dynamic weight coefficients of the hierarchical fusion module are determined through a validation set grid search.
[0045] This invention also provides a method for vessel segmentation in OCTA images based on improved U-Net and hierarchical fusion, comprising the following steps:
[0046] S101: Obtain the original OCTA image to be segmented and use a script developed using the pyStackreg library in Python for image processing to perform automatic registration.
[0047] S102, the registered image is input into the ECA-UNet model with an embedded ECA module to obtain the first blood vessel segmentation result.
[0048] S103. Input the same registered image into the OCTA-Net model pre-trained on the publicly available OCTA dataset ROSE to perform transfer inference and obtain a second vessel segmentation result that can detect peripheral microvessels.
[0049] S104, based on dynamic weighting coefficients, the first blood vessel segmentation result and the second blood vessel segmentation result are fused at the pixel level to generate the final blood vessel segmentation image.
[0050] Furthermore, the ECA (Efficient Channel Attention) module described in step S102 achieves lightweight recalibration through local cross-channel interaction, and can learn channel importance without relying on fully connected dimensionality reduction.
[0051] Given channel description vector ECA uses one-dimensional convolution to generate channel weights. :
[0052]
[0053] in To adapt to kernel size, This is the Sigmoid function. Its core function is to emphasize the discriminative channels related to vascular structures and suppress background noise channels, thereby improving the quality of feature expression with almost no significant increase in the number of parameters.
[0054] Furthermore, the OCTA-Net used in step S103 is a dedicated blood vessel segmentation network with a two-stage structure. This model is pre-trained based on the publicly available retinal OCTA dataset ROSE and has two-level processing capabilities of coarse segmentation and fine segmentation. It has outstanding detection performance for fibrous blood vessels such as peripheral vessels and damaged areas.
[0055] Furthermore, the dynamic weight coefficient α mentioned in step S104 is determined to have an optimal value on the validation set by traversing α∈{0.1,0.2,...,0.9}.
[0056] Example:
[0057] Data Acquisition and Preprocessing
[0058] This embodiment uses a rat cerebral cortex OCTA dataset collected in the laboratory. Ischemia was simulated to induce a stroke state through photochemical thrombosis, and rehabilitation observation was conducted. A high-resolution OCTA system was used to perform dye-free imaging of the cerebral cortex vessels, obtaining two-dimensional planar OCTA images. The original image resolution is in the range of 500×500 to 700×700 pixels, corresponding to a spatial resolution of 2 micrometers per pixel, which can effectively image cerebral cortex microvessels with a diameter of not less than 2 micrometers.
[0059] The dataset contains 223 manually annotated OCTA vascular images. Annotations were completed image by image by researchers with medical image processing backgrounds. The annotation tool was developed based on Python image processing scripts, supporting interactive vascular region delineation, pixel-level fine annotation, and real-time preview. A single-person quality control mechanism was employed after annotation, including initial annotation, interval review, and review of difficult cases, to ensure accurate vascular boundaries and topological continuity.
[0060] Data partitioning: The data was divided into a training set (134 images), a validation set (44 images), and a test set (45 images) in a 6:2:2 ratio. Partitioning was performed on an individual rat basis to ensure that different slices from the same rat were not distributed across the dataset, thus avoiding data leakage.
[0061] Preprocessing: First, image registration is performed using an affine transformation-based registration algorithm. Mutual information is used as the similarity measure, and the spatial transformation parameters are iteratively solved using the gradient descent method to effectively eliminate respiratory displacement and head micro-motion interference in rat in vivo imaging. After registration, all images are uniformly resampled to 256×256 pixels, and grayscale normalization is used to scale the pixel values to the [0,1] range.
[0062] Data augmentation: Used only during the training phase, specifically including random horizontal flips with a 50% probability, random vertical flips with a 50% probability, and random rotations at multiples of 90°, 180°, and 270°.
[0063] Image registration details
[0064] Image registration is implemented using the Python programming language, and the core registration algorithm is developed using the pystackreg image processing library. The registration process uses a structurally clear baseline image as a reference and performs spatial alignment on the temporal cortical images to be registered.
[0065] The specific steps are as follows: First, the color OCTA image is converted into a grayscale image; then, the region of interest (ROI) is cropped based on the effective distribution area of blood vessels in the rat cerebral cortex to unify the spatial dimensions of the image to be registered and the reference image; based on the characteristics of the main trunks and bifurcation points of large and medium-sized blood vessels in the cerebral cortex, affine transformation is used as the global registration scheme, and bilinear nonlinear transformation is added to the samples with local deformation for fine alignment; the registration process takes image feature matching as the optimization goal and automatically estimates spatial transformation parameters such as translation, rotation, scaling and shearing; finally, numerical cropping and bilinear interpolation are used to complete the resampling.
[0066] The registration results were comprehensively verified by color channel overlay and contour offset analysis to ensure that the temporal rat cerebral cortex images achieved accurate spatial alignment at the pixel level.
[0067] ECA-UNet model structure:
[0068] The structure of the ECA module is as follows: Figure 2 As shown: The input feature map has dimensions H×W×C. First, it undergoes global average pooling to obtain a 1×1×C channel descriptor; then, local cross-channel interaction is achieved through one-dimensional convolution, with the kernel size k adaptively calculated based on the number of channels C.
[0069]
[0070] After one-dimensional convolution, the channel weights are obtained by the Sigmoid activation function, and then multiplied channel by channel with the original input feature map to output the recalibrated feature map.
[0071] Compared to the classic channel-attention SE module (which requires a fully connected layer for dimensionality reduction and then dimensionality increase, resulting in a large number of parameters and potential loss of channel information), ECA employs a local cross-channel interaction strategy without dimensionality reduction, requiring only one-tenth the number of parameters of SE. Compared to hybrid attention CBAM, ECA does not introduce an additional spatial attention branch, resulting in lower computational overhead.
[0072] The ECA-UNet network structure is as follows: Figure 3As shown, based on the standard U-Net, it includes a 4-layer encoder, a 4-layer decoder, and skip connections. Each encoder block contains two 3×3 convolutional layers (stretch 1, padding 1) and a 2×2 max-pooling layer (stretch 2). Each decoder block contains one upsampling layer (2×2 transposed convolution) and two 3×3 convolutional layers. At each skip connection, the encoder features are first recalibrated through an ECA module, and then concatenated with the upsampled features from the decoder.
[0073] Loss function design:
[0074] In response to the elongated structure and class imbalance of cerebral blood vessels in OCTA, this embodiment conducts a benchmark comparison of three types of loss: BCE, Dice, and BCE+Dice combination, under a unified training setting.
[0075] BCE Loss is defined as:
[0076]
[0077] Dice Loss is defined as:
[0078] ,
[0079] in To predict probabilities, This is a real label.
[0080] Loss baseline experiment (Seed=42, Epoch=50, Batch Size=8, Learning Rate=1×10⁻⁶) -4 The result is as follows Figure 4 The results show that the BCE loss function converges the fastest, with an average loss of 0.1754 on the final validation set; the Dice loss has the highest initial value but the slowest convergence speed, with a final loss of 0.1815; and the combined BCE+Dice loss is 0.1917. Therefore, the main experiment uses BCE as the default loss.
[0081] The training hyperparameters are set as follows: batch size is fixed at 8, and the initial learning rate is... The optimizer uses AdamW (weight decay) The loss function uses binary cross-entropy (BCE) loss, the training rounds are 200, and an early stopping mechanism is used (15 rounds of patience).
[0082] Learning rate scheduling strategy: A combination of linear warm-up and cosine annealing is used. During the first 10 rounds of the warm-up phase, the learning rate is adjusted from... linearly increase to Subsequently, cosine annealing was used to attenuate the temperature to... The gradient clipping threshold is set to 1.0.
[0083] Experimental environment: Hardware consisted of a 12th generation Intel Core i5-12450H CPU, an NVIDIA RTX 4050 GPU (6GB VRAM), and 32GB of RAM; software included Python 3.10.13, PyTorch 2.4.0, and CUDA 12.1. Random seeds of 42, 43, and 44 were used for three independent replicate experiments to evaluate the stability and reproducibility of the model's performance.
[0084] The second segmentation module uses the OCTA-Net model based on transfer learning to perform vessel segmentation inference. This model does not require additional re-annotation and training on rat cerebral cortex OCTA data. The specific process is as follows:
[0085] Step 1: Image Input. The OCTA image, after preprocessing such as registration, normalization, and size unification, is directly input into the OCTA-Net model.
[0086] Step Two: Two-Stage Segmentation Inference. OCTA-Net employs a two-stage architecture of coarse segmentation followed by fine segmentation. First, a preliminary confidence map of blood vessels is generated using a block-based coarse segmentation module. Then, a fine segmentation module optimizes the vessel contours and details, fully exploring vascular features at different scales within the image. This model was pre-trained on the publicly available retinal OCTA dataset ROSE and demonstrates excellent recognition capabilities for small-diameter terminal blood vessels and weak-signal microvessels.
[0087] The layered fusion module employs a pixel-level weighted fusion strategy:
[0088]
[0089] in The probability map output by ECA-UNet. This is the binary mask output by the second segmentation branch. The dynamic weight coefficient α is applied to the validation set by traversing... The grid search was determined.
[0090] Experimental results show that The Dice coefficient on the validation set reaches its maximum value of 0.8989. At that time, the proportion of the second segmentation result was too high, and the recall rate of small blood vessels was too low; The first segmentation result accounted for too high a proportion, and a small number of false positive noise points appeared in the segmentation results.
[0091] To verify the advancement of this invention, ECA-UNet, it was compared with six mainstream models using the same dataset and training configuration. The comparison models included: U-Net, Attention U-Net, TransUNet-Lite, PDE-UNet, Spatial-Attention U-Net, and ResUNet.
[0092] The evaluation indicators are defined as follows:
[0093] Dice coefficient:
[0094]
[0095] IoU (Intersection over Union Ratio):
[0096]
[0097] Accuracy:
[0098]
[0099] Experimental results (mean) The standard deviation (n=3) is as follows:
[0100]
[0101] The results above show that the Dice coefficient, IoU, and accuracy of the ECA-UNet of this invention are all higher than those of all the comparison models, and the standard deviation of each index is smaller than that of most of the comparison methods, indicating that the present invention has better training stability and result reproducibility.
[0102] Furthermore, to verify the independent contributions of each improved module, an ablation experiment was designed. Using the standard U-Net as a baseline, ASPP, edge supervision, PDE constraints, and ECA modules were added sequentially.
[0103] The ablation experiment results (mean ± standard deviation, n=3) are as follows:
[0104]
[0105] The ablation experiments show that the ECA channel attention mechanism is the core contributor to the performance improvement. Introducing the ECA module alone improved the Dice coefficient by 0.0125 (to 0.8979) and the IoU by 0.0199 (to 0.8160). The performance of ECA alone is better than the combination of all modules, indicating that other modules (ASPP, edge supervision, PDE constraints) have redundancy or negative impacts when used in conjunction with ECA, possibly due to gradient conflicts or over-constraint of features.
[0106] Experiment on the fusion of small blood vessels with the whole blood vessel:
[0107] This embodiment fuses the direct transfer segmentation results (small vessel branches) from OCTA-Net with the overall vessel segmentation results from ECA-UNet. The fusion flowchart is shown below. Figure 5 As shown, the fusion method employs pixel-level weighted fusion.
[0108] The experimental results are as follows:
[0109]
[0110] The fusion method (α=0.9) achieved a slight improvement in Dice (+0.0010) and IoU (+0.0013), while ClDice was significantly improved by 0.0107 (reaching 0.8711), indicating that the weighted fusion strategy can further enhance the ability to preserve vascular topology on the basis of improving pixel-level accuracy, which is better than the single ECA-Unet.
[0111] The effect of complete blood vessel segmentation after fusion processing is as follows: Figure 6 As shown. Figure 6 The dataset includes three sets of time-series OCTA raw images (first row), representing the baseline, acute phase of vascular injury, and recovery phase, along with their corresponding binary segmentation maps (second row). Each set of images is marked with a red dashed box to indicate the same region of interest (ROI).
[0112] Comparing the segmentation output of a single model reveals that when using only ECA-UNet segmentation, newly formed fibrous microvessels in the damaged area are easily missed, and large areas of avascular blanks within the ROI deviate from the actual OCTA image. After weighted fusion in this embodiment, the previously missed small newly formed microvessels in the damaged recovery area can be completely identified and segmented, and the microvascular signals in the damaged area have a higher matching degree with the original OCTA grayscale image, which can accurately restore the microvascular network structure gradually reconstructed during the damage repair stage.
[0113] This system adopts a front-end and back-end separation architecture. The front-end is based on Vue3 and Element Plus component library, the back-end is based on FastAPI and PyTorch, and SQLite is used for data storage.
[0114] The front-end development utilizes the Vue.js 3 composite API and the Element Plus component library, leveraging the Vite build tool to efficiently construct a user interface that aligns with research usage habits. The back-end uses the FastAPI framework, whose native type annotation support and automatic API documentation generation facilitate API debugging and team collaboration. The model inference phase continues with the PyTorch framework from the training phase, ensuring seamless code reuse.
[0115] The system adopts a six-layer layered architecture design:
[0116] Front-end interaction layer: Implements pages and components based on Vue3, encapsulates network requests through Axios, and manages global state through Pinia.
[0117] Network communication layer: Based on HTTP / HTTPS protocol, cross-domain issues are resolved through CORS middleware, and Swagger is used to generate API documentation.
[0118] Backend interface layer: Provides three core interfaces: model list, segmentation inference, and weight management.
[0119] Business service layer: encapsulates three major business logics: model registration, inference core, and weight management.
[0120] Model inference layer: Loads U-Net series models based on the PyTorch inference engine to perform segmentation tasks.
[0121] Data storage layer: Inference records are stored in an SQLite database, and model weights and input / output data are stored in a file system.
[0122] The core interfaces of the backend system are as follows:
[0123] GET / : Used to check the health status of a service, allowing operations and maintenance personnel or the user to confirm whether the service is ready.
[0124] GET / api / v1 / seg / models: Returns a list of all models currently registered in the system, allowing the front-end or client to dynamically retrieve available models;
[0125] POST / api / v1 / seg / predict: Used to perform image segmentation inference tasks. When calling, you need to provide the model name (model_name) and the image file to be processed (image_file); it also supports specifying the weight version to use via the optional parameter weight_id to meet the model switching needs in different scenarios;
[0126] / api / v1 / weight / *: Provides complete management capabilities for weight files, including upload, query, and delete operations.
[0127] The predict API uses versioned paths and structured return data. The API returns standardized information such as segmentation mask image, inference time, and running device.
[0128] Furthermore, the predict interface employs a versioned path design (e.g., / api / v1 / ...) and a structured return data format. Specifically, the information returned by this interface uniformly includes standardized fields such as the segmentation mask image, the time taken for this inference (e.g., milliseconds), and the actual running device (e.g., CPU or GPU), thereby facilitating unified parsing of the returned results and monitoring of the running status by upper-layer applications.
[0129] Model Deployment and Topology Design:
[0130] The deployment topology adopts a containerized single-machine deployment model, which is divided into four parts: access layer, gateway and service layer, inference computing layer and storage layer.
[0131] Access layer: Users access the front-end container page built with Vue3, Vite and Element Plus through a browser.
[0132] Gateway and Service Layer: The front end forwards the segmented requests to the API gateway or Nginx via HTTP; after the gateway completes unified routing, it distributes the requests to the FastAPI backend service, and the backend obtains available model information from the model registry.
[0133] Inference computation layer: The inference task is scheduled to be executed on multiple PyTorch inference worker nodes through load balancing. The model submodule is responsible for loading the network structure and the corresponding weight file.
[0134] Storage layer: The SQLite database (octa.db) stores metadata such as task records, file indexes, and weight information, while the local file system stores the original image, prediction mask, and weight file.
[0135] This system can be tested for inference performance under specified hardware environments to evaluate its actual operating efficiency. Test metrics include, but are not limited to: average inference time per image, number of model parameters, backend service memory usage, processing capacity supported by a single worker, and throughput under batch inference conditions.
[0136] Specifically:
[0137] On a graphics processor (such as an RTX 4050 with 6GB of video memory), the system can measure the average inference time for a single input image with a size of 256×256 pixels.
[0138] Regarding the number of model parameters, the number of parameters for ECA-UNet and the complete model containing all modules can be counted separately.
[0139] The memory usage of the backend service during runtime, the processing capacity supported by a single worker (such as QPS), and the throughput of batch inference on a single GPU (such as batch_size=8) can all be quantitatively determined through corresponding testing methods.
[0140] Actual test data will depend on the specific hardware configuration and model implementation; this embodiment does not limit specific values.
[0141] The front-end interface is designed around the core reasoning process and auxiliary management process, and mainly includes four core pages:
[0142] Home page: As the core operation entry point of the system, it integrates functions such as model selection, image upload and preview, segmentation task execution and result visualization.
[0143] The History page summarizes the historical records and key statistics of all reasoning tasks, making it easier for researchers to review and compare segmentation results under different experimental conditions.
[0144] The FileManager page provides file filtering, previewing, and batch deletion functions to improve the efficiency of experimental sample management.
[0145] The WeightManager page supports uploading, viewing, and deleting versions of model weights, meeting the management needs of weight files at different training stages.
[0146] The system automatically scans the models directory and registers available models upon startup, eliminating the need for manual configuration. It employs a unified inference entry point, allowing inference requests from different models to be handled through a single predict interface.
[0147] Model structure and weight files are managed separately, and different versions of weights can be quickly switched using weight_id, facilitating comparison of experimental results under different training methods. Model weight files support uploading, list display, and deletion in .pth format.
[0148] The webpage system segmentation process is as follows:
[0149] First, select the target model and weight version on the system homepage; then upload the OCTA image to be segmented and preview it for confirmation; after clicking the inference button, the system calls the / api / v1 / seg / predict interface to perform segmentation inference and generate a segmentation mask; the front-end page displays the segmentation results in real time and returns the inference time, while automatically saving the task information to the history.
[0150] Researchers can review the details of segmentation tasks on the history page to compare experimental results and trace data.
[0151] The above description is merely a preferred embodiment of the present invention and does not limit the scope of the patent. Any equivalent structural transformations made based on the inventive concept of the present invention and the description and drawings, or direct or indirect applications in other related technical fields, are included within the protection scope of the present invention.
Claims
1. A blood vessel segmentation method for OCTA images based on improved U-Net and hierarchical fusion, characterized in that, The method includes: S1, Obtain the original OCTA image to be segmented and perform preprocessing; S2, input the preprocessed image into the improved U-Net model with an embedded high-efficiency channel attention module to obtain the first blood vessel segmentation result with complete main blood vessel topology; the improved U-Net model includes a four-layer encoder, a four-layer decoder and skip connections, each encoder block contains two convolutional layers and a max pooling layer, and each decoder block contains an upsampling layer and two convolutional layers. The efficient channel attention module is located at the jump connection between the encoder and decoder, and realizes local cross-channel information interaction through one-dimensional convolution with adaptively determined kernel size. The workflow of the efficient channel attention module is as follows: global average pooling is performed on the input feature map to obtain channel descriptors, one-dimensional convolution is used to generate channel weights, and after activation function, the weights are multiplied with the original input feature map channel by channel to output the recalibrated feature map. The kernel size k of the one-dimensional convolution is adaptively calculated by the number of channels C. S3, input the same preprocessed image into the pre-trained two-stage blood vessel segmentation model to perform transfer inference and obtain a second blood vessel segmentation result that can detect terminal microvessels; S4. Based on preset dynamic weighting coefficients, the first blood vessel segmentation result and the second blood vessel segmentation result are fused at the pixel level to generate the final blood vessel segmentation image.
2. The method according to claim 1, characterized in that, The preprocessing in step S1 includes: registering, normalizing, and unifying the size of the original OCTA image.
3. The method according to claim 2, characterized in that, The registration adopts an affine transformation-based registration algorithm, using mutual information as the similarity measure, and iteratively solves the spatial transformation parameters through gradient descent.
4. The method according to claim 1, characterized in that, The dual-stage vessel segmentation model described in step S3 adopts a two-level architecture of coarse segmentation and fine segmentation. First, a preliminary confidence map of the vessel is generated through the coarse segmentation module, and then the vessel contour and details are optimized using the fine segmentation module.
5. The method according to claim 1, characterized in that, In step S4, the optimal value of the dynamic weight coefficient α is determined on the validation set by traversing a grid search method of α∈{0.1,0.2,...,0.9}.
6. The method according to claim 1, characterized in that, Step S4 is followed by: performing connected component analysis on the final blood vessel segmentation image to remove discrete noise points.
7. A vessel segmentation system for OCTA images based on improved U-Net and hierarchical fusion, characterized in that, include: The data acquisition module is used to acquire the original OCTA image to be segmented; The preprocessing module is used to preprocess the original image; The first segmentation module, which embeds a pre-trained improved U-Net model, is used to segment blood vessels in the preprocessed image and generate a first blood vessel segmentation result with a complete main blood vessel topology. The improved U-Net model includes a four-layer encoder, a four-layer decoder, and skip connections. Each encoder block contains two convolutional layers and one max pooling layer, and each decoder block contains one upsampling layer and two convolutional layers. The efficient channel attention module is embedded at the skip connection between the encoder and decoder. This module achieves local cross-channel information interaction through one-dimensional convolution with adaptively determined kernel size. The workflow of the efficient channel attention module is as follows: global average pooling is performed on the input feature map to obtain channel descriptors; one-dimensional convolution is used to generate channel weights; after activation, the weights are multiplied with the original input feature map channel by channel to output the recalibrated feature map; the kernel size k of the one-dimensional convolution is adaptively calculated by the number of channels C. The second segmentation module has a pre-trained two-stage blood vessel segmentation model embedded in it. It is used to perform transfer inference on the same pre-processed image and output a second blood vessel segmentation result that can detect terminal microvessels. The layered fusion module is used to perform pixel-level weighted fusion of the first blood vessel segmentation result and the second blood vessel segmentation result based on preset dynamic weight coefficients to generate the final blood vessel segmentation image.
Citation Information
Patent Citations
Three-dimensional cortex surface segmentation method and system of OCTA image
CN114332087A
Retinal vessel segmentation method based on local features and vessel edge enhancement
CN122336270A