## 1 Introduction
To solve this problem, [PERSON] et al. [14] added a region proposal network (RPN) to the Fast R-CNN and achieved the end-to-end training. This has simultaneously increased the detection precision and training speed, but at the time, there was no framework to implement target detection and case segmentation at the same time. In view of this, [PERSON] et al. [15] expanded the Fast R-CNN model by adding a parallel branch of target prediction mask to the boundary framework recognition branch and obtained a good performance. In the production process of the factory, defect detection based on machine vision uses a computer to process the acquired images, which need the support of special image processing analysis and classification software. The images are usually acquired by one or more cameras at the inspection site. The position of the camera is usually fixed. In general, industrial automation systems are designed to inspect known objects only at fixed locations. By lighting and arranging the scene properly, it is convenient to receive the image features for processing and classification. These features are also known in advance. When processing is highly time-constrained or computation-intensive and exceeds the processing power of the main processor, more powerful hardware devices (e.g., DSPs or FPGAs) are used to accelerate processing [16]. Based on this defect framework, [PERSON] et al. [17] reviewed the vision-based defect detection methods, including traditional methods and the latest deep learning-based defect detection methods. To promote intelligent development in factories further, [PERSON] et al. [18] proposed a smart factory architecture to introduce deep learning technology and the Internet of Things into automated defect detection applications in factories. [PERSON] et al. [19] proposed a defect detection method that combines the generative adversarial network and CNN to ensure the detection accuracy of minor surface defects by generating enlarged defect image samples. [PERSON] et al. [20] proposed a segmentation deep learning-based method to detect surface cracks. The experiments have shown that this method can achieve a high detection accuracy by using approximately 25-30 defective samples. Recently, there have been few studies on the surface defect detection of automobile engine parts. Since automotive engine parts are small in size (approximately 2.8 cm in length and 1 cm in diameter), their surface defect lengths are of the millimeter order typically, which makes them difficult to recognize visually under normal lighting without using specialized auxiliary equipment. In addition, there are no open-source or reference datasets for the analysis of these types of defects. Furthermore, experimental surface defect detections conducted with the acquired data of automotive engine parts have shown that the two commonly used frameworks in the detection field, the Faster R-CNN and Mask R-CNN, perform poorly in surface defect detection, especially for small defects, due to the lack of targeted analysis of defect features. Considering all that is mentioned, this paper constructs a surface defect dataset of automobile engine parts using surface defect images with the resolution of three million real pixels acquired on engine parts using a 1080P HDMI high-definition digital microscope and labels the acquired data to optimize the network. Then, a suitable anchor size for the detection segmentation scale of the Mask R-CNN is determined using the labeled data to improve the small defect detection capability. Namely, the appropriate anchor scales for surface defect detection of automotive engine parts are selected by labeled data analysis. Finally, the selected anchor scales are added to the Mask R-CNN structure, proposing an improved anchor Mask R-CNN (IA-Mask R-CNN). Comparative experiments have proven that the proposed model is effective in detecting surface defects of automotive engine parts. The rest of the paper is organized as follows.