Reading the state of a patient’s blood vessels through the eye has long been one of medicine’s most convenient windows into overall health. The retinal vasculature is the only place in the human body where microvascular networks can be observed noninvasively, and clinicians routinely rely on the shape, density, and branching of these vessels to track diabetic retinopathy, hypertension, and other systemic conditions. The bottleneck has always been turning photographs of the fundus into precise, pixel-level maps of the vessel tree. Manual delineation is slow, expensive, and notoriously subjective, varying from one expert to the next, which is why automatic vessel segmentation has become a cornerstone of computer-aided ophthalmic screening.
A new study from the College of Software Engineering at Xinjiang University in Urumqi, published in Frontiers in Computer Science, tackles this problem with an architecture called BGAFS-UNet. Led by Guoce Zhang, with contributions from Zhezhe Zhu and Aizimaiti Xiaokaiti, the work builds on the familiar U-Net encoder–decoder template that has dominated medical image segmentation since 2015, but re-engineers nearly every stage of the pipeline to protect the fragile structures that conventional networks tend to destroy: hair-thin capillaries, low-contrast boundaries, and long, tortuous vessel trunks that stretch across the retina.
The difficulty is well understood in the field. Fundus images suffer from uneven illumination, lesions, and cluttered backgrounds, and the vessels themselves span an enormous range of scales, from broad trunks a dozen pixels wide to capillaries barely distinguishable from noise. Standard U-Net-style models compress spatial resolution as they descend the encoder, and in doing so they routinely blur away the weakest vessel responses before the decoder ever gets a chance to recover them. Transformers can capture long-range context that convolutions miss, but their quadratic attention cost explodes on high-resolution fundus images, and naive attention can even amplify noise or soften boundaries when training data is scarce.
BGAFS-UNet responds with a coordinated set of modules rather than a single trick. At the front of the network, a Boundary Perception Module performs what the authors call attention-directed multi-path downsampling. Before resolution is reduced, channel and spatial attention maps highlight vessel structures and suppress background redundancy; the feature is then passed through three parallel downsampling paths whose outputs are combined with learned, softmax-normalized weights, alongside a residual branch that stabilizes optimization under varying illumination. The result is a downsampling step that retains substantially more thin-vessel detail than a single strided convolution.
In the encoder proper, a Lightweight Wide Gated Attention block spreads the feature channels across four complementary receptive-field branches: point-wise, local, mid-range, and global. A Dynamic Channel Allocation scheme predicts image-dependent importance scores for each branch, so a fundus image dense with fine capillaries can shift capacity toward the point-wise and local paths, while one dominated by large trunks leans on the global branch. An Adaptive Branch Fusion head then arbitrates between branches with normalized weights and a spatial gate that suppresses unreliable responses in noisy or poorly lit regions. Because the operators remain convolution-friendly, the module captures multi-scale structure without the quadratic memory cost of full self-attention.
Fusion between encoder stages is handled by a Cross-Stage Fusion module that upsamples and projects the deeper feature before concatenation, closing the semantic gap that naive skip connections leave open. The fused features are then refined by ContMix, a compact contextual mixing operator that compares each position’s query against a pooled 7×7 grid of key tokens and gathers value information from dual 5×5 and 7×7 neighborhoods. This gives the network long-range vessel continuity at a fraction of the cost of windowed or global attention. In the decoder, Attention-Guided Dynamic Sampling replaces fixed bilinear upsampling with a learnable sampling grid: multi-scale offsets are predicted at several dilation rates, bounded by a tanh constraint and a learned complexity map, so the network sharpens vessel boundaries during reconstruction without wandering in smooth background regions.
The evaluation is notably careful for a deep-learning paper. The team ran three prespecified, image-disjoint runs on the standard DRIVE, STARE, and CHASE fundus benchmarks, with partitions fixed before patch extraction and subjects kept whole in CHASE so that both eyes of one child never straddled the train–test split. Preprocessing included grayscale conversion, CLAHE contrast enhancement, gamma correction, and field-of-view masking, with training on 48×48 patches and overlap-averaged reconstruction at inference. The full model reached F1 scores of 80.61 percent on DRIVE, 76.15 percent on STARE, and 79.53 percent on CHASE, the latter the highest among methods evaluated under the identical protocol.
What distinguishes the statistical analysis is its honesty about uncertainty. Rather than pooling pixels, the authors averaged each metric over the three runs per image and applied two-sided Wilcoxon signed-rank tests across the twenty DRIVE test images, with Holm correction for multiple comparisons. After correction, BGAFS-UNet’s improvements over U-Net held for boundary F-score, the topology-sensitive clDice metric, and large-vessel Dice, but not for overall Dice or small-vessel Dice. In other words, the gains are real but specific: the architecture is demonstrably better at drawing sharp boundaries and keeping the vascular tree connected, not uniformly better at every pixel-level measure. Ablations reinforced this nuanced picture, showing that removing the ContMix module destabilized training dramatically, while components like Cross-Stage Fusion contributed only through interaction with the rest of the network rather than as standalone wins.
The efficiency story is equally candid. BGAFS-UNet uses fewer parameters than the U-Net baseline, 14.22 million versus 17.38 million, but it demands more computation: 0.281 gigaflops against 0.202, and roughly 8.4 times the per-patch latency, translating to about 4.7 seconds per full DRIVE image versus 1.2 seconds for U-Net on an RTX 5090 GPU. The authors explicitly decline to claim an unconditional efficiency advantage, framing the model instead as parameter-efficient and structure-aware. They also acknowledge that all experiments were conducted within single datasets, so generalization across acquisition devices, patient populations, and clinical settings remains unproven.
Those caveats aside, the study offers a template for how segmentation research should be reported: prespecified partitions, image-level paired statistics with correction for multiple testing, component-wise ablations, and end-to-end runtime measurements all in one place. The code and reproducibility materials are publicly available on Gitee, pinned to a fixed commit, and the datasets themselves are public. For clinicians hoping to automate retinal screening, the message is that boundary fidelity and vascular connectivity, the qualities that matter most for measuring vessel tortuosity and detecting subtle remodeling, can now be improved in a targeted, statistically defensible way, even if the price is a slower inference pipeline that future optimization work will need to address.
Subject of Research: A boundary-aware U-Net variant for retinal vessel segmentation in fundus images
Article Title: BGAFS-UNet: adaptive feature fusion via boundary guided sampling for retinal vessel segmentation
Article References: Zhang, G., Zhu, Z., & Xiaokaiti, A. (2026). BGAFS-UNet: adaptive feature fusion via boundary guided sampling for retinal vessel segmentation. Frontiers in Computer Science, 8, Article 1896171. https://doi.org/10.3389/fcomp.2026.1896171
Image Credits: AI Generated
DOI: 10.3389/fcomp.2026.1896171
Keywords: retinal vessel segmentation, BGAFS-UNet, deep learning, medical imaging, U-Net, fundus images, boundary detection, attention mechanisms, DRIVE dataset, computer vision, ophthalmology, statistical validation
