1. Introduction
China is a country with a big fruit cultivation industry; since the 1980s, the cultivation scale and output of the Chinese fruit industry have been rising yearly, gradually surpassing those of European and American countries [
1]. The varieties of winter jujubes are diversified; there are more than 700 kinds of winter jujubes in the records of China alone, as the winter jujube is an edible fruit unique to China, and its cultivation has a thousand years of history. In recent years, the winter jujube, with its thin skin, delicate meat, rich nutritional content, etc. [
2], has gradually been popularized throughout the world. In 2023, China’s winter jujube production was approximately 3 million tons, with exports totaling 30,000 tons. Currently, picking operations of winter jujubes rely on multiple batches of manual picking and then their transport to a centralized manual sorting location. However, this kind of picking method results in the fruits being easily damaged, fruits with different maturities, both good and bad winter jujubes being mixed together, and so on, resulting in fruits that cannot undergo storage and long-distance transportation; additionally, it increases the winter jujube sorting difficulty, has serious impacts on economic benefits, and so on [
3]. The best method for processing winter jujubes is to pick and store them for no more than 12 h to ensure that they reach the crispy ripening stage. The stored winter jujubes should be free from mechanical injuries, diseases, cracks, and other defects. [
4]. Therefore, processing after picking is critical to enhancing the value of winter jujubes, but there is also a current urgent need to solve the technical problems. The grading of winter jujubes usually includes the following indexes—size, shape, maturity, and surface quality—of which the surface quality of winter jujubes is the most important [
5].
At present, in China Zhanhua, Dali, and other winter jujube planting areas, winter jujube sorting work is mainly completed manually; sorting work occupies the labor force, accounting for 40% of the whole winter jujube industry chain [
6]. With artificial sorting, there are many problems: due to the small size of winter jujubes, the artificial sorting accuracy and efficiency are low [
7], and human subjective factors also lead to a winter jujube sorting standard that is not uniform, which seriously impacts the winter jujube grower’s income [
8].
The grading and quality testing of fruits are important steps before they are stored or entered into the market, and consumers like products with good quality and good appearance. The testing and grading work of winter jujubes, on the one hand, can enhance the market competitiveness of winter jujubes and create a good reputation; on the other hand, eliminating unqualified winter jujubes is conducive to the long-distance transportation and storage of winter jujubes [
9]. The winter jujube shelf life is short, and the existence of defective winter jujubes will cause them to quickly deteriorate and rot, especially if the maturity is too high and there are mechanical injuries to the winter jujubes, which will accelerate a winter jujube quality decline in the same batch [
10]. The skin of winter jujubes is brittle and thin; just pressing hard on it can destroy the internal structure and form defects. How to realize the detection of the surface quality of winter jujubes and realize the non-destructive sorting of winter jujubes is thus the current problem.
Convolutional neural network (CNN) technology is widely used in various industries for the real-time detection and automated processing of objects. In the field of fruit products, a large amount of CNN-based sorting equipment that can realize more intelligent, efficient, and accurate fruit quality detection has also emerged [
11]. This study, based on the current problems in winter jujube sorting in China and the analysis of existing agricultural product detection technologies, uses convolutional neural network technology and refers to the “National Standard of the People’s Republic of China—Winter Jujubes” to classify winter jujubes with different surface defects. A winter jujube surface defect recognition and detection model is constructed. This study can reduce production costs, improve the efficiency and accuracy of winter jujube sorting, and promote the industrial development of winter jujubes.
Currently, researchers both domestically and internationally have conducted extensive research on agricultural detection. This includes the use of convolutional neural networks for managing agricultural planting, such as detecting field weeds [
12], detecting crop pests and diseases [
13], and monitoring soil conditions. Additionally, research has been performed on detecting various agricultural products, including spherical fruits and vegetables, like apples [
14], oranges [
15], and tomatoes [
16], as well as smaller fruits and vegetables, like grapes [
17] and goji berries [
18]. Furthermore, detection methods have been explored for irregularly shaped fruits and vegetables, such as potatoes [
19] and strawberries [
20].
From the aspect of agricultural production detection, this research mainly focuses on defect extraction and defect classification, and the application of machine vision and convolutional neural network technology is the common feature of these research methods. Machine vision technology can be used as the eyes of the computer to perceive the defects, the texture, the color, the type, and other information on the surface of the fruit, which is information that traditional spectral technology cannot provide; a convolutional neural network is used as the brain to screen and differentiate this information, and for the computer, different images will bring different information. Thanks to the high precision, high efficiency, lack of contact, and other advantages of this approach, the use of image processing to realize agricultural fruit and vegetable crop detection has become mainstream [
21].
In general, a neural network simulates the process of information processing in a human brain, and a computer program recognizes the input information [
22]. The earliest neural network model was the MP model, proposed by McCulloch and Pitts in 1943, and after continuous evolution, Rumelhart and Hinton et al. proposed the backpropagation network. In the 1990s, the BP neural network [
23] and the theory of visual image recognition were further developed, with models such as support vector machine (SVM) [
24] appearing one after another. However, problems such as local optimization, overfitting, and gradient diffusion could not be solved, so development slowed down. In 2006, Geoffery Hinton et al. thought that the network could be trained layer by layer to improve the feature learning ability, and this perspective in the field of artificial intelligence has caused a significant impact. Since then, scholars in many fields have proposed a variety of network models, and some scholars have attempted to combine neural networks and machine vision technology in the field of agricultural product inspection [
13].
KC et al. proposed a separable convolutional architecture for plant pest and disease detection with a success rate of 98.65% [
25]. Pattnaik et al. proposed a migration learning-based framework for tomato plant pest classification, achieving an 88.83% classification accuracy on the DenseNet169 model [
26]. Al-Saif et al. devised a technique to distinguish between various varieties of Indian date fruits by using the color and morphological features of individual fruits and training an artificial neural network classifier, which achieved an accuracy of 97.56% [
27]. Osako et al. developed a varietal classification system for lychee fruits using a pre-trained VGG16 model, which had an accuracy of 98.33% [
28]. Singh et al. used histogram equalization to enhance the image and then applied the k nearest neighbor (KNN) classifier to identify two types of apple leaf diseases. The experimental results showed that the classification accuracy was 96.41% [
29].
Although convolutional neural networks have made some progress in the detection and recognition of agricultural products, there are still many challenges to overcome, including a limited number of categories and low accuracy. In this study, we independently constructed a dataset of winter jujubes and divided them into six categories based on their different appearance qualities. We used a convolutional neural network to achieve accurate recognition of winter jujube images; improved the AlexNet; and conducted comparison experiments with VGG16, ResNet34, and InceptionV3, aiming to obtain a model with a more accurate recognition rate for winter jujubes. After accurately classifying the winter jujube dataset and improving the model, our model has gained the ability to accurately recognize and classify defects in winter jujubes.