# Boundary-Aware Transformer for Optic Cup and Disc Segmentation in Fundus Images
## 3 Proposed Method
### Proposed Architecture  
In this study, we propose a segmentation network incorporating the BAT module to more precisely delineate the boundaries between the OD and OC in fundus images. The proposed model is based on the conventional U-Net architecture but integrates the BAT module, which is specialized for boundary recognition and structural relationship learning, to enhance overall segmentation performance. Figure 5 provides a visual overview of the proposed network architecture.  
While the conventional CNN-based U-Net is effective at extracting the local features of individual objects, it has limitations in explicitly learning the structural relationships, such as inclusion and relative positioning, needed to distinguish the OC boundary located within the OD. Particularly, the boundary between the cup and disc is difficult to recognize accurately using only local features due to low color contrast and similar shapes. To address this limitation, we inserted the BAT module within the skip connections, leveraging Transformer attention to strengthen the recognition of structural relationships and boundary-focused learning.  
The overall network consists of three parts: an encoder, the BAT module, and a decoder. First, the encoder follows the convolution-based structure of U-Net, transforming the input image (\(512\times 512\times 3\)) into multi-resolution feature maps. Intermediate features extracted at each encoding stage are stored via skip connections for later use in the decoder. The intermediate feature maps extracted from the encoder are processed through the BAT module using Transformer attention. Placed within the skip connections, BAT performs attention operations that reflect the hierarchical relationship between OD and OC feature maps, enhancing information specifically relevant to boundary recognition. This allows the network to learn clearer representations of the OC boundaries contained within the OD. The refined feature maps are then passed to the decoder, which combines them with  
Figure 5: Overall architecture of the proposed segmentation network. The BAT modules are embedded into the skip connections of a U-Net backbone, with multi-scale features processed through boundary-aware attention to enhance the delineation of optic cup and disc regions.  
the corresponding skip connections to reconstruct the final segmentation output. The decoder performs repeated upsampling and convolution operations to gradually increase the spatial resolution and ultimately generates a segmentation output of size \(512\times 512\). A softmax activation function is applied at the final stage to produce the segmentation mask predicting the boundaries of the OD and OC.  
This design builds on the strength of CNNs in local feature learning while complementing it with global structural and boundary-focused information through the BAT module, enabling precise boundary delineation between the OC and OD. As a result, the proposed structure improves boundary segmentation accuracy compared to the conventional U-Net and more effectively captures the structural inclusion relationships within fundus images.