SunnyNet: A neural network approach to 3D non-LTE radiative transfer
Context. Computing spectra from 3D simulations of stellar atmospheres when allowing for departures from local thermodynamic equilibrium (non-LTE) is computationally very intensive. Aims. We develop a machine learning based method to speed up 3D non-LTE radiative transfer calculations in optically thick stellar atmospheres. Methods. Making use of a variety of 3D simulations of the solar atmosphere, we trained a convolutional neural network, SunnyNet, to learn the translation from LTE to non-LTE atomic populations. Non-LTE populations computed with an existing 3D code were considered as the true values. The network was then used to predict non-LTE populations for other 3D simulations, and synthetic spectra were computed from its predicted non-LTE populations. We used a six-level model atom of hydrogen and H$\alpha$ spectra as test cases. Results. SunnyNet gives reasonable predictions for non-LTE populations with a dramatic speedup of about 10$^5$ times when running on a single GPU and compared to existing codes. When using different snapshots of the same simulation for training and testing, SunnyNet's predictions are within 20-40% of the true values for most points, which results in average differences of a few percent in H$\alpha$ spectra. Predicted H$\alpha$ intensity maps agree very well with existing codes. Most importantly, they show the telltale signs of 3D radiative transfer in the morphology of chromospheric fibrils. The results are not as reliable when the training and testing are done with different families of simulations. SunnyNet is open source and publicly available.