# Mineral Identification Based on Deep Learning Using Image Luminance Equalization
## 2 The Proposed Method
### A New Algorithm Based on HELaplace
Since some of the images directly obtained from the website were taken under a microscope or after processing, this may have some influence on the experimental results. Therefore, we artificially removed the images that did not meet the requirements in the dataset during the collection process. We uniformly mixed each of the obtained mineral images in the ratio of 10:1:1 and separated them into a training set, a validation set, and a test set. An example of the mineral images is shown in Figure 5.

Figure 4: Change in (**a**) loss value and (**b**) precision value. Figure 5: Examples of cropped images ((**a–d**) chalcopyrite; (**e–h**) copper; (**i–l**) elbaite; and (**m–p**) demandtoid). The original images are from Mindat. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**\#No.** & **Mineral** & \
\begin{tabular}{c} **Number of** \\ **Samples** \\ \end{tabular} & **\#No.** & **Mineral** &
\begin{tabular}{c} **Number of** \\ **Samples** \\ \end{tabular} \\ \hline
1 & Adularia & 738 & 26 & Hematite & 6086 \\
2 & Aegirine & 909 & 27 & Magnetite & 2615 \\
3 & Agate & 3636 & 28 & Malachite & 7919 \\
4 & Albiite & 1882 & 29 & Marcastle & 1748 \\
5 & Almandine & 2124 & 30 & Moissanite & 10 \\
6 & Amber & 294 & 31 & Niccolite & 245 \\
7 & Anglesite & 1981 & 32 & Nitratine & 10 \\
8 & Azurite & 8320 & 33 & Opal & 3283 \\
9 & Beryl & 9836 & 34 & Orpiment & 754 \\
10 & Biotite & 1437 & 35 & Ozocerite & 23 \\
11 & Boracite & 240 & 36 & Pyrite & 13,042 \\
12 & Cassisterite & 3321 & 37 & Quartz & 46,398 \\
13 & Chalcopyrite & 3296 & 38 & Rhodochrosite & 4510 \\
14 & Cinnabar & 1618 & 39 & Ruby & 872 \\
15 & Copper & 5504 & 40 & Sapphire & 1056 \\
16 & Demantoid & 785 & 41 & Schorl & 2200 \\
17 & Diopside & 1649 & 42 & Selenium & 106 \\
18 & Elbaite & 5683 & 43 & Splaherite & 6412 \\
19 & Epidote & 3915 & 44 & Stiphire & 2548 \\
20 & Fluorite & 28,147 & 45 & Sulphur & 1843 \\
21 & Galena & 6661 & 46 & Topaz & 3926 \\
22 & Goethite & 4063 & 47 & Torbernite & 1170 \\
23 & Gold & 4796 & 48 & Turquoise & 988 \\
24 & Gypsum & 2439 & 49 & Whewellite & 94 \\
25 & Halite & 821 & 50 & Wulfenite & 8104 \\ \hline  & Total & & & 220,057 & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Names of the minerals and the number of samples. ### Test Result

We used the YOLOv5 neural network and HELaplace+YOLOv5 neural network to test images with too little light and too much light, respectively, and the average accuracy obtained is shown in Table 4. The test results show that the combination of the HELaplace and YOLOv5 algorithms can greatly improve the identification accuracy. Figure 6 shows the accuracy of mineral identification for all 50 categories. As we can see, except for specific minerals, all of our minerals are identified with an accuracy of more than 80%. Among them, four minerals possess relatively low accuracy due to the a small number of training samples, which include Moissanite, Nittratine, Ozocerite and Selenium. Using HELaplace in combination with YOLOv5, the accuracy of all mineral species was improved compared to the results without using HELaplace, especially the identification accuracy of minerals (Azurite, Chalcopyrite, Galena, Topaz) which was improved by 10%. The main reason is that the images taken in insufficiently or excessively bright light will have chromatic aberrations due to the light, many minerals have similar shapes and textures, and the resulting chromatic aberrations make it difficult for the model to correctly identify them based on the images. After applying HELaplace, the minerals (Adularia, Magnetite, and Malachite) do not significantly improve the accuracy, which is due to the fact that these minerals themselves are too dark and less influenced by light. It can be seen from Table 4 and Figure 6 that combining HELaplace with YOLOv5 can improve the identification accuracy of most minerals. ### Comparison with Other Methods

Table 5 demonstrates the number and accuracy of identified minerals for existing mineral detection methods.