We present mineralML (mineral classification using Machine Learning) for probabilistic classification of common igneous minerals. mineralML provides functions for calculating stoichiometries and crystallographic sites based on this classification, along with functions for handling mapped EDS data. Utilizing this package allows for the identification of misclassified mineral phases and poor-quality data. We streamline data processing and cleaning to allow for the rapid transition to usable data, improving the utility of data curated in these databases and furthering computing and modeling capabilities.
Read the documentation for a run-through of the mineralML code.
If you use mineralML in your work, please cite this preprint. This package represents a significant time investment. Proper citation helps support continued development and academic recognition.
Shi, S., Wieser, P., Gordon, C., Toth, N., Antoshechkina, P.M., Gleeson, M., Lehnert, K., (2026) mineralML: Leveraging Machine Learning for Probabilistic Mineral Classification in Geochemical Databases", Earth ArXiv. doi:10.31223/X53J2M@article{Shietal2026,
doi = {10.31223/X53J2M},
url = {https://doi.org/10.31223/X53J2M},
year = {2026},
author = {Shi, Sarah C and Wieser, Penny E and Gordon, Charlotte and Toth, Norbert and Antoshechkina, Paula M and Gleeson, Matthew LM and Lehnert, Kerstin},
title = {mineralML: Leveraging Machine Learning for Probabilistic Mineral Classification},
journal = {Earth ArXiv},
}
Open the mineralML web app at mineralml.streamlit.app. Upload a CSV or Excel file of oxide wt% (or type analyses in manually), get mineral classifications with prediction scores, and download an Excel workbook with one sheet per mineral plus stoichiometry sheets. The app sleeps after 12 hours without visitors; if you see a wake-up button, click it and wait ~30 seconds.
To run the app locally, see webapp/README.md.
If you do not have Python installed locally, run mineralML on Google Colab. The Cloud-based version runs rapidly, with test cases of >10,000 microanalyses classified within 4 seconds.
Obtain a version of Python between 3.10 and 3.14 if you do not already have it installed. mineralML can be installed with one line. Open terminal and type the following:
pip install mineralML
Make sure that you keep up with the latest version of mineralML. To upgrade to the latest version of mineralML, open terminal and type the following:
pip install mineralML --upgrade