This paper presents a comparative study of binarization techniques for automated defect detection in dye penetrant testing (DPT) images. We evaluate established methods, including global, adaptive, and histogram-based thresholding, against three novel machine learning-assisted approaches, Soft Binarization (SoBin), Delta Binarization (DeBin), and Convolutional Autoencoder Binarization (AutoBin), using a real-world dataset from an automated DPT system inspecting stainless steel pipes. Performance is assessed with both pixel-level and region-level metrics, with particular emphasis on the influence of defect saturation. Defect saturation is quantified as the mean saturation value of all pixels belonging to a given defect, and defects are grouped into ten categories spanning from low (60–68) to high (132–140) mean saturation. Our results demonstrate that for lower mean defect saturation values, methods such as AutoBin_Triangle, HSV_global_70, and SoBin achieve superior Intersection over Union (IoU) and high true positive rates. In contrast, methods based primarily on global thresholding of the saturation channel tend to perform competitively on images with higher defect saturation levels, reflecting their sensitivity to stronger color signals. Moreover, depending on the method, nearly perfect region-level true positive rates () or minimal false positive rates () can be attained, emphasizing the trade-off that different models offer distinct strengths and weaknesses, which necessitates selecting the optimal method based on the specific quality control requirements and risk tolerances of the industrial process. These findings underscore the critical importance of defect saturation as a cue for both human and computer vision systems and provide valuable insights for developing robust automated quality control and predictive quality algorithms.
Automated defect classification in dye penetrant testing (DPT) enables reliable surface inspection in manufacturing industries. This work provides a controlled comparison between two paradigms for multiclass defect classification: (i) classical machine learning using feature engineering with handcrafted descriptors and (ii) deep learning using representation learning. We evaluate both approaches on a large industrial dataset from centrifugally cast steel tube production, using segmented regions of interest and a four-class taxonomy (cracks, pinholes, scabs, slag inclusions). Three practical questions guide the study: data efficiency (how performance scales with training-set size), generalizationacross production-induced distribution shifts, and the effect of local image context, comparing tight crops of the defect with padded crops that include surrounding pixels.For data efficiency, convolutional models consistently outperform the handcrafted pipeline across all training-set sizes, reaching macro-averaged F1 up to 0.98 compared to a maximum of 0.89. Deep backbones trained on only 20% of the available data already exceed the full-data performance of classical pipelines (0.92 vs. 0.89). Robustness experiments show that learned representations remain stable across tube diameters and background variations, whereas handcrafted features exhibit pronounced sensitivity to geometric scale and illumination changes, with performance drops of up to 20 pp. Including contextual padding radius (CPR), neighborhood context improves classification: mean test Macro-F1 increases by +3.29 pp from CPR=0 to 25–45 px, then saturates (+0.16 pp from 65–100 px). These findings quantify the practical trade-offs between interpretability and performance in automated DPT and provide guidance for deploying robust multiclass classification on the factory floor.