In order to solve the problems of many kinds of crop diseases and pests, fast diffusion speed, and long time of manual identification of diseases and pests, a crop disease and pest identification model based on deep learning from the perspective of ecological and environmental protection is proposed. Firstly, crop images are collected by field sampling to collect data set, and image preprocessing is completed by using nearest neighbor interpolation. Then, the network structure of the AlexNet model is improved. By optimizing the full connection layer, different neuron nodes and experimental parameters are set. Finally, the improved AlexNet model is used to identify crop diseases and pests. The experimental analysis of the proposed model based on the constructed data set shows that the average recognition accuracy and recognition time of fragrant pear diseases and insect pests are 96.26% and 321 ms, respectively, which are better than other comparison models. And, the recognition accuracy of this method on other data sets is not less than 91%, which has good portability.