1. Introduction
The prune (
Prunus domestica L.) is a high-value fruit crop widely appreciated for its rich nutritional content and distinctive flavor [
1]. In regions such as Xinjiang, China, prune cultivation plays a significant role in the agricultural economy. However, due to their delicate skin and soft internal tissue, prunes are highly vulnerable to mechanical damage during postharvest handling, packaging, and transportation [
2]. Even mild external forces can induce internal bruising that remains invisible to the naked eye but accelerates tissue degradation, moisture loss, and microbial decay—ultimately reducing shelf life and economic value [
3,
4]. The early identification of such latent bruises is therefore critical for maintaining fruit quality and minimizing commercial loss.
Conventional techniques for detecting fruit damage include manual inspection, X-ray imaging, ultrasound testing, and machine vision systems [
5]. Among these, machine vision is effective for identifying surface-level defects but performs poorly on dark-skinned fruits like prunes, where low surface contrast and waxy bloom obscure damage cues [
6]. Ultrasound and X-ray techniques offer better penetration into internal tissues [
7,
8], but their high cost, operational complexity, and low throughput make them impractical for large-scale sorting. In contrast, near-infrared (NIR) spectroscopy provides a rapid, noninvasive alternative capable of capturing subtle chemical and structural changes within fruit tissues [
9]. It has been extensively applied to assess mechanical injuries in fruits such as apples [
10], pears [
11], peaches [
12], and avocados [
13], demonstrating strong potential for nondestructive quality monitoring. However, the majority of existing studies primarily address bruises caused by a single, high-impact event or visible surface damage. Relatively few investigations have focused on cumulative low-energy impacts, which are more representative of real-world damage scenarios encountered during transportation and postharvest handling.
Cumulative bruising results from repeated low-energy mechanical stresses—such as vibration, rolling, or compression—typically encountered during harvesting, packaging, or transport. Unlike single-impact injuries, cumulative damage often develops progressively and subtly, without immediate visible symptoms. Biologically, this process can cause gradual rupture of parenchyma cells, loss of cellular integrity, and redistribution of intercellular water. Chemically, it may trigger enzymatic browning, oxidation of phenolic compounds, and degradation of pigments such as anthocyanins or chlorophyll. These structural and compositional changes affect light absorption and scattering properties in plant tissues, particularly in the visible and near-infrared (Vis–NIR) spectral ranges. As a result, cumulative bruising can induce complex, nonlinear spectral variations, which serve as useful markers for nondestructive detection using spectroscopic techniques [
14,
15,
16].
Although NIR spectroscopy has been widely applied to detect mechanical damage in fruits, most existing studies have focused on single-event bruising caused by isolated impacts. To our knowledge, no prior work has systematically modeled cumulative mechanical stress by simulating repeated low-energy impacts and explicitly incorporating bruise progression levels into model training. To complement the existing research, this study explores the feasibility of incorporating cumulative damage stages into the classification framework, with the aim of enhancing the generalizability of bruise detection models to cumulative damage scenarios encountered during postharvest handling. This approach may serve as a practical extension of existing NIR-based methods toward more robust, real-world applications.
To address these challenges, this study presents a novel framework for detecting cumulative mechanical damage in prunes based on visible–near-infrared (Vis–NIR) reflectance spectroscopy integrated with advanced data analysis. A customized device was designed to simulate repeated impacts under controlled energy levels, generating prune samples with graded damage severity. Spectra in the 400–1050 nm range were collected from the equatorial zone of each fruit. Multiple preprocessing and feature selection methods were evaluated, and a classification model combining continuous wavelet transform (CWT), uninformative variable elimination (UVE), and support vector machine (SVM) was developed.
This study is positioned as a pilot investigation to explore the feasibility of cumulative bruise detection using spectral and machine learning techniques, with future extensions planned on larger datasets and more robust frameworks.
The specific objectives of this study are to (1) investigate the spectral response patterns of prunes under cumulative mechanical damage; (2) improve the classification accuracy of early-stage internal bruising; (3) provide a methodological reference for real-world deployment in automated, high-throughput fruit grading systems.
The remainder of this paper is structured as follows:
Section 2 details the materials, experimental setup, and spectral acquisition methods.
Section 3 presents the spectral analysis results, model development, and classification performance.
Section 4 discusses the key findings, potential limitations, and practical implications of the proposed approach. Finally,
Section 5 concludes the paper with a summary of the major contributions and suggestions for future work.
2. Materials and Methods
2.1. Sample Preparation
The prune samples used in this study were harvested on 10 August 2024, from a commercial orchard in Kashgar, Xinjiang, China. All fruits were collected from the same batch to ensure uniformity in maturity and tissue properties. A total of 200 prunes were selected based on the following criteria: intact skin, uniform shape, and absence of visible external defects. These samples exhibited an average fruit weight of 46 ± 10.5 g and mean dimensions of a = 45.1 ± 3.9 mm, b = 38.84 ± 3.2 mm, and c = 50.31 ± 4.3 mm, approximating an ellipsoidal geometry. Prior to testing, all samples were equilibrated at room temperature (23 °C, 15–25% relative humidity) for 24 h to stabilize their physiological conditions and reduce moisture-induced spectral variation.
Subsequently, the 200 prunes were randomly divided into four equal groups (50 samples per group) to create different levels of cumulative mechanical damage: intact (0 impacts), mild (1 impact), moderate (2 impacts), and severe (3 impacts). This ensured balanced group sizes for classification modeling and facilitated systematic comparisons across damage levels.
Due to quality issues such as postharvest deterioration or abnormal bruising patterns, 3 samples from the intact group and 1 sample from the moderate group were excluded from further analysis. As a result, the final dataset consisted of 196 samples.
Mechanical damage was simulated using a custom-designed impact device developed in-house to ensure precise control over impact energy and location (
Figure 1). The device was based on the commonly used free-fall principle in fruit bruise simulation [
16,
17] but introduced significant structural improvements for repeatability and experimental consistency. Specifically, the system incorporated a 370 g solid metal ball (45 mm diameter) mounted on a lightweight rod, guided through a vertical bearing frame for stable trajectory control. The ball was released from a fixed height of 15 cm, generating an estimated impact energy of approximately 0.544 J per drop (calculated using the formula E = mgh). Each prune was positioned in equator-up orientation in a high-density foam holder with a concave groove to cradle the fruit and minimize secondary bouncing or rotational displacement during impact.
Compared with conventional setups that rely on simple inclined planes or fixed-height brackets, this apparatus offers enhanced adjustability, improved energy consistency, and modularity for changing impact conditions. However, it also has limitations—primarily in replicating the complex, multidirectional forces encountered during real-world fruit handling and transportation. Despite this, the design provides a standardized and controllable method to simulate cumulative low-energy impacts, which is critical for isolating the spectral effects of progressive tissue damage without introducing confounding variables such as angular momentum or random contact points.
Based on the number of impacts administered, the samples were divided into four experimental groups:
Intact group (0 impacts);
Mild damage group (1 impact);
Moderate damage group (2 impacts);
Severe damage group (3 impacts).
After the impact, all samples were left undisturbed for another 24 h under the same ambient conditions to allow bruise development and stabilization prior to spectral acquisition.
It is important to clarify that the damage classification of the samples was not determined by visual or tactile inspection but rather by the predefined number of impacts applied using a standardized device (0, 1, 2, or 3 impacts). Each fruit’s damage level was thus assigned a priori based on controlled treatment. The subsequent tactile and visual descriptions serve only to illustrate the limited perceptibility of bruises in dark-skinned prunes and were not used to define or verify class labels. This approach ensured objective, repeatable grouping, while highlighting the need for spectroscopic methods to detect internal damage that may not be externally visible.
Although visual differentiation among the four groups was limited due to the dark skin and waxy surface of prunes, additional tactile and localized visual cues were used to verify the damage level. Mildly damaged samples typically exhibited slight surface indentation while maintaining overall firmness and no discoloration. Moderately damaged fruits showed deeper indentation and softening of the impact area, often accompanied by localized wateriness beneath the skin. Severely damaged samples had noticeable hydration, with some exhibiting skin rupture or minor juice leakage. These physical characteristics served as auxiliary criteria to support damage classification alongside impact count.
This cumulative damage modeling approach was selected to mimic real postharvest scenarios where fruits may experience repeated minor collisions during sorting, packaging, and logistics operations, which are often overlooked but can collectively compromise the internal quality [
18].
2.2. NIR Reflectance Spectral Acquisition
NIR spectroscopy captures the absorption and scattering characteristics of biological tissues when exposed to near-infrared light. Absorption features are mainly attributed to chemical constituents such as water, sugars, and proteins, while scattering is influenced by tissue density, cell structure, and surface morphology [
19,
20]. Compared with the transmission mode, the reflectance mode is more sensitive to changes in the surface and subsurface layers, which makes it suitable for detecting mechanical bruising in fruits [
21,
22]. Therefore, the reflectance mode was selected in this study to enhance the sensitivity to bruise-induced surface and near-surface tissue variations.
In this study, a reflectance-mode Vis–NIR spectral acquisition system was constructed, as illustrated in
Figure 2. The system consists of a PG2000-Pro back-thinned spectrometer (Ideaoptics, Shanghai, China; wavelength range: 367–1052 nm; SNR: 800:1), a 100 W HL-100 halogen light source (Shanghai Ideaoptics), and a Y-type bifurcated fiber optic probe (Guangzhou Ruike Photoelectric Technology Co., Ltd., Guangzhou, China). The illumination path was arranged such that the light passed through the Y-probe and illuminated the prune sample within a light-shielding box. The reflected signal was collected by the second branch of the fiber probe and transmitted to the spectrometer. All data were recorded using Morpho 3.2 software.
To stabilize sample positioning and reduce variability, each prune was placed in a custom fruit holder made of high-density foam, shaped to fit the fruit’s curvature. Preliminary experiments were conducted using a control-variable approach to determine the optimal acquisition parameters by minimizing spectral area variation and standard deviation across multiple test points, as recommended in prior optical system optimization studies [
23,
24]. Based on these trials, the finalized acquisition settings were the following:
Integration time: 100 ms;
Smoothing level: 5;
Fiber-sample distance: 18 cm (spot size slightly larger than the prune’s cross section);
Acquisition region: equatorial zone of the fruit.
During formal acquisition, reflectance spectra were collected at two symmetrical points on the equatorial region of each fruit. For damaged samples, one spectrum was taken from the bruise site, and the other from the opposite side. For intact samples, two equatorial points 180° apart were selected to simulate real inspection conditions. The average of the two spectra was calculated and used as the representative spectrum for subsequent modeling.
2.3. Data Processing and Analysis Methods
2.3.1. Spectral Preprocessing
Spectral preprocessing is essential for improving the robustness and accuracy of classification models by mitigating system noise, baseline drift, and scattering effects caused by sample surface and structural heterogeneity. In this study, five commonly used preprocessing techniques were applied to the raw reflectance spectra: multiplicative scatter correction (MSC), SG, detrending, standard normal variate (SNV), and CWT. Each method addresses specific distortions and contributes to enhancing signal clarity.
MSC [
25] linearly corrects each spectrum by referencing the mean spectrum of the calibration set, effectively reducing multiplicative and additive scattering effects and improving inter-sample comparability. SG [
26] smoothing applies a moving polynomial fit to suppress high-frequency noise while preserving local spectral features. Detrending [
27] eliminates sloping baselines by subtracting fitted polynomial trends, thus enhancing subtle spectral variations. SNV [
28] standardizes each spectrum by centering and scaling, mitigating the influence of particle size, surface texture, and illumination inconsistencies. CWT [
29], a time–frequency analysis technique, decomposes spectra into multi-resolution components using scaled wavelet functions, allowing for simultaneous noise suppression and feature enhancement. Notably, while CWT is formally categorized here under preprocessing, it also serves a dual role by enhancing local spectral features across multiple scales, thus effectively acting as a feature extraction method. Its contribution to model performance lies in this dual functionality.
Each of these preprocessing techniques was individually applied to the raw spectral data. Subsequently, the preprocessed spectra were used to train classification models using SVM, random forest (RF), and extreme gradient boosting (XGBoost). Model performance was compared in terms of accuracy, precision, recall, and F1-score to determine the most effective preprocessing strategy for cumulative impact damage classification.
2.3.2. Feature Wavelength Selection Methods
To reduce the dimensionality of spectral data and eliminate redundant or irrelevant variables, three widely adopted wavelength selection techniques were employed: successive projections algorithm (SPA), UVE, and competitive adaptive reweighted sampling (CARS). These methods aim to preserve informative spectral features while enhancing model performance and computational efficiency.
SPA is a forward selection algorithm designed to minimize collinearity among selected variables. It works by iteratively projecting candidate variables onto the residual subspace of previously selected ones, identifying the variable that contributes the most independent information at each step. SPA is particularly suited for spectral data, where adjacent wavelengths often exhibit high redundancy, and effectively reduces multicollinearity while preserving critical features for modeling [
30].
UVE is a variable selection method based on the partial least-squares (PLS) regression framework. It introduces artificial noise variables into the dataset and evaluates the stability of each spectral variable through cross validation. Variables with low stability values—comparable to or worse than the artificial noise—are eliminated, resulting in a refined set of relevant wavelengths [
31].
CARS employs a Darwinian “survival of the fittest” strategy that iteratively samples subsets of variables using Monte Carlo sampling and adaptive reweighting. At each iteration, variables with the highest importance (based on the regression coefficients) are retained, while less relevant ones are removed. This approach has proven highly effective in spectroscopy-based modeling [
32].
Each feature selection method was integrated with the classification models following CWT preprocessing, and their performance was evaluated in the Results section to determine the optimal strategy for detecting cumulative damage in prunes.
2.3.3. Classification Model Construction and Evaluation
To evaluate the spectral classification capability across different levels of cumulative bruise damage in prunes, three widely used machine learning algorithms were applied: SVM, RF, and XGBoost. These three classifiers were chosen to represent distinct modeling paradigms: SVM for its strong performance in high-dimensional small-sample settings through margin maximization, RF for its ensemble-based robustness against overfitting, and XGBoost for its capacity to capture nonlinear interactions via gradient boosting. These algorithms are particularly suitable for nonlinear classification problems in high-dimensional datasets such as near-infrared spectra [
33,
34].
The dataset was partitioned into training and validation sets at a 70:30 ratio using the Kennard–Stone (KS) algorithm, which selects samples to maximize spectral diversity and ensure an even distribution [
35]. All modeling procedures were conducted in Python 3.8, utilizing the scikit-learn and XGBoost libraries.
SVM constructs an optimal separating hyperplane in the feature space and is known for its robustness in small-sample, high-dimensional classification tasks. In this study, the radial basis function (RBF) kernel was used to capture nonlinear relationships between spectral features and bruise categories [
36].
RF is an ensemble learning technique based on decision trees, where multiple classifiers are trained on bootstrapped data subsets and their outputs are aggregated. RF is particularly robust to noise and performs well with redundant or high-dimensional features [
37].
XGBoost, an enhanced gradient-boosting framework, sequentially builds decision trees and optimizes a regularized objective function to minimize overfitting. Due to its high computational efficiency and predictive accuracy, XGBoost has been widely adopted in agricultural spectral classification tasks [
38].
In this study, default or empirically chosen hyperparameter values were adopted for the SVM, RF, and XGBoost classifiers without performing exhaustive tuning. This decision was made to emphasize the feasibility and general effectiveness of spectral modeling strategies under a standardized pipeline. Further performance improvements could potentially be achieved through advanced hyperparameter optimization, which may be explored in future work.
To further evaluate model robustness and mitigate sampling bias, five-fold cross validation was conducted within the training set during model development. The final model performance was evaluated on the independent 30% validation set. Specifically, the cross_val_score() function from scikit-learn was employed to compute the average classification accuracy across five folds for each classifier. This strategy complements the initial Kennard–Stone split and enhances the reliability of performance assessment.
Model performance was assessed using four standard metrics: accuracy, defined as (TP + TN)/(TP + TN + FP + FN), indicating the proportion of correctly classified samples; precision, calculated as TP/(TP + FP), reflecting the proportion of correctly predicted positive cases; recall, computed as TP/(TP + FN), measuring the model’s ability to detect true positives; and F1-score, given by 2 × (Precision × Recall)/(Precision + Recall), which balances precision and recall and is especially useful for imbalanced datasets. Here, TP, TN, FP, and FN represented true positives, true negatives, false positives, and false negatives, respectively.
3. Results
3.1. Spectral Characteristics of Prunes with Different Damage Levels
As shown in
Figure 3, the mean reflectance spectra of prunes under different cumulative damage levels exhibited distinctive patterns, particularly in the near-infrared region (700–1050 nm). Intact samples consistently showed the highest spectral intensity, especially beyond 850 nm. A progressive decline in reflectance was observed with increasing bruise severity, most notably around 818 nm and 980 nm. The absorption near 818 nm is primarily associated with the second overtone of O–H stretching in water molecules, reflecting changes in tissue hydration status and intracellular water mobility [
39,
40]. Meanwhile, the 980 nm region corresponds to a strong combination band of O–H stretching and bending vibrations, also indicative of the water content and the structural integrity of parenchyma cells [
41]. These variations suggest that cumulative mechanical stress may lead to progressive disruption of cell membranes and water redistribution, resulting in reduced absorption and scattering in these bands. Such observations are consistent with prior studies on fruit bruising and water-related spectral features in horticultural products [
20,
42].
These spectral changes are physiologically meaningful because water distribution and retention are closely related to tissue viability. In bruised fruit tissues, mechanical stress compromises cell membrane integrity, resulting in intracellular water leakage and intercellular redistribution. This leads to a measurable reduction in water-associated absorbance features at 818 nm and 980 nm. Additionally, the degradation of parenchyma cell walls due to repeated low-energy impacts may accelerate water loss and enzymatic activity, further altering the spectral responses [
43]. Thus, the observed changes in these NIR bands provide a biochemical basis for differentiating bruise severity in prunes using spectroscopic techniques.
In addition to the NIR trends described above, some atypical reflectance behaviors were observed in the visible region. Interestingly, severely bruised samples exhibited reflectance values lower than those of moderately bruised ones beyond 850 nm, which may be attributed to more extensive tissue degradation and dehydration. However, in the visible region (especially below 650 nm), severely damaged samples sometimes displayed slightly higher reflectance than moderately damaged or even intact ones. This could be due to reduced light absorption by and increased scattering from loosened or broken skin and flesh tissue, where cell walls have lost their buffering capacity [
44]. Such spectral reversal near 650 nm has also been reported in other fruit bruise studies and is considered a potential indicator of tissue structure saturation.
These spectral characteristics suggest that Vis–NIR reflectance signals in the 400–1050 nm range effectively capture bruise-related physiological changes in prunes. In particular, the 600–900 nm range demonstrated both a sufficient signal-to-noise ratio and strong biological relevance, providing a robust basis for subsequent feature selection and modeling strategies. The selected spectral range also aligns well with the optimal response range of the spectrometer used, ensuring data quality and reproducibility [
20].
3.2. Classification Results Based on Preprocessing and Modeling Methods
To evaluate the impact of different spectral preprocessing techniques on classification performance, six datasets were constructed, i.e., raw spectra (Raw) and five preprocessed versions using MSC, SG, detrending, SNV, and continuous wavelet transform (CWT). Each dataset was modeled using three classifiers: SVM, RF, and XGBoost. The classification results based on accuracy, precision, recall, and F1-score are presented in
Table 1.
In terms of overall classification accuracy, the models employing CWT preprocessing consistently outperformed those using other methods across all three classifiers. Among them, the CWT-XGBoost model achieved the highest accuracy (89.83%), followed by CWT-SVM and CWT-RF, both reaching 88.14%. Meanwhile, these CWT-based combinations also maintained high scores in precision, recall, and F1-score, indicating that CWT effectively enhances spectral feature expression and improves the model’s ability to distinguish between different levels of cumulative bruise damage. This multiscale transformation method is particularly well suited for the progressive damage classification scenario addressed in this study.
By contrast, conventional scatter correction techniques such as MSC and SNV yielded lower accuracy in certain classifiers. For example, the MSC-RF and SNV-XGBoost models achieved only 67.80% and 66.10% accuracy, respectively, with F1-scores below 70%. These results suggest that such methods may have limited effectiveness in handling spectra from cumulative damage scenarios, possibly due to their weaker ability to suppress noise or enhance discriminative features. Additionally, the SG and detrending preprocessing methods showed highly variable performance across models, with classification accuracies ranging from 72.88% to 84.75%, reflecting less stability and generalizability under different modeling strategies.
Furthermore, raw spectra without any preprocessing (Raw) showed relatively good performance when used with SVM (accuracy: 83.05%) but significantly lower results with RF and XGBoost (accuracy, 77.19% and 76.27%, respectively). This further confirms that spectral redundancy and noise can hinder the construction of robust classification models when left unaddressed.
In summary, CWT demonstrated strong capability in retaining both local and global spectral features through its multiscale decomposition mechanism, which makes it highly effective for detecting cumulative mechanical damage in prunes. Based on these findings, CWT was selected as the standard preprocessing method for subsequent feature selection and model construction to ensure optimal classification performance and model stability.
Given the comparable performance of SVM, RF, and XGBoost under the CWT preprocessing condition, model selection alone was insufficient to yield significant performance gains. Therefore, the subsequent analysis focused on incorporating wavelength selection strategies to further optimize classification outcomes and assist in identifying the most suitable model combination.
3.3. Model Optimization Based on Feature Wavelength Selection
To further enhance classification performance and reduce spectral dimensionality, three feature wavelength selection methods—successive projections algorithm (SPA), uninformative variable elimination (UVE), and competitive adaptive reweighted sampling (CARS)—were applied to the CWT-preprocessed spectra. Together with the three classifiers (SVM, RF, and XGBoost), a total of nine feature-selected models were constructed. Additionally, three baseline models using the full CWT-preprocessed spectra without feature selection were also included (CWT–SVM, CWT–RF, CWT–XGBoost), bringing the total number of models in this comparison to twelve. Their classification performance was evaluated based on accuracy, precision, recall, and F1-score, as summarized in
Table 2.
Among all tested combinations, the UVE–CWT–SVM model achieved the highest overall performance, with accuracy of 93.22%, precision of 92.90%, recall of 93.58%, and F1-score of 93.12%. This demonstrates an excellent balance across all four metrics and confirms the strong synergy between UVE’s variable stability filtering and SVM’s robustness in small-sample, high-dimensional scenarios. UVE–CWT–RF and UVE–CWT–XGBoost also performed well, achieving accuracies of 91.53% and 89.83%, respectively. These results suggest that UVE effectively selects physiologically relevant and discriminative bands that are compatible with various classifier architectures.
The SPA-based models also yielded competitive results. For example, SPA–CWT–XGBoost reached an accuracy of 90.68% and an F1-score of 90.10%, followed by SPA–CWT–RF (89.58%) and SPA–CWT–SVM (86.44%). However, compared to the UVE-based counterparts, the SPA models exhibited slightly lower recall and F1-score values, indicating reduced sensitivity in distinguishing intermediate bruise levels, such as moderate versus severe damage.
In contrast, CARS-based models consistently underperformed. The CARS–CWT–XGBoost model achieved only 79.66% accuracy and an F1-score of 78.79%, suggesting that its variable selection might have omitted key wavelengths or retained noisy bands, thereby weakening its classification performance.
The three full-spectrum models (CWT–SVM, CWT–RF, and CWT–XGBoost) also demonstrated reasonably strong performance, with accuracies ranging from 87.83% to 88.63%. Notably, the best full-spectrum model (CWT–XGBoost, 88.94% F1-score) still lagged behind the UVE–CWT–SVM model, highlighting the benefit of informative feature selection over raw full-band input. These baseline comparisons reinforce the idea that appropriate wavelength selection not only reduces dimensionality but also improves generalization by mitigating the redundant or irrelevant spectral content.
The differences in variable selection outcomes among UVE, SPA, and CARS are visualized in
Figure 4. The UVE-selected bands were concentrated primarily within the 600–900 nm range, which encompasses known absorption features related to water, chlorophyll, and tissue integrity. SPA identified fewer but physiologically meaningful wavelengths—such as 608 nm, 818 nm, and 980 nm—while CARS produced more widely scattered and less interpretable bands, particularly lacking in near-infrared consistency.
In summary, both the feature selection method and the classifier architecture jointly influenced the final model performance. The best-performing configuration—UVE–CWT–SVM—combined a stable, physiologically grounded feature set with a flexible and robust classifier, providing an optimal strategy for practical bruise detection tasks in prunes. Accordingly, this integrated modeling pipeline was adopted in the following sections to support performance interpretation and guide discussions on real-world applicability.
3.4. Confusion Matrix of the Optimal Model
To further assess the classification performance of the optimal model, the confusion matrix of the CWT-UVE-SVM classifier is shown in
Figure 5. The model correctly identified all intact samples and misclassified only one mildly damaged sample as intact, which indicates strong separability capacity between undamaged and bruised fruit. Most errors occurred for the moderate and severe categories, as two moderately damaged samples were identified as severely damaged and one severely damaged sample was misclassified as moderately damaged. These confusions likely resulted from overlapping spectral responses at higher bruise levels, where tissue degradation leads to signal saturation. Overall, the matrix demonstrated the model’s high reliability in differentiating cumulative damage levels in prunes.
4. Discussion
This study demonstrates that Vis–NIR spectroscopy, when integrated with a tailored data analysis pipeline, can effectively detect cumulative mechanical damage in prunes. Although the employed methods—CWT preprocessing, UVE-based feature selection, and SVM classification—are individually established, their combination was optimized to capture the progressive, nonlinear spectral changes induced by repeated low-energy impacts. Compared with alternative preprocessing–modeling configurations, the CWT–UVE–SVM pipeline achieved the best classification performance, underscoring the value of method alignment with the biological characteristics of bruise evolution.
Among all classifier–preprocessing combinations, CWT consistently enhanced the model performance across metrics. Its multiscale decomposition capabilities enable the retention of both global shape and localized variations in spectral curves, which is especially effective in capturing subtle spectral distortions caused by internal tissue disruption [
45]. UVE further contributed by extracting stable and physiologically relevant wavelengths—particularly in the 600–900 nm region—known to reflect water content, pigment changes, and tissue integrity [
46]. The spectral bands selected by UVE align well with biological signatures of cellular breakdown and water redistribution during damage accumulation.
SVM performed best under the reduced feature space created by UVE, likely due to its ability to generalize in high-dimensional, small-sample scenarios. While ensemble methods like RF and XGBoost showed slightly better performance in the initial preprocessing–modeling comparisons (
Table 1), SVM ultimately outperformed them after UVE-based variable selection. This outcome may be attributed to its ability to construct stable decision boundaries when irrelevant features are removed [
47]. Although less interpretable than ensemble models, SVM remains a robust option under constrained data conditions. Ensemble methods, on the other hand, remain highly competitive in broader contexts and may benefit from further tuning in future work.
In addition to prioritizing model interpretability and deployment feasibility, our study adopted a standardized modeling pipeline using default or empirically chosen hyperparameters, which helps minimize overfitting and model selection bias under small-sample conditions. This trade-off supports reproducibility but may limit performance optimization. Future work could explore automated hyperparameter tuning strategies to further enhance the classifier accuracy.
Furthermore, while this study focused on three commonly used classification models (SVM, RF, and XGBoost) to represent diverse algorithmic families, future studies could benefit from evaluating additional interpretable and lightweight classifiers such as decision trees. These models offer advantages in terms of transparency and deployment efficiency, especially in resource-constrained or real-time applications.
Notably, the observed similarity across accuracy, precision, recall, and F1-score stemmed from the combination of a balanced dataset (with equal sample sizes for each class) and the use of macro-averaged evaluation metrics. Since the classifier performed consistently across the four damage levels—intact, mild, moderate, and severe—the resulting metrics naturally converged to similar values. This consistency suggests model stability rather than evaluation bias.
To enhance operational feasibility, spectral measurements were conducted at the equator of the prune, balancing spectral consistency and industrial adaptability. This acquisition zone is compatible with operations by commercial fruit sorting systems, which rarely support full-surface scanning. Thus, the proposed detection protocol aligns with real-world constraints and favors scalability in postharvest applications [
48].
However, several challenges must be addressed for its industrial implementation. First, the spectral acquisition process must be adapted for high-throughput settings, where fruit motion, positioning errors, and vibration introduce variability. Second, ambient environmental conditions—such as light drift or temperature fluctuations—may reduce spectral fidelity, necessitating real-time correction strategies. Third, integration with complementary modalities like imaging or hyperspectral data fusion could improve detection robustness, especially for ambiguous or borderline bruising cases.
The study also acknowledges the limitations of its controlled experimental design. Bruise simulation was conducted under lab conditions with fixed energy inputs, which may not capture the variability of commercial postharvest logistics. The dataset, while balanced, remains relatively small and homogeneous. Future studies should incorporate larger, multi-seasonal datasets and test robustness under real packinghouse conditions. In addition, incorporating objective physiological measures such as firmness or water loss could improve both class labeling accuracy and model interpretability.
Finally, although the current approach relies on traditional machine learning models, future research may explore deep learning architectures—such as CNNs or autoencoders [
49]—for automated feature extraction. These models have shown promise in spectroscopy-related tasks, particularly for capturing nonlinear patterns and enhancing robustness in real-time classification scenarios.
In summary, the proposed framework offers a scalable, interpretable, and high-performing solution for cumulative bruise detection in prunes [
20]. While further validation is required, it holds strong potential for deployment in automated, nondestructive fruit grading systems.
5. Conclusions
This study proposes a robust and interpretable method for the nondestructive detection of cumulative mechanical damage in prunes by integrating Vis–NIR spectroscopy with machine learning techniques. A customized impact simulation system was constructed to replicate realistic postharvest handling conditions, enabling the controlled acquisition of spectral data under progressive damage scenarios. The proposed CWT–UVE–SVM pipeline achieved a high classification accuracy of 93.22%, demonstrating strong capability in capturing and modeling nonlinear reflectance responses caused by repeated low-energy impacts.
The research successfully fulfilled the three objectives outlined in the Introduction:
(1) To investigate the spectral response of prunes under cumulative mechanical damage. Progressive decreases in reflectance were observed at key wavelengths (e.g., 818 nm and 980 nm) corresponding to water absorption and tissue structural integrity. However, under severe and repeated impacts, reflectance tended to saturate or slightly rebound—likely due to extensive cellular collapse, water migration, and surface property alterations—highlighting the nonlinear spectral behavior of cumulative bruising.
(2) To improve the classification accuracy of early-stage internal bruising. The proposed CWT–UVE–SVM model achieved a classification accuracy of 93.22%, with macro-averaged precision, recall, and F1-score all exceeding 0.90. More importantly, the model successfully distinguished between intact fruit and three distinct damage levels—mild, moderate, and severe—demonstrating strong discriminative power across a progressive bruising continuum. This capability is essential for fine-grained quality control in real-world postharvest applications.
(3) To provide a methodological reference for real-world application. A complete detection pipeline was established, covering damage simulation, spectral acquisition, multistage preprocessing and feature selection, and robust modeling. This framework offers practical potential for integration into automated, high-throughput fruit sorting systems. While the current model demonstrated promising classification performance on a limited dataset, we acknowledge its exploratory nature. Future research should involve more extensive validation using larger, heterogeneous datasets under commercial logistics conditions to improve the system’s robustness, generalizability, and practical deployment.
Overall, this study provides a practical foundation for the industrial deployment of nondestructive bruise detection technologies and contributes new insights into the spectral modeling of cumulative damage in soft fruits.