In this work we propose an artificial neural network functional to the ground-state energy of fermionic interacting particles in homogeneous chains described by the Hubbard model. Our neural network functional was proven to have an excellent performance: it deviates from numerically exact calculations by less than 0.15% for a vast regime of interactions and for all the regimes of filling factors and magnetizations. When compared to analytical functionals, the neural functional was found to be more precise for all the regimes of parameters, being particularly superior at the weakly interacting regime: where the analytical parametrization fails the most, ~7%, against only ~0.1% for the neural network. We have also applied our homogeneous functional to finite, localized impurities and harmonically confined systems within density-functional theory (DFT) methods. The results show that while our artificial neural network approach is substantially more accurate than other equivalently simple and fast DFT treatments, it has similar performance than more costly DFT calculations and other independent many-body calculations, at a fraction of the computational cost.