  We present the first method to probabilistically predict 3D direction in a
deep neural network model. The probabilistic predictions are modeled as a
heteroscedastic von Mises-Fisher distribution on the sphere $\mathbb{S}^2$,
giving a simple way to quantify aleatoric uncertainty. This approach
generalizes the cosine distance loss which is a special case of our loss
function when the uncertainty is assumed to be uniform across samples. We
develop approximations required to make the likelihood function and gradient
calculations stable. The method is applied to the task of predicting the 3D
directions of electrons, the most complex signal in a class of experimental
particle physics detectors designed to demonstrate the particle nature of dark
matter and study solar neutrinos. Using simulated Monte Carlo data, the initial
direction of recoiling electrons is inferred from their tortuous trajectories,
as captured by the 3D detectors. For $40\,$keV electrons in a $70\%$
$\textrm{He}$ $30 \%$ $\textrm{CO}_2$ gas mixture at STP, the new approach
achieves a mean cosine distance of $0.104$ ($26^\circ$) compared to $0.556$
($64^\circ$) achieved by a non-machine learning algorithm. We show that the
model is well-calibrated and accuracy can be increased further by removing
samples with high predicted uncertainty. This advancement in probabilistic 3D
directional learning could increase the sensitivity of directional dark matter
detectors.
