Preserving Semantic Structural Constraints Within Neural Networks