Incorporating prior knowledge into deep neural networks without handcrafted features