Abstract
Red, black, and Taiji ginseng can be difficult to distinguish in trade. To address this issue, this study established a complementary workflow of an industrial camera and short-wave infrared (SWIR) imaging to authenticate these processed ginseng types and to predict the contents of six ginsenosides (Rb1, Rb2, Rc, Re, Rf, and Rg1) across 153 batches of processed ginseng (119 red, 16 black, and 18 Taiji ginseng). Ginsenoside reference values were established by UHPLC–MS/MS using digoxin as the internal standard, with the method showing satisfactory precision (RSD ≤ 3.76%), stability (RSD ≤ 3.84%), and recovery (97.04–102.76%). The logistic classification model achieved 96.73% accuracy, 92.31% balanced accuracy, 0.943 macro-F1, and 0.966 macro-AUC. For quantitative prediction, three models were built across the 153 batches of samples. R2p values ranged from 0.8978 to 0.9488 for the Ridge model, 0.8894 to 0.9470 for the PLSR model, and 0.5891 to 0.9111 for the RBF-SVR model. In an independent external validation set (n = 10; six black and four Taiji ginseng), the industrial-camera classifier assigned all samples correctly (100% accuracy), while the selected quantitative models yielded external R2 values of 0.8321–0.9365 and RMSEP values of 0.1229–0.942 percentage points. These results demonstrate that the complementary workflow of industrial camera and SWIR imaging provides a rapid, nondestructive, and promising strategy for authenticating confusable ginseng processed commodities and predicting their ginsenoside percentages.
1. Introduction
Ginseng (Panax ginseng C. A. Meyer) is among the most widely consumed medicinal roots, with its pharmacological value attributed primarily to dammarane-type triterpene saponins, the ginsenosides [1,2]. Red ginseng is prepared by steaming and drying, whereas black ginseng undergoes repeated steaming–drying cycles [1,3]. Taiji (tae-geuk) ginseng is typically prepared by treating fresh roots with hot water before drying [1]. White ginseng is dried directly [1]. Because these ginseng processed products can be visually similar while differing substantially in commercial value, they are readily intermingled in trade, and their authentication is a recurring practical concern.
Chromatographic and mass spectrometric methods, such as UHPLC–MS/MS, provide compound-resolved measurements for ginsenoside analysis [2]. Extraction, dilution, and instrument operation limit their convenience for preliminary screening. Near-infrared (NIR) spectroscopy and chemometrics have been used for authentication, origin discrimination, and ginsenoside estimation [4,5,6,7,8]. Short-wave infrared (SWIR) imaging extends this approach by acquiring spatially resolved spectra. It has been used to discriminate ginseng variety and age [9], visualize moisture, reducing sugars, and hollow rate in red ginseng [10], and predict ginsenosides when combined with X-ray measurements [11]. Short-wave infrared (SWIR) imaging and mass-spectrometric data fusion have also been used to classify the source of American ginseng [12]. Zappi et al. review how chemometrics can extract information from multidimensional analytical data [13].
The present study therefore combines an industrial camera with short-wave infrared (SWIR) imaging to authenticate red, black, and Taiji ginseng and to predict the responses of six ginsenosides (Rb1, Rb2, Rc, Re, Rf, and Rg1) across 153 batches (119 red, 16 black, and 18 Taiji ginseng). Meanwhile, UHPLC–MS/MS served as the reference method for ginsenoside analysis with digoxin as the internal standard. The industrial camera was used for product classification, while SWIR spectra were used for ginsenoside response prediction. The sensors address separate tasks in a complementary workflow (Figure 1). No model used both sensor outputs as inputs. A separate set of 10 independently collected batches (six black and four Taiji ginseng) was used only for external validation.
Figure 1.
Complementary analytical workflow. A 153-batch cohort of processed ginseng (119 red, 16 black and 18 Taiji ginseng) was measured with an industrial camera and a SWIR spectrometer and characterized by UHPLC–MS/MS with digoxin as internal standard.
2. Materials and Methods
2.1. Chemicals and Reagents
The standard compounds of ginsenosides Rg1, Re, Rf, Rc, Rb2 and Rb1 (Purity > 98%) were purchased from Chengdu Standard Sample Biotechnology Co. (Chengdu, China). A total of 153 batches of processed ginseng were collected, including 119 batches of red ginseng, 16 batches of black ginseng and 18 batches of Taiji ginseng. An additional 10 independent batches (six black ginseng and four Taiji ginseng) were collected as an external validation set and were not used in model development. The detailed information was provided in Table S1. HPLC-MS grade methanol and acetonitrile were purchased from Merck Co. (Darmstadt, Germany). The remaining chemical reagents adopted throughout this experiment all met analytical purity standards.
2.2. Determination of Ginsenosides by UHPLC–MS/MS
A 0.5 g portion of sample powder that had passed through a 100-mesh sieve was accurately weighed into a conical flask. After 25 mL of 70% aqueous methanol was added, the flask and its contents were accurately weighed. The sample was ultrasonicated for 30 min, allowed to cool, and replenished with the extraction solvent to compensate for mass loss. The extract was centrifuged at 18,900× g for 5 min. The supernatant was diluted 500-fold and passed through a 0.22 µm membrane filter before UHPLC–MS/MS analysis. Ginsenosides Rg1, Re, Rf, Rc, Rb2, and Rb1 were determined using a Waters ACQUITY UPLC system coupled to a Waters Xevo TQ-XS triple-quadrupole mass spectrometer (Milford, MA, USA). Separation on a C18 column (2.1 × 100 mm, 1.7 µm) was achieved with a binary mobile phase consisting of 0.1% formic acid in water (A) and 0.1% formic acid in acetonitrile (B) at a flow rate of 0.300 mL/min, using the following gradient: 0–1.0 min, 30% B; 1.0–3.5 min, linear increase to 42% B; 3.5–4.5 min, 42% B; 4.5–5.5 min, linear increase to 98% B; 5.5–7.0 min, 98% B; 7.0–7.1 min, return to 30% B; and 7.1–10.0 min, 30% B. The column was maintained at 35 °C and the autosampler at 8 °C, and the injection volume was 1.00 µL. Ions were generated by electrospray ionization in negative-ion mode with a source temperature of 150 °C and a desolvation temperature of 450 °C. The cone and desolvation gas flows were 150 and 1000 L/h, respectively; the nebulizer pressure was 7 bar; the collision gas flow was 0.20 mL/min; and the capillary voltage, cone voltage, and collision energy were 1.20 kV, 30 V, and 30 eV, respectively. The monitored transitions for each analyte and the internal standard are listed in Table S2. Specifically, Re and Rg1 eluted earliest at 1.05 and 1.08 min, respectively, followed by Rf (2.83 min), Rb1 (3.16 min), Rc (3.38 min), and Rb2 (3.56 min). Mass spectrometric detection was performed by monitoring the specific precursor-to-product ion transitions for each compound.
Digoxin, a glycoside, was used as a non-isotope-labeled internal standard. Digoxin contains a steroidal aglycone and a sugar chain, whereas the six target ginsenosides possess dammarane-type triterpenoid aglycones and sugar chains. Their shared hydrophobic cyclic skeleton and hydrophilic carbohydrate moieties provide a structural rationale for considering digoxin as a candidate internal standard, consistent with its previous use as an internal standard in the plasma assay of ginsenoside Rb1 and compound K [14]. However, differences in aglycone and sugar-chain structures mean that identical retention and ionization behavior cannot be assumed. Digoxin was monitored separately in negative-ion MRM mode using the transition m/z 779.40→649.61 at a retention time of approximately 2.50 min. Calibration was based on the ratio of the analyte peak area to the digoxin peak area. Digoxin was added after extraction to give a final concentration of 500 ppb in the injection solution.
2.3. Method Development
The analytical method for the six ginsenosides (Rb1, Rb2, Rc, Re, Rf, and Rg1) was validated in terms of linearity, intra- and inter-day precision, stability, spike recovery, and repeatability. Calibration curves were constructed from standards prepared at a series of concentration levels by plotting the analyte-to-digoxin peak-area ratio against nominal standard concentration, and LOD and LOQ were derived from the calibration data. Intra-day precision was assessed using low, medium, and high QC samples (50, 100, and 500 ng/mL) with six replicates within a single day, while inter-day precision was assessed by repeating the same QC levels over three consecutive days; both retention-time and peak-area RSDs were calculated. Stability was evaluated using high and low QC samples (n = 6) stored at room temperature and −4 °C and analyzed at 0 and 24 h, with area-response RSD used as the stability indicator. Spike recovery was determined at 80%, 100%, and 120% addition levels with six sample batches per level by comparing measured and added amounts, and mean recovery and RSD were calculated. QC repeatability was examined at three concentrations (50, 100, and 500 ng/mL) with seven measurements per level. SD and RSD were calculated. Method validation follows guidelines ICH Q2(R2) [15].
2.4. Industrial-Camera Image Acquisition
Each batch of processed ginseng sample was photographed once against a neutral background using a Basler industrial camera (acA1600-20gc) under fixed illumination and a fixed camera-to-sample distance. Color and texture descriptors were extracted from the root region and used as the classification input. A total of 121 features were extracted including the mean, standard deviation, and five quantiles of nine channels in RGB/Lab/HSV (63 features); 12-bin histograms for each Lab channel (36 features); a uniform LBP histogram (10 features); and the contrast, homogeneity, energy, and entropy of GLCMs in three directions (12 features). The features were also used for principal component analysis.
2.5. Short-Wave Infrared Imaging and Spectral Preprocessing
SWIR images were acquired using a line-scanning short-wave infrared imaging system with a native acquisition format of 640 × 640 pixels and 512 spectral bands over the nominal range 887.8–1725 nm, with a nominal wavelength increment of 1.62 nm. Exposure time was 10 ms. Two-fold spatial and spectral binning and on-chip dark-current subtraction were enabled. Diffuse halogen illumination was used. Samples were imaged without pretreatment on a polytetrafluoroethylene (PTFE) reference platform. The exported batch-level spectral matrix contained 153 records and 256 populated wavelength columns, with calibrated labels spanning 887.83–1710.55 nm; these exported column labels are distinguished from the nominal native acquisition range. Reflectance was calculated pixel-wise and band-wise as R = (I − D)/(W − D), using a PTFE white reference (W) and a dark frame (D) recorded for each sample frame (I). The full field was segmented using pixel-mean reflectance over 1000–1700 nm. Foreground polarity was checked by batch. A 40th-percentile threshold, 3 × 3 morphological closing and opening, and connected-component extraction were applied. Components with at least 30% overlap with the calibration-exclusion region were excluded. The allowed component-to-frame area fraction was relaxed from 0.20 to 0.35 and 0.50 as needed. Saturated, excluded-region, edge, non-finite, and out-of-range pixels were removed. Mean component spectra were averaged to one spectrum per batch. The spectral representation displayed in Figure 2b used a 21-point Savitzky–Golay filter of polynomial order 2 without differentiation, followed by SNV normalization [16,17]. SNV centers and scales each spectrum using its own bandwise mean and standard deviation. This within-spectrum normalization is distinguished from feature standardization fitted across training samples. The regression candidates were the prepared input used directly, an 11-point Savitzky–Golay filter followed by SNV, and 15-point Savitzky–Golay filters with first or second derivatives followed by SNV. The candidate response transformations were the identity and log(1 + y).
Figure 2.
SWIR spectra. (a) Raw reflectance spectra; (b) Spectra after 21-point Savitzky-Golay smoothing (polynomial order 2, no derivative) and standard normal variate normalization. Regression preprocessing was selected within the inner folds.
2.6. Building Classification Models and Quantitative Calibration Models
Industrial-camera features were modelled using radial-basis-function support vector machines (SVM), logistic regression, and random forest classifiers [18]. The SVM grid comprised C values of 0.1, 1 and 10 and gamma values of scale and 0.01. Logistic regression used C values of 0.1, 1 and 10, balanced class weights and a maximum of 5000 iterations. Random forests comprised 160 trees, with max_features set to sqrt or 0.7 and min_samples_leaf set to 1 or 3; balanced_subsample class weights were used. Constant-feature filtering and standardisation were fitted within training folds. Model selection used mean inner-fold balanced accuracy within grouped nested cross-validation with five outer and three inner folds. SVM probabilities were sigmoid-calibrated within the outer training data. Fixed-family comparisons, nested family selection, and a full-cohort refit represent distinct analyses.
For the SWIR data, partial least squares regression (PLSR), ridge regression and radial-basis-function support vector regression (RBF-SVR) models were built. PLSR was included because it remains the reference method for spectroscopic calibration [19]. Ridge regression represents a regularised linear alternative [20], and RBF-SVR is a non-linear kernel alternative of moderate capacity. The candidate hyperparameters were 1, 2, 4, 6, 10 and 15 latent variables for the PLSR model, regularisation strengths of 0.1, 10 and 1000 for the ridge model, and C of 1, 10 and 100 with gamma of scale or 0.01 and epsilon of 0.05 for the RBF-SVR model. All models were implemented in scikit-learn [21]. SWIR regression used five outer and three inner stratified grouped folds [22,23].
Splits were stratified by processing category and grouped by sample identity. The outer seed was 42 and inner seeds were 101–105. The 122/31 counts describe the split. For each analyte and outer fold, preprocessing, scaling, response transformation, and hyperparameters were selected using the inner folds. Squared errors were pooled after back-transformation to the original response scale. The configuration with the lowest pooled inner mean squared error was refitted on the full outer training partition and applied to its held-out test fold.
2.7. Evaluation of the Model Performance
Classification performance is reported as overall accuracy, balanced accuracy, class-specific sensitivity, macro-F1, and macro-AUC. Sensitivity is the fraction of each reference class correctly classified. Balanced accuracy and macro-F1 are the unweighted means of class-specific sensitivities and F1 scores, respectively. Macro-AUC is the unweighted mean of the one-versus-rest AUCs. Confusion matrices are reported as counts and row-normalised percentages.
For regression, the coefficient of determination R2 was defined as 1−SSE/SST, where SSE is the residual sum of squares and SST is the sum of squares about the mean reference value. RMSE was the square root of SSE divided by the number of evaluated samples. Both metrics used matched reference and prediction pairs on the dimensionless UHPLC–MS/MS response-index scale after back-transformation. This R2 differs from the squared Pearson correlation. Prediction metrics were calculated once on the pooled outer test predictions from all five folds (n = 153).
2.8. External Samples Validation
The external validation set comprised 10 independently collected processed ginseng batches (six black and four Taiji ginseng) that were not part of the 153-batch development cohort. The samples were measured with the same industrial camera and SWIR protocols and analyzed by UHPLC–MS/MS.
For ginsenoside prediction, the model used for each ginsenoside was trained on the development cohort using the preprocessing and hyperparameters established during internal cross-validation and then applied to the external SWIR spectra without further adjustment. For classification, the logistic-regression model was fitted on the development cohort and applied unchanged to the external image features. No external sample was used for preprocessing selection, feature selection, hyperparameter tuning, or model selection. External performance was calculated with the metrics defined in Section 2.7.
3. Results
3.1. Method Validation
As shown in Table 1 and Tables S3–S6, the method was validated for six ginsenosides (Rb1, Rb2, Rc, Re, Rf, and Rg1). The calibration curves showed good linearity, with R2 values ranging from 0.9977 to 0.9988 across individual linear ranges of 24.80–2059.00 ng/mL. The limits of detection (LODs) and limits of quantification (LOQs) ranged from 8.18 to 13.00 ng/mL and from 24.80 to 39.40 ng/mL, respectively. In the intra- and inter-day precision tests, the RSDs were ≤0.83% for retention time and ≤3.76% for peak area. Stability analysis showed RSDs of ≤3.84% at room temperature and ≤2.57% at −4 °C. Recovery ranged from 97.04% to 102.76%, with RSDs of ≤3.77%. Repeatability at low, medium, and high QC levels showed a maximum RSD of 9.39%.
Table 1.
Calibration curves, standard-solution ranges, LOD and LOQ of the UHPLC–MS/MS method.
3.2. SWIR Spectral Preprocessing
3.3. Principal Component Analysis
For the industrial camera image features, PC1 and PC2 carried 43.42% and 23.67% respectively, and the black ginseng records occupy a distinct region at negative PC1, while red and Taiji ginseng overlap. The two-standard-deviation ellipses in Figure 3a are descriptive contours. The red and Taiji groups show greater visual overlap.
Figure 3.
PCA score plots of industrial camera features (a) and prepared SWIR spectra (b).
For the SWIR spectra, PC1 carried 94.67% and PC2 3.00% of the variance. Figure 3b places black ginseng mainly at negative PC1, Taiji ginseng at positive PC1, and red ginseng between them. Assigning PC1 to overall raw reflectance intensity after SNV would require evidence from the loadings.
3.4. Performance of Three Classification Models
The performance of the three classification models based on industrial-camera features is summarized in Table 2. Logistic regression achieved the highest accuracy (96.73%), macro-F1 score (0.943), and macro-AUC (0.966), followed by random forest (94.77%, 0.915, and 0.959) and SVM (93.46%, 0.866, and 0.941). Figure 4 presents the corresponding confusion matrices for the Red, Black, and Taiji classes. Logistic regression correctly classified 118 of 119 Red samples, all 16 Black samples, and 14 of 18 Taiji samples (77.8%); one Red sample was misclassified as Taiji, and four Taiji samples were misclassified as Red. SVM correctly classified 118 of 119 Red samples, 15 of 16 Black samples, and 10 of 18 Taiji samples (55.6%), with one Red sample and one Black sample misclassified as Taiji and eight Taiji samples misclassified as Red. Random forest correctly classified 115 of 119 Red samples (96.6%), 15 of 16 Black samples (93.8%), and 15 of 18 Taiji samples (83.3%); four Red samples were misclassified as Taiji, one Black sample as Red, and three Taiji samples as Red. Balanced accuracy was 92.31% for logistic regression, 82.82% for SVM, and 91.24% for random forest. Random forest gave the highest sensitivity for Taiji ginseng (83.33%). In the order red, black, and Taiji ginseng, the class-specific sensitivities were 99.16%, 100.00%, and 77.78% for logistic regression, 99.16%, 93.75%, and 55.56% for SVM, and 96.64%, 93.75%, and 83.33% for random forest.
Table 2.
Performance of three classification models based on industrial-camera features.
Figure 4.
Confusion matrix of logistic regression, SVM and random forest models.
Figure 5 illustrates the one-versus-rest Receiver Operating Characteristic (ROC) curves for the Logistic regression, SVM, and Random forest models across the Red, Black, and Taiji classes. The area under the curve (AUC) values demonstrate that all three models exhibit strong discriminative capabilities, as the curves deviate significantly from the diagonal line representing random guessing. Specifically, the Logistic regression model yielded AUC values of 0.964, 1.000, and 0.934 for the Red, Black, and Taiji classes, respectively. The SVM model attained AUCs of 0.937 (Red), 0.997 (Black), and 0.888 (Taiji), while the Random forest model achieved 0.953 (Red), 1.000 (Black), and 0.925 (Taiji). A consistent trend across all evaluated models is that the Black class exhibits the highest separability, achieving near-perfect or perfect AUC scores (0.997–1.000). Conversely, the Taiji class presents the greatest classification challenge, yielding the lowest AUC values in each model (ranging from 0.888 to 0.934). Comparatively, Logistic regression demonstrated the most superior overall performance, achieving the highest AUC values for both the Red and Taiji classes among the three models.
Figure 5.
ROC curves for three classification models.
3.5. Performance of Three Quantitative Calibration Models
Table 3 presents the percentage ranges of the six ginsenosides (Rb1, Rb2, Rc, Re, Rf, and Rg1) in the training set (n = 122) and test set (n = 31). All six analytes covered relatively wide percentage ranges in both sets, and the minimum, maximum, and mean values were comparable between the two sets. For example, the mean percentages of Rb1, Rb2, Rc, Re, Rf, and Rg1 were 0.6660%, 0.6506%, 0.6571%, 0.6564%, 0.6275%, and 0.6224% in the training set, compared with 0.5463%, 0.5905%, 0.5736%, 0.5853%, 0.5987%, and 0.5915% in the test set, respectively. These results indicate that the distributions of the training and test sets largely overlapped, confirming that the dataset partition was reasonable.
Table 3.
Percentage ranges of six ginsenosides in the training and test sets.
The predictive performance of the three quantitative calibration models (PLSR, Ridge, and RBF-SVR) for the six ginsenosides is visually presented in Figure 6, Figure 7 and Figure 8 and quantitatively summarized in Table 4. As observed in the scatter plots, the predicted percentages were highly correlated with the reference percentages, with the data points closely distributed along the ideal diagonal line, indicating a strong linear relationship for all three models across the six analytes.
Figure 6.
Scatterplot of reference and prediction percentage of PLSR model for all 153 batches.
Figure 7.
Scatterplot of reference and prediction percentage of Ridge model for all 153 development batches.
Figure 8.
Scatterplot of reference and prediction percentage of RBF-SVR model for all 153 batches.
Table 4.
Performance of three quantitative calibration models on the percentage scale (n = 153; RMSE units in percentage points, pp).
According to Table 4, all three models exhibited excellent performance, with the determination coefficients of calibration (R2c) exceeding 0.9179. Notably, the RBF-SVR model achieved the highest calibration performance for five of the six analytes (R2c ranging from 0.9242 to 0.9977; RMSEC ranging from 0.0443 to 0.1502 percentage points). However, in the pooled held-out test folds (n = 153), the PLSR and Ridge models demonstrated more robust and superior predictive abilities. Specifically, the PLSR model yielded prediction determination coefficients (R2p) ranging from 0.8894 (Rf) to 0.9470 (Rb1), with corresponding RMSEP values between 0.1428 and 0.2587 percentage points. The Ridge model achieved comparable results with R2p values ranging from 0.8978 to 0.9488 and RMSEP values from 0.1490 to 0.2622 percentage points, yielding the highest R2p for Rc, Re, Rf, and Rg1, whereas PLSR achieved the highest R2p for Rb1 and Rb2. In contrast, despite its superior calibration fit, the RBF-SVR model exhibited a decrease in prediction accuracy (R2p ranging from 0.5891 to 0.9111; RMSEP ranging from 0.1849 to 0.3985 percentage points), indicating a potential risk of overfitting.
Overall, all three models possess good generalization capabilities for the quantitative percentage analysis of the six ginsenosides. Nevertheless, the PLSR and Ridge models exhibit more balanced and robust predictive stability, making them highly suitable for practical quantification applications.
3.6. External Validation
The final models selected within the development cohort were applied to the 10 independent external validation batches (six black and four Taiji ginseng). As summarized in Table 5, the selected PLSR (for Rb1, Rb2, Rc, Re, and Rf) and Ridge (for Rg1) models achieved external R2 values ranging from 0.8321 (Rc) to 0.9365 (Rb1), with corresponding RMSEP values between 0.1229 and 0.942 percentage points on the 163-batch percentage scale.
Table 5.
External validation of percentage models on 10 independent batches.
For industrial-camera classification, the final logistic-regression model assigned all 10 external batches to their correct reference class (10/10, 100% accuracy; 100% balanced accuracy and macro-F1 across the two represented classes). Predicted correct-class probabilities ranged from 80.00% to 100.00%, with all four Taiji ginseng batches exceeding 94.60% Taiji probability and no black ginseng batch exceeding 0.34% Taiji probability.
Because the external set comprised six black and four Taiji ginseng batches without red ginseng and shared the 163-batch normalization denominator, these results provide encouraging initial evidence of model transferability while highlighting the need for broader three-class prospective validation.
4. Discussion
The authentication of processed ginseng products remains challenging because red ginseng, black ginseng, and Taiji ginseng may exhibit overlapping visual characteristics despite differences in processing methods and commercial value. Conventional chromatographic methods provide reliable chemical information but are less suited to rapid screening of large numbers of samples. In this study, a complementary analytical strategy combining industrial-camera imaging and short-wave infrared (SWIR) spectroscopic imaging was developed to address both product authentication and ginsenoside percentage prediction. The two sensing approaches served complementary purposes: industrial-camera features were used to discriminate among the three processed ginseng types, whereas SWIR spectral information was used to predict the percentages of six major ginsenosides. By integrating visual classification with spectral prediction, the proposed strategy provides a potential means of improving the efficiency of processed ginseng quality assessment.
The UHPLC–MS/MS method provided reference measurements for model development and evaluation. The six ginsenosides showed good linearity, with determination coefficients ranging from 0.9977 to 0.9988. The method also exhibited satisfactory sensitivity, precision, stability, and recovery, supporting its use as a reference analytical procedure. Establishing reliable reference values is particularly important for spectroscopic calibration because the predictive performance of a model depends on the quality of the reference measurements. Although UHPLC–MS/MS remains necessary for accurate chemical quantification and model validation, its analytical requirements make it less convenient for routine screening of large sample collections. The validated reference method and the imaging-based approach therefore serve different but complementary roles in the proposed analytical workflow.
For product authentication, the industrial-camera models achieved consistently strong classification performance, with logistic regression providing the highest overall accuracy (96.73%), balanced accuracy (92.31%), macro-F1 score (0.943), and macro-AUC (0.966) among the three algorithms evaluated. These findings demonstrate that relatively accessible image-derived features, including color, texture, and local spatial patterns, can provide useful information for distinguishing processed ginseng products. The PCA results further showed that black ginseng occupied a comparatively distinct region of the feature space, whereas red ginseng and Taiji ginseng exhibited greater overlap. This pattern is consistent with the classification results, in which Taiji ginseng was more difficult to identify than black ginseng. Because the 119/16/18 class distribution makes overall accuracy sensitive to the majority red-ginseng class, reporting balanced accuracy and class-specific sensitivities clarifies performance on the smaller classes. Nevertheless, the high overall classification performance indicates that industrial-camera imaging can provide a practical first-line screening tool. The comparatively lower recall for Taiji ginseng also highlights the need for additional representative samples and further evaluation of difficult-to-distinguish products.
The SWIR spectroscopic imaging results further demonstrate the potential of spectral information for the nondestructive prediction of ginsenoside percentages. The spectra exhibited broad absorption features near 970, 1200, and 1450 nm [4]. The ~970 nm region is associated with the second overtone of O-H stretching (related to carbohydrates), the ~1200 nm region correlates with the second overtone of C-H stretching (reflecting the aliphatic carbon skeletons of ginsenosides), and the ~1450 nm region is attributed to the first overtone of O-H stretching and combination bands (reflecting the abundant hydroxyl groups in ginsenoside sugar moieties).
Following Savitzky–Golay smoothing and standard normal variate (SNV) normalization, baseline variation and multiplicative scattering were largely reduced, allowing spectral differences among samples to be more readily assessed. However, the PCA results showed that the first principal component accounted for 94.67% of the spectral variance, indicating that direct unsupervised visualization of the spectra is not sufficient to separate all product types cleanly. Accordingly, multivariate regression provides a useful means of relating the combined spectral information to reference ginsenoside percentages, even when the samples cannot be clearly separated by PCA alone.
Comparison of the three quantitative calibration models revealed that model performance depended on both the regression algorithm and the target analyte. RBF-SVR generally produced higher calibration determination coefficients than PLSR and ridge regression, indicating a closer fit to the calibration data. However, its performance in the held-out test folds was less consistent. In contrast, PLSR and ridge regression exhibited comparatively balanced calibration and prediction performance across the six ginsenosides. The prediction determination coefficients of PLSR ranged from 0.8894 to 0.9470, while those of ridge regression ranged from 0.8978 to 0.9488 on the percentage scale. These results indicate that both models captured substantial relationships between the SWIR spectra and the reference percentages. The differences between calibration and prediction performance are also important: a high calibration coefficient alone does not guarantee reliable prediction of previously unseen samples. The stronger calibration fit of RBF-SVR, combined with its comparatively less consistent prediction results (R2p of 0.5891–0.9111), may indicate a risk of overfitting. Overall, the results support the use of PLSR and ridge regression as promising approaches for quantitative screening, while emphasizing the importance of independent prediction performance in model selection.
Differences in predictive performance among the six ginsenosides further indicate that a single model may not perform equally well for all analytes. For example, the prediction determination coefficients obtained with PLSR and ridge regression were relatively high for Rb1 and Rc, whereas Rf and Rg1 showed comparatively lower prediction performance. Such differences may be associated with variations in concentration distributions and the extent to which the spectral data reflect analyte-related information. Because SWIR spectra represent the combined optical response of the sample, the resulting models may capture both direct chemical information and indirect correlations between spectral characteristics, processing category, and sample composition. The present results demonstrate predictive associations within the cohort but do not establish that the measured spectral features are specific to individual ginsenosides. Further work involving wavelength selection (such as variable importance in projection or permutation importance), model interpretation, and evaluation across more diverse samples would help clarify the contributions of individual spectral regions to quantitative prediction.
Despite the promising results, several limitations should be considered before practical implementation. First, the development dataset comprised 153 batches, with 119 red ginseng samples, 16 black ginseng samples, and 18 Taiji ginseng samples. The unequal class distribution and relatively small numbers of black and Taiji ginseng samples may limit the generalizability of the classification models, particularly for samples with atypical appearance or processing characteristics. Second, an independent external validation set of 10 batches (six black and four Taiji ginseng) was evaluated, achieving 100% classification accuracy and external regression R2 values of 0.8321–0.9365 on the fixed 163-batch percentage scale. However, because this external set lacked red ginseng and shared the 163-batch normalization denominator, prospective application will require a pre-specified normalization reference and external validation using larger sample cohorts collected from different sources, production batches, and processing conditions across all three classes. Third, the current study focused on six ginsenosides, and further research is required to determine whether the approach can be extended to additional chemical markers or multiblock sensor-fusion models [24].
In summary, the combined industrial-camera and SWIR imaging approach offers a promising strategy for the rapid authentication and nondestructive quantitative assessment of processed ginseng products. Industrial-camera imaging enabled effective discrimination among red, black, and Taiji ginseng, while SWIR-based regression models provided useful predictions of six major ginsenoside percentages. The complementary information obtained from the two sensing systems may help bridge the gap between rapid visual screening and quantitative chemical analysis. With further external validation and expansion of the sample population, this approach could support more efficient screening and quality assessment of processed ginseng in practical applications.
5. Conclusions
A complementary analytical strategy integrating industrial-camera imaging and short-wave infrared imaging was successfully developed for the authentication of red, black, and Taiji ginseng and the non-destructive prediction of six major ginsenosides. Using UHPLC-MS/MS as a reliable reference, the industrial camera achieved high classification accuracy (96.73% internally and 100% in external validation in six black ginseng and four Taiji ginseng), while short-wave infrared imaging models effectively predicted ginsenoside percentages (R2p = 0.8894–0.9488; external R2 = 0.8321–0.9365). This dual-sensor approach provides a rapid, non-contact, and efficient tool for the quality screening and assessment of processed ginseng.
Supplementary Materials
The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/chemosensors14120264/s1, Table S1: Sample types, geographical origins, sample number, and batch number; Table S2: MRM transitions of the seven analytes; Table S3: Intra-day and inter-day precision of the method; Table S4: Stability of the method; Table S5: Recovery of the method (n = 6); Table S6: Repeatability of the method.
Author Contributions
Conceptualization, Y.T.; methodology, W.L.; software, L.S.; validation, W.L. and L.S.; formal analysis, W.L. and L.S.; investigation, W.L. and L.S.; data curation, L.G.; writing—original draft preparation, W.L.; writing—review and editing, G.S., P.W. and Y.T.; supervision, Y.T.; project administration, Y.T.; funding acquisition, Y.T. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Zhejiang Provincial Drug Regulatory Science and Technology Program, grant number 2024001; the Hangzhou Key Scientific Research Program, grant number 2025SZD1B15; and the Zhejiang Provincial Administration for Market Regulation Science and Technology Plan Project, grant number ZC2025052.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Data are contained within the article.
Acknowledgments
The authors would like to thank the anonymous reviewers for their invaluable suggestions that helped improve the manuscript.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Lee, J.W.; Ji, S.-H.; Choi, B.-R.; Choi, D.J.; Lee, Y.-G.; Kim, H.-G.; Kim, G.-S.; Kim, K.; Lee, Y.-H.; Baek, N.-I.; et al. UPLC-QTOF/MS-Based Metabolomics Applied for the Quality Evaluation of Four Processed Panax ginseng Products. Molecules 2018, 23, 2062. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, H.P.; Zhang, Y.B.; Yang, X.W.; Zhao, D.Q.; Wang, Y.P. Rapid characterization of ginsenosides in the roots and rhizomes of Panax ginseng by UPLC-DAD-QTOF-MS/MS and simultaneous determination of 19 ginsenosides by HPLC-ESI-MS. J. Ginseng Res. 2016, 40, 382–394. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chen, W.; Balan, P.; Popovich, D.G. Changes of ginsenoside composition in the creation of black ginseng leaf. Molecules 2020, 25, 2809. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Pasquini, C. Near infrared spectroscopy: A mature analytical technique with new perspectives—A review. Anal. Chim. Acta 2018, 1026, 8–36. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Dong, F.; Lin, J.; You, J.; Ji, J.; Xu, X.; Zhang, L.; Jin, Y.; Du, S. A chemometric modeling-free near infrared barcode strategy for smart authentication and geographical origin discrimination of Chinese ginseng. Spectrochim. Acta A 2020, 226, 117555. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chen, H.; Lin, Z.; Tan, C. Fast discrimination of the geographical origins of notoginseng by near-infrared spectroscopy and chemometrics. J. Pharm. Biomed. Anal. 2018, 161, 239–245. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Inagaki, T.; Katayama, N.; Cho, R.K.; Chen, X.; Tsuchikawa, S. Near infrared estimation of concentration of ginsenosides in Asian ginseng. J. Near Infrared Spectrosc. 2019, 27, 115–122. [Google Scholar] [CrossRef] [Scilit]
- Zhang, W.; Qu, Z.; Wang, Y.; Yao, C.; Bai, X.; Bian, S.; Zhao, B. Near-infrared reflectance spectroscopy (NIRS) for rapid determination of ginsenoside Rg1 and Re in Chinese patent medicine Naosaitong pill. Spectrochim. Acta A 2015, 139, 184–188. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cheng, R.; Bai, X.; Guo, J.; Huang, L.; Zhao, D.; Liu, Z.; Zhang, W. Hyperspectral discrimination of ginseng variety and age from Changbai Mountain area. Spectrochim. Acta A 2024, 307, 123613. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Bai, X.; You, Y.; Wang, H.; Zhao, D.; Wang, J.; Zhang, W. Hyperspectral reflectance imaging for visualizing reducing sugar content, moisture, and hollow rate in red ginseng. Heliyon 2024, 10, e37919. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Miao, P.; Hao, N.; Zhao, Q.; Ping, J.; Liu, C. Non-destructive determination of ginsenosides in ginseng by combined hyperspectral and X-ray techniques based on ensemble learning. Food Chem. 2024, 437, 137828. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhang, H.; Zhang, H.; Wu, S.; Gong, X.; Zhu, J.; Yan, J.; Jiang, Y. Precise classification of traditional Chinese medicine sources using intelligent fusion of hyperspectral imaging-mass spectrometry data combined with machine learning: A case study of American ginseng. Spectrochim. Acta A 2025, 336, 126066. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zappi, A.; Marassi, V.; Giordani, S.; Kassouf, N.; Roda, B.; Zattoni, A.; Reschiglian, P.; Melucci, D. Extracting Information and Enhancing the Quality of Separation Data: A Review on Chemometrics-Assisted Analysis of Volatile, Soluble and Colloidal Samples. Chemosensors 2023, 11, 45. [Google Scholar] [CrossRef] [Scilit]
- Kim, H.-K. Pharmacokinetics of ginsenoside Rb1 and its metabolite compound K after oral administration of Korean Red Ginseng extract. J. Ginseng Res. 2013, 37, 451–456. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- International Council for Harmonisation. ICH Harmonised Guideline Q2(R2): Validation of Analytical Procedures; ICH: Geneva, Switzerland, 2023. [Google Scholar]
- Savitzky, A.; Golay, M.J.E. Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Anal. Chem. 1964, 36, 1627–1639. [Google Scholar] [CrossRef] [Scilit]
- Barnes, R.J.; Dhanoa, M.S.; Lister, S.J. Standard normal variate transformation and de-trending of near-infrared diffuse reflectance spectra. Appl. Spectrosc. 1989, 43, 772–777. [Google Scholar] [CrossRef] [Scilit]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
- Wold, S.; Sjöström, M.; Eriksson, L. PLS-regression: A basic tool of chemometrics. Chemom. Intell. Lab. Syst. 2001, 58, 109–130. [Google Scholar] [CrossRef] [Scilit]
- Hoerl, A.E.; Kennard, R.W. Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics 1970, 12, 55–67. [Google Scholar] [CrossRef]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Varma, S.; Simon, R. Bias in error estimation when using cross-validation for model selection. BMC Bioinform. 2006, 7, 91. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Tsamardinos, I.; Greasidou, E.; Borboudakis, G. Bootstrapping the out-of-sample predictions for efficient and accurate cross-validation. Mach. Learn. 2018, 107, 1895–1922. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zappi, A.; Biancolillo, A.; Kassouf, N.; Marassi, V.; Morozzi, P.; Tositti, L.; Melucci, D. Quantification of Recycled PET in Commercial Bottles by IR Spectroscopy and Chemometrics. Analytica 2024, 5, 219–232. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







