Document and natural image applications of deep learning