With the rapid development of UAV, image recognition technology is particularly important in uav flight. This paper for the collected images, to gray, after using the gaussian pyramid algorithm, build the gaussian pyramid of difference, and on the basis of the further combining gaussian fuzzy algorithm, the image enhancement processing as well as the preliminary extraction of target image feature points, and connecting with the convolutional neural network model, image of the secondary classification feature extraction and image recognition. Compared with the color image without graying processing and the convolutional neural network model only with graying processing, the algorithm has higher recognition accuracy and shorter response time after simulation verification. In this way, the uav can quickly and effectively identify the types of obstacles and take corresponding avoidance methods in time to reduce the occurrence of dangerous accidents.