Retinal vessel segmentation method and system based on discrete binary particle swarm optimization automatical encoding-decoding network

By optimizing the U-shaped neural network structure using the discrete binary particle swarm optimization algorithm and combining it with the feature pyramid attention module and attention mechanism, the stability and computational resource consumption issues of the NSMD-NAS model are resolved, achieving efficient retinal vessel segmentation that is suitable for clinical practice.

CN120598971BActive Publication Date: 2026-05-12UESTC (SHENZHEN) ADVANCED RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UESTC (SHENZHEN) ADVANCED RES INST
Filing Date
2025-06-06
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing NSMD-NAS models suffer from instability in the optimization process, insufficient adaptability for real-time applications, and model complexity issues in retinal vessel segmentation, resulting in low stability and efficiency in clinical applications.

Method used

The Discrete Binary Particle Swarm Optimization (DPSO) algorithm is used to automatically search and optimize the U-shaped neural network structure. Combined with the feature pyramid attention module and lightweight design, the network architecture is optimized through the encoding strategy. ECA-Net and CBAM attention mechanisms are introduced to improve the segmentation accuracy and efficiency of the model.

Benefits of technology

It achieves high precision and efficiency in retinal vessel segmentation, adapts to different computing resource environments, and enhances the real-time application value of the model in clinical diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120598971B_ABST
    Figure CN120598971B_ABST
Patent Text Reader

Abstract

The application discloses a retinal blood vessel segmentation method and system based on an automatic coding-decoding network of a discrete binary particle swarm optimization, and the segmentation method comprises the following steps: constructing a retinal blood vessel dataset; acquiring a lightweight U-shaped neural network model; acquiring an optimal U-shaped neural network model; and acquiring a segmentation result of a retinal blood vessel image through the optimal U-shaped neural network model. The discrete binary particle swarm optimization algorithm is used to automatically search and optimize the neural network structure, so that the network architecture can be automatically adjusted according to the task requirements, and meanwhile, the FPN Attention Block is introduced, the attention mechanism of the ECA-Net and the CBAM is combined, the attention mechanism is flexibly configured according to a selection factor, the encoder output is weighted, and then the decoder is fused, important local features can be effectively focused, and the segmentation precision of small blood vessels and complex structures is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, specifically to a method and system for retinal vessel segmentation based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization. Background Technology

[0002] An automated retinal vessel segmentation method based on the NSMD-NAS (Non-Subsampled Module and Neural Architecture Search) model aims to improve the efficiency and accuracy of diabetic retinopathy (DR) screening. This method combines multi-scale, multi-frequency, and multi-directional feature extraction. It constructs feature extraction layers using non-subsampled filters (NSMD) and convolutional and Transformer modules, automatically optimizing the network structure to adapt to the complex structure of retinal images. Specifically, the model optimizes 14 key parameters, such as convolutional layer type, number of filters, and pooling method, using a fixed-length genotype encoding strategy. It then uses a genetic evolutionary algorithm (GA) to search for the most adaptive network structure to obtain the optimal network structure, thereby achieving more accurate vessel segmentation, especially with strong capabilities in handling small vessels and complex backgrounds.

[0003] In the model structure, the NSMD module is fused with a CNN (Convolutional Neural Network) to extract boundary information at different scales, frequencies, and orientations. Normalization ensures the stability of features before they are input into the network. Combining the TUnet base network and multi-head attention mechanism further enhances the modeling ability for both local and global information. Experimental results show that the proposed NSMD-NAS model outperforms other popular retinal vessel segmentation models on the DRIVE, STARE, and CHASE_DB1 datasets, especially in terms of segmentation accuracy for small vessels and complex regions, and exhibits strong robustness and generalization ability.

[0004] However, existing NSMD-NAS models have the following shortcomings:

[0005] 1. Stability of the optimization process

[0006] Genetic algorithms (GA) are optimization methods based on natural selection, and their search process is highly stochastic. GA generates multiple candidate solutions through selection, crossover, and mutation operations, and evaluates them based on fitness. However, the optimization results of GA often depend on the diversity of the initial population and the setting of search parameters. Different initialization methods may lead the optimization process in different directions, or even get stuck in local optima. The model may exhibit different performances in different experiments, resulting in a certain degree of uncertainty in the final network architecture, which poses a challenge to the stability and consistency requirements of clinical applications.

[0007] 2. Adaptability of real-time applications

[0008] The NSMD-NAS model, due to its complex architecture and parameter optimization process, requires significant computational resources. Rapid feedback and real-time processing are crucial for practical clinical diagnosis. While the model achieves high accuracy during training, the inference phase (i.e., image segmentation in real-world use) can still require substantial computation time, especially on devices with limited hardware resources. Slow inference speeds may prevent the model from providing real-time or rapid results in clinical practice, diminishing its practical value as an auxiliary tool.

[0009] 3. Model Complexity

[0010] The NSMD-NAS model combines multiple complex modules, such as the Non-Subsampling Module (NSMD), convolutional layers, and Transformer modules. These modules are nested and work together, increasing the number of parameters and layers in the network. Furthermore, the use of genetic algorithms (GA) in network architecture search further increases the model's complexity. The design and optimization of each module requires consideration of multiple factors, such as multi-scale, multi-frequency, and multi-directional information fusion, making the overall network architecture extremely complex. This highly complex model structure not only increases training time but also makes the model's inference process slower and more difficult to optimize. This complexity also increases the difficulty of parameter tuning, requiring extensive experimentation and adjustments to find the optimal network structure. In addition, the complex architecture consumes more computational resources, which may limit its application in resource-constrained environments, especially in real-time clinical diagnosis, where a balance between accuracy and computational efficiency needs to be struck. Summary of the Invention

[0011] Based on this, the purpose of this invention is to provide a method and system for retinal vessel segmentation based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization. By constructing a basic operation sequence and a network search space within a limited range, the architecture of the U-shaped neural network is gradually optimized, thereby effectively improving the accuracy and efficiency of retinal vessel segmentation.

[0012] The first aspect is a method for retinal vessel segmentation based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization, which includes the following steps:

[0013] Step S11: Construct a retinal vessel dataset and divide the retinal vessel dataset into a training set, a validation set, and a test set;

[0014] Step S12: After designing the architecture search space of the U-shaped neural network, the internal structure and spatial architecture of different modules in the U-shaped neural network are searched using the discrete binary particle swarm optimization algorithm, and the training set and validation set are used for training and validation to obtain a lightweight U-shaped neural network model.

[0015] The search space of this architecture includes a first coding region, a second coding region, and a third coding region;

[0016] The first coding region contains two binary digits to represent the number of gene layers;

[0017] The second coding region contains seven binary bits. Bits 1 to 3 are used to represent the operation gene, bits 4 and 5 are used to represent the position of the attention factor, bit 6 is used to represent the selected attention factor, and bit 7 is used to represent the residual connection gene.

[0018] The third encoding area contains six binary bits. The first bit is used to represent the connection relationship between intermediate nodes (n1, n2), the second and third bits are used to represent the connection relationship between intermediate nodes (n1, n3) and (n2, n3), and the fourth, fifth and sixth bits are used to represent the connection relationship between intermediate nodes (n1, n4), (n2, n4) and (n3, n4).

[0019] Step S13: Test the performance of the lightweight U-shaped neural network model using a test set to obtain the optimal U-shaped neural network model;

[0020] Step S14: The input retinal vessel image is segmented using the optimal U-shaped neural network model, and the segmentation result of the retinal vessel image is displayed.

[0021] Preferably, in step S12, "00" in the first encoding area represents the second layer, "01" represents the third layer, "10" represents the fourth layer, and "11" represents the fifth layer.

[0022] 3. The retinal vessel segmentation method based on the automated encoder-decoder network optimized by discrete binary particle swarm optimization, characterized in that, in step S12, in the first to third bits of the second coding region, "000" indicates the basic operation sequence as "3x3 convolution + ReLU activation function", "001" indicates the basic operation sequence as "3x3 convolution + batch normalization (BN) + ReLU activation function", "010" indicates the basic operation sequence as "ReLU activation function + 3x3 convolution", and "011" indicates the basic operation sequence as "3x3 convolution + batch normalization (BN) + ReLU activation function". The sequence is: Batch Normalization (BN) + ReLU activation function + 3x3 convolution. "100" indicates the basic operation sequence is "3x3 convolution + instance normalization (IN) + ReLU activation function", "101" indicates the basic operation sequence is "3x3 convolution + instance normalization (IN) + Mish activation function", "110" indicates the basic operation sequence is "instance normalization (IN) + ReLU activation function + 3x3 convolution", and "111" indicates the basic operation sequence is "instance normalization (IN) + Mish activation function + 3x3 convolution". The number of convolution kernels is 10.

[0023] In the 4th and 5th positions, "00" represents the intermediate node n1, "01" represents the intermediate node n2, "10" represents the intermediate node n3, and "11" represents the intermediate node n4.

[0024] The 6th position, "0" indicates that CBAM is used as the attention mechanism, and "1" indicates that ECA-Net is used as the attention mechanism;

[0025] In the 7th position, "0" indicates that residual join was not used, and "1" indicates that residual join was used.

[0026] Preferably, in step S12, in the third encoding area, "0" in each binary number indicates that there is no connection between the two intermediate nodes, and "1" indicates that there is a connection between the two intermediate nodes.

[0027] Preferably, a feature pyramid attention module is used between the encoder output and decoder input of the U-shaped neural network to enhance the network's ability to fuse global and local features. This specifically includes the following steps:

[0028] A pyramid feature network is used to extract feature maps of different scales from the input feature map, and the feature maps of different scales are upsampled for the first time to adjust to the same spatial size, so that the feature maps of different scales are stitched together in the channel dimension to form a multi-scale feature map.

[0029] The multi-scale feature map is upsampled a second time to align with the input feature map in the spatial dimension, and then fused with the input feature map to obtain a fused feature map.

[0030] Convolutional layers are used to capture global semantic information in the global features of the fused feature map, while adaptive pooling layers are used to weight the local features in the fused feature map to calculate the attention weights corresponding to the global features and local features respectively.

[0031] Based on the attention weights corresponding to global and local features, the feature values ​​at each position in the input feature map are weighted to output a weighted feature map.

[0032] Preferably, the features between the encoder and decoder are fused using a bitwise addition method.

[0033] Preferably, when using the discrete binary particle swarm optimization algorithm for optimization, the first... i The speed of each particle V i The velocity and direction of the particle's movement in each dimension are defined as:

[0034]

[0035] In the formula, t For the number of iterations, w For inertial weights, It is the first i The local optimal position of each particle. G * It is the optimal position for all particles. r 1, r 2 is a random number generated from a uniform distribution U(0,1). c 1. c 2 represents the learning factor.

[0036] Secondly, a retinal vessel segmentation system based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization is provided, including:

[0037] Construct partitioning units to build the retinal vessel dataset, and divide the retinal vessel dataset into training set, validation set and test set;

[0038] The training and validation unit is used to search the internal structure and spatial architecture of different modules in the U-shaped neural network after the architecture search space of the U-shaped neural network is designed. The training and validation sets are used for training and validation to obtain a lightweight U-shaped neural network model.

[0039] The search space of this architecture includes a first coding region, a second coding region, and a third coding region;

[0040] The first coding region contains two binary digits to represent the number of gene layers;

[0041] The second coding region contains seven binary bits. Bits 1 to 3 are used to represent the operation gene, bits 4 and 5 are used to represent the position of the attention factor, bit 6 is used to represent the selected attention factor, and bit 7 is used to represent the residual connection gene.

[0042] The third encoding area contains six binary bits. The first bit is used to represent the connection relationship between intermediate nodes (n1, n2), the second and third bits are used to represent the connection relationship between intermediate nodes (n1, n3) and (n2, n3), and the fourth, fifth and sixth bits are used to represent the connection relationship between intermediate nodes (n1, n4), (n2, n4) and (n3, n4).

[0043] The test unit is used to test the performance of the lightweight U-shaped neural network model through a test set in order to obtain the optimal U-shaped neural network model.

[0044] The segmentation unit is used to segment the input retinal vessel image using an optimal U-shaped neural network model and display the segmentation results of the retinal vessel image.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0046] This invention utilizes the Discrete Binary Particle Swarm Optimization (DPSO) algorithm to automatically search for and optimize neural network structures, enabling the network architecture to automatically adjust according to task requirements. The DPSO algorithm, through its efficient particle swarm optimization process, can quickly find the optimal structure with limited computational resources, thus achieving efficient network architecture design. Compared to traditional manual design, this invention not only reduces human intervention but also improves the accuracy and efficiency of network architecture design.

[0047] This invention introduces the FPN Attention Block, combining attention mechanisms such as ECA-Net and CBAM, and flexibly configuring the attention mechanism based on selection factors. By weighting the encoder output before fusing it with the decoder, it can effectively focus on important local features, improving the segmentation accuracy of small blood vessels and complex structures. Compared with traditional methods, this design significantly enhances the model's sensitivity to key regions, effectively improving segmentation accuracy. Attached Figure Description

[0048] Figure 1 This is a diagram showing the correspondence between the encoding strategy and the network structure in this invention;

[0049] Figure 2 This is a schematic diagram of the feature pyramid attention module in this invention;

[0050] Figure 3 This is an example diagram of the internal node connection encoding method in this invention;

[0051] Figure 4 This is a flowchart of the Discrete Binary Particle Swarm Optimization (DPSO) algorithm in this invention.

[0052] Figure 5 This is a schematic diagram of the network search framework and the factor gene sequences inside its modules in this invention.

[0053] Figure 6 The visualization results show the comparison between the method of this invention and other methods on the DRIVE dataset;

[0054] Figure 7 Visualization results of comparative experiments between the method of this invention and other methods on the CHASE_DB1 dataset;

[0055] Figure 8 This is a structural block diagram of the segmentation system of the present invention.

[0056] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0057] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.

[0058] Please see Figure 1 An embodiment of the present invention provides a method for retinal vessel segmentation based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization, comprising the following steps:

[0059] Step S11: Construct a retinal vessel dataset and divide the retinal vessel dataset into a training set, a validation set, and a test set;

[0060] It should be noted that the experimental data for this invention are from a wide range of targeted sources, covering two publicly available datasets: DRIVE and CHASE_DB1. These datasets provide a rich variety of samples for the experiments, strongly supporting a comprehensive evaluation of the model's performance.

[0061] The DRIVE dataset (Digital Retinal Images for Vessel Extraction), released by the Netherlands Eye Institute, is a standardized dataset focused on retinal vessel segmentation. It holds significant research value and has a broad application base in the field of ophthalmic medical image analysis. This dataset was initially used to evaluate the performance of automated vessel segmentation algorithms, particularly in the early screening and diagnosis of chronic eye diseases such as diabetic retinopathy. Changes in the morphology and structure of blood vessels are often key pathological features; therefore, accurate vessel segmentation is crucial for clinical auxiliary diagnosis and pathological analysis. The DRIVE dataset contains 40 high-quality color fundus images, each with a resolution of 584×565 pixels. These images are clear, rich in detail, and fully represent the texture and structure of retinal vessels. More importantly, each image is accompanied by a binary mask of blood vessels manually annotated by professional ophthalmologists, serving as a precise reference standard for vessel regions. These high-quality human-labeled images not only provide a reliable training basis for supervised learning methods but also provide a unified benchmark for comparing model performance during the evaluation phase.

[0062] The CHASE_DB1 dataset is a medical image dataset focused on retinal vascular analysis in children, providing valuable reference for early diagnosis of ophthalmic diseases and research on children's visual health. Compared to other common adult retinal datasets, CHASE_DB1 is unique in that it focuses on children, making it irreplaceable in studying pediatric retinal development and diagnosing pediatric eye diseases. Because the vascular structure of the retina differs from that of adults in morphology, distribution, and scale, this high-quality dataset specifically designed for this population provides essential data support for developing more adaptive medical image analysis algorithms. The dataset contains 28 high-resolution color fundus images, each 960×999 pixels in size, rich in detail, clearly showing the fine branching structures of retinal vessels, meeting the needs for in-depth analysis of local vascular features. Each image is accompanied by expert-annotated vascular masks, providing authoritative labeling for vascular segmentation tasks in supervised learning methods. Professional medical equipment was used during image acquisition, ensuring image clarity and consistency, providing a solid input foundation for algorithm training.

[0063] Step S12: After designing the architecture search space of the U-shaped neural network, the internal structure and spatial architecture of different modules in the U-shaped neural network are searched using the discrete binary particle swarm optimization algorithm, and the training set and validation set are used for training and validation to obtain a lightweight U-shaped neural network model.

[0064] 1. Design the search space and encode the search space.

[0065] The encoding strategy of this invention, through a hierarchical design, systematically maps the global depth configuration, internal module operations, and node connection relationships of the network into binary gene sequences. This allows the particle swarm optimization algorithm to explore tens of thousands of potential architectures while maintaining structural effectiveness. The following section elaborates on the correspondence between the encoding strategy and the network structure, revealing how it controls the network size through the global architecture, defines feature processing logic through module operations, and achieves dynamic adaptation of feature flow through node connections, thereby striking a balance between performance and computational efficiency. This design not only demonstrates the decoupling and controllability of the search space but also significantly improves the model's ability to model retinal vascular topology, providing a new approach for automated network design.

[0066] This encoding strategy comprises three main parts: global architecture encoding (first encoding area), module operation encoding (second encoding area), and internal node connection encoding (third encoding area), such as... Figure 1 As shown. The global architecture encoding (2 bits) is used to control the number of skip connection layers and modules in the network, determining the overall depth and feature propagation scale; the module operation encoding (7 bits) is used to define the basic operation sequence, attention mechanism location, and residual connection state of each module, responsible for the computational logic and enhancement methods of feature processing; the internal node connection encoding (6 bits) is used to configure the feature flow path between intermediate nodes within the module, realizing the dynamic adjustment of multi-branch fusion and information interaction.

[0067] Global architecture encoding: Global architecture encoding (as shown in Table 1) plays a crucial role in the neural network architecture search system of this invention. It defines the number of skip connection layers in the U-shaped encoder-decoder network using only 2-bit binary codes, specifically the four combinations of "00", "01", "10", and "11". The determination of the number of skip connection layers directly determines the network's depth and the number of modules. From the minimum complexity configuration of "00" corresponding to 2 skip connection layers and 5 modules, to the maximum complexity architecture of "11" representing 5 skip connection layers and 11 modules, different binary encoding combinations guide the network in balancing complexity and representational capability, providing a flexible and efficient solution to adapt to diverse task requirements.

[0068] Table 1 Global Architecture Coding

[0069]

[0070] Module Operation Encoding: The rich variability of the structural search space within each encoder-decoder module (as shown in Table 2) provides ample possibilities for building high-performance network architectures. Module operation encoding, a key component, employs a unique 6-bit binary design, defining the core elements of each module. In these 5 bits, the first 2 bits define the basic operation sequence of the operation nodes within the module, the middle 2 bits focus on determining the node positions where the attention mechanism is embedded, the 5th bit represents the selected attention factor, and the 6th bit controls the residual connections (in this invention, this is represented by the input node information n of the encoder-decoder module). in Add to input node information n out Whether or not (in Chinese) is enabled.

[0071] Table 2 Encoding of Internal Space Operation Module of Encoding / Decoding Module

[0072]

[0073] It should be noted that this invention employs gene representation to encode the neural network architecture, enabling the search for lightweight neural network structures. This encoding process uses 3-bit binary numbers to represent the four basic operation genes designed. Each operation gene consists of three basic operations combined in a specific order: 3x3 convolution (Conv), ReLU activation function, Mish activation function, batch normalization (BN), and instance normalization (IN). By arranging and combining these operation genes, eight different operation sequences can be constructed.

[0074] Let the basic operation set of the gene be {Conv, ReLU, Mish, BN, IN}. By permuting and combining these basic operations, eight commonly used and different operation sequences are selected. For the convolution operation in each operation sequence, the number of convolution kernels C is limited to a certain range to ensure the lightweight nature of the neural network. In this invention, the number of convolution kernels C is limited to 10 to maintain the network's lightweight structure while ensuring its expressive power. In this way, a lightweight neural network architecture with strong expressive power can be searched under limited computational resources.

[0075] Table 3. Selection and Advantages of Predefined Operation Combinations

[0076]

[0077] Attention Mechanism Factor Positioning: This invention employs a concise and efficient encoding strategy to introduce attention factors in each module. Specifically, only one attention factor is allowed within a module, and its position is represented by binary encoding. The length of this position encoding is related to the number N of basic operation factors, determining the number of attention factors that can be supported within the module. To optimize the internal structure of the module, this method uses 2-bit binary numbers to represent the position of the attention factor. Let this position encoding be p, where p∈{0,1,2,3}, meaning that 2 bits can represent 4 different positional information. Specifically, the value range of the position encoding p is 00, 01, 10, 11, corresponding to the four different positions within the module. This design allows for flexible positioning of attention factors within each module, thus providing flexibility for the weighting and adjustment of features within the module. Through this compact binary encoding method, the system can efficiently manage attention factors in each module and achieve precise structural control. This encoding strategy ensures the optimization of the internal structure and functional flexibility of the module, further enhancing the model's adaptability and accuracy in feature extraction.

[0078] Attention Mechanism Factor Selection: In this invention, the attention mechanism factor is determined by the 6th binary bit. This invention introduces two different attention mechanisms: ECA-Net (Efficient Channel Attention) and CBAM (Convolutional Block Attention Module). To enable flexible selection of the attention mechanism, a binary selection factor α∈{0,1} is designed to specify which attention mechanism to use.

[0079] Specifically, when the selection factor α=0, CBAM is selected as the attention mechanism; while when α=1, ECA-Net is selected as the attention mechanism. This selection factor α controls the configuration of the attention mechanism, allowing the model to flexibly switch between the two mechanisms according to task requirements and data characteristics.

[0080]

[0081] Here, X is the input feature map, and ECA and CBAM represent two different attention mechanism operations, respectively. Through this selective design, the model can flexibly configure the attention mechanism according to the needs of specific tasks, thereby optimizing feature representation and enhancing the model's adaptability to different application scenarios.

[0082] Residual Connection Gene: In this invention, the residual connection gene is determined by the 7th binary digit, which controls whether the module introduces residual connections. Let the module's input be X and its output be Y. If the 7th binary digit... r=1, then the module introduces a residual connection; if r If the value is 0, then no residual connection is introduced.

[0083] The mathematical expression for residual connectivity is:

[0084]

[0085] in, f (X) represents the computational operation within the module, where X is the input feature map of the module and Y is the output feature map of the module. r It is the value of the 7th binary gene. When r When = 1, residual connection is enabled, meaning the input X is added to the module's output f(X); when r When =0, residual connections are disabled, and the output is only... f (X).

[0086] This design allows residual connections to be introduced into certain modules of the network, thereby enhancing the stability of feature propagation, mitigating the vanishing gradient problem, and improving the training efficiency and performance of the network.

[0087] Skip Connections: In practical applications, the design of the U-shaped network structure is not limited to a fixed number of layers, but can be flexibly adjusted according to the needs and complexity of the specific task. Let the total number of layers in the network be L, with N encoder and N decoder modules respectively. enc and N dec N can be adjusted within a certain range according to the characteristics of the task. enc and N dec This allows for flexibility in controlling the network's depth and complexity, thereby optimizing the model's expressive power and adaptability to meet the needs of different scenarios. Specifically, increasing or decreasing the number of encoder and decoder modules allows for flexible control of the network's depth and complexity.

[0088] Please see Figure 2 The skip connection in the U-shaped network structure is one of its key features, primarily aimed at enhancing information transfer between the encoder and decoder. Let the encoder output be E. i The input to the decoder is D i Based on the traditional skip connection, the encoder outputs E i It will also go through an additional FPN Attention Block (Feature Pyramid Attention Module), which further enhances the selectivity and weighting of features through a custom attention mechanism.

[0089] This attention mechanism, by introducing a pyramid feature network (FPN) and a global feature weighting mechanism, aims to significantly enhance the U-shaped neural network's ability to fuse local and global features, thereby improving its performance in handling complex tasks. Specifically, this mechanism is implemented through the following key steps:

[0090] (1) The pyramid feature network is used to extract feature maps of different scales from the input feature map, and the feature maps of different scales are upsampled for the first time to adjust to the same spatial size, so that the feature maps of different scales are spliced ​​together in the channel dimension to form a multi-scale feature map.

[0091] Specifically, the input feature map first passes through three pyramid convolutional layers, with each convolutional operation extracting feature maps at different scales. These feature maps at different scales represent information at different levels, with fine-grained local information and coarse-grained global information coexisting. This process ensures that the network can simultaneously capture detailed information and global semantic information in the image, thereby enhancing the model's expressive ability in visual tasks. To ensure effective fusion of features at different scales, all generated feature maps are upsampled to the same spatial size and then concatenated along the channel dimension to form a multi-scale feature representation.

[0092] (2) Perform a second upsampling on the multi-scale feature map to align it with the input feature map in the spatial dimension, and then fuse it with the input feature map to obtain a fused feature map;

[0093] Specifically, after obtaining the multi-scale feature maps, we perform an upsampling operation to further process this multi-scale information, aligning the concatenated feature map with the input feature map in spatial dimensions. At this point, the feature map integrates information from different scales, providing a richer feature representation. Next, we fuse the adjusted feature map with the input feature map to ensure that information from different levels is fully utilized in the network.

[0094] (3) Convolutional layers are used to capture global semantic information of global features in the fusion feature map, while adaptive pooling layers are used to weight local features in the fusion feature map to calculate the attention weights corresponding to global features and local features respectively.

[0095] Specifically, global and local features are processed by different modules, further extracted and optimized through convolutional layers and adaptive pooling layers, respectively. Convolutional layers primarily capture global semantic information, while adaptive pooling layers weight the input features based on local changes, helping the model to more flexibly focus on key regions. Through these operations, the network can calculate the attention weight for each region, thereby determining which regions' features are more important.

[0096] The attention mechanism involves weighted operations: attention weights are calculated for both processed global and local features, and these weights are applied to the input feature map in further operations. Specifically, the feature values ​​at each location in the input feature map are weighted according to the calculated weights, assigning higher weights to important features and suppressing unimportant features. Through this weighted operation, the network can effectively enhance the expression of important features and suppress irrelevant or useless features, thereby improving the model's accuracy and generalization ability.

[0097] (4) Based on the attention weights corresponding to the global and local features, the feature values ​​at each position in the input feature map are weighted to output a weighted feature map.

[0098] Specifically, after the aforementioned weighting operation, the feature map output by the network will have stronger expressive power, especially in the more accurate fusion of detailed features and global semantic information. This mechanism can effectively improve the model's ability to recognize complex backgrounds and small targets, making the network more flexible in performing tasks such as segmentation and recognition, and enabling more accurate feature extraction in key regions.

[0099] It's worth noting that FPN enhances the network's ability to focus on important regions through multi-scale pyramid feature fusion and weighted processing of global and local features. This design allows the network to accurately identify and strengthen key features when handling complex visual tasks, thereby effectively improving overall performance. The advantage of this design lies in its ability to capture information at different scales and dynamically adjust attention weights, giving the network greater flexibility and accuracy in complex tasks and making it better suited to diverse application scenarios.

[0100] Furthermore, in terms of encoder-decoder feature fusion, this invention employs an element-wise addition method to fuse features between the encoder and decoder. Let the encoder output be E. i The decoder output is D i The fusion operation obtains the fused feature by adding the elements at corresponding positions:

[0101]

[0102] This fusion operation preserves local details by adding elements one by one, while avoiding a significant increase in computational cost. This method is simple and efficient, helping to reduce the computational complexity of the model and improve its running speed while maintaining high performance.

[0103] Internal Node Connection Encoding: In this invention, the internal structure of each module can be represented by nodes and edges in graph theory. Each node represents an operation unit or sequence of operations, while edges represent the connection relationships between nodes. To represent the connection relationships between nodes within a module, we use binary encoding, where each bit represents the connection state between two nodes. Nodes are divided into two categories: default nodes and intermediate nodes. Default nodes include default input nodes and default output nodes. Default input nodes receive output data from upstream modules and pass it to each intermediate node without a preceding node. Default output nodes receive the outputs of all intermediate nodes without subsequent nodes, sum and process these output data, and then pass the processed data to the pooling layer.

[0104] Please see Figure 3 For the K intermediate nodes in the module, the connections between nodes are represented by a binary code of length K(K-1) / 2, where each pair of nodes corresponds to one bit. Specifically, the first bit represents the connection between node n1 and node n2, the next two bits represent the connections between node n1 and n3, node n2 and n3, and so on, until the last K(K-1) / 2 bits represent the connections between nodes n1, n2, ..., n. K-2 and n K-1 The connection relationship between them.

[0105] If a pair of nodes n i and n j If the corresponding bit between nodes is 1, it indicates that there is a connection between the two nodes, node n. j Will receive from node n i The output is used as part of the input. Conversely, if the corresponding bit is 0, it indicates that there is no connection between the two nodes. Finally, each node sums all its inputs and performs subsequent processing operations.

[0106] 2. Optimization Algorithm (Discrete Particle Swarm Optimization)

[0107] The Discrete Binary Particle Swarm Optimization (DPSO) algorithm is inspired by the study of bird flock foraging behavior. Bird flocks find optimal foraging locations through collective information sharing. Specifically, each bird's current position represents a possible solution, and each bird can evaluate the merits of its current position based on its fitness value and remember its own best position (local optimum). Simultaneously, the best positions of all individuals in the flock represent the optimal positions of the entire flock (global optimum). The flock's foraging activities continuously update the speed and position of each bird, ultimately leading the entire flock towards the globally optimal foraging area.

[0108] In the Discrete Binary Particle Swarm Optimization (DBO) algorithm, the velocity and position of the flock are mapped to a binary encoding space between 0s and 1s. The position of each individual particle is represented by binary bits, forming a binary vector. Through continuous iteration, the particle's velocity is updated by adjusting its binary position according to a predefined velocity-function relationship, thus achieving efficient searching of the solution space. In each iteration, the particle's velocity and position are updated based on a comparison between the local optimum and the global optimum, allowing the particle swarm to gradually approach the global optimum.

[0109] This algorithm implements particle velocity updates and position changes using discrete binary encoding, enabling the particle swarm to be optimized within a discrete search space, making it suitable for discretized optimization problems. In this way, the discrete binary particle swarm optimization algorithm can efficiently search the solution space and find the optimal binary encoding configuration after multiple iterations.

[0110] Please see Figure 4 In search space encoding, each binary bit is treated as a particle, thus mapping the entire gene sequence to a swarm of particles. Assume the swarm contains... M There are 10 particles, and the particles are in one N Find the optimal solution in a 3D space. The position of each particle is represented as... X i ∈RN, that is, the first i The coordinates of a particle in N-dimensional space.

[0111] The velocity V of each particle i i This represents its speed and direction of movement in each dimension, and is defined as:

[0112]

[0113] In the formula, t For the number of iterations, w Inertial weight (controlling the influence of a particle's current velocity on its future velocity). It is the first i The local optimal position of each particle. It is the optimal position for all particles. r 1, r 2 is a random number generated from a uniform distribution U(0,1). c 1. c 2 is the learning factor, which controls the particle's local optimal solution. and the global optimal solution The cognition.

[0114] The fitness of a particle is determined by the objective function. f ( X iThe fitness value is calculated to reflect the quality of a particle's position. After each iteration, the particle updates its position, selecting the historical position with the best fitness as the local optimum. The optimal position of the entire group is the global optimum. ,Right now:

[0115]

[0116] Next, the particle's velocity is mapped to the interval [0,1] using the Sigmoid function:

[0117]

[0118] To ensure that the particle's velocity remains within a reasonable range, preventing it from exceeding the boundary during position updates, the particle's position update finally follows this formula:

[0119]

[0120] in, X i t+1 Indicates the first i The particle in the first t The new position in +1 iterations. By repeatedly iterating the above process, the particle swarm continuously approaches the global optimum, thereby finding the optimal encoding scheme in the search space.

[0121] Step S13: Test the performance of the lightweight U-shaped neural network model using a test set to obtain the optimal U-shaped neural network model;

[0122] Step S14: The input retinal vessel image is segmented using the optimal U-shaped neural network model, and the segmentation result of the retinal vessel image is displayed.

[0123] It should be noted that, when evaluating model performance, this invention provides a series of metrics that offer a multi-dimensional standard for measurement. The following sections will provide a detailed introduction to Accuracy (ACC), Sensitivity (SEN), Specificity (SPE), F1 score (F1), Intersection over Union (IoU), and Precision.

[0124] Accuracy (ACC) is an intuitive and commonly used metric. It reflects the proportion of correctly predicted samples out of the total number of samples. The formula is: ACC = (Number of correctly predicted samples / Total number of samples) × 100%. This metric comprehensively considers the model's ability to distinguish between positive and negative samples; a higher value indicates higher prediction accuracy across the overall sample. However, when the sample class distribution is imbalanced, accuracy may give misleading results. For example, in extremely skewed datasets, even if the model mispredicts a large number of minority class samples, the accuracy may still be high if it correctly predicts the vast majority of majority class samples.

[0125] Sensitivity (SEN), also known as recall or True Positive Rate (TPR), focuses on the proportion of positive samples that the model can correctly identify when the actual samples are positive. Its calculation formula is: SEN = (Number of True Positive Cases / (Number of True Positive Cases + Number of False Negative Cases)) × 100%. In scenarios such as disease diagnosis, SEN is crucial because the goal is to detect as many individuals as possible who are actually ill (positive samples) and avoid missed diagnoses. High recall means that the model has a strong ability to capture positive samples and will not miss too many truly existing target samples.

[0126] Specificity (SPE), also known as the True Negative Rate (TNR), measures the proportion of actual negative samples that the model correctly identifies as negative. It is calculated as: SPE = (Number of True Negative Samples / (Number of True Negative Samples + Number of False Positive Samples)) × 100%. In practical applications, such as in security monitoring systems where normal behavior (negative samples) is identified, high specificity effectively reduces false alarms for normal situations. Compared to recall, specificity primarily reflects the model's ability to correctly identify negative samples, ensuring the model's accuracy when identifying non-target samples.

[0127] The F1 score (F1) is a harmonic mean metric that considers both precision and recall. Its formula is: F1 = 2 × (Precision × Recall) / (Precision + Recall). Since precision and recall can sometimes be mutually restrictive, focusing on only one metric cannot fully reflect model performance. The F1 score, by balancing these two metrics, provides a more comprehensive evaluation of the model's overall performance in predicting positive samples. A higher F1 score indicates that the model performs better in both accurately identifying positive samples and finding as many positive samples as possible, making it particularly suitable for tasks requiring a balance between accuracy and completeness.

[0128] Intersection over Union (IoU) is commonly used in object detection, image segmentation, and other fields. It measures the degree of overlap between the area of ​​the intersection (or pixel count, etc.) between the model's predicted results and the ground truth annotations, and the area of ​​their union. The formula is: IoU = (Intersection of predicted results and ground truth annotations / Union of predicted results and ground truth annotations) × 100%. A higher IoU value (closer to 1) indicates a closer match between the model's predictions and the actual situation, directly reflecting the model's accuracy in locating and segmenting target objects. It is a key performance indicator for evaluating such models.

[0129] Precision, or accuracy rate, refers to the proportion of samples that the model predicts as positive and which are actually positive out of all samples predicted as positive. The formula is: Precision = (Number of true positives / (Number of true positives + Number of false positives)) × 100%. Precision primarily focuses on the reliability of the model's positive predictions. High precision means that among the model's positive predictions, a higher proportion are true positives, indicating that the model is more accurate in identifying positive samples and effectively reduces false positives. This is crucial in scenarios where false positives are critical.

[0130] This invention employs two benchmark datasets, DRIVE and CHASE_DB1, to conduct a systematic comparative experiment on the proposed method against 11 classic and cutting-edge models in the retinal vessel segmentation task. The comparison models encompass traditional U-shaped network variants, lightweight architectures, and innovative models based on neural architecture search. Experimental results are quantitatively evaluated using multi-dimensional metrics such as ACC, SEN, SPE, F1, and IoU, comprehensively validating the model's segmentation accuracy and generalization ability. To ensure fair comparison, the hyperparameter settings of all compared models are consistent with those of the proposed method.

[0131] Comparison and verification: Please refer to Figure 5 To demonstrate the evaluation results of the network evolved by the algorithm of this invention, and to compare its performance on the DRIVE and CHASE_DB1 datasets with other advanced networks, the detailed network structure designed automatically is as follows: Figure 5 As shown.

[0132] The experimental results on the DRIVE dataset (Table 4) show that the sensitivity (SEN=0.8403) and specificity (SPE=0.9979) of the method presented in this invention are both at the current best level, surpassing the second-ranked MedUNAS ODE (SEN=0.8382) and the third-ranked UNet++ (SPE=0.9976), respectively. The F1 score (0.8299) ranks second among the comparative models, second only to MedUNAS ODE (0.8301) with 1.27M parameters. The method of this invention has only 0.09M parameters, achieving improved accuracy while maintaining lightweight characteristics. The IoU index (0.7542) is better than most comparative models, indicating its accuracy in vascular region localization. The limitations of traditional models such as UNet (F1=0.8052) and Attention UNet (F1=0.8089) in feature fusion and attention mechanisms lead to their inferior performance in the recognition of complex vascular structures.

[0133] Table 4 Comparison with other methods on the DRIVE dataset

[0134]

[0135] The experimental results on the CHASE_DB1 dataset (Table 5) further validate the robustness of the proposed method. In the retinal vessel segmentation task for children, the model leads with F1=0.8120 and SPE=0.9944. Although Genetic U-Net (F1=0.8152) and FR-UNet (F1=0.8138) have a slight advantage in F1 score, their parameter counts reach 0.93M and 1.15M respectively, which are 10 times and 13 times that of the proposed method. This comparison highlights the breakthrough balance between lightweight model and performance optimization achieved in this study. Notably, the proposed method also performs excellently in IoU (0.7436) and ACC (0.9701) metrics, indicating that its ability to identify small blood vessels in high-resolution images and its ability to suppress complex backgrounds are both leading.

[0136] Table 5 shows the comparison with other methods on the CHASE_DB1 dataset.

[0137]

[0138] Cross-dataset analysis reveals that our proposed method maintains stable performance across retinal images of different resolutions and age groups, validating its adaptability to the diversity of vascular morphology. Compared to NAS-based comparative models, our method, through a DBPSO-driven automated design framework, achieves comparable or superior segmentation accuracy while reducing the number of parameters by over 90%, fully demonstrating the synergistic advantages of modular search space and swarm intelligence optimization strategies. This lightweight characteristic is of great significance for scenarios such as real-time clinical diagnosis and the deployment of portable medical devices, providing an efficient solution for medical image analysis.

[0139] Please see Figure 6 and Figure 7 Furthermore, to intuitively verify the segmentation performance of the model in different task scenarios, this invention clearly demonstrates the advantages of its method on the DRIVE and CHASE_DB1 datasets through a visual comparison of results. Visual analysis not only intuitively presents the model's ability to recognize vascular structures but also reveals its noise suppression and detail capture characteristics in complex backgrounds. By comparing the segmentation results of different methods (such as...), Figure 6 and Figure 7 As shown in the figure, the significant advantages of this method in preserving vascular continuity, suppressing background interference, and handling small-scale features can be clearly observed. This is especially evident in the low-contrast regions of the DRIVE dataset (…). Figure 6 The model accurately captured microvascular branches missed by traditional methods (such as UNet) through the CBAM attention mechanism; in the high-resolution image of CHASE_DB1 ( Figure 7 Its dynamic feature fusion strategy effectively connects the delicate vascular network in children's retinas. These visualization results complement the quantitative indicators, jointly demonstrating the universality and efficiency of the automated network design framework in medical imaging and industrial inspection tasks.

[0140] Please see Figure 8 This invention provides a retinal vessel segmentation system based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization, comprising:

[0141] Construct partitioning units to build the retinal vessel dataset, and divide the retinal vessel dataset into training set, validation set and test set;

[0142] The training and validation unit is used to search the internal structure and spatial architecture of different modules in the U-shaped neural network after the architecture search space of the U-shaped neural network is designed. The training and validation sets are used for training and validation to obtain a lightweight U-shaped neural network model.

[0143] The search space of this architecture includes a first coding region, a second coding region, and a third coding region;

[0144] The first coding region contains two binary digits to represent the number of gene layers;

[0145] The second coding region contains seven binary bits. Bits 1 to 3 are used to represent the operation gene, bits 4 and 5 are used to represent the position of the attention factor, bit 6 is used to represent the selected attention factor, and bit 7 is used to represent the residual connection gene.

[0146] The third encoding area contains six binary bits. The first bit is used to represent the connection relationship between intermediate nodes (n1, n2), the second and third bits are used to represent the connection relationship between intermediate nodes (n1, n3) and (n2, n3), and the fourth, fifth and sixth bits are used to represent the connection relationship between intermediate nodes (n1, n4), (n2, n4) and (n3, n4).

[0147] The test unit is used to test the performance of the lightweight U-shaped neural network model through a test set in order to obtain the optimal U-shaped neural network model.

[0148] The segmentation unit is used to segment the input retinal vessel image using an optimal U-shaped neural network model and display the segmentation results of the retinal vessel image.

[0149] In summary, the beneficial effects of the present invention are as follows:

[0150] This invention utilizes the Discrete Binary Particle Swarm Optimization (DPSO) algorithm to automatically search for and optimize neural network structures, enabling the network architecture to automatically adjust according to task requirements. The DPSO algorithm, through its efficient particle swarm optimization process, can quickly find the optimal structure with limited computational resources, thus achieving efficient network architecture design. Compared to traditional manual design, this invention not only reduces human intervention but also improves the accuracy and efficiency of network architecture design.

[0151] This invention introduces the FPN Attention Block, combining attention mechanisms such as ECA-Net and CBAM, and flexibly configuring the attention mechanism based on selection factors. By weighting the encoder output before fusing it with the decoder, it can effectively focus on important local features, improving the segmentation accuracy of small blood vessels and complex structures. Compared with traditional methods, this design significantly enhances the model's sensitivity to key regions, effectively improving segmentation accuracy.

[0152] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A method for retinal vessel segmentation based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization, characterized in that, Includes the following steps: Step S11: Construct a retinal vessel dataset and divide the retinal vessel dataset into a training set, a validation set, and a test set; Step S12: After designing the architecture search space of the U-shaped neural network, the internal structure and spatial architecture of different modules in the U-shaped neural network are searched using the discrete binary particle swarm optimization algorithm, and the training set and validation set are used for training and validation to obtain a lightweight U-shaped neural network model. The search space of this architecture includes a first coding region, a second coding region, and a third coding region; The first coding region contains two binary digits to represent the number of gene layers; The second coding region contains seven binary bits. Bits 1 to 3 are used to represent the operation gene, bits 4 and 5 are used to represent the position of the attention factor, bit 6 is used to represent the selected attention factor, and bit 7 is used to represent the residual connection gene. The third encoding area contains six binary bits. The first bit is used to represent the connection relationship between intermediate nodes (n1, n2), the second and third bits are used to represent the connection relationship between intermediate nodes (n1, n3) and (n2, n3), and the fourth, fifth and sixth bits are used to represent the connection relationship between intermediate nodes (n1, n4), (n2, n4) and (n3, n4). Step S13: Test the performance of the lightweight U-shaped neural network model using a test set to obtain the optimal U-shaped neural network model; Step S14: The input retinal vessel image is segmented using the optimal U-shaped neural network model, and the segmentation result of the retinal vessel image is displayed.

2. The retinal vessel segmentation method based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization according to claim 1, characterized in that, In step S12, "00" in the first encoding area represents the second layer, "01" represents the third layer, "10" represents the fourth layer, and "11" represents the fifth layer.

3. The retinal vessel segmentation method based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization according to claim 1, characterized in that, In step S12, in the second encoding region, the first to third bits represent the following basic operation sequences: "000" indicates "3x3 convolution + ReLU activation function", "001" indicates "3x3 convolution + batch normalization (BN) + ReLU activation function", "010" indicates "ReLU activation function + 3x3 convolution", "011" indicates "batch normalization (BN) + ReLU activation function + 3x3 convolution", "100" indicates "3x3 convolution + instance normalization (IN) + ReLU activation function", "101" indicates "3x3 convolution + instance normalization (IN) + Mish activation function", "110" indicates "instance normalization (IN) + ReLU activation function + 3x3 convolution", and "111" indicates "instance normalization (IN) + Mish activation function + 3x3 convolution". The number of convolution kernels is 10. In the 4th and 5th positions, "00" represents the intermediate node n1, "01" represents the intermediate node n2, "10" represents the intermediate node n3, and "11" represents the intermediate node n4. The 6th position, "0" indicates that ECA-Net is used as the attention mechanism, and "1" indicates that CBAM is used as the attention mechanism; The 7th position, "0" indicates that no residual join was used, and "1" indicates that a residual join was used.

4. The retinal vessel segmentation method based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization according to claim 1, characterized in that, In step S12, in the third encoding area, "0" in each binary number indicates that there is no connection between the two intermediate nodes, and "1" indicates that there is a connection between the two intermediate nodes.

5. The retinal vessel segmentation method based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization according to claim 1, characterized in that, A feature pyramid attention module is used between the encoder output and decoder input of a U-shaped neural network to enhance the network's ability to fuse global and local features. This involves the following steps: A pyramid feature network is used to extract feature maps of different scales from the input feature map, and the feature maps of different scales are upsampled for the first time to adjust to the same spatial size, so that the feature maps of different scales are stitched together in the channel dimension to form a multi-scale feature map. The multi-scale feature map is upsampled a second time to align with the input feature map in the spatial dimension, and then fused with the input feature map to obtain a fused feature map. Convolutional layers are used to capture global semantic information in the global features of the fused feature map, while adaptive pooling layers are used to weight the local features in the fused feature map to calculate the attention weights corresponding to the global features and local features respectively. Based on the attention weights corresponding to global and local features, the feature values ​​at each position in the input feature map are weighted to output a weighted feature map.

6. The retinal vessel segmentation method based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization according to claim 5, characterized in that, The features between the encoder and decoder are fused using a bitwise addition method.

7. The retinal vessel segmentation method based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization according to claim 1, characterized in that, When using the discrete binary particle swarm optimization algorithm for optimization, the first... i The speed of each particle V i The velocity and direction of the particle's movement in each dimension are defined as: In the formula, t For the number of iterations, w For inertial weights, It is the first i The local optimal position of each particle. G * It is the optimal position for all particles. r 1, r 2 is a random number generated from a uniform distribution U(0,1). c 1. c 2 represents the learning factor.

8. A retinal vessel segmentation system based on an automated encoder-decoder network optimized by discrete binary particle swarm optimization, characterized in that, include: Construct partitioning units to build the retinal vessel dataset, and divide the retinal vessel dataset into training set, validation set and test set; The training and validation unit is used to search the internal structure and spatial architecture of different modules in the U-shaped neural network after the architecture search space of the U-shaped neural network is designed. The training and validation sets are used for training and validation to obtain a lightweight U-shaped neural network model. The search space of this architecture includes a first coding region, a second coding region, and a third coding region; The first coding region contains two binary digits to represent the number of gene layers; The second coding region contains seven binary bits. Bits 1 to 3 are used to represent the operation gene, bits 4 and 5 are used to represent the position of the attention factor, bit 6 is used to represent the selected attention factor, and bit 7 is used to represent the residual connection gene. The third encoding area contains six binary bits. The first bit is used to represent the connection relationship between intermediate nodes (n1, n2), the second and third bits are used to represent the connection relationship between intermediate nodes (n1, n3) and (n2, n3), and the fourth, fifth and sixth bits are used to represent the connection relationship between intermediate nodes (n1, n4), (n2, n4) and (n3, n4). The test unit is used to test the performance of the lightweight U-shaped neural network model through a test set in order to obtain the optimal U-shaped neural network model. The segmentation unit is used to segment the input retinal vessel image using an optimal U-shaped neural network model and display the segmentation results of the retinal vessel image.