An optimal margin distance determination is crucial for successful resection surgeries targeting early-stage non-small cell lung cancer (NSCLC). Yet, there has been no clear evidence regarding optimal margin distance, which is tightly associated with the recurrence and mortality after the operation. In this study, we proposed an innovative approach, a laser-induced breakdown hyperspectral imaging (LIBS-HSI) technique, capable of capturing the multi-element distribution within tumour tissues to probe optimal margin distance. The imaging quality of LIBS-HSI was enhanced by hyperspectral image (HSI) denoising algorithms founded on sparse representation and low-rank constraint, complemented by the application of the Butterworth notch resist filter. A semi-supervised deep learning model was developed to achieve pathological imaging segmentation recognition of malignant areas. This technique revealed the margin distance after getting malignant areas prediction and gradient, based on pseudo-colour imaging of elements composition within NSCLC samples. It stands as a promising candidate in postoperative pathological reports, enabling doctors to evaluate surgical outcomes in the future effectively.