The lung lesion segmentation from computed tomography (CT) scan image is crucial in medical imaging for identifying and treating lung disorders. To increase the precision and efficiency of lung segmentation, we can look at a new U-Net framework that makes use of attention gates and multi-head self-attention. The network may concentrate on multiple aspects of the data. The multi-head attention can gather both local as well as global information. Using numerous attention operations, the network can recognize specific aspects of lung lesions while taking surroundings into account. The attention gates work as selective amplifiers as well as suppressors in different aspects. They combine data from several scales and resolutions, emphasizing key areas and minimizing noise. By focusing on useful features, this filtering procedure improves the precision of the segmentation. This architecture uses encoders to extract low-level properties from CT images. The attention maps serve as a guide for the construction of attention gates, which judiciously select features from various U-Net levels. The lesion images are achieved through the up-sampling phases of the decoder. The lung lesion segmentation has significantly advanced due to the effective integration of multi-head self-attention and attention gates in the U-Net architecture. The proposed method AUNet-MHA with 5-fold cross-validation has achieved comparable training dice coefficient, validation dice coefficient, and test dice coefficient of 0.93, 0.92, and 0.78 respectively for lung lesion segmentation from the MedSeg CT dataset. This method captures subtle lesion patterns precisely and enhances lung lesion analysis and characterization using historical data. This method will give medical professionals more flexibility during analysis and effectively improve accuracy when diagnosing and formulating effective treatment plans.