# Mineral Identification Based on Deep Learning Using Image Luminance Equalization
## 2 The Proposed Method
### A New Algorithm Based on HELaplace
This allows the input and output of BottleneckCSP to be the same size, which enables the model to learn more features. The neck of YOLOv5 has the same FPN+PAN structure as in YOLOv4. However, the convolution operation used in the neck of YOLOv4 is regular. In contrast, the CSP2

Figure 1: (**a**) Original image; (**b**) image processed by HE; (**c**) image processed by Laplace; and (**d**) image processed by HELaplace. Figure 2: The structure of our model. structure inspired by the CSPNet [31] design is used in the neck structure of YOLOv5 to enhance the network feature fusion and improve the identification accuracy. ### Model Training

In this paper, the deep learning integrated development environment is Pycharm. Test environment: NVIDIA GTX 1060, 8G memory, Intel Core(TM) i7-8750H CPU, and Python 3.8 as the compiler language. The parameters we used for model training are shown in Table 2. Parameters not listed in the table are used as default values. In our experiments, we use the GLOU function [32] as our loss function. Its smaller value indicates more accurate results. The expression of its function is

\[\text{Glou}_{\text{loss}}=-\frac{1}{\sum_{p}1}\sum_{p}(1-\text{lou}_{p}) \tag{4}\]

where \(p\) denotes the predicted positive example index and \(\text{lou}_{p}\) is the intersection ratio of the predicted positive example frame \(p\) to the corresponding true frame. We recorded the changes in loss function GLOU values during the training process and tested the accuracy of the model on the validation set after each iteration of the training set was completed. The change in GLOU loss during the training process is shown in Figure 4. It can be seen that the model converges effectively, and the GLOU loss has reached a low level after 50 epochs. According to the figure, the model achieves the best accuracy \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Configuration** \\ \hline Pre-training weight & YOLOv5S.PT \\ Epochs & 100 \\ Sample size & 183,380 \\ Conf-thres & 0.05 \\ Iou-thres & 0.45 \\ Img-size & 640 \\ Batch-size & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters used for model training. Figure 3: The main model of YOLOv5 network. on the validation set after the 90 th iteration, and the accuracy decreases after continuing the training, probably due to some overfitting. ## 4 Test Result and Discussion

To test the accuracy of our method, we selected 13,911 images from a collection of 220,057 images for testing our neural network model. After inputting one of the images into the neural network, the mineral category with the highest probability is given. We evaluate the performance of our method in terms of accuracy, and also compare it with other methods and give results. ### Data

The training of mineral identification using YOLOv5 requires a large amount of data during validation and testing. The more data available for training, the more generalizable and robust the model will be, and the higher the accuracy will be. To obtain a large amount of specialized image data for a wide range of minerals, we chose to use image data from Mindat [33]. Mindat is a community-led global mineral and provenance database website and the world's largest database of mineral information. In this paper, one mineral is selected as a training representative in the database according to the mineral category criteria [33] in each mineral major category to obtain adequate category coverage. To further extend the mineral coverage categories, we expanded 26 minerals from those covered by work [16]. Therefore, the images of a total of 50 minerals were collected as experimental samples. The names of relevant minerals and the number of samples are shown in Table 3. Among them, the small numbers of samples of certain minerals are due to their rarity, which makes it difficult to obtain a large number of samples. It is worth noting that all samples of minerals in this paper are labeled according to the classification criteria of Mindat.