Coal mine coal flow foreign matter multi-scale detection method based on improved YOLOv8
By improving the YOLOv8 network and combining some dynamic full-dimensional convolutional modules and bidirectional feature pyramid networks, the problem of insufficient multi-scale target detection capability and feature fusion in foreign object detection in coal mines is solved, achieving high-precision and fast foreign object detection, which is suitable for underground embedded devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF MINING & TECH
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-01
AI Technical Summary
Existing foreign object detection technologies in coal mines struggle to achieve a good balance between accuracy, speed, and deployment adaptability, particularly in terms of insufficient multi-scale target detection capabilities, under-optimized feature fusion mechanisms, and significant contradictions between model complexity and deployment environment.
By employing an improved YOLOv8 network, combined with a portion of dynamic full-dimensional convolutional modules (PODConv) and a bidirectional feature pyramid network (BiFPN), the accuracy and real-time performance of multi-scale foreign object detection are enhanced through dynamic perception and cross-scale weighted fusion, making it suitable for embedded deployment in underground mines.
It significantly improves the detection accuracy and real-time performance of multi-scale foreign objects in coal flow, enhances the ability to capture features of small targets and complex-shaped foreign objects, maintains the lightweight characteristics of the model, and is suitable for deployment in downhole equipment with limited computing resources.
Smart Images

Figure CN121963087A_ABST
Abstract
Description
A Multi-Scale Detection Method for Foreign Objects in Coal Flow Based on Improved YOLOv8 Technical Field
[0001] This invention relates to the field of computer vision and pattern recognition technology, and in particular to a multi-scale detection method for foreign objects in coal mine coal flow based on an improved YOLOv8. Background Technology
[0002] In coal mine production, belt conveyors are crucial equipment for transporting coal. However, during mining and transportation, various non-coal foreign objects often appear on the conveyors, mainly including slender anchor bolts, large pieces of coal gangue, surface cracks, and various small metal parts. If these foreign objects are not detected and removed in a timely manner, they will pose a serious threat to production safety. For example, slender anchor bolts may get stuck in rollers or idlers, causing belt tearing or motor overload; large pieces of gangue can easily cause blockages at transfer points; and if surface cracks on the belt are not detected in time, they may also lead to belt breakage accidents. Therefore, achieving high-precision real-time detection of foreign objects in coal flow is an important technical prerequisite for ensuring safe production in coal mines.
[0003] Currently, foreign object detection in coal mines mainly relies on the following traditional methods:
[0004] Manual inspection: Relies on inspectors to check at regular intervals, which has problems such as high labor intensity, strong subjectivity, high missed detection rate due to visual fatigue, and poor real-time performance.
[0005] Infrared sensor monitoring: It mainly identifies metallic foreign objects by temperature difference, but it can only identify a limited range of types, is greatly affected by the environment, and has difficulty distinguishing non-metallic foreign objects with complex shapes.
[0006] Mechanical screening: It separates large foreign objects through physical screens, but it is ineffective for slender pieces, small foreign objects, and cracks, and it is easy to cause equipment wear and blockage.
[0007] The methods described above are insufficient to meet the modern coal mine's requirements for high real-time performance, high accuracy, and strong adaptability in detection.
[0008] In recent years, with the development of deep learning technology, object detection algorithms based on convolutional neural networks have been gradually applied to the field of foreign object detection in coal mines. Among them, the YOLO series of single-stage detection algorithms has become a research hotspot due to its good balance between speed and accuracy. However, when directly applying existing YOLO models to complex coal flow scenarios in underground coal mines, the following technical bottlenecks still exist:
[0009] 1. Insufficient multi-scale target detection capability: Foreign objects in coal flow scenarios vary greatly in size, ranging from large pieces of gangue to tiny cracks, and have diverse shapes. YOLO series models mostly use static convolution kernels with fixed parameters, which are difficult to adapt to the characteristics of foreign objects of different scales and postures, and are prone to missing small targets or targets with special shapes.
[0010] 2. Inadequate feature fusion mechanism: Existing models typically use path aggregation networks or traditional feature pyramids for multi-scale feature fusion. During the fusion process, simple addition or splicing operations are often used, assigning the same weight to features at different levels. This fails to fully consider the differences in the contribution of features at different resolutions to the detection results, causing shallow details to be submerged in deep semantic information, which affects the detection accuracy of small targets.
[0011] 3. The contradiction between model complexity and deployment environment is prominent: Introducing complex modules such as full-dimensional dynamic convolution to improve detection accuracy will significantly increase the amount of computation and parameters, and reduce the inference speed. However, most underground coal mine detection equipment are embedded terminals with limited computing power, which cannot support the real-time operation of high-complexity models; although existing lightweight models are fast, their feature extraction capabilities are limited, making it difficult to achieve high-precision detection in complex backgrounds.
[0012] In summary, existing coal flow foreign object detection technologies struggle to achieve a good balance between accuracy, speed, and deployment adaptability. There is an urgent need for a detection method that can enhance multi-scale feature representation capabilities, possess high computational efficiency, and be suitable for embedded deployment. To address this, this invention proposes a multi-scale coal flow foreign object detection method based on an improved YOLOv8. Through structural innovation and module optimization, it achieves a simultaneous improvement in detection accuracy and inference speed. Summary of the Invention
[0013] The purpose of this invention is to overcome the problems in the prior art and provide a multi-scale detection method for foreign objects in coal mine flow based on an improved YOLOv8 network. This invention proposes a structure combining a partially dynamic convolutional module (PODConv) and a bidirectional feature pyramid network (BiFPN) on the basis of a lightweight YOLOv8n network. Through dynamic perception and cross-scale weighted fusion, the detection accuracy and real-time performance of multi-scale foreign objects (such as large pieces of gangue, anchor bolts, cracks, and small foreign objects) in coal flow are significantly improved while reducing computational complexity, making it suitable for embedded deployment scenarios in underground mines.
[0014] To achieve the aforementioned objectives, the present invention employs the following technical solution: a multi-scale detection method for foreign objects in coal mine flow based on an improved YOLOv8, comprising the following steps:
[0015] S1 Data Acquisition and Preprocessing: Acquire real-time monitoring video streams or images of underground conveyor belt transportation scenarios in coal mines, construct an initial dataset containing multi-scale foreign objects, and perform hybrid enhancement processing on the initial dataset to form a processed dataset;
[0016] S2 Constructs an improved foreign object detection model: Construct a foreign object detection model based on an improved YOLOv8; the overall architecture of the foreign object detection model includes a backbone network, a neck network, and a detection head;
[0017] S3 Partial Dynamic Full-Dimensional Convolution Module Construction and Processing: In the backbone network, a partial dynamic full-dimensional convolution module is used to replace the standard convolutional layer in the original YOLOv8 network. The partial dynamic full-dimensional convolution module is used to extract multi-level features from the input image and output feature maps of different scales.
[0018] S4 Neck Network Bidirectional Feature Fusion: In the neck network, a bidirectional feature pyramid network is constructed to receive the multi-scale feature maps output by the backbone network and perform bidirectional cross-scale weighted feature fusion.
[0019] S5 Model Training and Inference: The foreign object detection model is iteratively trained using the processed dataset. The difference between the predicted value and the true label is calculated using the loss function, and the model weights are updated. The category and bounding box location information of the foreign object are output. The category of the foreign object includes at least gangue, coal flow cracks, anchor bolts, and metal foreign objects.
[0020] Furthermore, in step S1, the data augmentation process specifically employs a hybrid strategy combining Mosaic enhancement and Copy-Paste, as follows:
[0021] S1.1 Mosaic Enhancement: Four coal flow images are randomly selected, cropped, scaled, and stitched together to form a new training image, thereby increasing background complexity and target scale diversity.
[0022] S1.2 Copy-Paste Strategy: Target foreign object instances are segmented and copied from the source image and randomly pasted to any location in another coal flow image to increase the frequency of target foreign objects in the training samples. This hybrid enhancement strategy enriches the background and target scale distribution of the training samples, particularly increasing the frequency of small-scale foreign objects, which helps improve the model's generalization ability in complex downhole environments and its sensitivity to small targets.
[0023] Furthermore, in step S2, the foreign object detection model construction process includes:
[0024] S2.1 Backbone Network Improvement: The standard convolutional layers in the original YOLOv8n backbone are replaced with some dynamic full-dimensional convolutional modules;
[0025] S2.2 Neck Network Improvement: The original PANet structure is replaced with a bidirectional feature pyramid network;
[0026] S2.3 Detection Head: Retaining the original decoupled head structure of YOLOv8, including classification and regression branches, it directly predicts the target center and bounding box using an anchor-free mechanism. This structure enhances multi-scale feature extraction and fusion capabilities while maintaining model lightweightness, facilitating efficient and accurate target detection in computationally limited embedded devices.
[0027] Furthermore, in step S3, the construction and computation process of the partial dynamic full-dimensional convolution module includes:
[0028] S3.1 Channel Segmentation: The input feature map X is segmented into a first feature subset X_dynamic and a second feature subset X_static along the channel dimension according to a preset ratio;
[0029] S3.2 Dynamic Convolution Calculation: Perform full-dimensional dynamic convolution operation on the first feature subset X_dynamic, dynamically adjust the convolution kernel parameters through a multi-dimensional attention mechanism, extract spatial and channel features, and obtain the dynamic feature map Y_dynamic;
[0030] S3.3 Feature Preservation Shortcut: Do not perform convolution operation on the second feature subset X_static, retain the original feature information as an identity mapping, and obtain the static feature map Y_static;
[0031] S3.4 Feature concatenation: The dynamic feature map Y_dynamic and the static feature map Y_static are concatenated along the channel dimension;
[0032] S3.5 Cross-channel fusion: Perform 1×1 pointwise convolution on the stitched feature map to fuse cross-channel information and adjust the number of output channels to obtain the final output feature map. This module combines dynamic perception and static preservation mechanisms to effectively control computational complexity while enhancing feature representation capabilities, making it suitable for differential extraction of multi-scale foreign object features.
[0033] Further, in step S3.2, the operation of the full-dimensional dynamic convolution includes:
[0034] S3.2.1 Attention Weight Generation: The input features are processed by global average pooling and fully connected layers to generate four sets of attention scalars in parallel, namely: spatial location attention. Input channel attention Output channel attention and the number of convolution kernels and attention ;
[0035] S3.2.2 Dynamic kernel generation: The four sets of attention scalars are multiplied element-wise with the static convolution kernel to generate a dynamic convolution kernel that adapts to the current input. The specific formula is as follows;
[0036] , where n is the number of basic convolutional kernels;
[0037] S3.2.3 Convolution Operation: The first feature subset X_dynamic is convolved using the dynamic convolution kernel to capture the multi-scale and posture change features of coal flow foreign objects. The convolution kernel is dynamically generated through a multi-dimensional attention mechanism, enhancing the model's adaptive perception capability of foreign object morphology and scale, and improving the recognition accuracy of multiple targets in complex backgrounds.
[0038] Further, in step S3.2, the preset ratio of channel segmentation is determined by the divide-and-conquer factor g, where the number of channels in the first feature subset participating in the dynamic convolution calculation is C / g, and the number of channels in the second feature subset that remains unchanged is C×(1-1 / g), where C is the total number of channels in the input feature map, g is an integer greater than 1, and × is a multiplication sign. By controlling the dynamic calculation ratio through an adjustable divide-and-conquer factor, a flexible balance between computational efficiency and feature representation capability is achieved, adapting to resource constraints under different deployment scenarios.
[0039] Furthermore, in step S4, the specific topology and fusion method of the bidirectional feature pyramid network are as follows:
[0040] S4.1 Structural optimization: Delete intermediate nodes with only one input edge and add jump connection edges that directly connect the input node to the output node at the same level to form a bidirectional cross-scale connection structure;
[0041] S4.2 Weighted Fusion: At each feature fusion node, learnable scalar weights are introduced to perform weighted summation of feature maps from different sources;
[0042] S4.3 Normalization: The weights are normalized using the Swish activation function, calculated as follows: , ,
[0043] Among them, China Let be the i-th input feature map, y be the output feature map after BiFPN fusion, and N be the number of feature maps participating in the fusion. It is the i-th feature layer currently participating in the computation. It is the j-th feature layer participating in the fusion. The value after activation by the Swish activation function To prevent division by zero, the constant is usually 10. -4 Through a weighted bidirectional feature fusion mechanism, the interaction between shallow details and deep semantic information is enhanced, thereby improving the robustness of detecting small-sized foreign objects in complex backgrounds.
[0044] Furthermore, in step S2, the detection head adopts a decoupled head structure and, based on an anchor-free mechanism, directly predicts the center point position and bounding box regression parameters of foreign objects in the coal flow. This design reduces the dependence on preset anchor frames, simplifies the model structure, and improves the positioning accuracy of irregularly shaped targets.
[0045] Furthermore, in step S5, the specific content of the model training and inference is as follows:
[0046] S5.1 Training Environment and Parameters: The experiment was conducted under the Windows 11 operating system, using the PyTorch deep learning framework. The training parameters were set as follows: SGD optimizer, initial learning rate 0.01, weight decay 0.0005, batch size 8, and training epochs 200.
[0047] S5.2, Loss function: CIoULoss is used as the bounding box regression loss, DFLLoss is used as the distribution focus loss, and BCELoss is used as the classification loss. The model parameters are updated iteratively through the backpropagation algorithm.
[0048] S5.3, Inference Detection: Input the video stream to be detected into the trained model, and the model outputs the detection results including the object category, confidence level and bounding box coordinates, and performs visualization annotation.
[0049] A computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the method described above.
[0050] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0051] This invention effectively addresses the limitations of static convolution in extracting multi-scale foreign object features by introducing a partially dynamic full-dimensional convolution module (PODConv). This module employs a channel segmentation strategy, dynamically calculating only a subset of channels. While introducing a multi-dimensional attention mechanism to enhance the perception of foreign object morphology and scale, it retains some original features to maintain computational efficiency. This design enables the model to achieve a significant improvement in detection accuracy with significantly lower parameter and computational costs compared to fully dynamic convolution schemes. It particularly enhances the feature capture capability for small targets and complex-shaped foreign objects, providing higher-quality multi-scale feature representations for subsequent fusion stages.
[0052] In the feature fusion stage, a bidirectional feature pyramid network is adopted to replace the traditional structure. Through optimized topological connections and a learnable weighted fusion mechanism, the bidirectional interaction between deep semantic information and shallow detailed features is enhanced. This structure can adaptively evaluate and fuse the contributions of feature maps at different resolutions, effectively alleviating the problem of small target detail information being submerged in traditional equal-weight fusion. Experiments show that this improvement significantly enhances the model's robustness to detecting small-sized objects with complex backgrounds, greatly improves the detection accuracy of key categories, and maintains the lightweight nature of the network structure.
[0053] Furthermore, by combining a hybrid data augmentation strategy of Mosaic and Copy-Paste, the problem of sample imbalance and few classes commonly found in coal mine foreign object datasets is specifically alleviated, enriching the diversity and complexity of training samples. Combined with an anchor-free detection mechanism and a targeted loss function design, the stability of model training and the final localization accuracy are further optimized. The entire method effectively controls model size and computational load while ensuring high accuracy, forming a complete solution that is highly accurate, fast, and suitable for deployment in underground embedded equipment, meeting the practical needs of real-time and reliable foreign object detection in coal mine safety production. Attached Figure Description
[0054] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0055] Figure 1 shows the core principle of multi-dimensional dynamic convolution.
[0056] Figure 2 shows the core principle diagram of partial dynamic convolution.
[0057] Figure 3 shows the improved YOLOv8n architecture.
[0058] Figure 4 is a flowchart of an embodiment of the present invention. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0060] This embodiment provides a multi-scale detection method for foreign objects in coal mine coal flow based on an improved YOLOv8n. The specific network structure is shown in Figure 3, and the overall process is shown in Figure 4. It mainly includes the following steps:
[0061] Step S1: Data Acquisition and Preprocessing
[0062] First, a coal flow foreign object dataset was constructed for underground coal mines. In this embodiment, a total of 1791 coal flow images containing foreign objects of different scales were collected. The foreign object categories included large pieces of gangue (1282 images), belt cracks (74 images), anchor bolts (402 images), and small foreign objects (58 images). To address the issues of imbalanced dataset samples and insufficient samples for some targets (such as small foreign objects and cracks), a hybrid data augmentation strategy was adopted:
[0063] S1.1, Mosaic Enhancement: The four training images are randomly cropped, scaled, and stitched together to form a new image, which enriches the image background and enhances the model's ability to detect small targets.
[0064] S1.2, Copy-Paste strategy: The foreign object is segmented from the source image and, after random shaking, flipping and other transformations, "pasted" to a random position in other training images. This artificially increases the frequency of small foreign objects in the training set and prevents the model from overfitting.
[0065] Finally, random affine transformation, random color enhancement, and random flipping operations are performed on the image, and the input image size is uniformly adjusted to 640×640.
[0066] Step S2: Construct an improved foreign object detection model
[0067] This invention uses YOLOv8n as the baseline model and improves the structure of its backbone network and neck network.
[0068] S2.1, Backbone Network Improvement: The standard convolutional layers in the original YOLOv8n backbone are replaced with some dynamic full-dimensional convolutional modules.
[0069] S2.2, Neck Network Improvement: The original PANet structure is replaced with a bidirectional feature pyramid network.
[0070] S2.3, Head: Maintains the original decoupled head structure of YOLOv8, including classification and regression branches, and uses an anchorless mechanism to directly predict the target center and bounding box.
[0071] Step S3: Construction and processing of partial dynamic full-dimensional convolution modules
[0072] To balance feature extraction capability and computational efficiency, this invention designs a partially dynamic full-dimensional convolution module. As shown in Figure 2, the specific processing procedure is as follows:
[0073] S3.1, Channel Segmentation: Assume the number of channels in the input feature map is C, and set the divide-and-conquer factor g. Divide the input feature map into two parts in the channel dimension: the number of sub-feature channels participating in the dynamic calculation in the first part is C / g, and the number of sub-feature channels remaining unchanged in the second part is C×(1-1 / g).
[0074] S3.2, Dynamic Convolution Branch: Perform full-dimensional dynamic convolution on the first part of the channel features. Full-dimensional dynamic convolution introduces a parallel multi-dimensional attention mechanism, as shown in Figure 1. Four sets of attention weights are calculated through global average pooling and fully connected layers: spatial attention... Input channel attention Output channel attention and convolution kernel attention These four sets of weights are multiplied element-wise with the static convolution kernel to generate a dynamic convolution kernel, which is then used to convolve the input features. This process can capture the spatial details and channel features of foreign objects from all angles.
[0075] S3.3, Shortcut Branch: No convolution operation is performed on the second part of the channel features; they are directly retained, similar to the identity mapping in residual connections, to reduce redundant computation.
[0076] S3.4, Feature Fusion: The features processed by the full-dimensional dynamic convolution module are concatenated with the retained features in the channel dimension, and cross-channel information is fused through a 1×1 pointwise convolution to output the final feature map.
[0077] Step S4: Feature fusion of the bidirectional feature pyramid network
[0078] In the neck network, to address the issue of information loss during feature fusion for multi-scale targets, especially micro-cracks and small foreign objects, a bidirectional feature pyramid network structure is employed. The specific fusion mechanism is as follows:
[0079] S4.1, Topology optimization: Remove intermediate nodes with only one input edge, and add jump connections directly from the input node to the output node to achieve bidirectional cross-scale flow of high-level semantic features and shallow detail features.
[0080] S4.2, Weighted Feature Fusion: Unlike the simple addition of traditional fully connected layers, the bidirectional feature pyramid network structure introduces learnable weights for each input feature. At the feature fusion node, the weights are normalized using the Swish activation function.
[0081] Step S5: Model Training and Inference
[0082] S5.1 Training Environment and Parameters: The experiment was conducted on a Windows 11 operating system using the PyTorch deep learning framework. The hardware configuration consisted of an Intel Core i7-10750H CPU and an NVIDIA GeForce RTX 2060 Max-Q GPU. The training parameters were set as follows: SGD optimizer, initial learning rate 0.01, weight decay 0.0005, batch size of 8, and 200 training epochs.
[0083] S5.2, Loss Function: CIoULoss is used as the bounding box regression loss, DFLLoss as the distribution focus loss, and BCELoss as the classification loss. The model parameters are updated iteratively through the backpropagation algorithm.
[0084] S5.3, Inference Detection: Input the video stream to be detected into the trained model. The model outputs the detection results, which include the category of foreign object (coal block, crack, anchor bolt, small piece), confidence level and bounding box coordinates, and performs visualization annotation.
[0085] To verify the effectiveness of the present invention, comparative ablation experiments were conducted on the above dataset.
[0086] Overall performance: As shown in Table 1, the BiFPN-YOLOv8n-PODConv model proposed in this invention achieves an mAP@0.5 of 0.755, which is 7.7% higher than the baseline model YOLOv8n's 0.701.
[0087] Table 1 Comparative Experiment
[0088]
[0089] Multi-scale detection performance: As shown in Table 2, in the highly challenging detection of "small piece" foreign objects, the AP value of the proposed model reached 0.535, an improvement of approximately 23.8% compared to the baseline model's 0.432; in "crack" detection, the AP value increased from 0.841 to 0.869. This fully demonstrates the synergistic advantages of BiFPN and PODConv in multi-scale feature extraction.
[0090] Table 2 Detection accuracy of the model for each category
[0091]
[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A multi-scale detection method for foreign objects in coal mine flow based on an improved YOLOv8, characterized in that, Includes the following steps: S1 Data Acquisition and Preprocessing: Acquire real-time monitoring video streams or images of underground conveyor belt transportation scenarios in coal mines, construct an initial dataset containing multi-scale foreign objects, and perform hybrid enhancement processing on the initial dataset to form a processed dataset; S2 Constructing an improved foreign object detection model: Constructing a foreign object detection model based on an improved YOLOv8; the overall architecture of the foreign object detection model includes a backbone network, a neck network, and a detection head; S3 Construction and processing of a partially dynamic full-dimensional convolutional module: In the backbone network, a partially dynamic full-dimensional convolutional module is used to replace the standard convolutional layer in the original YOLOv8 network, and the partially dynamic full-dimensional convolutional module is used to extract multi-level features from the input image, outputting feature maps of different scales; S4. Neck Network Bidirectional Feature Fusion: In the neck network, a bidirectional feature pyramid network is constructed to receive the multi-scale feature maps output by the backbone network and perform bidirectional cross-scale weighted feature fusion; S5. Model Training and Inference: The foreign object detection model is iteratively trained using the processed dataset. The difference between the predicted value and the true label is calculated through the loss function, and the model weights are updated. The category and bounding box location information of the foreign object are output; The category of the foreign object includes at least gangue, coal flow cracks, anchor bolts, and metal foreign objects.
2. The method for multi-scale detection of foreign objects in coal mine flow based on improved YOLOv8 according to claim 1, characterized in that, In step S1, the data augmentation process specifically adopts a combination of Mosaic augmentation and Copy-Paste hybrid strategy, specifically: S1.1 Mosaic augmentation: Four coal flow images are randomly selected, cropped, scaled and stitched together, and recombined into a new training image to increase background complexity and target scale diversity; S1.2 Copy-Paste strategy: Segment and copy the target foreign object instance from the source image, and randomly paste it to any position in another coal flow image to increase the frequency of the target foreign object in the training samples.
3. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 1, characterized in that, In step S2, the foreign object detection model construction process includes: S2.1 Backbone network improvement: replacing the standard convolutional layers in the original YOLOv8n backbone with a partially dynamic full-dimensional convolutional module; S2.2 Neck network improvement: replacing the original PANet structure with a bidirectional feature pyramid network; S2.3 Detection head: maintaining the original decoupled head structure of YOLOv8, including classification and regression branches, and directly predicting the target center and bounding box using an anchorless mechanism.
4. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 1, characterized in that, In step S3, the construction and calculation process of the partial dynamic full-dimensional convolution module includes: S3.1 Channel segmentation: The input feature map X is segmented into a first feature subset X_dynamic and a second feature subset X_static in the channel dimension according to a preset ratio; S3.2 Dynamic convolution calculation: Full-dimensional dynamic convolution operation is performed on the first feature subset X_dynamic, and the convolution kernel parameters are dynamically adjusted through a multi-dimensional attention mechanism to extract spatial and channel features, resulting in a dynamic feature map Y_dynamic; S3.3 Feature preservation shortcut: No convolution operation is performed on the second feature subset X_static, and the original feature information is retained as an identity mapping to obtain a static feature map Y_static; S3.4 Feature concatenation: The dynamic feature map Y_dynamic and the static feature map Y_static are concatenated in the channel dimension; S3.5 Cross-channel fusion: 1×1 pointwise convolution is performed on the concatenated feature map to fuse cross-channel information and adjust the number of output channels to obtain the final output feature map.
5. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 4, characterized in that, In step S3.2, the operation of the full-dimensional dynamic convolution includes: S3.2.1 Attention weight generation: global average pooling and fully connected layer processing are performed on the input features to generate four sets of attention scalars in parallel, namely: spatial location attention. Input channel attention Output channel attention and the number of convolution kernels and attention S3.2.2 Dynamic Kernel Generation: The four sets of attention scalars are multiplied element-wise with the static convolution kernel to generate a dynamic convolution kernel adapted to the current input. The specific formula is as follows: ; where n is the number of basic convolution kernels; S3.2.3 Convolution operation: The first feature subset X_dynamic is convolved using the dynamic convolution kernel to capture the multi-scale and posture change features of coal flow foreign objects.
6. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 4, characterized in that, In step S3.2, the preset ratio of channel segmentation is determined by the divide-and-conquer factor g, wherein the number of channels in the first feature subset participating in the dynamic convolution calculation is C / g, and the number of channels in the second feature subset that remains unchanged is C×(1-1 / g), where C is the total number of channels in the input feature map, g is an integer greater than 1, and × is a multiplication sign.
7. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 1, characterized in that, In step S4, the specific topology and fusion method of the bidirectional feature pyramid network are as follows: S4.1 Structure optimization: Delete intermediate nodes with only one input edge and add jump connection edges that directly connect the input node to the output node at the same level to form a bidirectional cross-scale connection structure; S4.2 Weighted fusion: At the feature fusion node of each level, learnable scalar weights are introduced to perform weighted summation on feature maps from different sources; S4.3 Normalization: The weights are normalized using the Swish activation function, calculated as follows: , Among them, China Let be the i-th input feature map, y be the output feature map after BiFPN fusion, and N be the number of feature maps participating in the fusion. It is the i-th feature layer currently participating in the computation. It is the j-th feature layer participating in the fusion. The value after activation by the Swish activation function To prevent division by zero of constants.
8. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 1, characterized in that, In step S2, the detection head adopts a decoupled head structure and, based on an anchorless mechanism, directly predicts the center point position of foreign objects in the coal flow and the regression parameters of the bounding box.
9. The multi-scale detection method for foreign objects in coal mine flow based on improved YOLOv8 according to claim 1, characterized in that, In step S5, the specific content of model training and inference is as follows: S5.1, Training environment and parameters: The experiment was conducted under the Windows 11 operating system, using the PyTorch deep learning framework. The training parameters were set as follows: SGD optimizer, initial learning rate 0.01, weight decay 0.0005, batch size 8, and training epochs 200; S5.2, Loss function: CIoULoss was used as the bounding box regression loss, DFLLoss as the distribution focus loss, and BCELoss as the classification loss. The model parameters were iteratively updated through the backpropagation algorithm; S5.3, Inference detection: The video stream to be detected was input into the trained model, and the model output the detection results including the foreign object category, confidence level, and bounding box coordinates, and then visualized and labeled.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.