This paper describes an innovative machine-learning application, based on variational autoencoder frameworks, to quantify the concentrations and associated uncertainties of common minerals in sedimentary formations using the measurement of atomic element concentrations from geochemical spectroscopy logs as inputs. The algorithm comprises an input(s), encoder, decoder, output(s), and a novel cost function to optimize the model coefficients during training. The input to the algorithm is a set of dry-weight concentrations of atomic elements with their associated uncertainty. The first output is a set of dry-weight fractions of 14 minerals, and the second output is a set of reconstructed dry-weight concentrations of the original elements. Both sets of outputs include estimates of uncertainty on their predictions. The encoder and decoder are multilayer feed-forward artificial neural networks (ANN), with their coefficients (weights) optimized during calibration (training). The cost function simultaneously minimizes error (accuracy metric) and variance (precision or robustness metric) on the mineral and reconstructed elemental outputs. Training of the weights is done using a set of several-thousand core samples with independent, high-fidelity elemental and mineral (quartz, potassium-feldspar, plagioclase-feldspar, illite, smectite, kaolinite, chlorite, mica, calcite, dolomite, ankerite, siderite, pyrite, and anhydrite) data. The algorithm provides notable advantages over existing methods to estimate formation lithology or mineralogy relying on simple linear, empirical, or nearest-neighbor functions. The ANN numerically capture the multidimensional and nonlinear geochemical relationship (mapping) between elements and minerals that is insufficiently described by prior methods. Training is iterative via backpropagation and samples from Gaussian distributions on each of the elemental inputs, rather than single values, for every sample at each iteration (epoch). These Gaussian distributions are chosen to specifically represent the unique statistical uncertainty of the dry-weight elements in the logging measurements. Sampling from Gaussian distributions during training reduces the potential for overfitting, provides robustness for log interpretations, and further enables a calibrated estimate of uncertainty on the mineral and reconstructed elemental outputs, all of which are lacking in prior methods. The framework of the algorithm is purposefully generalizable so that it can be adapted across geochemical spectroscopy tools. The algorithm reasonably approximates a “global-average” model that requires neither different calibrations nor expert parameterization or intervention for interpreting common oilfield sedimentary formations, although the framework is again purposefully generalizable so it can be optimized for local environments where desirable. The paper showcases a field application of the method for estimating mineral type and abundance in oilfield formations from wellbore-logging measurements.