Abstract
Recent approaches to the internal quality inspection of apples with the application of hyperspectral imaging technology are highly cost-intensive because of labor involvement for the data collection on a fixed posture and manual selection of the region of interest (RoI). In addition, several studies have repeated the data acquisition for the same apple. Current methods cannot meet the automation requirements of the sorting line. Therefore, this study proposed a novel method for automatically selecting RoI in hyperspectral images of apples with random poses. Firstly, the preliminary RoI selection of apple hyperspectral image was carried out, followed by the performance of histogram statistics of each pixel with spectral intensity at 700 nm wavelength. The top 40% area of the spectral intensity was reserved to obtain the magnitude relationship of the spectral intensity of each pixel point and a morphological erosion operation. Original apple RoI was acquired and overexposed pixels were removed with spectral intensity greater than 3900 (maximum 4095) in the reserved area at 700 nm. Secondly, the relationship between apple size and prediction accuracy was measured for the in-depth RoI analysis. A partial least square regression (PLSR) model was established between the average spectrum and apple sugar content of RoI with different sizes. Finally, the established model with the top 70% of the spectral intensity achieved the best prediction accuracy. Non-destructive estimation of apple sugar content was performed through hyperspectral imaging technology with reference to the proposed RoI selection method. A competitive adaptive reweighted sampling algorithm along the PLSR (CARS-PLSR) model was established after black-and-white correction and standard normal transformation (SNV) preprocessing and obtained the highest prediction accuracy. The determination coefficient of cross-validation (Rcv) and root mean square error of cross-validation (RMSECV) were 0.9595 and 0.3203°Brix, respectively. The determination coefficient of prediction (Rp) was 0.9308, and the root mean square error of prediction (RMSEP) was 0.4681°Brix. Results proved that the auto-selection of RoI is an efficient and accurate method, which can provide a foundation in practical application for online apple grading systems with hyperspectral imaging technology.
Introduction
Hyperspectral imaging (HSI) is a powerful non-destructive tool for assessing internal fruit quality, such as sugar content (Brix). However, transitioning HSI from laboratory settings to high-speed industrial sorting lines presents significant challenges. A primary bottleneck is the selection of the Region of Interest (RoI). In manual or semi-automated systems, human intervention is often required to identify the central tissue of the fruit, especially as apples arrive in random orientations on a conveyor belt. Variations in pose, specular reflections (hot spots), and the presence of stems or blossom ends introduce noise that degrades prediction accuracy. This study addresses these issues by proposing a fully automated RoI selection method designed for random-pose apples on a sorting line.
Methodology
The proposed system integrates hardware and software to automate the quality assessment process. The experimental setup includes a loading unit, a machine vision unit, and a hyperspectral imaging system integrated into a conveying line.
Hyperspectral Data Acquisition
The HSI system operates within a dark box to minimize environmental light interference. It consists of a spectrometer, a lens, and dual light sources. Apples are transported through the system on a mobile unit driven by a motor and frequency converter.
Automated RoI Selection Pipeline
The core of the method is a multi-step image processing pipeline:
- Preliminary Segmentation: The system identifies apple tissue by analyzing spectral intensity at 700 nm, a wavelength where reflectance is typically highest for apples. The background is discarded, and the top 40% of the brightest pixels are initially selected.
- Morphological Erosion: To eliminate noise from the apple's edges and complex structures like the stem (pedicel) or blossom end (calyx), a morphological erosion operation is applied, shrinking the mask toward the center of the fruit.
- Overexposure Filtering: Pixels with intensities exceeding 3900 (out of a 4095 maximum) are removed to prevent sensor saturation from skewing the data.
- Size Optimization: The researchers evaluated RoI sizes ranging from 10% to 100% of the remaining area. It was determined that the top 70% of the spectral intensity area provided the optimal signal-to-noise ratio for sugar content prediction.
Experimental Results
The study utilized 135 Yantai Fuji apples, with 124 samples remaining after data cleaning via Monte Carlo cross-validation. Sugar content was measured using a digital refractometer to provide ground truth.
The spectral data were preprocessed using Standard Normal Transformation (SNV). A Competitive Adaptive Reweighted Sampling (CARS) algorithm was employed to reduce the spectral dimensions from 380 bands to 40 key features. The final Partial Least Squares Regression (PLSR) model demonstrated high robustness:
- Cross-Validation: $R_{cv} = 0.9595$, $RMSECV = 0.3203°Brix$.
- Prediction Performance: $R_p = 0.9308$, $RMSEP = 0.4681°Brix$.
Conclusion
This research demonstrates that automated RoI selection based on spectral intensity thresholding and morphological operations is highly effective for real-time apple sorting. By focusing on the most representative tissue and automatically filtering out noise from random poses and specular reflections, the system achieves laboratory-grade accuracy on a moving sorting line. This method provides a scalable foundation for the next generation of non-destructive fruit grading systems.
Summary updated