Object detection models have been widely used in the industrial field, and related companies use AOIs for screw image defect detection. However, the captured image contains incomplete or multiple screw images, which results in AOI detection false kill, and the type of defects cannot be classified. This study proposes a deep learning framework for detecting screw defects by first performing image preprocessing and extracting complete screw images and, finally, building the YOLOv5 model for screw head defect detection.