setlength{\parindent}{2em}The application of anomaly detection in workpiece surface defect detection activities is growing. Such methods only need to use the images of qualified workpiece to train the network, which overcomes the problem that object detection require a large amount of defect data. Although such methods can reliably classify normal and abnormal workpieces, it is challenging to pinpoint abnormal areas, particularly on workpieces complex structural backgrounds. To solve this issue, A multi-scale masked feature reconstruction-based anomaly detection method is proposed. First, the features of various scales are aligned, aggregated and concated to generate multi-scale features for local areas of the image. Then, the multi-scale features are separated into blocks and randomly masked in order to increase the precision of defect segmentation in the structural background data, and the masked features are reconstructed using a masked autoencoder in order to recover their original features. Finally, the feature differences before and after reconstruction are compared to detect abnormal areas in the image. The experimental results demonstrate that the method is adaptable and can successfully increase the fault segmentation accuracy of structural background workpieces while also achieving good detection results on unstructured background workpieces.