  The observation of the shadow of the supermassive black hole M87$^{*}$ by the
Event Horizon Telescope (EHT) is sensitive to the spacetime geometry near the
circular photon orbit and beyond, and it thus has the potential to test general
relativity in the strong field regime. Obstacles to this program, however,
include degeneracies between putative deviations from general relativity and
both the description of the accretion flow and the uncertainties on
"calibration parameters", such as e.g. the mass and spin of the black hole. In
this work, we introduce a formalism, based on a principal component analysis,
capable of reconstructing the black hole metric (i.e. the "signal") in an
agnostic way, while subtracting the "foreground" due to the uncertainties in
the calibration parameters and the modelling of the accretion flow. We apply
our technique to simulated mock data for spherically symmetric black holes
surrounded by a thick accretion disk. We show that separation of signal and
foreground may be possible with next generation EHT-like experiments.
