# Stratographic Division Method Based on the Improved YOLOv8
## 2 Materials and Methods
### YOLOv8x-CAMDP Model Introduction
#### 2.4.1 CA Attention Mechanism  
The CA attention mechanism integrates channel and spatial information, focusing on incorporating coordinate data to deepen the model's understanding of spatial relationships. By leveraging positional information to weight features, the network can concentrate more on essential features, thereby enhancing their expressiveness and prominence. This enhancement in feature representation significantly improves the accuracy of target localization and recognition [22]. The specific workings of the CA attention mechanism are as follows:  
Firstly, to capture remote spatial interactions with precise positional information, the input feature maps are subjected to global average pooling in both the height and width directions, resulting in feature maps oriented by these directions. The process is computed as follows:  
Figure 3: YOLOv8x-CAMDP network structure.  
\[Z_{c}^{h}(h)=\frac{1}{W}\sum_{0\leq i<W}x_{c}(h,i) \tag{1}\] \[Z_{c}^{w}(w)=\frac{1}{H}\sum_{0\leq j<H}x_{c}(j,w) \tag{2}\]  
Secondly, the feature maps from the global receptive field in both the width and height directions are concatenated and processed through the operation (1 \(\times\) 1 convolution, normalization, and activation) to generate feature map \(f\). The process is computed as follows:  
\[f=\delta\Big{(}F_{1}\Big{(}\Big{[}z^{h},z^{w}\Big{]}\Big{)}\Big{)} \tag{3}\]  
Next, feature map \(f\) is convolved with a 1 \(\times\) 1 convolution kernel based on its original height and width to obtain feature maps \(F_{h}\) and \(F_{w}\), with unchanged channel counts. After processing with the sigmoid activation function, attention weights \(g^{h}\) and \(g^{w}\) are obtained for the height and width directions, respectively. The process is computed as follows:  
\[g^{h}=\sigma\Big{(}F_{h}\Big{(}f^{h}\Big{)}\Big{)} \tag{4}\]  
\[g^{w}=\sigma(F_{w}(f^{w})) \tag{5}\]  
Finally, on the original feature map, a multiplication-weighted calculation is performed to obtain feature maps with attention weights in both the width and height directions. The process is computed as follows:  
\[y_{c}(i,j)=x_{c}(i,j)\times g_{c}^{h}(i)\times g_{c}^{w}(j) \tag{6}\]  
CA attention mechanisms are added to three effective feature layers output by the backbone feature extraction network, where their role is as follows:  
1. Channel relationships are learned to compute channel weights, which are applied to each pixel point in the input feature map to enhance key feature channels and optimize boundary differentiation.
2. The average pooling results in the width and height directions are merged and processed by convolution, normalization, and activation functions to capture the relationship between the width and height dimensions to enhance the identification of boundary features.
3. The feature dimensions are recovered by transposition, and attention scores are obtained with Sigmoid activation to indicate the importance of different locations. Critical boundary regions are reinforced by multiplying the original input feature map with the attention score.
4. The ability to adaptively adjust the focus of attention based on the input data without additional supervision and the ability to work effectively on images with different resolutions and aspect ratios are particularly important for capturing subtle features at the boundaries.