Document classification is one of the significant procedure in paper document recognition. This article proposed a method for document image enhancement to improve the performance of classification in the convolutional neural network. An enhanced document image was generated by extracting the table frame, text region, and shape of the raw document. The template-based classification experiment on 414 customs documents and more than one thousand generated images showed the enhanced image could help CNN model achieve higher accuracies compared to the original images. It could also diminish the interference of noise and unrelated features in document classification optimizing the robustness of networks. The proposed method also demonstrated the channels of the image could provide more information except for color in deep neural networks. As the similarity in the whole image classification tasks, the conclusion might provide ideas for the training of the neural networks in other fields such as street view recognition, medical image recognition, etc.