Coal and Gangue Classification Based on Laser-Induced Breakdown Spectroscopy and Deep Learning Authors: Mengyuan Xu, Yachun Mao, Zelin Yan, Mengqi Zhang, Dong Xiao Published: 2023 ABSTRACT During the extraction and processing of coal, a large amount of solid waste, collectively known as gangue, is produced. This gangue has a low carbon content but a high ash content, accounting for approximately 15 to 20% of the total coal yield. Before coal is used, coal and gangue must be effectively separated to reduce the gangue content in the raw coal and improve the efficiency of coal utilization. This study introduces a classification method for coal and gangue based on a combination of laser-induced breakdown spectroscopy (LIBS) and deep learning. The method employs Gramian angular summation fields (GASF) to convert 1D spectral data into 2D time-series data, visualizing them as 2D images, before employing a novel deep learning model—GASF-CNN—for coal and gangue classification. GASF-CNN enhances model focus on critical features by introducing the SimAM attention mechanism, and additionally, the fusion of various levels of spectral features is achieved through the introduction of residual connectivity. GASF-CNN was trained and tested using a spectral data set containing coal and gangue. Comparative experimental results demonstrate that GASF-CNN outperforms other machine learning and deep learning models across four evaluation metrics. Specifically, it achieves 98.33, 97.06, 100, and 98.51% in the accuracy, recall, precision, and F1 score metrics, respectively, thereby achieving an accurate classification of coal and gangue. Introduction Coal gangue, a solid waste commonly found in coal generation and extraction processes, is characterized by a low carbon content and high ash content. Its main components are alumina and silica, and it also contains a variety of harmful oxides.1 As coal mining operations continue to expand, the quality of raw coal gradually declines. Utilizing the raw coal directly not only diminishes coal utilization efficiency and leads to significant resource wastage but also releases a large amount of harmful gases, contributing to environmental pollution. Efficient coal classification and treatment can remove a large proportion of gangue, significantly improving coal utilization efficiency and substantially reducing pollution during coal consumption. Achieving accurate classification of coal and gangue is a pivotal step in the modernization and transformation of intelligent coal mines and plays a positive role in harmonizing the economic, social, and ecological aspects of coal resource development. As depicted in Figure 1, two main methods can be employed for classifying coal and gangue: manual classification and automatic classification. In manual classification, the operators primarily sort coal and gangue based on color and other visual characteristics. The working conditions for manual classification are generally more strenuous and demanding, posing risks to the physical and mental well-being of the workers. This may result in diminished classification efficiency and accuracy, thus making it difficult to guarantee the quality of coal and gangue classification. Introducing automatic classification technology minimizes personnel involvement while effectively enhancing the classification efficiency. According to the use of water resources, automatic classification can be divided into two methods: wet classification and dry classification. Wet classification mainly includes hydrodynamic screen jigging classification and heavy medium classification, and these methods are widely used in the field of coal and gangue classification.2 By use of the density difference between coal and gangue, the effect of stratified separation is realized. In the wet classification process, a large amount of water resources is consumed, which may also lead to the raw coal being slurried, thus causing environmental pollution problems. Therefore, the core focus of realizing the clean and efficient classification of coal gangue is to develop the dry classification method of the coal gangue. In dry classification, different technical approaches can be used, including the wind classification method,3 based on vibration signal classification4,5 and nondestructive classification technology.6,7 In recent years, the coal industry has been actively adopting advanced sensor, machine vision, and automation technologies. The wide range of applications of these technologies covers spectroscopic techniques, image analysis, and robot control, and the maturity of these tools is gradually increasing. At the same time, disciplines such as statistics and data analysis are rapidly developing. In this context, new intelligent nondestructive classification techniques are becoming the main exploration direction of coal and gangue classification research. Classification methods of coal and gangue. As a nondestructive classification technique, spectral analysis offers exceptional efficiency and cost-effectiveness. It can provide measurement data both quickly and in real time, thus providing a reliable foundation for assessing coal quality parameters. At present, spectral analysis techniques are broadly employed in fields such as coal composition analysis, coal classification, and coal rock identification. Cheng et al.8 analyzed carbon, hydrogen, nitrogen, and ash in coal based on laser-induced breakdown spectroscopy (LIBS) and support vector machines (SVM) and achieved high accuracy. Song et al.9 proposed a novel coal analysis system that combines LIBS and cooperative learning techniques. The system demonstrated excellent performance in predicting the calorific value, sulfur content, and volatility of coal. Cao et al.10 used a combination of LIBS and KNN to classify coal types based on 11 elements in coal. Liu et al.11 proposed a method for classifying coal and rock, which constructs a simplified spectral model (SSM) of LIBS and realizes the accurate recognition of coal and rock in unmanned coal mining scenarios based on SSM and neural networks. Ma et al.12 utilized a stepwise classification method to separate coal from common detritus and improve the accuracy of coal analysis. Zheng et al.13 combined various machine learning algorithms, such as clustering, partial least-squares, and laser-induced breakdown spectroscopy, to achieve differentiation of the source of coal. Liu et al.14 realized the approximate analysis of coal based on laser-induced breakdown spectra by combining principal component regression, artificial neural network, and PCA-ANN models. All of the above methods are used to deal with high-dimensional spectral data using machine learning, but the direct use of machine learning algorithms to model spectral data is usually ineffective, so before modeling, spectral data need to be downscaled using preprocessing methods such as principal component analysis (PCA). If an inappropriate preprocessing method is used, it will not only be detrimental to the model performance improvement but also lead to an unreliable prediction accuracy of the subsequently constructed model. Compared to machine learning, deep learning has stronger feature extraction capabilities and can build end-to-end analytical models that do not rely on preprocessing.15,16 Xiao et al.17 fused reflectance spectroscopy with deep learning techniques for the determination of coal composition content, and this innovative combination demonstrated accurate predictions in experiments. Chen et al.18 proposed a novel method for rock classification, which is based on LIBS images and utilizes deep learning networks and migration learning methods to achieve the classification of three kinds of rocks. Xiao et al.19 proposed a method for fast classification of coal, which was based on reflectance spectroscopy and the convolutional neural network (CNN) model, and finally achieved an accuracy of 98.3%. The method converts 1D spectra into 2D spectra arranged in “S” shape, which is less flexible and interpretable. Li et al.20 used a deep learning approach to combine a 1D CNN with visible-near-infrared spectroscopy to obtain rich spectral information and achieve 97.61% classification accuracy for coal and gangue. The method uses 1D convolution to extract spectral features; compared with 2D convolution, 1D convolution can extract the features of neighboring bands, but it is weaker for spatial information extraction. In this study, we aim to encode the 1D LIBS data into the form of 2D images so that we can better utilize 2D-CNN for feature learning and analysis. Wang and Oates21 introduced a technique, termed Gramian angular summation field (GASF), that transforms a time series into an image while preserving temporal correlations. Inspired by the above scholars’ methodology, we aim to convert 1D spectral data into 2D spectral images using GASF and subsequently assess the performance of the GASF-CNN model in the classification tasks of coal and gangue through comparative experiments. Theory and Methodology Data Set A total of 100 samples were collected, including 50 coal samples and 50 gangue samples. Among them, 16 gangue and 18 coal samples were collected from the Shenfu Dongsheng mine, 18 gangue and 27 coal samples from the Yanzhou mine, and 16 gangue and 5 coal samples from the Pingshuo mine. We utilize an Ocean Insight brand MX2500+ spectrometer to collect laser-induced breakdown spectral data of the samples, which has a spectral range of 199–1112 nm with eight channels. The device requires minimal sample volume and is self-cleaning to avoid the influence of coal surface dust on the spectral data, ultimately realizing the accurate collection of complete atomic spectral line signals at the time of atomic excitation radiation prominence. In this paper, a laser with a wavelength of 1064 nm was used, and the voltage was set to 655 V. The steps for the acquisition of laser-induced breakdown spectroscopy data for each sample used in this paper are shown below.(1)Select five evenly distributed sampling points on the sample surface according to the five-point sampling method;(2)Adjust the height of the spectrometer lens so that the laser can be focused on the sample surface and then adjust the position of the fiber optic probe. When the laser hits the sample, a high-temperature and high-pressure plasma is formed, which emits light specific to its constituent elements, and the fiber-optic probe is positioned in the right place to help capture the light adequately;(3)After adjusting the lens and fiber optic probe to the appropriate position, the first self-cleaning function is used to remove dust and other debris on the surface of the sampling point. For the cleaned sample sampling point, the laser was used to strike five times to obtain five sets of spectral data of the point, and the average value of these five sets of data was taken as the spectral data of the collection point;(4)After obtaining the spectral data of the five acquisition points of this sample, the average value of the five acquisition points is taken as the final LIBS data of this sample. (1)Select five evenly distributed sampling points on the sample surface according to the five-point sampling method; Select five evenly distributed sampling points on the sample surface according to the five-point sampling method; (2)Adjust the height of the spectrometer lens so that the laser can be focused on the sample surface and then adjust the position of the fiber optic probe. When the laser hits the sample, a high-temperature and high-pressure plasma is formed, which emits light specific to its constituent elements, and the fiber-optic probe is positioned in the right place to help capture the light adequately; Adjust the height of the spectrometer lens so that the laser can be focused on the sample surface and then adjust the position of the fiber optic probe. When the laser hits the sample, a high-temperature and high-pressure plasma is formed, which emits light specific to its constituent elements, and the fiber-optic probe is positioned in the right place to help capture the light adequately; (3)After adjusting the lens and fiber optic probe to the appropriate position, the first self-cleaning function is used to remove dust and other debris on the surface of the sampling point. For the cleaned sample sampling point, the laser was used to strike five times to obtain five sets of spectral data of the point, and the average value of these five sets of data was taken as the spectral data of the collection point; After adjusting the lens and fiber optic probe to the appropriate position, the first self-cleaning function is used to remove dust and other debris on the surface of the sampling point. For the cleaned sample sampling point, the laser was used to strike five times to obtain five sets of spectral data of the point, and the average value of these five sets of data was taken as the spectral data of the collection point; (4)After obtaining the spectral data of the five acquisition points of this sample, the average value of the five acquisition points is taken as the final LIBS data of this sample. After obtaining the spectral data of the five acquisition points of this sample, the average value of the five acquisition points is taken as the final LIBS data of this sample. The acquisition process is listed in Figure 2. Acquisition process of spectral data. Using a coal sample for illustration, we directed a laser beam at a point on its surface five consecutive times, and the resulting five spectral curves are depicted in Figure 3. In the figure, each spectral curve is represented by a different color. The curves exhibit similar trends, differing minimally in peak values. This indicates that the spectral curves used in this study have high stability and reproducibility. Schematic of the spectral curves of 5 experiments. Band Selection We selected the LIBS curves of coal and gangue for comparison, and the spectrometer collected data in the band range 199–1112 nm. The spectral curves of gangue and coal are shown in Figures 4 and 5, respectively. Our observations indicate that in the 199–620 nm range, the differences between the spectral data of coal and gangue are less significant and follow a similar trend, making it challenging for deep learning models to effectively classify them. In the 620–900 nm range, the intensity of coal spectra is higher as compared to gangue. The greater disparity in their trends aids deep learning models in learning different spectral features, thereby facilitating more accurate classification. LIBS curve of gangue. LIBS curve for coal. GASF21 GASF consists of three steps: normalization of 1D spectral data, polarization of 1D spectral data, and calculation of the GASF matrix. Normalization of 1D Spectral Data Given n actual measurements of the spectral data S = {s1, s2, ···, and sn}, we normalize S to make the spectral data lie in the range [−1,1]. The normalized spectral data s̃i is obtained by eq 1:1 Polarization of 1D Spectral Data The second step of the GASF method is to polarize the 1D spectral data, presenting the normalized spectral data from the previous step in polar coordinates. Polar coordinates are defined by eq 2:2 In eq 2, ϕ denotes the spectral value in polar coordinates; ti denotes the wavenumber of the spectral data, N is the cross section in the stabilized polar coordinate space, and r denotes the radius. Calculation of the GASF Matrix After the polar coordinates of the spectral data are obtained, the GASF matrix is obtained by triangulating and calculating the spatial correlation between the poles. The GASF is defined in eq 3.3where I is the unit row vector. Finally, the conversion effect is shown in Figure 6. 1D LIBS and GASF image conversion process. Residual Connection Traditional shallow neural networks can capture only simple texture information, and it is difficult to dig deeper into more advanced features. Therefore, we adopt the residual connection approach22 to overcome this problem. By introducing residual connectivity, we can increase the depth of the network to extract deeper features and also avoid the situation where the network is too deep, resulting in performance degradation. Since the feature maps processed by the backbone network have dimensional variations, if the structure in Figure 7a is used directly for element summation, it will lead to the problem of element mismatch. In the GASF-CNN model, we use Conv-Block_5 and Conv-Block_6 to perform dimensionality transformation by downscaling or upscaling on the shortcut path, as shown in Figure 7b. Schematic diagram of the residual connection. SimAM23 To enhance the model’s ability to focus on key features for more accurate classification of coal and gangue, we introduce an attention module in this study. Current attention modules are plagued by two main limitations. First, they can refine features in either the channel or spatial dimensions but are not capable of simultaneously accounting for both, thereby limiting their flexibility. Second, conventional attention modules often require a complex series of operations, such as pooling, for their design and implementation, making them cumbersome to work with. The SimAM attention module utilized in this study employs uniform weights and is parameter-free, providing both flexibility and efficacy in improving model representation. In neural networks, important neurons inhibit the surrounding neurons of lower importance. The SimAM module achieves the identification of important neurons using an energy function to measure the linear divisibility between neurons. The energy function is defined as follows:4Here, i is the index over spatial dimension, t and xi are the target and other neurons of the input features, y is the output, and λ is the regularization coefficient, M = H × W is the number of energy functions, wt is the weight, bt is the bias, , the mean, and the variance . The minimum energy can be calculated by eq 5.5 We observe that when the energy is lower, the neuron t becomes more distinct from the surrounding neurons; under these conditions, its importance increases. Therefore, can be utilized to calculate the importance of a neuron. After obtaining the importance of the neurons according to the energy function, we need to augment the features according to the definition of the attention mechanism, where X is the input feature.6 Proposed Methods CNN has a strong feature extraction capability and has a wide range of applications in 2D image and 3D visual processing tasks.24,25 The convolutional neural network model GASF-CNN used in this paper consists of six Conv-Block, flatten layer, and a fully connected layer. Among them, Conv-Block consists of a convolutional layer, normalization layer, activation function layer, maximum pooling layer (only 1, 5, and 6 are included), and SimAM layer. The specific structure of the GASF-CNN model is shown in Figure 8, and the specific parameters of each Conv-Block are listed in Table 1. As can be seen from Figure 8, the input of the GASF-CNN model is a 2D spectral image converted from 1D spectral data; at this time, the dimension of the 2D spectral map is 3 × 231 × 231, where 3 represents the feature dimension and 231 × 231 represents the length and width. The GASF-CNN model consists of a total of three paths, and finally, the three paths converge to pass the features to the flatten layer. First, in the intermediate path, it is mainly composed of Conv-Block_1, Conv-Block_2, Conv-Block_3, and Conv-Block_4. After the input features are processed by Conv-Block_1, the spectral dimension is deepened from 3 to 16, and the feature size is reduced to 57 × 57 after Conv Layer and Max Pooling. The output of Conv-Block_1 is used as the input of Conv-Block_2, and after the processing of Conv-Block_2, the feature dimension rises to 32 dimensions, and the feature size is reduced to 27 × 27. Conv-Block_1 and Conv-Block_2 reduce the feature dimension from low-dimensional mapping to high-dimensional space, which can retain more effective information and avoid the loss of key features. The input feature of Conv-Block_3 is the output of Conv-Block_2. After the processing of Conv-Block_3, the feature dimension is restored from 32 dimensions to 16 dimensions. At this time, the 16-dimensional feature has more abundant near-band information than the 16-dimensional feature output by Conv-Block_1, and the feature size is reduced from 27 × 27 to 13 × 13. Conv-Block_4 also plays a role in dimensionality reduction and feature fusion. After processing with Conv-Block_4, the output feature dimension is 1 × 11 × 11. In the upper path, the function of Conv-Block_5 is to transmit the input features directly to the end of the path, avoid the loss of the original feature information, and realize the fusion of multiscale features. The role of the lower path and the upper path is similar, and the feature dimension is reduced from 16 × 57 × 57 to 16 × 13 × 13. Finally, the output characteristics of the three paths are transmitted to the flatten layer, and the classification of coal and gangue is realized after the processing of the fully connected layer. Table 1Specific Parameters of the GASF-CNN Modelblocklayerfilter sizefilter numberstep sizeConv- Block_1Input Conv Layer5162BN Layer 16 ReLU Max Pooling216 SimAM Conv-Block_2Conv Layer5322BN Layer 32 ReLU SimAM Conv-Block_3Conv Layer3162BN Layer 16 ReLU SimAM Conv-Block_4Conv Layer311BN Layer 1 ReLU SimAM Conv-Block_5Conv Layer1615BN Layer 1 ReLU Max Pooling41 SimAM Conv- Block_6Conv Layer7162BN Layer 16 ReLU Max Pooling216 SimAM Specific Parameters of the GASF-CNN Model GASF-CNN model structure. Result and Discussion Experimental Result In this study, we used the Python programming language, constructed the models with the help of the Pytorch 1.7 framework under the Windows 11 operating system, and visualized the experimental results using MATLAB 2018b. In this paper, the learning rate is 0.001, the batch size is 8, and the max epoch is 30. Given the constraints in acquiring spectral data, this paper employs the method of adding Gaussian noise to increase the sample size to 100 for both coal and gangue. Of the expanded 200 samples, 140 were randomly selected for training the model, while the remaining 60 were used for evaluation. In this classification task, samples are divided into two categories: gangue is labeled as 1, and coal is labeled as 2. Figure 9 illustrates the training process of the GASF-CNN model. Here, red points represent classification accuracy, and green lines, distributed along the y-axis, indicate error rates. As is evident from Figure 9, the first iteration yields low classification accuracy and large errors. However, in subsequent iterations, the classification accuracy increases substantially, exceeding 90% and entering a brief stabilization phase. After the 14th iteration, the accuracy experiences minor fluctuations but continues to gradually increase, ultimately stabilizing at a higher accuracy level, while the error rate also stabilizes within a smaller range. The final classification results, presented in Figure 10, indicate that only the 29th test sample is misclassified—predicted to be coal but actually gangue—resulting in a classification accuracy of 98.33%. Training process of GASF-CNN. Classification results of the GASF-CNN model. Algorithm Comparison and Evaluation To validate the effectiveness of the GASF-CNN model proposed in this paper in coal and gangue classification tasks, we selected several models in the spectral domain for comparison. Among them, the machine learning models include ELM,26 Two-hidden-layer ELM (TELM),27 BP,28 and random forests (RF)29 and also compared with the deep learning models DR-TELM17 and RS_PSOTELM,19 which were published in the last two years. The specific parameter details of the comparison test are as follows. The number of nodes in the hidden layer of ELM and TELM are set to 35, the number of decision trees in RF is set to 10, and the hyperparameter settings of DR-TELM and RS_PSOTELM are kept the same as that of GASF-CNN. To ensure the fairness of the comparison experiments, in this paper, DR-TELM and RS_PSOTELM are trained and tested on a 2D spectral data set based on GASF transformation instead of using the spectral transformation method in the original article. Table 2 shows the results of multiple evaluation metrics for different models on the classification task, where the bold represents the optimal classification results. Accuracy can be used to visualize the proportion of correct and incorrect classification, recall can reflect the sample size of coal incorrectly predicted as gangue, precision can reflect the sample size of gangue incorrectly predicted as coal, and F1 score is a combination of recall and precision. From Figure 11, it is evident that the ELM has 10 misidentified samples in the test set, in which eight are coal samples misclassified as gangue and two are gangue samples misclassified as coal. Figure 12 indicates that the classification performance of TELM is significantly improved compared to ELM, with four coal samples being misidentified as gangue. As shown in Figure 13, the misclassification rates for the BP model are similar to those of TELM, with multiple coal samples being erroneously classified as gangue. Figure 14 reveals that the RF model results in five misclassified samples, where three coal samples are misclassified as gangue and two gangue samples are misclassified as coal. According to Figure 15, the RS_PSOTELM model has one misclassification for each of gangue and coal, resulting in equal recall and precision rates of 97.06%. Finally, Figure 16 demonstrates that the DR-TELM model has three misclassified samples, comprising two gangue samples and one coal sample. It should be noted that the 29th sample in the classification results of each model is misclassified as coal, which is found to be collected from Pingshuo mining area by analyzing the sample classification results. From Section 2.1, there are five coal samples collected from the Pingshuo mining area, and the number of samples becomes 10 after data expansion, in which five samples are randomly divided into the training set and five samples are randomly divided into the test set. Since the ratio of samples in the training set and test set is 1:1, there is a possibility of insufficient learning effect. In addition, gangue and coal are closely connected in the generation process, so gangue and coal have similar properties and their properties are related to the degree of closeness to coal. A combination of factors led to the misclassification of the 29th sample; compared with other models, GASF-CNN has a better learning effect in the face of a small number of samples and has the least misclassification for the test samples of the same native source, which proves that the model proposed in this paper has excellent stability and generalization performance. Table 2Experimental Results of Different Models on Coal and Gangue Classification Tasksmodelsaccuracy (%)recall (%)precision (%)F1 score (%)ELM2683.3376.4792.8683.87TELM2793.3388.2410093.75RF2891.6791.1893.9492.54BP2991.6785.2910092.06DR_TELM1795.0097.0694.2995.65RS_PSOTELM1996.6797.0697.0697.06GASF-CNN98.3397.0610098.51 Experimental Results of Different Models on Coal and Gangue Classification Tasks Classification results of ELM. Classification results of TELM. Classification results of BP. Classification results of RF. Classification Results of DR-TELM. Classification results of RS_PSOTELM. Conclusions In this article, a novel classification method for coal and gangue is proposed, which converts 1D LIBS data into GASF images and utilizes the GASF-CNN model to classify the images. GASF-CNN makes the model focus on the key features by introducing the SimAM attention mechanism, and the fusion of different levels of spectral features is achieved by introducing the residual connection. The experimental results show that GASF-CNN has only one misclassified sample in the test set. It achieves 98.33, 97.06, 100, and 98.51% accuracy, recall, precision, and F1 score metrics, respectively. Compared to other machine learning and deep learning models, GASF-CNN has a more excellent performance in the classification task of coal and gangue. This paper provides a low-cost and highly reliable method for coal and gangue classification as well as facilitating the automation of coal and gangue classification and high-quality allocation of fossil energy.