Small bodies environment is usually difficult to be modelled for a number of reasons. Among the others, the uncertainty associated to the non-uniform gravitational field requires in-situ observations for its refinement, or its identification. This operation becomes even more challenging in case the orbiting platform is a CubeSat or, in general, a platform with reduced computational power as well as a high autonomy requirement. In this paper, a new approach to reconstruct on-board the gravity field of either unknown or partially known bodies is presented. In particular, the use of a Hopfield Neural Network (HNN) to reconstruct the coefficients of a Spherical Harmonics Expansion (SHE), that is assumed to approximate the gravity field of the body, is described. A comparison with an Extended Kalman Filter (EKF) used for parameter estimation is presented and the differences of the two methods are critically discussed: due to the structure of the HNN, the former results to be computationally faster and lighter than a stand-alone EKF used for parameter estimation.