# Construction of Three-Dimensional Semantic Maps of Unstructured Lawn Scenes Based on Deep Learning
## 3 Materials and Methods
### Semantic Segmentation Module
#### 3.1.4 Attention Mechanism ECA  
In the original DeepLabv3+ model, after passing through the backbone network, the model directly enters the ASPP layer for processing, with the importance of each channel's semantic information weighted equally by default. The attention mechanism can be considered a dynamic weight adjustment process based on input features. In the visual domain, humans can extract information from areas of interest in complex scenes using the brain. Inspired by this observation, attention mechanisms have been introduced in computer vision to mimic this aspect of the human visual system. ECANet is an image attention mechanism focused on enhancing the model's attention to edge information, aiming to improve the performance of image-processing tasks. Here are some key features of ECANet:  
1. ECANet introduces a contextual attention mechanism to allow the model to better understand relationships between pixels in an image. This helps the model capture contextual information in the image more effectively. 2. By enhancing attention to edge information, ECANet improves the model's perception of details. This is crucial for many image-processing tasks such as object detection and image segmentation. 3. ECANet introduces an adaptive pooling mechanism to dynamically adjust the size of attention, enabling the model to adapt better to targets or details of different sizes. The design of ECANet aims to enhance the model's perception of important information in the image, particularly when dealing with complex images. This mechanism has demonstrated good performance in many image-processing tasks. Figure 3 provides a schematic diagram of the ECANet attention mechanism's network structure. \begin{table}
\begin{tabular}{c c c c c c} \hline
**Input** & **Network** & **t** & **c** & **n** & **s** \\ \hline \(224\times 224\times 3\) & Conv2d & - & 32 & 1 & 2 \\ \(112\times 112\times 32\) & Bottleneck & 1 & 16 & 1 & 1 \\ \(112\times 112\times 16\) & Bottleneck & 6 & 24 & 2 & 2 \\ \(56\times 56\times 24\) & Bottleneck & 6 & 32 & 3 & 2 \\ \(28\times 28\times 32\) & Bottleneck & 6 & 64 & 4 & 2 \\ \(14\times 14\times 64\) & Bottleneck & 6 & 96 & 3 & 1 \\ \(14\times 14\times 96\) & Bottleneck & 6 & 160 & 3 & 1 \\ \(7\times 7\times 160\) & Bottleneck & 6 & 320 & 1 & 2 \\ \(7\times 7\times 320\) & Conv2d \(1\times 1\) & - & 1280 & 1 & 1 \\ \(7\times 7\times 1280\) & Avgpool \(7\times 7\) & - & - & 1 & - \\ \(1\times 1\times 1280\) & Conv2d \(1\times 1\) & - & k & - & - \\ \hline \end{tabular}
\end{table} 
Table 1: MobileNetV2 network architecture. In Figure 3, \"\(k\)\" represents the optimal range for channel information interaction, which is the kernel size of the one-dimensional convolution, calculated using Formula (1). \[k=\left|\frac{\log_{2}(C)}{\gamma}+\frac{b}{\gamma}\right|_{odd} \tag{1}\]  
In Formula (1), \"C\" is the number of feature channels, and in this paper, \(\gamma\) and \(b\) are set to 2 and 1, respectively. These parameters are used to adjust the ratio between the number of channels \"C\" and the kernel size \"\(k\)\". When there are many channels, the kernel size \"\(k\)\" increases with \"C\" and vice versa when there are fewer channels. This approach enables effective interactions between different channels, promoting fusion. In the context of image semantic segmentation tasks, low-level feature maps play a crucial role as they contain the original details and texture information of the image. In the structure presented in this paper, the ECANet attention mechanism is introduced before the high-level information is fed to the ASPP and is also added to the low-level features provided to the decoding part. The inclusion of the ECA module enhances the network's ability to express local features, expands the receptive field, and facilitates the capture of more diverse feature information.