# WAID: A Large-Scale Dataset for Wildlife Detection with Drones
## 3 Methods
### Improved YOLOv7 Model Based on Attention Mechanism  
#### 3.2.1 SEBlock Module  
[PERSON] et al. [77] proposed the SE-Net (Squeeze-and-Excitation Network) in 2017, which is a model that incorporates an attention mechanism in the channel-wise dimension to enhance the network's representational power by simulating the interdependencies between convolutional feature channels [78]. The SENet introduces the Squeeze-and-Excitation (SE) module, aiming to allocate different weights to each feature map to enable the network to focus on more useful features. The design of the SE module is illustrated in Figure 4.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Class** & **Sheep** & **Cattle** & **Seal** & **Camelus** & **Zebra** & **Kiang** \\ \hline Training & 3602 & 3301 & 2709 & 512 & 443 & 551 \\ Validation & 349 & 943 & 330 & 149 & 126 & 157 \\ Testing & 173 & 471 & 329 & 82 & 65 & 74 \\ Total & 4124 & 4715 & 3368 & 743 & 643 & 782 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The numbers of wildlife in different classes used for training, validation, and testing for each class in the WAID dataset.  
The SE module begins with a Squeeze operation on the feature map obtained from convolutional layers. It employs global average pooling (GAP) to compress spatial information (\(H\times W\)) from each channel into a single-channel representation. The algorithm is as follows:  
\[Z_{C}=F_{sq}(U_{c})=\frac{1}{W\times H}\sum_{i=1}^{W}\sum_{i=1}^{H}U_{c}(i\,,j). \tag{1}\]  
Here, \(U_{c}\) represents the input feature map, \(U_{c}\in R^{H\times W\times C}\), where \(R\) denotes the feature map dimension, \(C\) is the number of channels in \(U_{c}\), and \(H\) and \(W\) represent the height and width of \(U_{c}\), respectively. \(F_{sq}(U_{c})\) represents the compression operation, and \(Z_{C}\) represents the resulting \(1\times 1\times C\)-dimensional vector obtained from compressing \(U_{c}\).  
Subsequently, a global feature Excitation operation is performed. This involves two fully connected layers (fully connected) to further compress and reconstruct the features. The first fully connected layer is for dimension reduction (\(w_{1}\)), followed by a ReLU activation function for non-linear transformation, and finally, another fully connected layer (\(w_{2}\)) to restore the features to their original dimension. This process generates distinct weights for each feature channel, capturing the relationships between different channels. The algorithm is as follows:  
\[S_{C}=F_{ex}(Z_{C},\ w_{2})=\delta(w_{2}\sigma(w_{1}Z_{C})) \tag{2}\]  
\[\sigma(x)=\frac{1}{1+e^{-x}} \tag{3}\]  
where \(F_{ex}(z_{C},\ w_{2})\) represents the Excitation operation, \(\sigma\) and \(\delta\) denote the ReLU and Sigmoid activation functions, respectively, and \(S_{C}\) represents the attention weight information obtained by applying the ReLU and Sigmoid activations to the channel feature vector \(Z_{C}\), resulting in a \(1\times 1\times C\)-dimensional vector.  
Finally, the \(S_{C}\) is multiplied element-wise with the original feature map to obtain the enhanced feature map. The algorithm is as follows:  
\[\bar{X}_{c}=F_{scale}(U_{c},\ S_{C})=U_{C}\times S_{C}. \tag{4}\]  
Here, \(F_{scale}(U_{c},\ S_{C})\) denotes the reconstruction operation and \(\bar{X}_{c}\) represents the reconstructed feature map after the scaling operation.