This paper introduces a deep learning method tailored for recognizing and classifying vegetables, targeting the challenges in identifying vegetables within the vegetable flow process. A limited dataset including five common vegetable types was assembled, divided into training and testing subsets. Data augmentation techniques were employed to balance the sample quantities. Based on the TensorFlow deep learning framework, a Convolutional Neural Network (CNN) was constructed comprising four convolutional layers and two fully connected layers. Techniques such as L2 regularization and Dropout were employed to mitigate overfitting. Additionally, a confusion matrix was utilized to visualize the predicted quantities and accuracy for each class of images. Unlike complex architectures handling extensive datasets, this model offers simplicity, enabling easy deployment on terminals. Its low power consumption and minimal hardware demands suit the needs of routine vegetable circulation processes. Experimental results reveal an enhanced recognition accuracy with larger dataset sizes. Adam as the optimization algorithm notably outperforms SGD and momentum in the experiments. Moreover, employing a greater number of convolutional kernels enhances recognition effectiveness. On a dataset comprising 175,536 training images and 43,884 testing images, the recognition accuracy consistently stabilizes above 80%. The peak recognition rate achieved reaches 84.13%.
|