To solve the problem of low target detection accuracy caused by the change of imaging scale, complex ground background and inconspicuous infrared target characteristics when infrared image seeker detects ground tank targets. In this paper, a You Only Look Once, Transform Head Squeeze-and-Excitation (YOLOv5s-THSE) model is proposed based on the YOLOv5s model, and a multihead attention mechanism is added to the backbone and neck of the network. The Cross Stage Partial, Squeeze-and-Exclusion (CSP_SE) module is added to the neck of the network, a small target detector is introduced into the head of the network, and the complete center section over union loss function is used in the model. Through various improvement measures, the background of the infrared target is suppressed, and the detection ability of the infrared tank target is improved. Experiments on infrared tank target data sets show that the model proposed in this paper can effectively improve the detection performance of infrared tank targets under ground background compared with several methods, such as YOLOv5s, YOLOv5s + SE, and YOLOV 5s + Convective Block Attention Module (CBAM).