Restricted by a metal-enclosed structure, the internal defects of large transformers are difficult to visually detect. In this paper, a micro-robot is used to visually inspect the interior of a transformer. For the micro-robot to successfully detect the discharge level and insulation degradation trend in the transformer, it is essential to segment the carbon trace accurately and rapidly from the complex background. However, the complex edge features and significant size differences of carbon traces pose a serious challenge for accurate segmentation. To this end, we propose the Hadamard production-Spatial coordinate attention-PixelShuffle UNet (HSP-UNet), an innovative architecture specifically designed for carbon trace segmentation. To address the pixel over-concentration and weak contrast of carbon trace image, the Adaptive Histogram Equalization (AHE) algorithm is used for image enhancement. To realize the effective fusion of carbon trace features with different scales and reduce model complexity, the novel grouped Hadamard Product Attention (HPA) module is designed to replace the original convolution module of the UNet. Meanwhile, to improve the activation intensity and segmentation completeness of carbon traces, the Spatial Coordinate Attention (SCA) mechanism is designed to replace the original jump connection. Furthermore, the PixelShuffle up-sampling module is used to improve the parsing ability of complex boundaries. Compared with UNet, UNet++, UNeXt, MALUNet, and EGE-UNet, HSP-UNet outperformed all the state-of-the-art methods on both carbon trace datasets. For dendritic carbon traces, HSP-UNet improved the Mean Intersection over Union (MIoU), Pixel Accuracy (PA), and Class Pixel Accuracy (CPA) of the benchmark UNet by 2.13, 1.24, and 4.68 percentage points, respectively. For clustered carbon traces, HSP-UNet improved MIoU, PA, and CPA by 0.98, 0.65, and 0.83 percentage points, respectively. At the same time, the validation results showed that the HSP-UNet has a good model lightweighting advantage, with the number of parameters and GFLOPs of 0.061 M and 0.066, respectively. This study could contribute to the accurate segmentation of discharge carbon traces and the assessment of the insulation condition of the oil-immersed transformer. [ABSTRACT FROM AUTHOR]