Simulated petrological labels enable probabilistic mineralogy prediction from whole-rock geochemistry
Authors: Matthew J. Liu, Aaron D. Kaplan, Michael L. Whittaker, Kristin A. Persson
Organizations: Materials Sciences Division, Lawrence Berkeley National Laboratory, Berkeley, CA, USA · Energy Geosciences Division, Lawrence Berkeley National Laboratory, Berkeley, CA, USA
Modal mineralogy, the mineral identities and abundances in rocks, guides geological studies and industrial resource extraction. While measuring modal mineralogy is time-intensive, whole-rock chemical measurements furnish elemental concentrations at higher throughput. Predicting mineralogy from elemental data, however, poses a one-to-many inverse problem, and labeled mineralogical datasets are too sparse to train on at scale. We address both challenges by simulating petrological labels that express multiple formation conditions per composition and at a scale unattainable by measurements. Nearly one million simulated labels supervise the middle component of a three-part model: a transformer encoder self-supervised on roughly 788,000 whole-rock compositions, the simulation-trained heads that predict distributions over mineral assemblages, and a recalibration layer that aligns the predictions with measured mineralogy. Zero-shot on 640 volcanic rocks, the model discriminates the presence of most mineral categories and predicts which rocks are richer in each mineral. However, the predicted abundances are systematically offset from measured values. Recalibration fit on as few as 25 labeled rocks recovers 76 percent of the likelihood improvement from fitting on the full 368-rock fitting set, while abundance error responds more slowly (11.0% zero-shot and 9.5% with the full fitting set). This work demonstrates how a machine learning model in the geochemical sciences can both leverage an imperfect simulator and mitigate its systematic biases.
Figures & tables
Figure 1: Zero-shot predictions over 640 volcanic rocks. (a) Model inputs. (b) Presence AUROC per mineral category, where the dotted line represents a random classifier. Whiskers span the 25th to 75th percentile across bootstrap resamples of stratigraphic units. (c) Violin plots for predicted vs. measured mineral abundance when the heads are given the measured mineral list as their support (i.e., teacher-forced). In (a) and (c), violin width reflects the density of rocks at each value and the tick marks the median. Mineral abbreviations in Table B9 .
Figure 2: Recalibration improves mineral predictions. Zero-shot vs. recalibrated predictions on the test set rock with the median recalibrated joint NLL. (a) Model input. (b, c) Zero-shot presence probability and mineral abundance. (d, e) Analogous predictions after a 25-rock fit. Abundance panels (c and e) each summarize 2,048 candidate assemblages sampled from the presence probabilities of (b and d), respectively. Points denote the mean across candidates, shaded bands indicate the 25th to 75th percentile, and gray lines connect predicted to measured values. Mineral abbreviations in Table B9 .
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
Family
Challenge addressed
Adopted in this work
Site-specific tabular models
Predicting quantities that are costly to measure at an operating site
–
Grain-scale classifiers
Automated mineral identification from spot chemistry
Stoichiometric naming rules (Appendix B.4 )
Normative and unmixing calculation
Estimating mineralogy from bulk composition
The prediction task and precedent for probabilistic output
Thermodynamic simulators
Computing equilibrium assemblages at fixed conditions
The label generator
Simulation-to-real transfer
Carrying simulation-trained models to real-world measurements
Recalibration paradigm
Appendix
Table A1: Prior families of work in geochemical prediction, the challenge each addresses in its respective field, and what this work adopts from each.
Group
Count
Members
frac
Majors
9
Si, Al, Ca, Mg, Fe, K, Na, Ti, Cr
wt% / 100
Traces
13
Sr, Zr, Ba, Y, Rb, Ni, Nb, V, La, Ce, Nd, Yb, Th
ppm / 106
Redox
1
Fe 3+ /total Fe
ratio, unscaled
Appendix
Table B1: The fixed elemental inputs read by the encoder.
State
src
frac
Attended
Padding (element not reported)
0
0
no
Populated
1–118
>0
yes
Masked for pretraining
119
0
yes
Fe-redox ratio
120
ratio in [0,1]
yes
Appendix
Table B2: Possible states for each token of the input sequence.
Hyperparameter
Meaning
Value
d_model
Dimensionality of latent representation
256
n_layers
Transformer encoder layers
4
n_heads
Attention heads per layer
8
dim_feedforward
Feed-forward width, 4× d_model
1024
activation
Non-linear activation function
GELU
norm_first
Pre-norm residual arrangement
true
Appendix
Table B3: Encoder configuration.
Hyperparameter
Meaning
Value
mask_prob
Fraction of populated rows masked
0.281
batch_size
Rocks per step
32
lr
Adam learning rate
8.18×10−5
weight_decay
Adam weight decay
1.98×10−3
epochs
Ceiling, not a target
60
early_stop_patience
Epochs without val improvement
3
Appendix
Table B4: Pretraining configuration and outcome.
Phase
Abbreviation
Benchmark category
Presence rate (%)
plagioclase
plag
Feldspar
79.3
alkali feldspar
afs
Feldspar
20.0
clinopyroxene
cpx
Pyroxene
76.5
orthopyroxene
opx
Pyroxene
25.4
amphibole
amp
Amphibole
53.3
biotite
bi
Biotite
27.0
Appendix
Table B5: The 21-phase vocabulary of the assemblage head, with each phase’s presence rate, defined as the percent of training labels in which the phase is present (i.e., holds more than 0.1 wt% of the crystal mass). The ten phases above the divider map onto the 7 benchmark categories of Table B9 .
Split
Compositions
Draws each
Melt fractions read (wt%)
Labels
Train
9,946
48
50, 30
949,228
Validation
218
128
50, 30
55,576
Test
274
128
50, 30
69,521
Appendix
Table B6: Size of the simulated label corpus by split.
Head
Predicts
Distribution
Trunk
Parameters
Assemblage
phase presence and abundance
Bernoulli × Dirichlet
3×512
1,346,090
Composition
per-phase oxide composition
Dirichlet per phase
1×128
65,404
Conditions
T , P , dissolved H 2 O
Gaussian mixture per axis
2×512
418,843
Appendix
Table B7: The three prediction heads, where trunk width and depth were tuned by Bayesian search alongside the loss weights and optimizer settings (Appendix B.6 ).
Hyperparameter
Meaning
Range
Selected
lr
AdamW learning rate
10−4 to 10−2
4.70×10−4
weight_decay
AdamW weight decay
10−7 to 10−2
2.46×10−5
λabund
Abundance weight, nominal
0.0048 to 0.048
0.0281
λbalance
Mass-balance weight
10−3 to 104
3.08×10−3
dropout
Trunk dropout, all heads
0 to 0.4
0.260
mode_hidden
Assemblage trunk width
64, 128, 256, 512
512
Appendix
Table B8: Joint search space and optimized values over the training environment and assemblage-head architecture. The remaining weights were fixed during the search at λcomp=1.0 and λcond=0.01 .
Feldspar
Pyroxene
Amphibole
Biotite
Olivine
Fe-Ti oxides
Quartz
fsp
px
amp
bi
ol
opq
q
plagioclase
clinopyroxene
amphibole
biotite
olivine
spinel
quartz
alkali feldspar
orthopyroxene
ilmenite
Appendix
Table B9: Mapping predicted phases onto the 7 mineral categories quantified in [ 14 ] and [ 15 ] .
Reported mineral
Category
Density (g cm -3 )
plagioclase
feldspar
2.68
alkali feldspar
feldspar
2.57
feldspar
feldspar
2.63
quartz
quartz
2.65
silica phases
quartz
2.32
pyroxene
pyroxene
3.40
Appendix
Table B10: Densities used to convert reported volume percent to mass fractions.
Figure C1: Composition and conditions predictions against simulated labels. Predictions for one validation composition, an andesite, was selected because it had the median of the per-composition assemblage NLL at the 50%-melt readout. (a, b) Predicted compositions of the most probable anhydrous phase (clinopyroxene, a) and the most probable hydrous phase (amphibole, b), as ranked by the presence branch. Predicted points represent the mean over 2,048 candidate compositions from the predicted Dirichlet and whiskers span the 25th to 75th percentile. Simulated label points reflect the median of the simulated labels across the composition’s 128 draws and whiskers span the 25th to 75th percentile. (c–e) Predicted formation temperature, pressure, and dissolved water content over 512 assemblages sampled from the presence branch, against the sampled conditions of the same 128 draws.
Figure C2: Zero-shot composition and conditions predictions for a measured rock. Predictions for one benchmark rhyolite, the rock of Fig. 2 , selected for having the median of the recalibrated joint NLL over the test set. (a, b) Predicted composition of the most probable anhydrous phase (alkali feldspar, panel a) and the most probable hydrous phase (biotite, panel b), as ranked by the presence branch. Points represent the mean over 2,048 candidate compositions from the predicted Dirichlet and whiskers span the 25th to 75th percentile. (c–e) Predicted formation temperature, pressure, and dissolved water content over 512 assemblages sampled from the presence branch. The benchmark reports neither mineral compositions nor formation conditions, so no measured counterpart appears.
Figure D1: Recalibration tiers across fit sizes. The three recalibration configurations described in Appendix B.7 . (a) Median joint NLL. For reference, the zero-shot joint NLL is 13.4 nats, above the plotted range. (b) Abundance MAE, reported as the mean of the 7 per-category MAE values, where the dashed line marks the zero-shot value. For both panels, error bars span the interquartile range over the 10 replicates at each fitting size, evaluated on the fixed validation set of 111 rocks spanning 39 stratigraphic units. Axes are shared with Figs. D2 and D3 .
Figure D2: Heads trained on measured abundances across fit sizes. The three heads differing only in their input: the frozen encoder’s latent representation, the composition the latent representation was computed from, or a zero vector. (a) Median joint NLL. For reference, the zero-shot joint NLL is 13.4 nats, above the plotted range. (b) Abundance MAE, reported as the mean of the 7 per-category MAE values, where the dashed line marks the zero-shot value. For both panels, error bars span the interquartile range over the 10 replicates at each fitting size, evaluated on the fixed validation set of 111 rocks spanning 39 stratigraphic units. Axes are shared with Figs. D1 and D3 .
Figure D3: Simulated and measured supervision across fit sizes. The recalibration configuration is the mixture tier described in Appendix B.7 , which corrects predictions supervised by simulated labels. Meanwhile the head is the one given the latent representation, which is trained on measured abundances alone. Both represent the most performant from their respective groups in Figs. D1 and D2 . (a) Median joint NLL. For reference, the zero-shot joint NLL is 13.4 nats, above the plotted range. (b) Abundance MAE, reported as the mean of the 7 per-category MAE values, where the dashed line marks the zero-shot value. For both panels, error bars span the interquartile range over the 10 replicates at each fitting size, evaluated on the fixed validation set of 111 rocks spanning 39 stratigraphic units. Axes are shared with Figs. D1 and D2 .
Major
Si
Al
Ca
Mg
Fe
K
Na
Ti
Cr
R2
0.92
0.92
0.88
0.92
0.86
0.87
0.79
0.90
–
Trace
Sr
Zr
Ba
Y
Rb
Ni
Nb
V
La
Ce
Nd
Yb
Th
R2
0.80
0.80
0.77
0.82
0.89
0.80
0.85
0.83
0.93
0.94
0.94
0.84
0.88
Appendix
Table E1: Per-element imputation performance of the pretrained encoder. To score an element, its value is hidden from the encoder and a decoder recovers it from the frozen pooled latent representation. Each entry is the log-space R2 between recovered and measured concentrations over 157,544 held-out compositions. Cr occupies the ninth major-element row of the input vocabulary but is never reported in the pretraining compilation. Its row therefore always enters as padding, and no measured value exists to score against.
Feldspar
Pyroxene
Amphibole
Biotite
Olivine
Fe-Ti oxides
Quartz
AUROC
0.870
0.780
0.575
0.770
0.829
0.638
0.853
Appendix
Table E2: Zero-shot presence discrimination per mineral category. AUROC of the predicted presence probability, computed over every rock in the benchmark.
Feldspar
Pyroxene
Amphibole
Biotite
Olivine
Fe-Ti oxides
Quartz
Spearman ρ
0.456
0.396
0.350
-0.044
0.762
0.219
0.667
n
601
292
312
322
79
559
148
Appendix
Table E3: Zero-shot abundance ranking per mineral category. Spearman rank correlation between predicted and measured abundance, computed over the n rocks that report a quantity for each category.
Feldspar
Pyroxene
Amphibole
Biotite
Olivine
Fe-Ti oxides
Quartz
Rocks over-predicted (%)
72
37
46
29
41
6
84
Median pred/measured
1.14
0.76
0.92
0.61
0.88
0.34
2.01
n
601
292
312
322
79
559
148
Appendix
Table E4: Zero-shot abundance bias per mineral category. The percentage of rocks where predicted abundance exceeds the measured abundance; the median across rocks of the predicted-to-measured abundance ratio; and the number of rocks n that report a quantity for the category.
Figure F1: Composition encoder pretraining loss. Masked-element reconstruction loss (dimensionless) over pretraining of the composition encoder, where the loss is the standardized log MSE as presented in Eq. 3 . The validation loss is evaluated on held-out compositions from the pretraining set. Training was halted by early stopping once the validation ceased to improve 0.001/epoch.
Figure F2: Per-head training loss. Loss over joint-heads training, where each head is saved at its own best-validation epoch (vertical dashed line). The validation loss is evaluated on the 55,576 rows of the validation compositions (Table B6 ). (a) Assemblage head, the summed presence and abundance loss. (b) Composition head. (c) Conditions head.
Figure F3: Joint NLL decomposed into presence and abundance factors. The three heads trained on measured abundances, differing only in their input (Appendix D ). (a) The presence (Bernoulli) factor of Eq. 1 . (b) The abundance (Dirichlet) factor, where all three heads are given the measured mineral list as their support (i.e., teacher-forced). (c) The joint NLL, the sum of the presence and abundance factors. Note that this panel corresponds exactly to Fig. D2 a. Points are medians and error bars span the interquartile range over the 10 replicates at each fitting size, evaluated on the benchmark validation set. Note that the gap between curves is a difference of medians because each curve summarizes one head separately.
Figure F4: Water sensitivity of amphibole crystallization. Amphibole occurrence and abundance in the simulated label corpus, pooled over the validation compositions.
Geochemical anomaly detection plays a critical role in mineral exploration as deviations from regional geochemical baselines may indicate mineralization. Existing studies suffer from two key limitations: (1) single region scenarios which limit model generalizability; (2) proprietary datasets, which makes result reproduction unattainable. In this work, we introduce GeoChemAD, an open-source benchmark dataset compiled from government-led geological surveys, covering multiple regions, sampling sources, and target elements. The dataset comprises eight subsets representing diverse spatial scales and sampling conditions. To establish strong baselines, we reproduce and benchmark a range of unsupervised anomaly detection methods, including statistical models, generative and transformer-based approaches. Furthermore, we propose GeoChemFormer, a transformer-based framework that leverages self-supervised pretraining to learn target-element-aware geochemical representations for spatial samples. Extensive experiments demonstrate that GeoChemFormer consistently achieves superior and robust performance across all eight subsets, outperforming existing unsupervised methods in both anomaly detection accuracy and generalization capability. The proposed dataset and framework provide a foundation for reproducible research and future development in this direction.
Yihao Ding, Yiran Zhang, Chris Gonzalez +2
The University of Western Australia, Perth, WA, Australia
Scientific drilling has produced large archives of physical, chemical and magnetic measurements linked to descriptions of the rock recovered. These archives are mostly incomplete: instruments sample at different intervals, recovery is partial, and destructive analyses preclude later measurement of the same material. We train an self-supervised embedding model on the LILY ocean drilling database using six routinely logged properties (bulk density, magnetic susceptibility, natural gamma radiation, and red, green and blue reflectance) across 236,963 observations from 296 boreholes, with a masked variational autoencoder that has a heteroscedastic Gaussian decoder and learnable mask tokens. The embeddings separate geologist-assigned lithologies as well as a variant trained with those labels, and increasing the weight on the labels degrades reconstruction while leaving classification unchanged. The labels are recoverable from the measurements geologists use to assign them, so training on them adds nothing. Lithological categories compress continuous measurements into classes, and compressing them discards what the measurements record about the processes that produced the rock. The embeddings also predict physical properties that were absent from training, on boreholes the model has never seen. While depth should account for this since sediments compact with burial, it does not. On held-out boreholes depth alone reaches a median R2 of -0.02, against 0.20 for the embedding.
John M. Aiken, William Gilpin, Thorsten W. Becker
University of Oslo, Oslo, Norway · Expert Analytics, Oslo, Norway · Department of Physics, University of Texas at Austin, Austin, TX, USA +2
Rapid mineral characterization is essential for applications ranging from mineral exploration to industrial ore processing. To this end, Hyperspectral Imaging (HSI) has emerged as a promising sensing modality thanks to its fine spectral resolution, enabling mineral discrimination in both close-range and remote sensing settings. However, the scarcity of publicly available datasets with reliable ground-truth labels hinders the development and evaluation of HSI-based mineral identification methods. We release Minerals in the Wild, a multi-purpose dataset comprising 1,132 rock specimens collected across Europe. For each specimen, we provide an HSI acquisition together with an elemental characterization obtained via an XRF sensor. We define the task of elemental characterization on our dataset and propose a pruning mechanism that removes distant signatures from the USGS dictionary prior to a convex optimization approach for matching HSI pixels with USGS spectral signatures. Finally, we empirically show that our approach outperforms simpler baselines.
Eleftheria Tetoula-Tsonga, George Arvanitakis, Theodoros Giannakas
Institute of Communication and Computer Systems, Athens, Greece · Geonova, Athens, Greece