Compact representations of microstructure images using triplet networks