  We consider the problem of target detection with a constant false alarm rate
(CFAR). This constraint is crucial in many practical applications and is a
standard requirement in classical composite hypothesis testing. In settings
where classical approaches are computationally expensive or where only data
samples are given, machine learning methodologies are advantageous. CFAR is
less understood in these settings. To close this gap, we introduce a framework
of CFAR constrained detectors. Theoretically, we prove that a CFAR constrained
Bayes optimal detector is asymptotically equivalent to the classical
generalized likelihood ratio test (GLRT). Practically, we develop a deep
learning framework for fitting neural networks that approximate it. Experiments
of target detection in different setting demonstrate that the proposed CFARnet
allows a flexible tradeoff between CFAR and accuracy.
