We report detection and characterization of wavelength-scale objects with subwavelength resolution by combining diffractive imaging and machine learning. The technique clarifies the information channels in the diffraction imaging and provides insight into machine learning processes.