| As one of the leading food crops in China,wheat dominates in terms of cultivation,import,and export consumption.Different wheat grades correspond to different ranges and values of use,and the inspection of the appearance of wheat kernels is an essential part of the grading process.Currently,most wheat appearance tests rely on the human eye,which can easily lead to errors due to visual fatigue and tedious steps.In this study,we investigate a fast,objective,and highly accurate method to detect the appearance of wheat kernels based on deep learning.We also design a web-based system to detect the appearance of wheat kernels.The main research contents and conclusions are as follows:1.Recognition of the appearance quality of single-kernel wheat images.The image pre-processing and other techniques were used to build wheat single-kernel and multi-kernel image datasets.The Vgg Net-16-W,Res Net-34-W,Efficient Net-b2-W,Dense Net-121-W and Vi T-B/16-W network models were constructed to recognize single-kernel wheat images and trained on the Kaggle platform by using an Adam optimizer with a learning rate of 0.0001 and a cosine annealing learning rate reduction strategy.The results show that image enhancement and migration learning can accelerate the convergence of the model and improve the recognition accuracy by 0.48% and 2.8%,respectively.The results of the test set showed that the recognition accuracy of the Vi T-B/16-W model was low,the recognition time of the Vgg Net-16-W model was long,and the average recognition accuracy of the other three models was above 98%.Considering the network weight file size,recognition time,and model generalization,the Efficient Net-b2-W model was used for single-kernel wheat recognition.2.Detection of appearance quality of multi-kernel wheat images.The traditional YOLOv5 s model was optimized by adding an attention mechanism and improving the loss function.The improved network m AP value increased by 3.38%,and the missed detection rate decreased by about 3%,but the accuracy of wheat detection was lower for some label types.Therefore,a method is proposed to cascade the improved YOLOv5 s model with the Efficient Net-b2-W model obtained from single-kernel recognition experiments.The model is applied to the test set,and the results show that the proposed cascade method improves the detection accuracy of wheat kernel types by about 6.2% and can meet the detection needs of multi-kernel wheat images.3.Based on the methods of the above study,a B/S architecture-based wheat multi-kernel appearance quality detection system was developed.HTML,CSS,JS and other technologies were used to build the front-end page to complete the functions of image input,image submission,and recognition results.The back end uses the Django framework to load wheat’s target detection and classification models.The system was tested in a good network environment.It took about 2.2 seconds from uploading the wheat image to the detection result being fed back to the page,with a recognition accuracy of 95.7%,which is sufficient for detecting wheat grain appearance and quality in the actual buying process. |