# Target Recognition of Coal and Gangue Based on Improved YOLOv5s and Spectral Technology

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Introduction to YOLOv5s Algorithm

## 3. Network Optimization

#### 3.1. Optimization of Loss Function of Intersection Union Ratio

#### 3.1.1. GIoU Loss Function

_{2}is the area of the merging area of rectangular boxes A and B (i.e., blue + red + green area), and S

_{3}is the area of the smallest rectangular box surrounding A and B (i.e., dashed box area). The loss function of YOLOv5 is:

#### 3.1.2. DIoU Loss Function

#### 3.1.3. CIoU Loss Function

#### 3.2. Optimization of Non-Maximum Suppression

_{i}, the highest score of the prediction box is represented by M and the scores of other prediction boxes are represented by B

_{i}. ε represents the NMS threshold. The use of DIoU-NMS can, to some extent, improve the detection of close objects, improve the recognition of overlapping occluded targets and avoid false detections or missed detections caused by coal or gangue being too close together.

## 4. Processing and Production of Coal Gangue Dataset

#### 4.1. Equipment and Data Collection

#### 4.2. Multi-Spectral Image

#### 4.3. Band Selection

#### 4.4. Dataset and Noise Reduction Processing

#### 4.4.1. Gaussian Filter

#### 4.4.2. Non-Local Average Denoising

## 5. Results and Discussion

#### 5.1. Ablation Experiment

#### 5.2. Comparison Diagram of Loss Function

#### 5.3. Comparison Chart of Recall Rate

#### 5.4. Detection Result

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Liu, X.; Song, G.; Jiang, B. Development history and Prospect of coal industry. Min. Saf. Environ. Prot.
**2019**, 46, 100–103+112. [Google Scholar] - Lei, S.; Xiao, X.; Zhang, M. Research on coal gangue identification method based on improved yolov3. Min. Saf. Environ. Prot.
**2021**, 48, 50–55. [Google Scholar] [CrossRef] - Hu, F.; Zhou, M.; Yan, P.; Liang, Z.; Li, M. A Bayesianoptimal convolutional neural network approach for classification of coal and gangue with multispectral imaging. Opt. Lasers Eng.
**2022**, 156, 107081. [Google Scholar] [CrossRef] - Zhang, J.; He, G.; Wang, J. Recognition accuracy of infrared image of difficult to distinguish coal gangue with liquid intervention under different mixing degrees. J. China Coal Soc.
**2022**, 47, 1370–1381. [Google Scholar] [CrossRef] - Zhang, J.; Wang, J.; He, G.; Cheng, D.; Han, X.; Fan, T. Experimental study on liquid intervention to improve the recognition efficiency of coal gangue. J. China Coal Soc.
**2021**, 46, 681–691. [Google Scholar] [CrossRef] - Wei, B.; Hu, Z.; Wang, X.; Zhao, P.; Zhao, Y.; Xiao, W. Study on spontaneous combustion law and comprehensive treatment engineering measures of coal gangue hill. Min. Saf. Environ. Prot.
**2016**, 43, 92–95. [Google Scholar] - Cao, X.; Li, Y.; Wang, P.; Wu, X. Research status and prospects of coal gangue identification methods. Ind. Mine Autom.
**2020**, 46, 38–43. [Google Scholar] [CrossRef] - Zhang, N.; Liu, C. Radiation characteristics of natural gamma-ray from coal and gangue for recognition in top coal caving. Sci. Rep.
**2018**, 8, 190. [Google Scholar] [CrossRef] - Jiang, L.; Ma, L.; Yang, K.; Xu, Z. Intelligent identification of coal gangue in fully mechanized top coal caving face based on MFCC and fd-cnn convolutional neural network. J. China Coal Soc.
**2020**, 45, 1109–1117. [Google Scholar] [CrossRef] - Xu, Z.; Lv, Z.; Wang, W.; Zhang, K.; LV, H. Machine vision recognition method and optimization of intelligent separation of coal gangue. J. China Coal Soc.
**2020**, 45, 2207–2216. [Google Scholar] [CrossRef] - Si, L.; Tan, C.; Zhu, J.; Wang, Z.; Li, J. A coal-gangue recognition method based on X-ray image and laser point cloud. Chin. J. Sci. Instrum.
**2022**, 43, 193–205. [Google Scholar] [CrossRef] - Shang, D.; Zhang, L.; Niu, Y.; Fan, X. Design and key technology analysis of coal-gangue sorting robot. Coal Sci. Technol.
**2022**, 50, 232–238. [Google Scholar] - Li, M.; Duan, Y.; Cao, X.; Liu, C.; Sun, K.; Liu, H. Image identification method and system for coal and gangue sorting robot. J. China Coal Soc.
**2020**, 45, 3636–3644. [Google Scholar] [CrossRef] - Gao, Y.; Zhang, B.; Lang, L. Coal and gangue recognition technology and implementation based on deep learning. Coal Sci. Technol.
**2021**, 49, 202–208. [Google Scholar] [CrossRef] - Guo, Y.; Wang, X.; He, L.; Liu, P. Research on coal and gangue recognition method based on TW-RN optimized CNN. Coal Sci. Technol.
**2022**, 50, 228–236. [Google Scholar] [CrossRef] - Li, R.; Li, B.; Wang, X.; Liu, T.; Li, L.; Fan, S. A Classification Method of Coal and Gangue Based on XGBoost and Visible-Near Infrared Spectroscopy. Spectrosc. Spectr. Anal.
**2022**, 42, 2947–2955. [Google Scholar] - Ding, Z.; Chang, B. Near-infrared reflectance spectrum data preprocessing method for coal gangue identification. J. Mine Autom.
**2021**, 47, 93–97. [Google Scholar] - Shen, K.; Ji, L.; Zhang, Y.; Zou, S. Coal gangue target detection based on improved yolov5s model. Ind. Mine Autom.
**2021**, 47, 107–111+118. [Google Scholar] [CrossRef] - Yan, P.; Sun, Q.; Yin, N.; Hua, L.; Shang, S.; Zhang, C. Detection of coal and gangue based on improved YOLOv5.1 which embedded scSE module. Measurement
**2022**, 188, 110530. [Google Scholar] [CrossRef] - Guo, L.; Wang, Q.; Xue, W.; Guo, J. A Small Object Detection Algorithm Based on Improved YOLOv5. J. Univ. Electron. Sci. Technol. China
**2022**, 51, 251–258. [Google Scholar] - Tan, J.; Fan, N.; Bai, B.; Tan, N.; LI, Y.; Zhao, Y. Study on the influence of Gaussian filtering on the sub-pixel matching accuracy of regular speckle images. China Meas. Test
**2022**, 48, 6–11. [Google Scholar] - Zhu, Z.; Yang, H.; Wang, L.; Zhang, W. A Non-local Means Filtering Method for SAR Images Based on Pixel Selection. Instrum. Tech. Sens.
**2020**, 9, 117–120+126. [Google Scholar]

**Figure 13.**Comparison diagram of coal gangue target detection. (

**a**) SSD network detection results. (

**b**) Original YOLOv5s network detection results. (

**c**) Improved YOLOv5s network detection results.

Noise Reduction Method | Training Duration/h | mAP |
---|---|---|

Gaussian filter | 8.5 | 0.94 |

Non-local average noise reduction | 8.0 | 0.96 |

Models | Detection Time/s | Size/M | Precision | Recall | mAP |
---|---|---|---|---|---|

SSD | 0.063 | 78.1 | 0.79 | 0.80 | 0.80 |

Original YOLOv5s | 0.045 | 14.4 | 0.85 | 0.90 | 0.86 |

Improve YOLOv5s | 0.019 | 13.6 | 0.98 | 0.98 | 0.96 |

YOLOv5s | CIoU Loss | DIoU-NMS | Precision | Recall | mAP |

__ | __ | 0.85 | 0.90 | 0.86 | |

√ | __ | 0.88 | 0.86 | 0.87 | |

__ | √ | 0.89 | 0.92 | 0.88 | |

√ | √ | 0.98 | 0.98 | 0.96 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Yan, P.; Kan, X.; Zhang, H.; Zhang, X.; Chen, F.; Li, X.
Target Recognition of Coal and Gangue Based on Improved YOLOv5s and Spectral Technology. *Sensors* **2023**, *23*, 4911.
https://doi.org/10.3390/s23104911

**AMA Style**

Yan P, Kan X, Zhang H, Zhang X, Chen F, Li X.
Target Recognition of Coal and Gangue Based on Improved YOLOv5s and Spectral Technology. *Sensors*. 2023; 23(10):4911.
https://doi.org/10.3390/s23104911

**Chicago/Turabian Style**

Yan, Pengcheng, Xuyue Kan, Heng Zhang, Xiaofei Zhang, Fengxiang Chen, and Xinyue Li.
2023. "Target Recognition of Coal and Gangue Based on Improved YOLOv5s and Spectral Technology" *Sensors* 23, no. 10: 4911.
https://doi.org/10.3390/s23104911