To understand how the brain produces behavior, we must elucidate the relationships between neuronal connectivity and function. The medial prefrontal cortex (mPFC) is critical for complex functions including decision-making and mood. mPFC projection neurons collateralize extensively, but the relationships between mPFC neuronal activity and brain-wide connectivity are poorly understood. We performed whole-brain connectivity mapping and fiber photometry to better understand the mPFC circuits that control threat avoidance in male and female mice. Using tissue clearing and light sheet fluorescence microscopy (LSFM), we mapped the brain-wide axon collaterals of populations of mPFC neurons that project to nucleus accumbens (NAc), ventral tegmental area (VTA), or contralateral mPFC (cmPFC). We present DeepTraCE (deep learning-based tracing with combined enhancement), for quantifying bulk-labeled axonal projections in images of cleared tissue, and DeepCOUNT (deep-learning based counting of objects via 3D U-net pixel tagging), for quantifying cell bodies. Anatomical maps produced with DeepTraCE aligned with known axonal projection patterns and revealed class-specific topographic projections within regions. Using TRAP2 mice and DeepCOUNT, we analyzed whole-brain functional connectivity underlying threat avoidance. PL was the most highly connected node with functional connections to subsets of PL-cPL, PL-NAc, and PL-VTA target sites. Using fiber photometry, we found that during threat avoidance, cmPFC and NAc-projectors encoded conditioned stimuli, but only when action was required to avoid threats. mPFC-VTA neurons encoded learned but not innate avoidance behaviors. Together our results present new and optimized approaches for quantitative whole-brain analysis and indicate that anatomically defined classes of mPFC neurons have specialized roles in threat avoidance.SIGNIFICANCE STATEMENT Understanding how the brain produces complex behaviors requires detailed knowledge of the relationships between neuronal connectivity and function. The medial prefrontal cortex (mPFC) plays a key role in learning, mood, and decision-making, including evaluating and responding to threats. mPFC dysfunction is strongly linked to fear, anxiety and mood disorders. Although mPFC circuits are clear therapeutic targets, gaps in our understanding of how they produce cognitive and emotional behaviors prevent us from designing effective interventions. To address this, we developed a high-throughput analysis pipeline for quantifying bulk-labeled fluorescent axons [DeepTraCE (deep learning-based tracing with combined enhancement)] or cell bodies [DeepCOUNT (deep-learning based counting of objects via 3D U-net pixel tagging)] in intact cleared brains. Using DeepTraCE, DeepCOUNT, and fiber photometry, we performed detailed anatomic and functional mapping of mPFC neuronal classes, identifying specialized roles in threat avoidance.