Casting parts are widely utilized in the industry as a cost-effective alternative to original parts. However, surface defects may occur on casting components due to various factors such as the manufacturing process and material characteristics. In this study, a deep learning model was implemented to detect defects on the surface of casting products and measure their size according to a proposed standard. This enables the evaluation of the performance of the casting products and determines their reliability for use in different applications. A new dataset was collected and preprocessed, consisting of four types of casting defects. The dataset was used to train a U-Net model to identify surface defects on the casting products. Once a defect was detected, the output of the U-Net algorithm was passed through a function to generate a histogram. The size of the defect was then calculated by determining the ratio between the defect size and the total surface area of the casting product. The U-Net model achieved a satisfactory performance, with a dice coefficient of 81% obtained for both training and validation data. This result demonstrates the effectiveness of the deep learning model in solving this type of problem.