We explore the possibility of detecting anomalous structures buried under the skin surface by studying the deviations from the ideal Airy pattern of the point-spread function (PSF) of a terahertz microscope that includes the skin as one of the reflecting surfaces of the optical system. Using a custom terahertz microscope with a monochromatic point source emitting at 0.611 THz, we record the PSF images with a microbolometer camera. Skin simulants based on collagen gel, with and without artificial buried structures, have been analyzed. The geometrical features characterizing the PSF deformations have been extracted automatically from the PSF images. A machine learning algorithm applied to these geometrical features produces a reliable classification of targets with or without buried structures with error below 5%. It can even classify targets with anisotropic buried structures according to their different orientation.