We present a new method for inferring galaxy star formation histories (SFH) using machine learning methods coupled with two cosmological hydrodynamic simulations. We train convolutional neural networks to learn the relationship between synthetic galaxy spectra and high-resolution SFHs from the eagle and Illustris models. To evaluate our SFH reconstruction we use Symmetric Mean Absolute Percentage Error (SMAPE), which acts as a true percentage error in the low error regime. On dust-attenuated spectra we achieve high test accuracy (median SMAPE = 10.5 per cent). Including the effects of simulated observational noise increases the error (12.5 per cent), however this is alleviated by including multiple realizations of the noise, which increases the training set size and reduces overfitting (10.9 per cent). We also make estimates for the observational and modelling errors. To further evaluate the generalization properties we apply models trained on one simulation to spectra from the other, which leads to only a small increase in the error (median SMAPE |$\sim 15{\,{\rm {per\, cent}}}$|⁠). We apply each trained model to SDSS DR7 spectra, and find smoother histories than in the |$\textsf{vespa}$| catalogue. This new approach complements the results of existing spectral energy distribution fitting techniques, providing SFHs directly motivated by the results of the latest cosmological simulations.

This article is published and distributed under the terms of the Oxford University Press, Standard Journals Publication Model (https://academic.oup.com/journals/pages/open_access/funder_policies/chorus/standard_publication_model)