Next Article in Journal
Investigation on the Formation and Evolution Mechanism of Flow-Resistance-Increasing Vortex of Aero-Engine Labyrinth Based on Entropy Generation Analysis
Previous Article in Journal
Estimates for Coefficients of Bi-Univalent Functions Associated with a Fractional q-Difference Operator
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Image Recognition Method for Coal Gangue Based on ASGS-CWOA and BP Neural Network

1
R & D Department, Zhuhai Xinhe Technology Co., Ltd., Zhuhai 519600, China
2
School of Electrical Engineering, Zhejiang University, Hangzhou 310000, China
3
School of Mechanical Electronic & Information Engineering, China University of Mining & Technology-Beijing, Beijing 100083, China
4
Comprehensive Experimental Teaching Demonstration Center of Engineering, Beijing Union University, Beijing 100101, China
*
Authors to whom correspondence should be addressed.
Symmetry 2022, 14(5), 880; https://doi.org/10.3390/sym14050880
Submission received: 24 March 2022 / Revised: 14 April 2022 / Accepted: 22 April 2022 / Published: 25 April 2022
(This article belongs to the Topic Applied Metaheuristic Computing)

Abstract

:
To improve the recognition accuracy of coal gangue images with the back propagation (BP) neural network, a coal gangue image recognition method based on BP neural network and ASGS-CWOA (ASGS-CWOA-BP) was proposed, which makes two key contributions. Firstly, a new feature extraction method for the unique features of coal and gangue images is proposed, known as “Encircle–City Feature”. Additionally, a method that applied ASGS-CWOA to optimize the parameters of the BP neural network was introduced to address to the issue of its low accuracy in coal gangue image recognition, and a BP neural network with a simple structure and reduced computational consumption was designed. The experimental results showed that the proposed method outperformed the other six comparison methods, with recognition of 95.47% and 94.37% in the training set and the test set, respectively, showing good symmetry.

1. Introduction

Removing gangue from raw coal is conducive to improving the efficiency of coal utilization and reducing environmental pollution. Therefore, the identification of gangue and coal blocks is a necessary step for the efficient removal of coal gangue in coal production, which is of great significance for environmental protection [1,2]. Because of its obvious advantages of resource saving, low cost, the simple processing system and convenient maintenance, image recognition technology for the separation of coal gangue has been widely studied and applied in the literature [3,4,5,6,7]. Researchers have developed a variety of image recognition methods for coal gangue image recognition, which contribute to research into coal gangue separation technology based on image recognition and have laid a foundation for further research. However, these methods have their shortcomings. For example, in [3], the proposed method resulted in a waste of computing resources and low time efficiency because it calculated 15 eigenvalues at the same time, although only the best five eigenvalues were actually used. In the study by Zhou et al. [4], the new method adopted a deep convolution neural network to address the task of online accurate and rapid identification of coal gangue, which required extensive computation. In other studies [5,6], although the recognition rate of the methods used was high, the artificially set threshold parameters played a decisive role in the intermediate calculation link, which depended on an extensive experimental statistical analysis or experience, resulting in the calculation being complex. The stability of performance was questionable, and the generalized ability to recognize coal gangue images with different characteristics in different regions was not necessarily high. The authors of [7], proposed a method that required a large number of samples generated by the introduction of the transfer learning method, suggesting that the method’s generalization and universality are questionable and may be limited when the sample size is small.
Since it was proposed by the team of Rumelhart and McClelland in 1986, the BP (back propagation) neural network has been widely used in the field of image recognition [8] because of its simple structure and high calculation efficiency, such as in [9]. To solve the problem of remote sensing image classification, the authors established an improved BP neural network and set the dynamic training intensity to improve the learning speed and classification accuracy of the BP neural network classifier. However, determining the optimal training intensity consumes a large amount of computing resources; moreover, the sample set classification problems of different fields have different optimal training intensities due to the large differences in the sample characteristics, so the generalizability is questionable, probably resulting in this method being unsuitable for image coal gangue classification with a wide area and many sources. In another study [10], a small image recognition and classification method based on GA-BP was proposed, in which the combination of a genetic algorithm and the BP neural network gave full play to the nonlinear mapping ability of the neural network, resulting in strong learning ability and fast convergence speed. The experimental results showed that the new method had higher recognition accuracy and better performance than the traditional BP algorithm and the GA-BP algorithm. The authors of [11] adopted a hybrid algorithm combining a genetic algorithm and a back propagation algorithm, and the experimental results showed that this GA-BP algorithm had higher efficiency, robustness and practicability. The researchers in [12] proposed an epilepsy diagnosis method based on an improved genetic algorithm–optimized back propagation (IGA-BP) neural network and used this method to detect clinical epilepsy quickly and effectively. Liu et al. [13] used a genetic algorithm (GA) to construct a classification model based on the BP neural network to automatically identify the correlations in a multi-mode blog, and the experimental results showed that the classification model based on GA-BP was better than the traditional BP neural network. Yu et al. [14] considered the problem that a BP algorithm based on a gradient descent principle falls into the local minima, and thus, the classification of multispectral remote sensing images using spectral information cannot obtain ideal results. Yu et al. developed a new method combining feature texture knowledge with a BP neural network trained by particle swarm optimization (PSO). The experimental results showed that this method had improved classification accuracy. Ying et al. [15] proposed a method combining a random loss algorithm and particle swarm optimization (PSO-BP) for the recognition and classification of small images, which corrected the weights of the PSO algorithm based on the error back propagation adjustment of the traditional BP algorithm to establish the PSO-BP network model. The hidden layer unit of the PSO-BP network was improved by using the random loss algorithm, thus achieving faster operation speeds. The authors of [16,17] proposed variants of the PSO-BP combining a BP neural network and PSO to address the task of supervised classification of synthetic aperture radar (SAR) images and the problems of low accuracy and efficiency in traditional part classification methods. This kind of BP neural network method based on GA or PSO optimization has a certain reference value for coal gangue image classification. Unfortunately, the accuracy of image coal gangue classification was still not high, as shown by a comparative experiment in a follow-up paper. In addition, the BP neural network has also been applied in other fields. For example, in [18], the researchers proposed a metal surface defect classification method based on an improved bat algorithm to optimize the BP neural network, which was used to classify images of defects with different characteristics. The researchers in [19] proposed an automatic recognition method of cloud and precipitation particle shapes based on a BP neural network to solve the problem that the shape of cloud particle images measured by airborne cloud imaging probes (CIPs) cannot be automatically recognized.
Although these methods have some shortcomings, they have still contributed to the research into coal gangue separation technology based on image recognition and laid a foundation for further research. In 2007, Yang and his coauthors proposed a new swarm intelligence algorithm [20], which simulates the predation process of wolves to solve complex nonlinear optimization problems. Due to its superior performance, it has been widely used in various fields and has been continuously developed and improved. For example, in [21], the author proposed a novel and effective opposite wolf pack algorithm to estimate the parameters of a Lorenz chaotic system. In another study [22], the improved wolf pack search algorithm was used to calculate the quasi-optimal trajectory of a rotor UAV in complex three-dimensional space. Moreover, in [23], the wolf pack algorithm was used to find the root of the polynomial equation of the problem accurately and quickly. Similarly, in [24], Zhou Qiang and others proposed a wolf pack search algorithm based on the leader strategy (LWCA). The researchers in [25] designed an adaptive shrinking grid search chaos wolf optimization algorithm (ASGS-CWOA) using adaptive standard deviation updating to achieve better performance, which included new regeneration rules, a new raid strategy, a new siege strategy and a new siege adaptive step size. Inspired by the good optimization ability of the wolf pack intelligent optimization algorithm and the excellent classification performance of the BP neural network, this article proposes a coal gangue image recognition method based on ASGS-CWOA and the BP neural network.
The remainder of this article is organized as follows. Section 2 presents a description of “Encircle–City Feature”, a combination of ASGS-CWOA and the BP neural network and an overview of new method. In Section 3, we present comparative experiments to show the effectiveness of the proposed approach. The conclusion is given in Section 4.

2. Proposed Method

2.1. Encircle–City Feature

By comparing a large number of sample images, it was found that the brightness area of coal block images is significantly larger than that of gangue images, but the degree of recognition of distinguishing coal blocks and gangue according to the contrast index is not very high because the contrast of coal is significantly greater than that of gangue from a local point of view. Nevertheless, this difference in contrast will partially offset the images from each other from an overall point of view.
In this article, the basic idea of Encircle–City Feature is to divide the sample image into several continuous small areas of 50 × 50 without overlaps or blanks, in which the following operations should be performed. If we assume that the matrix of the small 50 × 50 area is I, the implementation steps are as follows:
Step 1: Divide each sample image evenly into M × N small areas with M rows and N columns such that each small area should be 50 pixels × 50 pixels without overlaps and blanks and perform Steps 2 to 4 for each one.
Step 2: Obtain the average gray value of the “City”. The total gray (denoted by Citysum_gray) of small 30 × 30 areas is calculated to obtain the average gray (denoted by Cityaverage_gray) in the central district. This is like a castle located in the central area, so we call it the “City” (shown in red in Figure 1). This is given by Equation (1).
{ C i t y s u m _ g r a y = i = 11 , j = 11 40 , 40 I ( i , j ) C i t y a v e r a g e _ g r a y = C i t y s u m _ g r a y 900
Step 3: Obtain the total gray value (denoted by Encirclesum-gray) and the average gray value (denoted by Encircleaverage-gray). The peripheral part of the small 50 × 50 area excluding the central 40 × 40 pixels is like the wall around a castle, so it is called the “Encircle”, as shown in blue in Figure 1. Equation (2) is as follows:
{ E n c i r c l e s u m g r a y = i = 1 , j = 1 50 , 50 I ( i , j ) i = 6 , j = 6 45 , 45 I ( i , j ) E n c i r c l e a v e r a g e g r a y = E n c i r c l e s u m _ g r a y 900
Step 4: For the small area of Row m and Column n, obtain the “Encircle–City” value using Equation (3):
{ E n c i r c l e C i t y ( m , n ) = C i t y a v e r a g e g r a y E n c i r c l e a v e r a g e g r a y ( m < = M , n < = N )
Step 5: Obtain the average value of the “Encircle–City” matrix (M × N matrix “Encircle–City” obtained using Step 4). Finally, calculate the “Encircle–City” value of the whole sample image as shown in Equation (4).
{ A v e r a g e g r a y = m = 1 , n = 1 M , N E n c i r c l e C i t y ( m , n ) ( M × N ) L e n g t h = f i n d l e n g t h ( E n c i r c l e C i t y > A v e r a g e g r a y ) E n c i r c l e C i t y e i g e n v a l u e = l e n g t h / ( M × N )
where “Averagegray” means the average value of the overall matrix “Encircle–City”; “Length” means the number of elements larger than “Averagegray” in the matrix “Encircle–City”, which is obtained by the function “find-length”; Encircle–Cityeigenvalue stands for the overall “Encircle–City Feature” value of one sample image, as shown in Figure 2.
In this article, small areas of 50 × 50 were used to segment one overall sample image, in which “Encircle” contains 900 pixels and “City” contains 900 pixels, meaning that the Encircle–City Feature can better reflect the texture features of the image under ideal circumstances. It should be noted that we only used the Encircle–City Feature value to identify coal and gangue, and the recognition accuracy reached 83.24%, which is not discussed in detail due to limited space.
Unfortunately, the images are often irregular such that the “Encircle” and the “City” in the small 50 × 50 local area do not necessarily strictly follow the ideal situation shown in Figure 2, which leads to the lower accuracy in identifying coal and coal gangue images using the Encircle–City Feature (83.24%). In fact, we are more concerned about the light–dark contrast of small local areas than the whole image, so we introduced the auxiliary value of the “Encircle–City Feature”: the “Encircle–City Assist”, the details of which are given below.
Step 1: Divide each sample image evenly into small M × N areas with M rows and N columns such that each small area must include 50 pixels × 50 pixels without overlaps or blanks and perform Steps 2 to 4 for each one.
Step 2: Sort the image pixels of the small 50 × 50 area in ascending order according to the gray value, as shown in Equation (5):
b l o c k s o r t = S o r t ( b l o c k )  
where “blocksort” means the matrix after arrangement in ascending, which is calculated and returned by the function “Sort”.
Step 3: Calculate “Encircle–CityAssist”, the auxiliary value of the “Encircle–City Feature” of the current small 50 × 50 area block, which is the difference between the second half of “blocksort” and its first half, as shown in Equation (6).
E n c i r c l e C i t y a s s i s t = b l o c k ( 2501 : 5000 ) b l o c k ( 1 : 2500 )
It should be noted that we only used the “Encircle–CityAssist” value to identify coal and gangue, and the recognition accuracy reached 78.21%, which is not discussed in detail due to limited space.

2.2. ASGS-CWOA-BP

2.2.1. Overview of ASGS-CWOA

We proposed ASGS-CWOA in [20] with three contributions: the strategy of adaptive shrinking grid search (ASGS), the strategy of opposite–middle raid (OMR) and the adaptive standard deviation updating amount (ASDUA), which has been shown to have superior performance compared with some state-of-the-art algorithms at that time. Accordingly, in this study, we use ASGS-CWOA to address the issue of optimizing the weights of the BP neural network for coal gangue image recognition. In order to adapt to the particularity of the recognition network weights, which are always small, some necessary adjustments of the step size should be made according to the following rules.
In this article, the variation range of the weights was set between −5 and 5 based on experience, i.e., range_max = 5 and range_min = −5. Correspondingly, the value range is [−5, 5] in any dimension for the position of one wolf.
Thus, the step size of the siege stage can be obtained by using Equation (7) as follows:
{ o s t e p _ c _ m a x = ( r a n g e _ m a x r a n g e _ m i n ) / 2 s t e p _ c _ m i n = 0.01 s t e p c = s t e p _ c _ m i n × ( r a n g e _ m a x r a n g e _ m i n ) × e x p ( ( l o g ( s t e p _ c _ m i n / s t e p _ c _ m a x ) ) × t / T )
where step_c_max is the upper limit of the siege step’s size, step_c_min is the lower limit, t indicates the current number of iterations and T represents the upper limit.
The step sizes of the migration stage and the summons–raid stage can be obtained by using Equation (8) as follows:
{ s t e p a = s t e p c × 100 ,   w h e n   s t e p c     0.001 s t e p a = s t e p c × 1000 ,   w h e n   s t e p c < 0.001 s t e p b = s t e p a × 2
where stepa means the step size of the migration stage and stepc means one of the summons–raid stages. In order to prevent the stepc value from getting smaller and smaller with each iteration such that the values of stepa and stepb become too small to affect the optimization effect, the values of stepa and stepb are amplified when the value of stepc is less than 0.001.

2.2.2. The Recognition Network

Based on the BP neural network and the ASGS-CWOA algorithm and considering the factors of low network complexity and less computation, this research designed a recognition network with a simple structure for coal and gangue images (RN-CGI), which includes six input layers, four hidden layers and one output layer, as shown in Figure 2.
Here, the hidden layer adopts the “tansig” kernel function, and the output layer adopts the “purelin” kernel function. The position coordinates of each wolf in the wolf pack represent the weights of the BP neural network, and the fitness value is jointly calculated by the recognition network and the sample eigenvector according to Equations (9) and (10).
Xi = (xi1, …, xid, …, xiD) (i = 1, …, n; d = 1, …, D)
{ N e t . W = [ x i 1 x i 2 x i 3 x i 4 x i 5 x i 6 x i 7 x i 8 x i 9 x i 10 x i 11 x i 12 x i 13 x i 14 x i 15 x i 16 x i 17 x i 18 x i 19 x i 20 x i 21 x i 22 x i 23 x i 24 ] N e t . L = [ x i 25 x i 26 x i 27 x i 28 ]
where Xid is the coordinate of the i-th wolf in the d-th dimension, Net.W is the weight from the input layer to the hidden layer, and Net.L is the weight from the hidden layer to the output layer. From the sum of the elements of Net.W and Net.L, it is obvious that D is 28, correspondingly. In this way, the location information of each wolf can be mapped into the weight parameters of the recognition network. By continuously optimizing the location information of the wolves, the potential optimal solution with the best fitness value is obtained.
In this article, the network output values of all training samples are calculated according to the network weight parameters mapped by the position information of wolfi. Since this article considers the binary classification of coal and gangue images (coal = 0; gangue = 1) and the BP neural network adopts the “tansig” and “purelin” kernel functions, the following judgment can be made for the network output value outi: for the i-th sample, when outi is less than 0.5, this indicates coal, i.e., set 0, but if it is greater than or equal to 0.5, it is judged to be gangue, i.e., set 1. Accordingly, the fitness function can be given by Equation (11).
{ o u t = ( o u t 1 , o u t 2 , , o u t i , o u t n u m ) ,   i = 1 , 2 , , n u m r i g h t _ n u m = l e n g t h ( o u t = B J ) f i t n e s s k = r i g h t _ n u m / n u m
where num is the number of training or test samples, right_num is the number of samples correctly identified, BJ is the label (0 or 1) of the training or test sample, length (out = BJ) is a function that can calculate and return the number of correctly identified samples and fitnessk is the fitness value of wolfk of the k-th wolf, that is, the recognition accuracy.

2.3. Overview of the Proposed Method

2.3.1. Image Preprocessing

With a camera (Huawei Honor 20, 48 million pixels), 358 gangue images and coal block images (including 285 gangue images and 173 coal block images) were taken. The image size was 4000 × 3000, forming the original sample set. We preprocessed the original images in order to extract the feature vectors, as shown in Figure 3.
  • Image Graying: Grayscale images refer to images containing only brightness information and no color information. Grayscale processing is the process of changing the color image containing brightness and color into grayscale images.
  • Median Filtering: Median filtering is a nonlinear signal processing technology that can effectively suppress noise based on the sorting statistical theory. Its basic principle is to replace the gray value of a point in the digital image with the median value of each point in the local neighborhood of the point. This paper used a 3 × 3 local neighborhood.
  • Otsu Segmentation: The Otsu algorithm is an efficient algorithm for image binarization proposed by the Japanese scholar Otsu in 1979. The principle is to divide the original image into foreground and background images by a threshold. For the foreground, N1, csum and M1 are used to represent the number of points, the quality moment and the average gray level of the foreground under the current threshold, respectively. For the background, N2, sum csum and M2 are used to represent the number of points, the quality moment and the average gray level of the background under the current threshold, respectively. When the optimal threshold is selected, the difference between the background and the foreground should be the greatest.
  • Erosion and Dilation: Erosion is the use of algorithms to corrode the edges of the image. The function is to start off the “burr” on the edge of the target. Inflation uses the algorithm to expand the edges of the image. The function is to fill the edges or internal pits of the target. Having the same amount of erosion and dilation can make the target surface smoother, which is a symmetrical process.
  • Target Area Focusing: The size of the original image of the sample was 4000 × 3000. The processing capacity of image storage and calculation is large, and the blank area accounts for a large proportion, resulting in unnecessary gangue in the resources. In order to lock the effective area, we used the corroded and expanded images to minimize the boundary of the target area, remove the unnecessary background and focus on the foreground target area of the image.
  • Nearest Interpolation Image Size Scaling: After the target area focusing operation, due to the differences in the influence of sample image noise and the different sizes of the target areas, the sizes of the gray image of the “target area” were different. In order to unify the sample size, the size scaling operation was carried out on the image; that is, the “nearest interpolation” operation was used to reduce the size of the sample images that were greater than 800 × 600 and increase the size of the sample images that were less than 800 × 600. The unified sample image size was 800 × 600.
The results of the prepossessing process are shown in Figure 3.

2.3.2. Gray Level Co-Occurrence Matrix (GLCM)

The method commonly used to describe the grayscale texture is the grayscale correlation matrix. The index eigenvalues derived from the gray level co-occurrence matrix are as follows: “contrast” returns the contrast between a pixel in the whole image and its neighbors. The contrast of an image composed of constants is 0. The calculation equation is
C o n t r a s t = i , j | i j | 2 p ( i , j )  
Correlation” returns the cross-correlation between a pixel in the whole image and its neighbors. The value range is [−1, 1]. The cross-correlation of images composed of constants is none. The correlation degrees 1 and −1 correspond to complete positive correlation and complete negative correlation, respectively. The calculation equation is
C o r r e l a t i o n = i , j ( i μ i ) ( j μ j ) p ( i , j ) σ i σ j  
Homogeneity” reflects the tightness of the distribution of elements in the GLCM relative to the diagonal of the GLCM. The value range is [0, 1]. The homogeneity of a diagonal GLCM is 1. The equation is
H o m o g e n e i t y = i , j p ( i , j ) 1 + | i j |
Energy” returns the sum of squares of all elements in the GLCM. The value range is [0, 1]. The energy of an image composed of constants is 1. The calculation equation is
E n e r g y = i , j p ( i , j ) 2  

2.3.3. Feature Extraction of Coal and Gangue Images

According to the theories detailed above, the feature vector of each sample image is composed of six image features (contrast, correlation, homogeneity, energy, Encircle–City Feature and Encircle–City Feature auxiliary). As shown in Table 1, the sample included 358 sample images composed of 185 gangue images and 173 coal images.
As space is limited, only some data have been listed; the complete list of data is given in the link in Appendix A.

2.3.4. Flowchart of the Proposed Method

As shown Figure 4, the flow chart of the proposed method includes the steps of inputting samples, initialization of the ASGS-CWOA, the optimization process and recording the data. The details about inputting the samples are given in Section 2.3.2 and Section 2.3.3, and the details of initialization of the ASGS-CWOA, the optimization process and recording the data are described in Section 2.2.1 and Section 2.2.2 above.

3. Simulation Experiment

3.1. Experimental Environment

To verify the feasibility and efficiency of the algorithm proposed in this article, several groups of comparative experiments were carried out by using the new ASGS-CWOA-BP method, the classification method GA-BP based on genetic algorithm optimization and the BP neural network, the classification method PSO-BP based on particle swarm optimization and the BP neural network, the classification method LWCA-BP based on the wolf pack optimization algorithm with the leadership strategy and the BP neural network, and the original BP neural network based on gradient descent and random forest (RF).
Table 1 shows the numerical experimental data based on six-dimensional feature vectors from 358 samples, and Table 2 lists the parameters of the six classification methods for coal and gangue images. The comparative experiments were run on a computer equipped with a CPU (AMD A6-3400m APU with RadeonTM HD Graphics 1.40 GHz), 12.0 GB of memory (11.5 GB available) and Windows 7 (64 bit). To prove the good performance of the proposed algorithm, optimization calculations were run 30 times on the sample feature vectors for testing, and the classification algorithm mentioned above were also tested.

3.2. Experimental Results

Firstly, Figure 5a,b show the comparison curves for the classification accuracy of each algorithm based on the data in Table 3 for the training set and test set, respectively, from which we can intuitively see that the curve for ASGS-CWOA-BP is better than that of the others, except for the pink curve corresponding to RF on the training set, which means that, on the whole, ASGS-CWOA-BP has the best performance in the classification of coal gangue images using RN-CGI.
It can be clearly seen from Figure 5c that the ASGS-CWOA-BP curve is higher than the GA-BP curve in both the training set and the test set, which means that ASGS-CWOA-BP is better than GA-BP in terms of the accuracy of classifying coal gangue images using RN-CGI. In the same way, ASGS-CWOA-BP is better than PSO-BP and LWCA-BP, as shown in Figure 5d,e, respectively. The principle is that these four methods are based on the same intelligent algorithm to optimize the weight of the BP neural network; however, their classification results are not consistent, which shows that the optimization ability of these four intelligent algorithms is different and that the ability of ASGS-CWOA-BP is the best.
Additionally, Figure 5f indicates that the ASGS-CWOA-BP had better performance than the original BP depending on gradient descent for the classification of coal gangue images using RN-CGI, whether on the training set or the test set. In fact, BP depending on gradient descent had the worst performance compared with GA-BP, PSO-BP, LWCA-BP and ASGS-CWOA-BP, which are based on an intelligent algorithm to optimize the weight of the BP neural network, which shows the inherent deficiency of gradient-descent-based BP resulting from limitations by the degree of the gradient descent because of some particularity of the problem to be solved, while intelligent algorithm-based BPs are not subject to such restrictions.
In particular, RF was used as a comparison algorithm to analyze the performance of BPs. It can be seen that RF has a very good curve for the training set but a poor one for the test set (Figure 5g), which means that the model trained by RF will be overfitted due to the small dimensions of the feature vectors, which also shows the superiority of the algorithm proposed in this study.
Finally, the best record, average and variance of the classification accuracy are shown in Figure 6a–c, respectively, from which we can see that the proposed method was better for the best value of classification accuracy than any algorithm except RF on the training set, as well as for the average value. However, the variance of ASGS-CWOA-BP was not better than that of LWCA-BP and RF on the training set, while it was better than that of GA-BP, PSO-BP and BP, as shown in Figure 6c. However, the variance of ASGS-CWOA-BP was less than that of GA-BP, PSO-BP and LWCA-BP and was basically the same as that of BP, although it was a little worse than RF. Thus ASGS-CWOA-BP had the best performance of in terms of the best value and high robustness.

4. Conclusions

To improve the recognition accuracy of coal gangue images, a coal gangue image recognition method based on the BP neural network and ASGS-CWOA (ASGS-CWOA-BP) was proposed, which makes two key contributions. Firstly, a new feature extraction method regarding the unique features of coal and gangue images is proposed. Additionally, a method using ASGS-CWOA to optimize the parameters of the BP neural network was introduced to address the issue of low accuracy in coal gangue image recognition, and a BP neural network with a simple structure and reduced computational consumption was designed. The theoretical research and experimental results revealed that compared with GA-BP, PSO-BP, LWCA-BP, BP and RF, ASGS-CWOA-BP had the best classification accuracy and high robustness under the same conditions.
Compared with the five other algorithms, ASGS-CWOA-BP performed well in most cases on the training set and test set, and its best classification accuracy on the training set was 95.47% while that on the test set was 94.37%, as shown in Table 4 and Figure 6a. It should be emphasized that this was achieved under extremely limited conditions as follows: (1) the structure of the BP-based recognition network was extremely simple (only six-dimensional feature vectors were required in the input layer and only four nodes in the hidden layer), and (2) the number of samples was very small (only 358 coal gangue image samples). These extremely limited conditions greatly reduced the amount of calculation, and the GPU was not used from beginning to end; therefore, all simulation experiments can be implemented only on a laptop with ordinary performance, as detailed above, which shows that the new method proposed in this article has superior performance. In fact, the recognition model trained by this method is quite suitable for use in mobile portable coal gangue image recognition equipment with weak computing power and low energy consumption.
However, what needs to be remembered is that the most popular image recognition model based on deep learning has higher and better recognition or classification accuracy and has been studied by a considerable number of scholars. Unfortunately, the network of this technology is complex (with many levels and a large amount of calculation) and often requires a large number of image samples. On the contrary, this is exactly the advantage of the method proposed in this article.
Our future work is to continue to improve the performance of the wolf pack optimization algorithm and to apply it to optimize a more complex BP-based recognition network to increase the feature dimensions of the extracted coal gangue images and increase the number of samples to improve the classification accuracy of coal gangue images.

Author Contributions

D.W. conceived the algorithm framework and wrote the article; J.N. and D.W. performed the program experiments; J.N. and T.D. contributed the data. All authors have read and agreed to the published version of the manuscript.

Funding

This study was funded by National Key Research and Development Program of China (grant no. SQ2018YFC060172).

Acknowledgments

The authors are grateful to their peer experts for the full support of this paper and thank Zhuhai Xinhe Technology Co., Ltd. and China University of Mining and Technology-Beijing for providing the necessary scientific research environment, as well as special thanks to Beijing Union University for its support of scientific research funds.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Link: https://pan.baidu.com/s/1dlcJGE6_UYNn3vYoQdH_BgExtraction (accessed on 1 February 2022). Code: 4033.

References

  1. Qian, M.; Xu, J.; Wang, J. Further on the sustainable mining of coal. J. China Coal Soc. 2018, 43, 1–13. [Google Scholar]
  2. Zhou, N.; Yao, Y.; Song, W.; He, Z.; Meng, G.; Liu, Y. Present situation and Prospect of coal gangue treatment technology. J. Min. Saf. Eng. 2020, 37, 11. [Google Scholar]
  3. Xue, G.; Li, X.; Qian, X.; Zhang, Y. Coal-gangue image recognition in fully-mechanized caving face based on random forest. Ind. Mine Autom. 2020, 46, 57–62. [Google Scholar]
  4. Xu, Z.Q.; Lv, Z.Q.; Wang, W.D.; Zhang, K.; Lv, H. Machine vision recognition method and optimization for intelligent separation of coal and gangue. J. China Coal Soc. 2020, 45, 2207–2216. [Google Scholar]
  5. Yu, G. Expanded order co-occurrence matrix to differentiate between coal and gangue based on interval grayscale compression. J. Image Graph. 2012, 8, 966–970. [Google Scholar]
  6. Yu, L. A New Method for Image Recognition of Coal and Coal Gangue. Mod. Comput. 2017, 17, 68–72. [Google Scholar]
  7. Rao, Z.; Wu, J.; Li, M. Coal-gangue image classification method. Ind. Mine Autom. 2020, 46, 69–73. [Google Scholar]
  8. Wen, X. Intelligent Fault Diagnosis Technology: Matlab Application; Beijing University of Aeronautics and Astronautics Press: Beijing, China, 2015. [Google Scholar]
  9. Zheng, Y.-G.; Wang, P.; Ma, J.; Zhang, H.B. Remote sensing image classification based on BP neural network model. Trans. Nonferrous Met. Soc. China 2005, 15, 232–235. [Google Scholar]
  10. Chen, Y.X.; Liao, X.D.; Wang, J.H.; Tao, Z.; Sui, L.Y. Small Image Recognition Classification Based on PCA and GA-BP Neural Network. In Proceedings of the 2018 2nd IEEE Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC 2018), Xi’an, China, 25–27 May 2018; pp. 1360–1363. [Google Scholar]
  11. Zhou, W.C.; Xie, G.S.; Liu, B. The application of mixed GA-BP algorithm on remote sensing image classification. In Proceedings of the Conference: Geoinformatics 2008 and Joint Conference on GIS and Built Environment: Classification of Remote Sensing Images, Guangzhou, China, 28–29 June 2008. [Google Scholar]
  12. Liu, G.; Wei, X.; Zhang, S.; Cai, J.; Liu, S. Analysis of epileptic seizure detection method based on improved genetic algorithm optimization back propagation neural network. Shengwu Yixue Gongchengxue Zazhi/J. Biomed. Eng. 2019, 36, 24–32. [Google Scholar]
  13. Liu, M.; Guan, W.; Yan, J.; Hu, H. Correlation identification in multimodal weibo via back propagation neural network with genetic algorithm. J. Vis. Commun. Image Represent. 2019, 60, 312–318. [Google Scholar] [CrossRef]
  14. Yu, J.; Zhang, Z.; Guo, P.; Qin, H.; Zhang, J. Multispectral remote sensing image classification based on PSO-BP considering texture. In Proceedings of the 7th World Congress on Intelligent Control and Automation (WCICA), Chongqing, China, 25–27 June 2008; pp. 6803–6806. [Google Scholar]
  15. Chen, Y.X.; Liao, X.D.; Wang, J.H.; Tao, Z.; Sui, L.Y. Small Image Recognition Classification Based on Random Dropout and PSO-BP. In Proceedings of the 2018 2nd IEEE Advanced Information Management, Communicates, Electronic and Automation Control Conference, Xi’an, China, 25–27 May 2018; pp. 1243–1246. [Google Scholar]
  16. Yu, J.; Li, Y.; Zhang, Z.S.; Jiang, J.C. Research on supervised classification of fully polarimetric SAR image using BP neural network trained by PSO. In Proceedings of the World Congress on Intelligent Control and Automation (WCICA), Jinan, China, 7–9 July 2010; pp. 6152–6157. [Google Scholar]
  17. Wei, B.; Hu, L.; Zhang, Y.; Zhang, Y. Parts Classification based on PSO-BP. In Proceedings of the 2020 IEEE 4th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC 2020), Chongqing, China, 12–14 June 2020; pp. 1113–1117. [Google Scholar]
  18. Wang, W.; Lu, K.; Wu, Z.; Long, H.; Zhang, J.; Chen, P.; Wang, B. Surface defects classification of hot rolled strip based on improved convolutional neural network. ISIJ Int. 2021, 61, 1579–1583. [Google Scholar] [CrossRef]
  19. Dong, H.; Jiao, R.; Huang, M. Research on recognition method of cloud precipitation particle shape based on bp neural network. MATEC Web Conf. 2021, 336, 06011. [Google Scholar] [CrossRef]
  20. Yang, C.; Tu, X.; Chen, J. Algorithm of Marriage in Honey Bees Optimization Based on the Wolf Pack Search. In Proceedings of the International Conference on Intelligent Pervasive Computing, Jeju, Korea, 11–13 October 2007; Volume 871, pp. 462–467. [Google Scholar]
  21. Li, H.; Wu, H. An oppositional wolf pack algorithm for Parameter identification of the chaotic systems. Opt. Int. J. Light Electron Opt. 2016, 127, 9853–9864. [Google Scholar] [CrossRef]
  22. Chen, Y.B.; Mei, Y.S.; Yu, J.Q.; Su, X.L.; Xu, N. Three-dimensional Unmanned Aerial Vehicle Path Planning Using Modified Wolf Pack Search Algorithm. Neurocomputing 2017, 266, 445–457. [Google Scholar]
  23. Yang, N.; Guo, D.L. Solving Polynomial Equation Roots Based on Wolves Algorithm. Sci. Technol. Vis. 2016, 15, 35–36. [Google Scholar]
  24. Zhou, Q.; Zhou, Y. Wolf colony search algorithm based on leader strategy. Appl. Res. Comput. 2013, 30, 2629–2632. [Google Scholar]
  25. Wang, D.; Ban, X.; Qian, X. An Adaptive Shrinking Grid Search Chaos Wolf Optimization Algorithm with Adaptive Standard-Deviation Updating Amount. Comput. Intell. Neurosci. 2020, 2020, 7986982. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Schematic diagram of Encircle—City Feature.
Figure 1. Schematic diagram of Encircle—City Feature.
Symmetry 14 00880 g001
Figure 2. Recognition network for coal and gangue images.
Figure 2. Recognition network for coal and gangue images.
Symmetry 14 00880 g002
Figure 3. Flowchart of image preprocessing.
Figure 3. Flowchart of image preprocessing.
Symmetry 14 00880 g003
Figure 4. Flowchart of the proposed method.
Figure 4. Flowchart of the proposed method.
Symmetry 14 00880 g004
Figure 5. Classification accuracy comparison curve. (a) Comparison on the training set; (b) comparison on the test set; (c) ASGS-CWOA-BP vs. GA-BP; (d) ASGS-CWOA-BP vs. PSO-BP; (e) ASGS-CWOA-BP vs. LWCA-BP; (f) ASGS-CWOA-BP vs. BP; (g) ASGS-CWOA-BP vs. RF. Red: ASGS-CWOA-BP; green: GA-BP; black: PSO-BP; blue: LWCA-BP; cyan: original BP based on gradient descent; pink: RF. Circles indicate data from the training set while * indicates data from the test set.
Figure 5. Classification accuracy comparison curve. (a) Comparison on the training set; (b) comparison on the test set; (c) ASGS-CWOA-BP vs. GA-BP; (d) ASGS-CWOA-BP vs. PSO-BP; (e) ASGS-CWOA-BP vs. LWCA-BP; (f) ASGS-CWOA-BP vs. BP; (g) ASGS-CWOA-BP vs. RF. Red: ASGS-CWOA-BP; green: GA-BP; black: PSO-BP; blue: LWCA-BP; cyan: original BP based on gradient descent; pink: RF. Circles indicate data from the training set while * indicates data from the test set.
Symmetry 14 00880 g005aSymmetry 14 00880 g005b
Figure 6. Statistical analysis of the classification accuracy. (a) Best recorded classification accuracy; (b) average classification accuracy; (c) variance of the classification accuracy.
Figure 6. Statistical analysis of the classification accuracy. (a) Best recorded classification accuracy; (b) average classification accuracy; (c) variance of the classification accuracy.
Symmetry 14 00880 g006
Table 1. Feature vector of the sample set.
Table 1. Feature vector of the sample set.
OrderContractCorrelationHomogeneityEnergyEncircle–City FeatureEncircle–City Feature Auxiliary
16.080.820.660.140.380.49
25.40.80.630.090.360.43
32.940.880.750.220.370.42
47.920.730.590.080.340.41
58.090.770.640.130.340.51
67.810.790.650.140.330.46
……
3533.520.890.730.130.30.34
3542.540.920.780.130.280.28
3553.130.90.730.090.340.32
3563.210.910.730.090.310.36
3572.810.910.730.110.290.28
3583.970.870.730.170.310.38
Table 2. Configuration of the other methods in the comparison.
Table 2. Configuration of the other methods in the comparison.
OrderNameConfiguration
1GP-BPGA is applied to optimize the BP neural network. The genetic algorithm experiment uses the toolbox of MATLAB 2017A, and its configuration parameters are as follows: the crossover probability is set to 0.7, the mutation probability is set to 0.01 and the generation gap is set to 0.95.
2PSO-BPPSO is applied to optimize the parameters of the BP neural network to produce the PSO-BP classification method. The toolbox called “PSOt” in MATLAB is used in experiments of particle swarm optimization, with the following configuration: individual acceleration = 2; weighted initial time = 0.9; weighted convergence time = 0.4. This limits the individual speed to 20% of the variation range.
3LWCA-BPLWCA is applied to optimize the parameters of the BP neural network to produce the LWCA-BP method based on the ideas presented in [24]. The configuration is: migration step (Step A) = 1.5, summons–raid step (Step B) = 0.9, siege threshold (R0) = 0.2, upper limit of the siege step (Step cmax) = 1 × 106, lower limit of the siege step (Step cmin) = 1 × 10−2, updated amount of the population (M) = 5, maximum number of iterations (T) = 600, number of wolves in the population = 50.
4BP with Gradient Descent (BP)BP neural network with gradient descent. This calls the BP neural network training function of MATLAB 2017b to generate the BP network net = newff (P, t, s). The sim (net, in) function is then used to predict the input data. P represents the training sample set, T represents the labels of the training sample set, s represents the network parameters (such as the number of hidden layers), net represents the trained network classification prediction model and in is the input data to be determined.
5Random Forest (RF)This calls the random forest function classrf_train of MATLAB 2017b to train the training network and calls classrf_predict to predict the training samples and test samples.
6ASGS-CWOA-BPUpper limit number of iterations (T) = 600; number of wolves in the population (N) = 50, Range_max = 5 and Range_min = −5, i.e., the value range is [−5, 5] in any dimension for the position of one wolf.
Table 3. Experimental records.
Table 3. Experimental records.
OrderClassification Accuracy on the Training SetClassification Accuracy on the Test Set
ASGS-CWOA-BPGA-BPPSO-BPLWCA-BPBPRFASGS-CWOA-BPGA-BPPSO-BPLWCA-BPBPRF
10.92330.8850.90940.90940.89210.95770.80280.87320.85920.78870.7746
20.93730.8780.8920.90590.89210.92960.88730.8310.87320.78870.7887
30.94080.8850.8850.90940.916410.90140.8310.87320.87320.8310.7887
40.93730.87460.90590.91640.909410.90140.8310.90140.87320.8310.7746
50.93380.91640.90240.91990.909410.88730.88730.84510.85920.8310.7746
60.91640.87110.88850.93380.909410.87320.8310.87320.94370.8310.7887
70.94770.89550.88850.92680.909410.90140.84510.88730.90140.8310.7746
80.95470.8920.89550.91290.909410.94370.80280.87320.85920.8310.7887
90.93730.90940.8780.91640.909410.90140.85920.87320.84510.8310.7887
100.91990.8920.91290.91290.933810.90140.85920.84510.90140.85920.7887
110.94770.88150.8990.91990.933810.91550.80280.8310.91550.8310.7887
120.94080.89550.91640.91640.933810.92960.87320.88730.88730.8310.7887
130.93380.88850.87460.90590.940810.91550.8310.80280.88730.84510.7746
140.91640.90240.8920.90240.940810.90140.88730.87320.87320.84510.7746
150.92330.88150.91640.91290.940810.91550.85920.88730.8310.84510.7887
160.91640.8920.8850.91290.940810.90140.8310.84510.85920.84510.7887
170.92680.90240.89550.90940.940810.92960.84510.88730.88730.84510.7887
180.93380.8850.91640.90940.940810.95770.8310.87320.85920.84510.7887
190.92330.8920.90240.91290.940810.91550.81690.8310.87320.84510.7746
200.94080.89550.8850.90590.940810.90140.87320.87320.81690.84510.7887
210.93730.89550.8850.91990.940810.92960.84510.87320.91550.84510.7887
220.93380.89550.89550.91990.940810.92960.81690.85920.90140.84510.7887
230.94770.8920.88850.90940.940810.91550.80280.80280.91550.84510.7887
240.92680.88150.8990.91290.940810.90140.81690.81690.87320.84510.7887
250.94080.87110.8990.91640.940810.92960.77460.80280.8310.84510.7887
260.93030.87110.90940.90590.940810.92960.80280.87320.80280.84510.7746
270.92330.86410.90240.91640.940810.88730.81690.85920.87320.84510.7746
280.93030.87110.90940.90590.940810.91550.88730.85920.91550.84510.7887
290.94080.8990.8780.91640.940810.91550.81690.85920.88730.84510.7887
300.93730.8850.88850.91290.940810.88730.84510.87320.90140.84510.7746
Table 4. Statistical analysis of classification accuracy.
Table 4. Statistical analysis of classification accuracy.
MethodTraining SetTest Set
Best AccuracyAverageVarianceCorresponding AccuracyAverageVariance
ASGS-CWOA-BP95.47%0.93330.010194.37%0.91410.02
GA-BP91.64%0.8880.012288.73%0.83710.0302
PSO-BP90.59%0.89650.01290.14%0.85820.0272
LWCA-BP93.38%0.91360.006794.37%0.87650.0317
BP94.08%0.92970.016384.51%0.83760.0151
RF100%1078.87%0.7840.0068
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Wang, D.; Ni, J.; Du, T. An Image Recognition Method for Coal Gangue Based on ASGS-CWOA and BP Neural Network. Symmetry 2022, 14, 880. https://doi.org/10.3390/sym14050880

AMA Style

Wang D, Ni J, Du T. An Image Recognition Method for Coal Gangue Based on ASGS-CWOA and BP Neural Network. Symmetry. 2022; 14(5):880. https://doi.org/10.3390/sym14050880

Chicago/Turabian Style

Wang, Dongxing, Jingxiu Ni, and Tingyu Du. 2022. "An Image Recognition Method for Coal Gangue Based on ASGS-CWOA and BP Neural Network" Symmetry 14, no. 5: 880. https://doi.org/10.3390/sym14050880

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop