自动驾驶场景下,针对前方障碍物探测实时性和检测精确度难以权衡的问题,本文提出一种改进的CBAM-YOLOv7自动驾驶检测算法。通过加入CBAM (Convolutional Block Attention Module)双通道注意力机制,对YOLOv7模型主网络部分进行修改,增加模型特征提取的能力,提高检测效果,使改进后的算法在检测精准率上有很大提升。通过创建多元化环境下的自动驾驶数据集进行测试,实验结果表明,对比原YOLOv7模型,改进后的检测算法的mAP值提升了5.60%,精准率提升了2.50%,在前方障碍物识别精准率中,行人检测率可以达到86.2%,交通类障碍物可以达到96.9%。In the automatic driving scenario, an improved CBAM-YOLOv7 automatic driving detection algorithm is proposed in this paper to address the problem that the real-time detection of obstacles ahead is difficult to balance with the detection accuracy. By adding a Convolutional Block Attention Module (CBAM) dual-channel attention mechanism, the main network part of the YOLOv7 model is modified to increase the ability of feature extraction of the model and improve the detection effect, which greatly improves the detection accuracy of the improved algorithm. The test results show that compared with the original YOLOv7 model, the mAP value of the improved detection algorithm is increased by 5.60%, and the accuracy rate is increased by 2.50%. In the accuracy rate of the forward obstacle recognition, the pedestrian detection rate can reach 86.2%, and the traffic obstacle detection rate can reach 96.9%.