We introduce twin neural network (TNN) regression. This method predicts
differences between the target values of two different data points rather than
the targets themselves. The solution of a traditional regression problem is
then obtained by averaging over an ensemble of all predicted differences
between the targets of an unseen data point and all training data points.
Whereas ensembles are normally costly to produce, TNN regression intrinsically
creates an ensemble of predictions of twice the size of the training set while
only training a single neural network. Since ensembles have been shown to be
more accurate than single models this property naturally transfers to TNN
regression. We show that TNNs are able to compete or yield more accurate
predictions for different data sets, compared to other state-of-the-art
methods. Furthermore, TNN regression is constrained by self-consistency
conditions. We find that the violation of these conditions provides an estimate
for the prediction uncertainty