Fast and highly accurate fire detection algorithms are crucial for production and daily life. However, detecting fires in the early stages is challenging due to the lack of distinct features and fixed shapes of flames and smoke. To address this issue, we propose a fire detection algorithm, DCGC(Dual Channel Group Convolution)-YOLO, based on an improved YOLOv5 model. The DCGC-YOLO model introduces a new layer structure and anchor algorithm to optimize original YOLOv5 model. Firstly, we introduce a Cross Stage Partial (CSP) structure with a cascade of large convolutional kernels in the bottleneck layer. This structure increases network's receptive field, enhances feature extraction capabilities, and employs a channel cleansing mechanism that combines various channels separated by group convolution, promoting information exchange in the channel dimension and enabling better information encoding. Next, we integrate the Effective Squeeze and Extraction (eSE) mechanism into the new layer structure, enhancing the model's ability for long-range modeling and focusing more on target areas. Finally, we utilize an Intersection over Union (IoU)-based anchor generation algorithm to adjust the anchor sizes on custom fire dataset, enhancing the model's robustness and improving detection accuracy. Experimental results on our custom fire dataset demonstrate that the proposed DCGC-YOLO algorithm effectively detects targets with mAP of 41.1%, which is 2.9% higher than YOLOv5s, while reducing network parameters and computational complexity. To further validate the effectiveness of our proposed algorithm, we conduct experiments on the COCO2017 dataset. The results show that DCGC-YOLO achieves mAP of 38.9%, demonstrating strong generalization and competitiveness compared to state-of-the-art detectors.