In the field of industrial production, automatic surface defect segmentation plays a crucial role in improving product quality and production efficiency. However, due to the interference of complex backgrounds and uneven illumination, efficient and accurate segmentation of surface defect remains a significant challenge. To address these issues, this work proposes an adaptive feature refinement U-shaped network (U-Net) for pixel-level segmentation of surface defect. The proposed framework draws inspiration from the classic U-Net architecture, and the pre-trained EfficientNet-B0 is selected as the encoder part to extract the multi-scale context information. Then, a novel adaptive feature refinement module, which further learns the global channel-wise dependencies and captures cross-channel local spatial patterns from multi-level features, is introduced to enhance the robustness of feature representation. Finally, these enhanced encoder features are up-sampled, and are further fed into the decoder part to obtain pixel-level defect segmentation results. To assess the validity and accuracy of the proposed model, this network is validated through extensive experiments on four different types of defect datasets. Experimental results show that the proposed model performs well on these datasets, with the maximum mean intersection over union (MIoU) of 91.63%. Meanwhile, the model is compared with some U-Net-based models and other state-of-the-art segmentation models, and it can also achieve competitive performance on MIoU scores. With the acceleration of the graphics processing unit, the proposed network can achieve a detection speed of 82 frames per second, which can meet the needs of real-time detection in the industrial fields.