Maintaining an in-focus image over long time scales is an essential and non-trivial task for a variety of microscopic imaging applications. Here, we present an autofocusing method that is inexpensive, fast, and robust. It requires only the addition of one or a few off-axis LEDs to a conventional transmitted light microscope. Defocus distance can be estimated and corrected based on a single image under this LED illumination using a neural network that is small enough to be trained on a desktop CPU in a few hours. In this work, we detail the procedure for generating data and training such a network, explore practical limits, and describe relevant design principles governing the illumination source and network architecture.