We develop a machine learning model to detect dark substructure (subhalos) within simulated images of strongly lensed galaxies. Using the technique of image segmentation, we turn the task of identifying subhalos into a classification problem where we label each pixel in an image as coming from the main lens, a subhalo within a binned mass range, or neither. Our network is only trained on images with a single smooth lens and either zero or one subhalo near the Einstein ring. On a test set of noiseless simulated images with a single subhalo, the network is able to locate subhalos with a mass of $10^{8} M_{odot}$ and place them in the correct or adjacent mass bin, effectively detecting them 97% of the time. For this test set, the network detects subhalos down to masses of $10^{6} M_{odot}$ at 61% accuracy. However, noise limits the sensitivity to light subhalo masses. With 1% noise (with this level of noise, the distribution of signal-to-noise in the image pixels approximates that of images from the Hubble Space Telescope for sources with magnitude $< 20$), a subhalo with mass $10^{8.5}M_{odot}$ is detected 86% of the time, while subhalos with masses of $10^{8}M_{odot}$ are only detected 38% of the time. Furthermore, the model is able to generalize to new contexts it has not been trained on, such as locating multiple subhalos with varying masses, subhalos far from the Einstein ring, or more than one large smooth lens.