  We explore how information in images of nearby galaxies can be used to
estimate their distance. We train a convolutional Neural Network (NN) to do
this, using galaxy images from the Illustris simulation. We show that if the NN
is trained on data with random errors added to the true distance (representing
training using spectroscopic redshift instead of actual distance), then the NN
can predict distances in a test dataset with greater accuracy than it was given
in the training set. This is not unusual, as often NNs are trained on data with
added noise, in order to increase robustness. In this case, however, it offers
a route to estimating peculiar velocities of nearby galaxies. Given a galaxy
with a known spectroscopic redshift one can use the NN-predicted distance to
make an estimate of the peculiar velocity. Trying this using relatively low
resolution (1.4 arcsec per pixel) simulated galaxy images we find fractional
RMS distance errors of 7.7% for galaxies at a mean distance of 75 Mpc from the
observer, leading to RMS peculiar velocity errors of 440 km/s. In a companion
paper we apply the technique to 145,115 nearby galaxies from the NASA Sloan
Atlas.
