Application of convolutional neural networks in offline handwriting recognition and pen-path recovery