# Robust Miner Detection in Challenging Underground Environments: An Improved YOLOv11 Approach
## 2 Materials and Methods
### Mine Worker Detection Network Structure
#### 2.2.1 ECA Attention Mechanism  
The Efficient Channel Attention (ECA) mechanism dynamically adjusts the channel weights of input features, which empowers the network with stronger attention to key features [21]. Compared with the traditional squeeze-and-excitation mechanism, an ECA module avoids reducing the channel dimension and directly learns channel-wise attention  
Figure 2: Improved network structure diagram.  
through a one-dimensional convolution after global average pooling [22]. In a word, the key of the ECA mechanism is how to adaptively determine the size of the one-dimensional convolution kernel so that the range of local interactions between channels is equal to the dimension of the channel. Through this adaptive mechanism, the way to handle the feature automatically according to the number of feature channels can be learned on ECA; thus, effective feature learning is realized without tedious manual tuning of parameters.  
The implementation steps of the ECA module are divided as follows, as illustrated in Figure 3: The ECA module first applies global average pooling (GAP) to the input feature map of dimensions (H \(\times\) W \(\times\) C), reducing it to a feature vector of size (1 \(\times\) 1 \(\times\) C), thereby capturing the global information for each channel. Subsequently, the adaptive convolution kernel size, computed using Equation (1), is employed to capture inter-channel dependencies. Finally, the Sigmoid function, as defined in Equation (2), is used to compute the activation values of the one-dimensional convolution output, thereby generating the channel-wise attention weights.  
\[k\;=\;\psi(C)\;=\;\frac{\log_{2}C+1}{2} \tag{1}\]  
\[\text{Sigmoid}(x)\;=\;\frac{1}{e^{-x}+1} \tag{2}\]  
In YOLOv11, the ECA attention module was added above the SPPF layer of the back-bone network, enhancing the capture of significant information relevant to object detection. Because the ECA mechanism does not involve any dimensionality reduction, it can maintain more original information about features from the target objects, thus further strengthening the network for its feature representation capability [23]. In addition, one-dimensional convolution-based local interaction also allows the model to pay more attention to those important channel features that relate to object detection and adjust the receptive field adaptively, thus improving accuracy in detection and enhancing recognition capability, especially when faced with a complex background [24]. This lightweight design will greatly improve the network performance without adding too much computation cost or parameter count, hence supporting YOLOv11 in achieving high precision and efficiency.  
The specific process for adding the ECA attention mechanism is as follows. First, create an ECA.py file in the _ultralytics/nn_ folder and paste the core implementation code into it, then save the file. Next, import this module into the _init_py_ file. Finally, complete the module import and registration in the _ultralytics/nn/tasks.py_ file.