This paper focuses on the intelligent detection of prohibited items in Xâray images during the security checking process. An intelligent semantic segmentation model of prohibited items in Xâray images is proposed based on the attentionâbased object localization method. Based on the preâtrained CNN classification framework, the attention mechanism can map the highâlayer semantic information of objects into the input space, while generating energy saliency maps to locate the prohibited items. In order to make the obtained attention maps discriminative, the lateral and contrastive inhibition strategies are introduced and combined together which can highlight the responses of activated neurons. Under the guidance of attention responses, two traditional image segmentation algorithms are employed to achieve the semantic segmentation results for the prohibited items detection in Xâray images. The proposed semantic segmentation model relies on weakly supervised learning mechanism, and only depends on the category labels of prohibited items, which greatly avoids the work cost of data semantic annotation. The experimental results based on the public SIXray baseline and the selfâbuilt Xâray image database demonstrate the proposed method can achieve about 65% IoU localization precise averagely. In addition, comparison experiments were carried out with the stateâofâtheâarts and ablation experiments to verify the effectiveness of the proposed model.