Abstract:To address the challenges encountered in segmenting scanning electron microscope images of lanthanum tungsten rods—such as difficulties in distinguishing adhered grains and occlusion of grain boundaries—an improved method based on the Pix2PixGAN framework is proposed to achieve high-precision extraction of tungsten grain boundaries. First, the standard skip connection is replaced with an edge guided attention module, integrated with Laplacian feature map extraction, to enhance the multi-scale representation of grain boundary features. Second, an efficient upsampling convolution block is introduced for feature upsampling, effectively mitigating checkerboard artifacts and facilitating the fusion of multi-level features. The original L2 loss function is substituted with a combined loss function comprising weighted binary cross-entropy loss and weighted intersection-over-union loss, emphasizing the optimization of edge pixels. Finally, gradient penalty is incorporated to improve the stability and diversity of the generator. Experimental results demonstrate that the improved model achieves an F1-score of 72.47%, a recall rate of 77.21%, and a precision of 68.32%, representing improvements of 13.02%, 6.49%, and 16.87%, respectively, over the baseline Pix2PixGAN model. Furthermore, the proposed method surpasses RCF, RINDNet, UCTransNet, and MEGANet in terms of F1-score and precision, confirming its effectiveness in grain boundary extraction.