In the early stages of a fire outbreak, timely and accurate detection is crucial. However, existing target algorithms struggle to meet the real-time and accuracy requirements for fire detection. Addressing this issue, this paper proposes a new fire detection algorithm, DG-YOLO (Double channels and Group convolution), based on the YOLOv5s model. Firstly, the model introduces a novel dual-branch group convolution structure called DGBlock, which cascades large convolutional kernels to increase the network's receptive field. Moreover, it employs group convolution to reduce computational and parameter complexity, effectively enhancing the network's detection capabilities while lowering computational complexity. Secondly, the Effective Squeeze-and-Excitation (ESE) attention mechanism is utilized to boost the network's long-range modeling ability, guiding the network to focus more on relevant features. Experimental results demonstrate that using the DG-YOLO algorithm achieves a detection accuracy (mAP) of 41.9% on a custom fire dataset, an improvement of 2.8% over the original algorithm. To further validate the network's performance, this paper compares four mainstream algorithms on the COCO 2017 dataset, achieving an mAP of 38.6%, a 1.2% improvement over the original algorithm, effectively confirming the algorithm's efficacy.