Handwritten digit recognition is closely related to our daily life and work.Traditional manual judgment of handwritten digits requires a lot of effort,and there are also drawbacks such as low accuracy and inability to guarantee timeliness.To address this issue,convolutional neural network are used for handwritten digit recognition.Firstly,divide the MNIST dataset into training and testing sets.Secondly,build two types of convolutional neural network models,LeNet-5 and AlexNet,on MATLAB for training.Then,import the testing set into the model to test its performance.Finally,import the validation set to validate model performance.The experimental results show that the AlexNet model has a higher recognition rate for the validation set than the LeNet-5 model,and the stability of the AlexNet model is better than that of the LeNet-5 model.