1. Introduction
Korla pears are renowned for their thin skin and juicy texture, enjoying a high reputation both domestically and internationally [
1]. They are significant drivers of economic development in the Xinjiang region and are recognized as a geographical indication product under the China–EU agreement [
2]. The cultivation of Korla pears has a history of over 1400 years in their native region of Korla, Xinjiang [
3]. In addition to Korla, these pears are also grown in nearby areas such as Luntai County, Aral City, Aksu City, and Awat County [
4]. Known for their rich flavor, thin skin without residue, crispness, juiciness, and high nutritional value, Korla pears are considered a premium variety of pears [
5].
With the continuous improvement in living standards, consumers’ demand for quality has been increasing. They require the pears not only to look good but also to have excellent internal nutritional qualities [
6]. Currently, the determination of fruit maturity largely relies on farmers’ experience, which can significantly affect the fruit’s market value. Immature or overripe pears often fail to meet optimal production, processing, and storage standards, adversely affecting both farmers’ interests and the nutritional value of the fruit.
Maturity in Korla pears refers to the physiological and quality characteristics that influence their flavor, storage, transportation, and processing. Higher maturity levels enhance qualities like color, aroma, sweetness, acidity, hardness, and juiciness, making them more appealing to consumers [
7,
8]. The maturity level also impacts the storage and transportation of the pears. Immature pears are harder and less prone to damage but lack flavor, making them hard to sell. Overripe pears, on the other hand, are softer and more prone to bruising and damage, which hinders long-distance transportation and storage, making them susceptible to pests and rot [
9]. Maturity also affects the processing and utilization of the pears. Ideally matured pears can be processed into products like canned pears, pear juice, dried pears, pear wine, and pear vinegar, increasing their added value and economic benefits. Therefore, mastering the optimal harvest time and maturity evaluation methods is key to enhancing the industry level and competitiveness of Korla pears.
Traditional detection methods are mainly manual, consuming significant human, material, and financial resources. The study of detecting the maturity of Korla pears using hyperspectral imaging technology can significantly improve detection efficiency and accuracy, reduce reliance on human resources, and save considerable time and costs [
10]. This technology enables rapid online monitoring of pear maturity, improving processing and sales efficiency, ensuring fruit quality, and increasing consumer satisfaction. Hence, this method holds substantial significance for the development of smart agriculture [
11].
Several studies have demonstrated the effectiveness of hyperspectral imaging in nondestructive quality assessment of agricultural products [
12]. Rajkumar et al. [
13] used hyperspectral imaging to establish a multiple linear regression (MLR) model to predict the quality (moisture, hardness, and soluble solids) of bananas at different maturity stages, showing successful predictions. Zhang et al. [
14] employed principal component analysis (PCA) to select optimal wavelengths (441.1 to 1013.97 nm) and combined texture features to develop a support vector machine (SVM) model for strawberry maturity identification, achieving an accuracy of 95.0%. Ribera-Fonsec et al. [
15] used PCA to analyze the absorbance differences at 560 nm and 640 nm wavelengths for grape maturity, measuring quality indices (SSC, TA, DI), and showed good prediction capabilities. Munera S et al. [
16] used NIR hyperspectral imaging to establish partial least squares regression (PLSR) models for the maturity of two nectarine varieties, achieving successful discrimination. Chu Zhang et al. [
14] used hyperspectral imaging to establish an SVM classification model for different maturity stages of strawberries, demonstrating that the combination of spectral and texture features provided the best maturity classification results. Shao et al. [
17] used hyperspectral imaging to classify mature, mid-ripe, and unripe strawberries, employing PLS-DA and LS-SVM for maturity evaluation, showing that the LS-SVM model with effective wavelengths performed best in field evaluations, with an accuracy of 96.7%. Sun et al. [
18] established SVM prediction models for soluble solids content and hardness of Hami melons based on hyperspectral technology, demonstrating that hyperspectral technology can achieve simultaneous quantitative prediction of quality (SSC, hardness) and qualitative maturity classification. Shao et al. [
19] studied the quality and maturity of Feicheng peaches using hyperspectral imaging, determining SSC and hardness values, showing that the optimal models for predicting SSC and hardness were CARS-MLR, and the ANN could effectively classify peach maturity. Jiang Hao et al. [
20] used hyperspectral imaging technology to establish Fisher linear discriminant models for maturity classification of strawberries based on existing and newly constructed parameters, showing that hyperspectral imaging can achieve automatic strawberry maturity identification.
In summary, although hyperspectral technology is recognized as an effective method for nondestructive quality assessment of agricultural products, research on the quality and maturity detection of Korla pears is relatively limited, with most studies focusing on hardness and SSC determination. This study uses hyperspectral imaging technology to successfully collect spectral data of Korla pears and develop new machine learning models for maturity assessment, significantly improving detection efficiency and accuracy. Compared to traditional methods, our technique improved test set accuracy by nearly 10%, providing strong technical support and theoretical basis for the rapid, nondestructive detection of the quality and maturity of Korla pears. These improvements not only optimize data processing but also enhance model generalization, representing significant progress in pear quality monitoring and smart agriculture development.
2. Materials and Methods
2.1. Collection of Korla Pear Samples
Aral City, located in southern Xinjiang, is one of the main cultivation areas for Korla pears. The region experiences a typical temperate continental arid desert climate, with an average annual temperature of 10.7 °C to 11.2 °C, a frost-free period of 170 to 227 days, and annual sunshine hours ranging from 2762.1 to 3186.3 h. The abundant light and heat resources, along with the significant diurnal temperature variation, contribute to the superior quality of the pears.
To ensure the representativeness and scientific validity of the experimental data, this study harvested Korla balsam pear from Batuan pear orchard (81°41′39.86″ E, 40°36′51.79″ N) in Alar City. The orchard is a high-yield pear orchard (≥1580 kg/667 m
2) located in the temperate desert climate zone; the soil is mainly sandy loam, and the spacing between rows of fruit trees is 4 m × 5 m. Fruit trees with an age of 10 to 15 years were selected in the four directions of each orchard, namely, east, west, south, and north, to harvest the fruit. In order to ensure the accuracy of experimental data, each stage of the collection of the appearance of the size and color of the balsam pear is basically the same. The location of the experimental field is shown in
Figure 1.
A total of 600 samples were collected, with 150 samples from each of four different stages. The early harvest stage (first stage) was in early August, specifically on 2 August 2023. The late August harvest (second stage) occurred on 29 August 2023. The mid-September harvest (third stage) was on 25 September 2023, and the late October harvest (fourth stage) was on 25 October 2023. Each stage is characterized as shown in
Table 1.
Stratified sampling of the Korla balsam pear samples was conducted according to different time points (2 August, 29 August, 25 September, and 25 October), and the 600 samples were divided into prediction and validation sets at a ratio of 2:1 to ensure the representativeness and scientificity of the data. Hyperspectral images of balsam pear were collected using a hyperspectral imaging system (wavelength range 380 to 1000 nm). The sweetness value of the balsam pear was then measured using an ATAGO portable digital fruit brix meter. The acquired hyperspectral images were corrected with black and white plates, and preprocessing methods such as multiple scattering correction (MSC), standard normal variable transformation (SNV), and normalization were used to remove noise and interference in the spectral data; then, these methods were compared and analyzed to select the best preprocessing method. The algorithm for extracting feature wavelengths was selected, and the three methods of principal component analysis (PCA), partial least squares regression (PLS), and successive projection method (SPA) were used for comparative analysis, to finalize the best feature wavelength extraction method and to screen out eight key wavelengths (460 nm, 570 nm, 594 nm, 610 nm, 670 nm, 730 nm, 810 nm, and 890 nm). Based on the full-spectrum information and the characteristic wavelength information, the ripeness classification and discrimination model of pear was established based on partial least squares (PLS), BP neural network, and support vector machine (SVM), respectively. The accuracy and robustness of the models were ensured through cross-validation and parameter optimization. The specific steps and methods of the research process are shown in
Figure 2, and systematically evaluated the quality characteristics of the samples at different harvesting stages and ensured the scientific validity and reliability of the research results.
2.2. Hyperspectral Image Acquisition and Sugar Content Measurement of Korla Pears
Before each experiment, dust was carefully removed from the surface of the Kuril balsam pear using soft paper, and each balsam pear was numbered for hyperspectral imaging and brix determination. The hyperspectral imaging system used in this study consisted mainly of an ImSpector V10E (Specim, Finland) imaging spectrometer. The system has a spectral range of 380 to 1000 nm and is equipped with a CCD array detector, two fiber-optic halogen lamps with adjustable light intensity of 150 W, a light source with emission wavelengths ranging from 400 to 1000 nm and high emissivity in this wavelength range, an OLE23 C-mount imaging lens, and OBF570 filters, as shown in
Figure 3.
During the measurement process, a portable digital refractometer (ATAGO PAL-1) was used to measure the sugar content of the pears. The detection range of the refractometer was 0–53%, with a measurement accuracy of ±0.2%. Before each experiment, the optimal data acquisition parameters for the hyperspectral instrument were determined: the distance between the object and the sensor was set to 300 mm, the exposure time was 1.2 ms, the scanning speed of the motorized stage was 0.6014 nm/s, and the actual length of the scanning line was 200 mm. During the measurement, the camera was placed vertically and a black background was used to minimize the effects of neighboring shadows and reflections and a reflection coefficient of 0.03.
After completing the hyperspectral image acquisition of the Korla pears, the sugar content of the pears was measured using the ATAGO PAL-1 portable digital refractometer. Before the sugar content measurement, the peel of the pear sample at the measurement site was removed. Each sample was measured at three different positions (as shown in
Figure 4). The average of the five measurements for each pear sample was taken as the reference sugar content value for that sample.
2.3. Spectral Preprocessing
To prevent noise in the hyperspectral images caused by dark current and uneven light intensity in the hyperspectral camera, black and white reference corrections were performed on the collected hyperspectral images. The corrected images were calculated using the following equation:
where
Ro is the original hyperspectral image of the pear.
Rb is the black reference image: The black reference image is recorded by photographing an object or background that is completely black. This image is used to correct for dark current and noise in the image to ensure image purity and contrast.
Rw is the white reference image: The white reference image is recorded by photographing a completely white object or background. The white reference image is used to correct for uneven brightness distribution in the image to ensure accurate brightness in the final image.
Ra is the corrected hyperspectral image.
The original spectrum data contain not only information from the sample itself but also noise, such as stray light and sample background, which interferes with the spectral information of the sample. To eliminate noise interference on the spectral curve, preprocessing methods such as multiplicative scatter correction (MSC), standard normal variate (SNV), and normalization were used in this study.
MSC algorithm: This algorithm normalizes data at each wavelength to eliminate the influence of multiplicative scatter, thus improving data quality and interpretability. The MSC algorithm formula is as follows: Calculate the average spectral vector
for each sample, which is the average value of all samples at the same wavelength:
Calculate the average spectral vector X
j for each wavelength, which is the average value of all samples at the same wavelength:
Calculate the standard deviation
for each wavelength, which is the standard deviation of all samples at the same wavelength:
Perform MSC correction for each sample using the following formula:
where X
ij is the spectral value of the ith sample at the jth wavelength, N is the number of samples, M is the number of wavelengths, k is an adjustment parameter (usually 1), X’
ij is the MSC-corrected spectral value, and X
j is the global average spectral vector.
SNV algorithm: This algorithm standardizes the data at each wavelength to conform to a standard normal distribution, eliminating fluctuations caused by spectral intensity differences and making the data closer to independently and identically distributed characteristics, thus improving feature interpretability. The SNV algorithm formula is as follows:
Calculate the average spectral vector
for each sample:
Calculate the standard deviation
for each wavelength:
Standardize each sample using SNV:
where X
ij is the spectral value of the ith sample at the jth wavelength, N is the number of samples, M is the number of wavelengths,
is the global average spectral vector, and σj is the global standard deviation. All preprocessing methods were implemented using MATLAB R2024a.
2.4. Feature Wavelength Selection Methods
Currently, the successive projections algorithm (SPA) is increasingly used for extracting characteristic wavelengths. It effectively removes collinearity between wavelength variables and avoids information redundancy, allowing a small amount of information to represent most of the spectral information of the samples. Stepwise multivariate linear regression (SMLR) is a commonly used mathematical method for selecting regression variables in multivariate linear regression by choosing the optimal bands based on the correlation coefficients between quality parameters and wavelengths. The basic idea is to perform a significance test on each wavelength included in the regression equation at each step of the calculation to determine its significant impact on y. Insignificant wavelengths are removed, and only those significantly affecting y remain. New wavelengths are selected and validated for their significant characteristics, ensuring that the regression equation contains only the most influential wavelengths. In this study, SPA and SMLR methods, along with tenfold cross-validation and 100 iterations of Monte Carlo sampling, were used to determine the features with the lowest cross-validation RMSE.
2.5. Discriminant Modeling Methods
Convolutional neural networks (CNNs) are a deep learning technique widely applied in image and video recognition, recommendation systems, and image classification. CNNs simulate the human visual system, automatically and effectively identifying complex patterns and features in images. They consist of multiple layers, mainly including convolutional layers, pooling layers, and fully connected layers. Convolutional layers extract basic visual features from the input image using filters; pooling layers reduce feature dimensions and enhance model generalization; fully connected layers, at the final stage of the network, transform extracted features into the final output. In this study, we utilized CNNs to analyze and identify the maturity of Korla pears, training the model to recognize spectral images at different maturity stages for rapid and accurate maturity discrimination.
Additionally, we used a BP neural network model for maturity discrimination based on the sugar content characteristic wavelengths of Korla pears. We selected spectral features of 100 samples at different maturity stages as input vectors for the BP model, with 50 samples as test samples. The number of nodes in the input layer was equal to the number of input variables, with one hidden layer node and one output layer node. The transfer functions for the input and hidden layers were tangent sigmoid functions, while the output layer used a linear transfer function. The training method used was gradient descent with a momentum factor of 0.6, a training precision of 0.001, and a maximum of 5000 iterations.
We also designed a new modeling method based on convolutional neural networks, named CNN-S. This model employed depthwise separable convolution, applying filters to each input channel individually for depthwise convolution, followed by 1 × 1 pointwise convolution for feature combination, reducing the number of model parameters and computational complexity. CNN-S integrated batch normalization and ReLU activation functions in all convolutional layers, enhancing the model’s learning ability and efficiency in processing hyperspectral image data. The stacked convolutional and pooling layers iteratively extracted features from pear image data, improving generalization and accelerating convergence. In the final stage, an adaptive average pooling layer simplified feature processing before the fully connected layer, further improving the classification efficiency of different maturity levels of pears. The fully connected layer mapped the extracted features to maturity levels (immature, semimature, mature, overripe), assigning a numerical value (1, 2, 3, 4) for classification.
All hyperspectral images of pear samples were collected using the SpectralSENS software 17.0, and the collected hyperspectral image data were processed and analyzed using ENVI 5.6 and MATLAB R2024a software.
4. Discussion
The sample size of this study was relatively small, with only 150 samples of Korla balsam pear in each stage. This limitation may affect the generalizability and reliability of the results. In practical applications, the insufficient sample size may lead to poor performance of the model when dealing with unseen data, especially when dealing with pears of different varieties, different growing environments, or different picking times [
21]. Therefore, future studies should consider increasing the sample size and including samples from different regions to improve the generalization ability and stability of the model. Obtaining more data from actual production by working with agricultural cooperatives and farms can enable the results to be validated and replicated in different regions and growing conditions.
In addition, the hyperspectral imaging technique and convolutional neural network model (CNN-S) used in this study were tested under laboratory conditions, which may be different from applications in real agricultural production environments. For example, factors such as lighting conditions, temperature variations, and external contamination of pears may affect the detection performance of the model. Therefore, further validation and optimization of the model is needed to ensure its robustness and reliability under different environmental conditions.
The experimental conditions were relatively homogeneous and mainly conducted in a controlled laboratory environment, which may have neglected the effects of different environmental factors (e.g., temperature, humidity) on pear ripeness detection. In real agricultural production, changes in environmental conditions can significantly affect fruit growth and ripening. Therefore, considering multivariate environmental conditions is crucial to improve the generalization ability of the model [
22]. For example, how temperature and humidity variations affect the accuracy of hyperspectral imaging and neural network models is something that needs to be further explored.
In terms of feature selection, although a certain feature selection method was used in this study, future research could consider using other feature selection methods to improve the analysis. For example, common feature selection methods include principal component analysis (PCA), recursive feature elimination (RFE), and tree model-based importance assessment. Each of these methods has advantages and disadvantages:
Principal component analysis (PCA): PCA converts high-dimensional data into low-dimensional data through dimensionality reduction techniques, which can reduce data redundancy and improve the computational efficiency of the model. However, the results of PCA may be harder to interpret because principal components are linear combinations of original features.
Recursive feature elimination (RFE): RFE selects the optimal subset of features by recursively constructing the model and eliminating the least important features. RFE usually provides high accuracy but is computationally expensive, especially when dealing with a large number of features.
Importance assessment based on tree models such as random forest and gradient boosted tree: These methods perform feature selection by evaluating the contribution of each feature to the model performance. Tree modeling approaches typically strike a good balance between accuracy and computational efficiency and are easy to interpret.
Future research could compare the performance of these feature selection methods in terms of accuracy and computational efficiency to determine the best method that is most suitable for ripeness detection in Kuril balsam pear.
To overcome these limitations, future research efforts could be improved and extended in several ways. First, the sample size needs to be expanded by collecting more pear samples from different seasons, geographic locations, and varieties to improve the generalization ability of the model. This can be accomplished by working with agricultural cooperatives and farms to obtain more data from actual production. Second, multienvironmental testing is conducted to evaluate the model’s performance under different environmental conditions (e.g., light intensity, temperature, humidity, etc.) to ensure its adaptability in real-world applications. Onsite tests can be conducted during the production and processing of pears to collect more actual data.
In addition, model optimization is key. The structure and parameters of the model are further optimized by introducing more advanced machine learning and deep learning techniques. For example, integrated learning methods or migration learning techniques can be used to significantly improve the accuracy and robustness of the model. Meanwhile, multi-indicator assessment should also be carried out, and more quality indicators (e.g., hardness, acidity, aroma, etc.) should be introduced for comprehensive assessment in addition to the characteristic wavelength of brix, in order to realize the comprehensive detection of pear quality.
Cross-regional studies are also very important. Studies need to be conducted in pear-growing areas in different regions to verify the applicability and stability of the model in different regions and to explore the feasibility of modeling in different regions. In addition, more environmental variables, such as temperature and humidity, should be added in subsequent studies. Experiments were conducted under different temperature and humidity conditions to assess the effects of these factors on hyperspectral imaging and neural network modeling. Specific measures include collecting samples under high-temperature, low-temperature, high-humidity, and low-humidity conditions to analyze the effects of temperature and humidity variations on pear spectral features and model accuracy. Data should also be collected under different light conditions (e.g., bright light and low light) to ensure the stability of the model under various light intensities.
To further improve the accuracy and robustness of the model, multivariate models can be introduced to optimize the model using multivariate machine learning methods by combining more environmental variables (e.g., soil composition, precipitation, etc.) for comprehensive analysis. For example, methods such as random forests and gradient boosted trees can be used to improve model performance. Factors such as temperature, humidity, and light are incorporated into the model through multivariate regression modeling or integrated learning methods to enhance the comprehensive assessment of pear ripeness.
Finally, field testing and validation are also essential steps. Field tests are conducted in real production environments to obtain measured data under different environmental conditions, and field experiments are conducted to verify the applicability and stability of the model in real agricultural production [
23]. There should be collaboration with agricultural cooperatives and farms to conduct long-term monitoring and data collection in different regions and environmental conditions to ensure the effectiveness of the model under various real conditions.