Abstract:In this paper, a different network architecture is proposed for intelligent segmentation of THz security inspection images based on Generative Adversarial Network(GAN) and multi-head attention mechanism. The algorithm is prone to address the problems of low-resolution THz images, blurred edges of dangerous goods, and inability to segment dangerous goods efficiently. More realistic images are obtained by studying the feature map of the deep discriminator. The multi-head attention mechanism is introduced to improve the recognition ability of the model to the characteristics of dangerous goods. A large number of experimental results of segmentation of terahertz security inspection images show that the proposed GAN has better generalization ability at the same depth than the traditional Convolution Neural Networks(CNN).The introduction of multi-head attention mechanism strengthens the model's learning of the characteristics of dangerous goods, which also has a good effect in the case of unknown dangerous goods category. The Intersection Over Union(IOU) index is 9.6% higher than that of RestNet-50, 21.3% higher than that of RestNet-18, and 12.3% higher than that of U-Net. The research is conducive to image segmentation algorithms for more accurate and efficient processing of THz security images, which broadens further applications of THz intelligent security systems.