In machine learning, a convolutional neural network (ConvNet) is a class of deep, feed-forward artificial neural networks. Featured by low computing load and fast convergence, the network has been successfully applied to pattern recognition. This paper gives a detailed introduction to the structure, working principles and advantages of ConvNet, and applies it to the recognition of vehicle types. In reference to previous research, two deep neural networks were created, namely VGG 16 and AlexNet. The experimental results show that our methods have performed well in vehicle classification in complex background images.