  We reconstruct the extra-galactic gamma-ray source-count distribution, or
$dN/dS$, of resolved and unresolved sources by adopting machine learning
techniques. Specifically, we train a convolutional neural network on synthetic
2-dimensional sky-maps, which are built by varying parameters of underlying
source-counts models and incorporate the Fermi-LAT instrumental response
functions. The trained neural network is then applied to the Fermi-LAT data,
from which we estimate the source count distribution down to flux levels a
factor of 50 below the Fermi-LAT threshold. We perform our analysis using 14
years of data collected in the $(1,10)$ GeV energy range. The results we obtain
show a source count distribution which, in the resolved regime, is in excellent
agreement with the one derived from catalogued sources, and then extends as
$dN/dS \sim S^{-2}$ in the unresolved regime, down to fluxes of $5 \cdot
10^{-12}$ cm$^{-2}$ s$^{-1}$. The neural network architecture and the devised
methodology have the flexibility to enable future analyses to study the energy
dependence of the source-count distribution.
