The recent development of serial crystallography at synchrotron and X-ray free-electron laser (XFEL) sources is producing crystallographic datasets of ever increasing volume. The size of these datasets is such that fast and efficient analysis presents a range of challenges that have to be overcome to enable real-time data analysis, which is essential for the effective management of XFEL experiments. Among the blocks which constitute the analysis pipeline, one major bottleneck is `peak finding', whose goal is to identify the Bragg peaks within (often) noisy diffraction patterns. Development of faster and more reliable peak-finding algorithms will allow for efficient processing and storage of the incoming data, as well as the optimal use of diffraction data for structure determination. This paper addresses the problem of peak finding and, by extension, `hit finding' in crystallographic XFEL datasets, by exploiting recent developments in robust statistical analysis. The approach described here involves two basic steps: (1) the identification of pixels which contain potential peaks and (2) modeling of the local background in the vicinity of these potential peaks. The presented framework can be generalized to include both complex background models and alternative models for the Bragg peaks.