| Apples are a widely consumed fruit,and the preservation and evaluation of their quality are of great significance to both fruit farmers and consumers.This paper studies an apple appearance quality grading system based on multispectral imaging technology,aiming to enhance the existing methods of apple quality assessment and improve the accuracy and efficiency of apple quality evaluation.For the apple defect detection problem,this study focuses on an apple defect detection method based on hyperspectral imaging technology.A one-dimensional convolutional neural network model,Spectral CNN,is designed to classify the spectra of defect areas on pixel-level.The study shows that the model’s accuracy is not dependent on the spectral preprocessing method and outperforms traditional chemical metrics models.Furthermore,this study uses the successive projections algorithm to extract 20 feature wavelengths to reduce the dimensionality of the hyperspectral image.The effectiveness of these feature wavelengths was validated,and the model achieved accuracies of 97.45% and 95.79% on the full wavelength and feature wavelength datasets,respectively.To further reduce the spectral data volume and improve detection efficiency,the study uses Score-CAM feature visualization technology to compress the number of feature wavelengths once more,resulting in four feature wavelengths.Based on these four feature wavelengths,this study designs a multispectral imaging system to collects multispectral images of defective apples.The YOLOv5 s model is then used to detect defects in the multispectral images of apples.The study finds that the defect detection accuracy of YOLOv5 s on multispectral images is 91.6%,which is 10.1% higher than the YOLOv5 s model based on RGB images.Apple appearance quality grading indicators include not only defects but also fruit diameter,fruit shape,and coloration rate.For the detection of these three indicators,this study uses machine vision methods to extract the contours of apples,then,calculates the fruit diameter and fruit shape based on contour features,and calculates the coloration rate of apples based on the HSV color space.Finally,the study develops an apple appearance grade sorting device using the detection methods for defects,fruit diameter,fruit shape,and coloration rate.The device consists of structural and software components.The structural part is responsible for transporting and rolling the apples,while the software part detects apple defects,coloration,fruit diameter,and fruit shape.The detection results and grading outcomes are displayed on the image interface for user viewing.After testing,the device can rapidly and stably detect the various indicators of apple appearance and give the quality grade of apples,achieving real-time detection of apple appearance quality. |