China's grassland area is vast, once a grassland fire occurs, it will cause serious threat to people's life and property. At present, the domestic grassland fire monitoring means is mainly manual monitoring, this monitoring means of monitoring cost is large, low efficiency, real-time poor, and it is difficult to achieve complete detection, so the use of satellite, UAV images and other advanced means to identify grassland fire is the current research hot spot. In this paper, using UAV images, the detection is divided into two stages according to the burning process of grassland fires. In the early stage, the improved YOLOv5 network model is used to identify smoke due to the more obvious smoke characteristics; in the middle and late stage, the color characteristics of the fire area change obviously, and a flame detection method combining static and dynamic features is proposed. The C3 structure of the Neck part of the YOLOv5 model is improved, and the CBAM attention mechanism is introduced to make the model pay more attention to the target information; the loss function of YOLOv5 is improved, and DIoU is adopted as its loss function, and the experimental results show that the mAP of the improved YOLOv5 model is improved by 2.53% when trained on the self-built smoke dataset, and the recognition accuracy is effectively improved. When flame recognition is performed, the flame is affected by wind, vegetation coverage, humidity and terrain, etc., and spreads in all directions at different speeds, forming a dynamic outward-expanding circle with an increasing area and a distinct black color in the overfire area. Static color features are firstly used for pre-determination, and then the dynamic area and contour changes of the overfire are further discriminated. Experiments show that the algorithm reduces the false recognition rate of grassland fires and has good practicality.