  Local detection of magnetic fields is crucial for characterizing nano- and
micro-materials and has been implemented using various scanning techniques or
even diamond quantum sensors. Diamond nanoparticles (nanodiamonds) offer an
attractive opportunity to chieve high spatial resolution because they can
easily be close to the target within a few 10 nm simply by attaching them to
its surface. A physical model for such a randomly oriented nanodiamond ensemble
(NDE) is available, but the complexity of actual experimental conditions still
limits the accuracy of deducing magnetic fields. Here, we demonstrate magnetic
field imaging with high accuracy of 1.8 $\mu$T combining NDE and machine
learning without any physical models. We also discover the field direction
dependence of the NDE signal, suggesting the potential application for vector
magnetometry and improvement of the existing model. Our method further enriches
the performance of NDE to achieve the accuracy to visualize mesoscopic current
and magnetism in atomic-layer materials and to expand the applicability in
arbitrarily shaped materials, including living organisms. This achievement will
bridge machine learning and quantum sensing for accurate measurements.
