## 3 Algorithm Improvement
### Improved ShuffleNetv2 Network Module
#### 3.3.2 Improved ShuffleNetv2 Network Model  
Considering the speed requirement for non-coal foreign object detection by the mining inspection robot, ShuffleNetv2 0.5X is chosen as the backbone network, and improvements are made to this model. The enhanced network architecture is depicted in Figure 7. The network architecture includes Conv (standard convolution), MaxPool (max pooling), ShuffleNetv2 (max pooling), ShuffleNetv2 (max pooling), and the network architecture is depicted in Figure 8.  
Figure 6: Schematic diagram of the SimAM weight assignment. fileNetV2(1,3) (downsampling module stacked one time, basic unit module stacked three times), GlobalPool (global pooling), FC (fully connected layer), ReLU (activation function), BN (batch normalization), DWConv (depthwise separable convolution), SimAM (simple and parameter-Free attention mechanism), Concat (channel concatenation), Channel shuffle (channel shuffle module), and Channel split (channel splitting module). The specific operations are as follows:  
1. SimAM attention modules are inserted before the feature concatenation of the basic and downsample units in the ShuffleNetv2 network model. This is because the SimAM attention mechanism can effectively exploit the neurons in the downsample layer and basic unit of the ShuffleNetv2 network using an energy function and balance the weight allocation based on the importance of neurons. It assigns greater weight to important feature channels and smaller weight to less important ones, thereby enhancing the attention of the downsample unit and basic unit. In addition, including the attention mechanism SimAM after the convolutional layers is intended to prevent the network from losing significant non-coal foreign object information due to the preceding convolutional operations. It enables the network to focus more on critical features related to non-coal foreign objects, thereby enhancing the model's discriminative ability for different types of foreign objects. 2. Due to the high similarity between certain classes of non-coal foreign objects in coal blocks, such as nuts and bolts, both being deep brown or large coal pieces and coal gangue having only subtle differences in shape, it becomes challenging to distinguish them. By increasing the stacking times of the basic units, the network becomes more refined, enabling it to capture better the finer shape features that differentiate different foreign objects. This allows the network to thoroughly learn and utilize more detailed information about non-coal foreign objects. The downsampling unit of ShuffleNetv2 is denoted as shuffle-b, and the basic unit is denoted as shuffle-a. As shown in Table 1, while ensuring model lightweights, the stacking times of the downsampling unit in Stage 3 are set to 1, and the stacking times of the basic unit are increased to 9 times. The specific process of the improved YOLOv8 for non-coal foreign object image classification in a belt conveyor is as follows: Firstly, the non-coal foreign object images of the belt conveyor are subjected to data augmentation and other preprocessing operations at the input end, and the images are transformed into 224 \(\times\) 224 \(\times\) 3 and input into the  
Figure 7: Improved YOLOv8n network model. improved ShuffleNetv2 network in the backbone. Then, the images go through convolution and max-pooling operations to obtain feature maps. Through three ShuffleNetv2 network modules containing upsampling units and basic units, which further extract non-coal foreign object features with attention information, a 7\(\times\) 7 \(\times\) 192 feature map is obtained. Specifically, the upsampling units and basic units in Stage 2 and Stage 4 are stacked once and thrice, respectively, while in Stage 3, the upsampling units and basic units are stacked once and nine times. The feature extraction results are then sequentially processed through convolution operations, a global pooling layer, and fully connected layer operations before undergoing feature fusion with the neck layer.