Approximation of dilation-based spatial relations to add structural constraints in neural networks