Traffic sign recognition is an essential part of intelligent transportation systems and autonomous driving. However, due to the small size of traffic signs, there are a few problems in traffic sign recognition, such as missed recognition, false recognition, and so on. Therefore, we choose YOLOv7 as the baseline and propose an anti-interference feature enhancement YOLO, abbreviated as AIF-YOLO. Firstly, to enhance the network’s feature extraction capability, we add an adaptive feature extraction module (AFEM) structure to adaptive adjust the size of receptive field and refine features. Secondly, we introduce a contextual transformer into the feature extraction network of YOLOv7, resulting in the contextual transformer efficient layer aggregation network (CoT-ELAN) module. This improvement enables the model to capture the relation between traffic signs and environment and thus separate the interference signs. Furthermore, Wise-IoU loss was adopted to optimize network training, effectively addressing the poor quality label issue in the traffic sign dataset. Experiments were tested on Tsinghua-Tencent 100k dataset(TT100K), and the results show that our improved model performed better than the baseline YOLOv7, and other popular algorithms on precision, recall, and mAP@0.5.