# Weak Edge Target Segmentation Network Based on Dual Attention Mechanism
## 3 Model Design and Optimization
### Edge Attention Extraction Module  
In semantic segmentation tasks, low-scale feature maps typically possess higher resolution and richer spatial information, crucial for accurate object localization and segmentation. However, many networks employing an \"encoder-decoder\" structure in the early stages often overlook the extraction and utilization of low-scale features, limiting segmentation performance. While some methods attempt to enhance the representation of low-scale features by introducing multi-path spatial pyramid pooling or large convolutional kernels, these approaches often come with high computational complexity, rendering them unsuitable for real-time segmentation tasks. On the other hand, some existing methods specifically designed for real-time semantic segmentation and low-scale feature extraction have limitations: using small-sized image inputs may introduce more low-scale information, but their training strategies are complex and impractical, and while certain structures emphasizing spatial information have achieved good segmentation results, they do not fully consider the rich edge information inherent in low-scale features. Addressing the aforementioned issues, the proposed Edge-Aware Enhancement Module (EAEM) aims to design an efficient and effective low-scale feature extraction mechanism for real-time semantic segmentation tasks. Inspired by the Laplacian operator's role in edge detection, we have devised an edge-enhancing convolution, EE-Conv, and integrated it into the construction of EAEM. The design of EE-Conv draws inspiration from the operational principles of the eight-neighbor Laplacian operator, as illustrated in Figure 3. The Laplacian operator, a second-order differential operator widely used in image processing for edge detection and enhancement, offers several significant advantages over first-order differential operators like the Sobel operator. Firstly, the Laplacian operator's response to edges is directionally invariant, exhibiting good isotropy in detecting edges in all directions uniformly, thereby avoiding the directional bias seen with first-order differential operators. Secondly, the Laplacian operator's definition includes Gaussian smoothing, effectively suppressing image noise and enhancing the robustness of edge detection. Additionally, as a second-order differential operator, the Laplacian operator is more sensitive to details and textures in images, enabling the extraction of finer and more comprehensive edge information. Figure 2: WETS-Net network architecture diagram. Compared to traditional convolution, EE-Conv introduces minimal additional computation while extracting edge information, ensuring the module's lightweight nature and real-time performance. Based on this, the EAEM module designed in this study is illustrated in Figure 4. The module comprises two paths: a main path and a sub-path. Structurally, the main path incorporates three key convolution operations. The first and third layers employ 1 \(\times\) 1 convolution, followed by ReLU and Sigmoid activation functions, respectively. The second layer utilizes EE-Conv combined with a ReLU activation function to accurately extract edge features from the feature map. Following the convolution operations of the main path, an edge attention weight matrix of size \(1\times\mathrm{H}\times\mathrm{W}\) is generated, effectively enhancing the pixel proportion of the target edge area. This weight matrix is convolved with the input image based on edge features transmitted by the sub-path to obtain the edge attention feature map, which serves as input for the final convolution layer. This design methodology effectively integrates spatial and edge information, enhancing the module's information extraction capability. Notably, the entire structure contains only one short path, utilizing 1 \(\times\) 1 convolution, which minimizes information processing time. This design incorporates a spatial attention mechanism, optimizing edge feature extraction while improving computational resource utilization efficiency.