  The resolution of optical imaging is classically limited by the width of the
point-spread function, which in turn is determined by the Rayleigh length.
Recently, spatial-mode demultiplexing (SPADE) has been proposed as a method to
achieve sub-Rayleigh estimation and discrimination of natural, incoherent
sources. Here we show that SPADE is optimal in the broader context of machine
learning. To this goal, we introduce a hybrid quantum-classical image
classifier that achieves sub-Rayleigh resolution. The algorithm includes a
quantum and a classical part. In the quantum part, a physical device
(demultiplexer) is used to sort the transverse field, followed by mode-wise
photon detection. This part of the algorithm implements a physical
pre-processing of the quantum field that cannot be classically simulated
without essentially reducing the signal-to-noise ratio. In the classical part
of the algorithm, the collected data are fed into an artificial neural network
for training and classification. As a case study, we classify images from the
MNIST dataset after severe blurring due to diffraction. Our numerical
experiments demonstrate the ability to learn highly blurred images that would
be otherwise indistinguishable by direct imaging without the physical
pre-processing of the quantum field.
