## 3 Materials and Methods
### ShadeNet: A Novel Approach to High-Precision Shade House Extraction
#### 3.2.2 Backbone of ShadeNet: Swin Transformer
However, this modification leads to \"isolated\" patches (patches that do not belong to any window) and incomplete patches. Using the \"cyclic shifting\" technique, Swin Transformer moves the \"isolated\" patches to windows that are not yet fully repaired. Figure 8: Two successive Swin Transformer blocks. MLP represents multilayer perceptron. LN represents layer normalization. W-MSA represents window multi-head self-attention. SW-MSA represents shifted window multi-head self-attention. A Swin Transformer block consists of either a W-MSA module or a SW-MSA module, followed by a two-layer MLP with GELU nonlinearity in between. A LayerNorm (LN) layer is applied before each MSA module and each MLP, and a residual connection is applied after each module. 3.2.3. GCLSA Module: Enhancing Shade House Extraction with Global-Channel and Local-Spatial Attention  
In the task of shade house extraction, the key challenge lies in enhancing the model's ability to distinguish shade houses from similar objects, thereby reducing the misclassification rate and improving accuracy. Through comparative experiments, we found that networks based on self-attention mechanisms, compared to traditional CNNs, can effectively capture long-range dependencies and global contextual information in images. This enables the optimization of feature representations, thereby improving extraction accuracy. This result indicates that when performing shade house extraction, the model's ability to relate contextual information is crucial for accurately distinguishing shade houses. Building on this insight, further analysis of the images revealed that the objects surrounding shade houses typically consist of simple backgrounds such as farmland or bare soil, while similar objects, such as dark water bodies, roads, or building shadows, are usually surrounded by dense buildings or roads in more complex urban environments. Therefore, by further enhancing the model's ability to learn global contextual information, it could, upon identifying the \"black rectangles\", discern whether the surrounding environment consists of farmland, thus determining whether the target is a shade house. This could effectively reduce misclassification and improve extraction accuracy. Based on this, we designed a Global-Channel and Local-Spatial Attention (GCLSA) Module (Figure 9), which aims to strengthen the model's ability to capture global contextual information, especially in complex backgrounds. This module combines channel and spatial attention mechanisms to optimize the weighted distribution of feature maps, enabling the model to focus more accurately on the target region and relate it to the background environment, thus improving the precision of shade house extraction. Global-Channel Attention Submodule: The relationship between channels is crucial for capturing global information. Without considering the inter-channel dependencies, the model may fail to fully leverage all the information in the feature map, leading to the insufficient capture of global features. To enhance the inter-channel dependencies, we employed multi-layer perceptron (MLP) in the channel attention submodule. By utilizing MLP for channel attention, redundant information between channels can be reduced, and important features can be emphasized. First, the input feature map's dimensions are permuted, changing from C \(\times\) H \(\times\) W to W \(\times\) H \(\times\) C, so that the channel dimension is moved to the last dimension. Then, two MLP layers are applied: the first layer reduces the  
Figure 9: The structure of the GCLSA module. number of channels to 1/4 of the original, introducing non-linearity via a ReLU activation function, and the second layer restores the channel number to its original dimension. This process facilitates better capture of global dependencies between channels. Next, the Sigmoid activation function was applied to generate the channel attention map.