# Date Fruit Classification Based on Surface Quality Using Convolutional Neural Network Models
###### Abstract  
Classifying the quality of dates after harvesting the crop plays a significant role in reducing waste from date fruit production. About one million tons of date fruit is produced annually in Saudi Arabia. Part of this production goes to local factories to be produced and packaged to be ready for use. Classifying and sorting edible dates from inedible dates is one of the first and most important stages in the production process in the date fruit industry. As this process is still performed manually in date production factories in Saudi Arabia, this may cause an increase in the waste of date fruit and reduce the efficiency of production. Therefore, in our paper, we propose a system to automate the classification of dates fruit production. The proposed system focuses on classifying the quality of date fruit at the postharvesting stage. By automating the process of classifying date fruit at this stage, we can increase the production efficiency, raise the classification accuracy, control the product quality, and perform data analysis within the industry. As a result, this increases the market competitiveness, reduces production costs, and increases the productivity. The system was developed based on convolutional neural network models. For the purpose of training the models, we constructed a new image dataset that contains two main classes that have images of date fruit with excellent surface quality and another class for date fruit with poor surface quality. The results show that the used model can classify date fruit based on their surface quality with an accuracy of 97%. machine learning; deep learning; convolutional neural network; object detection +
Footnote †: journal:  
have proposed a new system that can carry out this process automatically with fewer misclassification errors. An example of a stage that needs a system to classify the dates is the preharvesting stage; in this stage, the farmer needs to classify the maturity level of dates to check if they are ready to be harvested or not. It is important to build a classifier system for this stage, because if we do not classify the maturity level of dates correctly, they will be thrown away, because they will be harvested before they are ready; this will increase waste in production. [PERSON] et al. [5] proposed a solution to this problem by building a system to classify the maturity level of dates before they are harvested. There are also other stages that need new systems to reduce the waste caused by misclassification. In our paper, we focused on developing a postharvesting automated classifier system. We developed it to enhance the efficiency of the classification and, also, to increase the accuracy of classification. As a result, the waste of production will be reduced. Additionally, it will facilitate data analysis within the industry and assist with the control of the quality of production. After being harvested, date crops still need to be filtered, because some dates are defective due to several causes, such as insects, diseases, or birds eating them. After harvesting the crops, farmers inspect the dates visually and identify good crops and eliminate unwanted crops. Sometimes, farmers classify good dates as defective by mistake and throw them out, which increases waste. This process is carried out manually, and it involves a human error factor. Moreover, it takes a long time and requires a lot of labor effort. Therefore, we built a system to classify dates and find the defective dates among the good ones. Moreover, to train this model we constructed a new image dataset that has two main classes, one for the good dates and another class for defective dates. The model was built based on deep learning and computer vision techniques. In this paper, we introduce a system that can classify the date fruit automatically after harvesting the crop, and our major contributions are  
1. Construction of a new image dataset for date fruit with good surface quality and defective surface quality. 2. Localization of the date fruit in the images. 3.