Automatic Classification of Plutonic Rocks with Machine Learning Applied to Extracted Shades and Colors on iOS Devices

Conference paper
Part of the Lecture Notes in Networks and Systems book series (LNNS, volume 358)


Light/dark shades and color are some properties used for the classification of plutonic rocks but are difficult to measure because they depend on the experience of the observer. Moreover, the classification of plutonic rocks using various instrumental techniques tends to be expensive and time-consuming. To address this situation, we extracted dominant shades and colors from 283 plutonic rock images in RGB and CIELAB formats to train several machine learning models. The best model was deployed on an iOS application that identifies four classes of plutonic rocks from darkest to lightest: gabbro, diorite, granodiorite, and granite. The best results were for the K-Nearest Neighbors model using CIELAB dominant colors data with accuracy, precision, recall, and F-score of 93%.


Plutonic rock classification Feature extraction Dominant colors Machine learning IOS Application 


  1. 1.
    Abadi, M., et al.: TensorFlow: large-scale machine learning on heterogeneous distributed systems (2016). arXiv:n1603.04467 [cs.DC]
  2. 2.
    Apple. Swift. The powerful programming language that is also easy to learn. Available:
  3. 3.
    Cheng, G., Guo, W.: Rock images classification by using deep convolution neural network. In: Journal of Physics: Conference Series, vol. 887, pp. 012089, August 2017Google Scholar
  4. 4.
    CocoaPods: What is CocoaPods. Available:
  5. 5.
    Encyclopædia Britannica: Diorite, January 2009. Available: diorite
  6. 6.
    Fan, G., Chen, F., Chen, D., Dong, Y.: Recognizing multiple types of rocks quickly and accurately based on lightweight CNNs model. IEEE Access 8, 55269–55278 (2020)CrossRefGoogle Scholar
  7. 7.
    Fan, G., Chen, F., Chen, D., Li, Y., Dong, Y.: A deep learning model for quick and accurate rock recognition with smartphones. Mob. Inf. Syst. 2020, 1–14 (2020)Google Scholar
  8. 8.
    Géron, A.: Hands-on Machine Learning with Scikit-Learn, Keras, and TensorFlow. O’Reilly UK Ltd., Farnham (2019)Google Scholar
  9. 9.
    Harrington, P.: Machine Learning in Action. Manning Pubn, Shelter Island (2012)Google Scholar
  10. 10.
    Lary, D.J., et al.: Machine learning applications for Earth observation. In: Mathieu, P.P., Aubrecht, C. (eds.) Earth Observation Open Science and Innovation. ISRS, vol. 15, pp. 165–218. Springer, Cham (2018). Scholar
  11. 11.
    Maitre, J., Bouchard, K., Bédard, L.P.: Mineral grains recognition using computer vision and machine learning. Comput. Geosci. 130, 84–93 (2019)CrossRefGoogle Scholar
  12. 12.
    Natural resources conservation service. part 631: Geology. In: National Engineering Handbook, number 210-VI, vol. 4, p. 7 (2012)Google Scholar
  13. 13.
    Pedregosa, F., et al.: Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12(85), 2825–2830 (2011)MathSciNetzbMATHGoogle Scholar
  14. 14.
    Ran, X., Xue, L., Zhang, Y., Liu, Z., Sang, X., He, J.: Rock classification from field image patches analyzed using a deep convolutional neural network. Mathematics 7(8), 755 (2019)CrossRefGoogle Scholar
  15. 15.
    Reinders, C., Ackermann, H., Yang, M.Y., Rosenhahn, B.: Chapter 4 - Learning convolutional neural networks for object detection with very little training data. In: Yang, M.Y., Rosenhahn, B., Murino, V. (eds.) Multimodal Scene Understanding, pp. 65–100. Academic Press (2019)Google Scholar
  16. 16.
    Scikit-learn. Nearest neighbors. Available:
  17. 17.
    Tan, L.: Chapter 17 - Code comment analysis for improving software quality. In: Bird, C., Menzies, T., Zimmermann, T. (eds.) The Art and Science of Analyzing Software Data, pp. 493–517. Morgan Kaufmann, Boston (2015)Google Scholar
  18. 18.
    TensorFlow: TensorFlow Lite guide, March 2020. Available:
  19. 19.
    Vera, J., et al.: RACEFEN Glosario de geología. Available: rac.htm
  20. 20.
    Zhang, Y., Li, M., Han, S., Ren, Q., Shi, J.: Intelligent identification for rock-mineral microscopic images using ensemble machine learning algorithms. Sensors 19(18), 3914 (2019)CrossRefGoogle Scholar

Copyright information

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022

Authors and Affiliations

  1. 1.Facultad de Ingeniería y TecnologíaUniversidad de MontemorelosMontemorelosMexico
  2. 2.Department of Earth and Biological SciencesLoma Linda UniversityLoma LindaUSA
  3. 3.Geoscience Research InstituteLoma LindaUSA

Personalised recommendations