Traditional flame and smoke detection mostly rely on temperature and smoke sensor, but the detection of temperature detector and smoke detector has a certain lag. In order to solve this problem of hysteresis and low accuracy, we propose an improved YOLOV3 algorithm combined with attention mechanism for flame and smoke detection. Firstly, a multi-scene large-scale flame and smoke image dataset is built. The localization and classification of the flame and smoke areas in the image are annotated precisely. The suspected areas of the flame and smoke in the image are obtained by color analysis, so that the suspected areas of the flame and smoke objects are concerned. Then combined with the feature extraction ability of deep network, the problem of flame and smoke detection is transformed into multi-classification and coordinate regression. Finally, the detection model of flame and smoke in multi-scene is obtained. Our experiments show the effectiveness of the improved YOLOv3 algorithm combined with attention mechanism in flame and smoke detection. Our proposed method achieves outstanding performance in the dataset of flame and smoke image. The detection speed also meets the need of real-time detection.