The hazelnut (Corylus avellana L.) is a strategic agricultural product of high economic and nutritional value. Turkiye is the world leader in hazelnut production and export. The quality of hazelnuts is critically essential for international competitiveness and economic returns. The most common method for determining quality in the literature and industry is calculating the percentage of hazelnut kernels based on the ratio of sound kernels.
However, this method relies on human observation, which can lead to errors and inconsistencies. In particular, this observation-based method sometimes fails to detect defects in the hazelnut kernel. Recently, nondestructive quality determination methods, particularly X-ray imaging technology, have allowed for the quick and accurate detection of internal and external defects in food products.
However, the hazelnut industry has only recently started to adopt these technologies and deep learning–based computer vision methods. Significant advantages in terms of accuracy and efficiency for analyzing the quality of hazelnuts, recognizing objects, and detecting defects are offered by nondestructive food processing technologies and artificial intelligence-based approaches.
This study created and made publicly available a unique dataset of X-ray images for defect detection in hazelnut kernels. Defect detection was performed using deep learning–based object detection algorithms, including YOLOv5, YOLOv8, Faster R CNN, and SSD, whereas segmentation was achieved using K-means clustering, yielding successful results.
Consequently, with joint usage of defect detection and segmentation, the developed method provides a more objective, accurate, and reliable process for assessing hazelnut quality.