Next Article in Journal
The Effects of the Apple MdLTPG17 in Mediating Drought Stress Tolerance and Regulating Fruit Gloss Formation
Previous Article in Journal
Dual-Branch Deep Remote Sensing for Growth Anomaly and Risk Perception in Smart Horticultural Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics

by
Muhammad Zeeshan Ali
1,
Pimjai Seehanam
1,2,*,
Darunee Naksavi
3,* and
Phonkrit Maniwara
2
1
Department of Plant and Soil Sciences, Faculty of Agriculture, Chiang Mai University, Chiang Mai 50200, Thailand
2
Postharvest Technology Research Center, Faculty of Agriculture, Chiang Mai University, Chiang Mai 50200, Thailand
3
Faculty of Agriculture, Uttaradit Rajabhat University, Uttaradit 53000, Thailand
*
Authors to whom correspondence should be addressed.
Horticulturae 2026, 12(4), 462; https://doi.org/10.3390/horticulturae12040462
Submission received: 11 March 2026 / Revised: 31 March 2026 / Accepted: 6 April 2026 / Published: 8 April 2026
(This article belongs to the Section Postharvest Biology, Quality, Safety, and Technology)

Abstract

Mold infection by Aspergillus and Penicillium spp. in Sithong sweet tamarind (Tamarindus indica L.) during commercial postharvest storage poses quality and food safety risks. However, the current visual detection method, which involves randomly cracking open the pods, is both destructive and laborious. The integration of near-infrared spectroscopy (NIRS) with artificial neural networks (ANN) enables rapid and non-destructive detection while capturing non-linear biochemical–spectral relationships, offering advantages over conventional destructive and linear analytical methods. It was tested as a mold classifier in sweet tamarind pods preserved in commercial ambient conditions (25 °C, 60% relative humidity) for five weeks. Six hundred pods were examined weekly using interactance spectroscopy (800–2500 nm) with six measurement points per pod and four spectral preprocessing methods. The ANN outperformed partial least squares discriminant analysis (PLS-DA) across all storage weeks, peaking at Week 2 with standard normal variate (SNV) preprocessing (prediction accuracy: 85.00%; sensitivity: 0.84; specificity: 0.86; F1-score: 0.85). Advanced tissue degeneration caused spectral heterogeneity, which decreased performance at Week 4 (prediction accuracy: 71.82–76.36%). Principal component loadings identified mold-induced water redistribution and carbohydrate depletion wavelengths at 938, 975–980, and 1035 nm. Week-adaptive calibration is essential for implementation because of the large difference between week-specific model accuracy (up to 85%) and overall storage model accuracy (63.53%). These findings provide a mechanistic underpinning for smaller wavelength-selective sensors and temporally adaptive mold screening systems in commercial tamarind storage.

Graphical Abstract

1. Introduction:

Sweet tamarind (Tamarindus indica L.) is a commercially significant tropical fruit crop, comprising 18.17% of the global market, valued at around USD 760.75 million [1,2]. The Sithong cultivar, renowned for its remarkable sweetness, elongated pods, and advantageous pulp-to-seed ratio, has achieved notable recognition in export markets, with China representing USD 1.1 billion in yearly imports. Nonetheless, postharvest mold infection constitutes a significant impediment to upholding the quality requirements required by these markets. Fungal infections, chiefly attributed to Aspergillus spp. and Penicillium spp., infiltrate pods via microscopic surface apertures, instigating internal deterioration prior to the manifestation of any observable exterior signs [3,4]. This obscure infection pattern is particularly worrisome as it renders manual visual inspection futile. Mold incidence significantly escalates within a one-to-five-week storage period under commercial ambient settings (25 °C, 60% relative humidity) [5]. Aspergillus spp. is recognized makers of aflatoxins, highly potent carcinogens controlled at nanogram-per-gram levels in numerous importing nations, rendering mold identification a critical food safety concern rather than a mere quality control matter [4].
Modern sorting methods depend on destructive sampling and human examination, techniques that are statistically constrained, labor-intensive, and unable to assess complete commercial batches [6,7]. Near-infrared spectroscopy (NIRS) has become a validated non-destructive analytical method for assessing agricultural quality, as it examines the vibrational overtones of C–H, O–H, and N–H bonds in intact samples throughout the 800–2500 nm range [8,9,10]. Fungal colonization causes biochemically specific alterations in moisture redistribution due to hyphal cell-wall rupture, carbohydrate utilization, and metabolic water generation, which result in unique spectral signatures that can be differentiated from healthy tissue [11]. NIRS-based mold classification has been thoroughly confirmed in citruses [12] and chestnuts [13], attaining prediction accuracies of 90% using suitable chemometric algorithms. Recent studies have also demonstrated the growing potential of spectroscopic approaches for non-destructive detection of internal fungal infection and related postharvest disorders in fruit systems relevant to the present work. For example, portable long-wave and short-wave NIR spectroscopy has been used for accurate detection of hidden mold infection in citrus, while visible/near-infrared transmission spectroscopy has recently been applied to detect early moldy-core infection in apples. In addition, hyperspectral and machine-learning-based approaches have shown that infected citrus tissues can be discriminated from sound tissues even before severe external symptoms become obvious. Although these commodities differ from sweet tamarind in morphology, they provide strong proof-of-concept that spectroscopic methods can detect infection-induced internal biochemical and structural changes in intact fruit [14,15,16]. Artificial neural networks (ANN) are especially adept in NIR spectral classification due to their ability to encapsulate non-linear, high-dimensional correlations between spectral characteristics and biological quality states, which linear discriminant approaches like PLS-DA fail to model effectively [17,18,19]. Although there is substantial literature on NIRS in postharvest quality assessment, a comprehensive evaluation of NIRS-ANN for mold detection specifically in sweet tamarind, a commodity characterized by a unique double-walled leguminous pericarp that complicates optical penetration, has not been documented throughout an entire commercial storage period. The recent preliminary experiment validated the spectrum efficacy of this method, wherein we demonstrated the feasibility of NIRS-based mold detection in sweet tamarind by assessing 400 pods at a single time point, achieving a classification accuracy of up to 97.6% using an SNV-PLS-DA model. While previous work demonstrated feasibility at a single time point, the present study extends this approach by evaluating temporal dynamics over a full five-week storage period and introducing a week-adaptive classification framework, which is necessary during commercial storage. Biochemical changes associated with fungal infestation are considerably time-dependent. During storage, alterations in moisture distribution, tissue senescence, fungal growth intensity, and host substrate depletion can progressively modify spectral responses, potentially altering model performance across sampling dates. Similar effects of biological variability, temporal change, and calibration drift on NIRS robustness have been documented in several fruit and food applications, highlighting the importance of adaptive or calibration-maintenance strategies when models are applied beyond their original sampling domain [20,21,22,23,24]. This work systematically evaluates NIRS-based mold detection in Sithong sweet tamarind throughout five weeks of commercial storage, addressing the existing gap. The explicit objectives were (1) to delineate spectral alterations linked to advancing mold proliferation during storage; (2) to assess and compare preprocessing methodologies and classification algorithms (PLS-DA vs. ANN) for weekly mold identification; (3) to ascertain an optimal detection interval throughout the storage duration where discrimination is enhanced; and (4) to identify pivotal wavelengths that facilitate mold differentiation for prospective simplified sensor innovation.

2. Materials and Methods

2.1. Experimental Materials and Storage Conditions

Six hundred Sithong sweet tamarind pods were gathered at commercial maturity in March 2024 from plantations located in Uttaradit Province, Thailand (17°59′32″ N, 100°52′43″ E). Selection criteria encompassed uniform maturity, consistent pod morphology, absence of exterior damage, and lack of apparent infections. Each pod was cleansed with a white cotton rag. Six measurement sites were delineated with permanent markers on both sides of each pod (anterior, medial, and posterior regions) to guarantee uniform spectrum capture. Pods were categorized into six groups of 100, allocated for weekly destructive analysis during Weeks 0 to 5. All pods were maintained at 25 °C and 60% relative humidity in a controlled-environment growth chamber (Sanyo MIR-553, Osaka, Japan) during the trial period, simulating commercial ambient storage [5].

2.2. NIR Spectral Acquisition

Near-infrared spectra were obtained utilizing a bench-top FT-NIR spectrometer (Bruker Optik GmbH, no. 3374, Ettlingen, Germany) functioning within the range of 800–2500 nm. An optical fiber interactance probe (Bruker IN 261-F, Bruker Optics GmbH, Ettlingen, Germany) was placed directly on the pod surface at each of the six designated locations. The interactance geometry (fiber spacing of 2–3 mm and probe contact with incident angle of 90°) was intentionally chosen over reflectance or transmittance. The double-layered pericarp increases photon scattering and reduces penetration depth, limiting conventional reflectance-based measurements. The interactance configuration allows partial subsurface probing (~2–3 mm), enabling detection of internal biochemical changes. This approach was successfully performed in thick-peel commodities [20,21]. This is essential for thick-skinned leguminous pods, as pure reflectance would predominantly capture the outside shell and overlook the inside biochemical alterations linked to mold colonization. Each collection comprised 32 co-added scans (spectral resolution of 8 cm−1, acquiring time of 30 s/site) to optimize the signal-to-noise ratio. The conclusive spectral profile for each pod was derived from the average of six spectra obtained from three anatomical sites on both sides. This average method considers regional variation in infection patterns [25]. An hourly background spectrum was obtained using a Spectralon® reflectance standard (Bruker Optics GmbH, Ettlingen, Germany) to adjust for instrumental drift. All spectral acquisitions were conducted under controlled conditions (25 ± 1 °C, 60 ± 5% RH). Spectral data were obtained utilizing OPUS software (version 7.2, Bruker Optik GmbH) and subsequently exported as ASCII files for additional analysis.

2.3. Mold Assessment and Sample Classification

Subsequent to spectral capture, each pod was manually opened and inspected under regulated lighting for fungal proliferation. Pods exhibiting discernible mycelial development (either one or multiple parts) with internal discoloration and tissue degradation were categorized as ‘moldy’ (class 1), while pods devoid of contamination were categorized as ‘intact’ (class 0). Furthermore, after storing for 5 weeks, 12 moldy pods were subjected to pathological analysis, confirming that Aspergillus sp. and Penicillium sp. were the key pathogens (Supplementary Figure S1). A balanced dataset was assembled weekly by selecting equal quantities of intact and moldy pods, resulting in a final modeling dataset of 170 samples: Week 0 (14 intact, 14 moldy), Week 1 (16 intact, 16 moldy), Week 2 (16 intact, 16 moldy), Week 3 (16 intact, 16 moldy), Week 4 (11 intact, 11 moldy), and Week 5 (12 intact, 12 moldy), culminating in a total of 85 intact and 85 moldy pods. The diminished sample size at Week 4 onwards indicates the presence of significantly degraded pods that could not be accurately categorized into either class through visual inspection alone, rather than merely a decrease in infection prevalence; this distinction is crucial for evaluating late storage model efficacy [26].

2.4. Spectral Preprocessing

Original data underwent four preprocessing techniques executed in Unscrambler software (version 9.7, CAMO, Oslo, Norway): (1) standard normal variate (SNV) normalizes each spectrum by subtracting its mean and dividing by its standard deviation, thereby correcting for multiplicative scatter effects; (2) multiplicative scatter correction (MSC) removes both additive and multiplicative light-scattering contributions by regressing each spectrum against a reference mean spectrum; (3) first derivative (Savitzky–Golay, 9-point window, 1st order polynomial) enhances spectral resolution and eliminates baseline offset; and (4) second derivative (Savitzky–Golay, 9-point window, 2nd order polynomial) further resolves overlapping bands and removes residual baseline curvature [27,28,29,30].

2.5. Principal Component Analysis

Principal component analysis (PCA) was utilized as an unsupervised pattern recognition method to examine spectral clustering patterns, temporal trends, and wavelength contributions [31,32,33]. It was conducted independently on the original dataset and all four preprocessed spectral datasets. Score plots of the initial two major components were created for each storage week and for the aggregated dataset. The loading plots of PC1 were analyzed to determine the wavelengths that most significantly contribute to sample discrimination [34].

2.6. Classification Model Development

2.6.1. Partial Least Squares Discriminant Analysis (PLS-DA)

Partial least squares discriminant analysis (PLS-DA) served as a foundational linear classification technique [35,36]. The ideal quantity of latent variables was ascertained by a leave-one-out cross-validation. The models were developed using The Unscrambler (version 9.7, CAMO, Oslo, Norway).

2.6.2. Artificial Neural Networks (ANN)

ANN classification models were developed utilizing a multilayer perceptron (MLP) architecture [37], characterized by one hidden layer comprising 5–10 neurons (optimized for each model through cross-validation), a hyperbolic tangent (tanh) activation function in the hidden layer, and a linear output layer with a binary classification threshold of 0.5. All artificial neural network computations were executed utilizing JMP v.10 (SAS Institute Inc., Cary, NC, USA).

2.6.3. Data Partitioning and Validation

For weekly analyses, the balanced datasets (22–32 samples per week) were randomly divided into calibration (~50%) and prediction (~50%) sets by stratified random sampling to preserve proportional class representation [38]. The comprehensive storage model utilized a whole dataset of 170 samples, comprising 85 intact and 85 moldy specimens, which were divided according to a 50:50 calibration-to-prediction ratio. Due to the restricted data numbers, to reduce variability associated with small datasets, the partitioning process was repeated 10 times and averaged; however, potential overfitting remains a limitation of the study.

2.7. Model Evaluation Metrics

The classification performance was assessed using sensitivity (true positive rate), specificity (true negative rate), F1-score (harmonic mean of precision and recall), and overall accuracy, derived from confusion matrices for both calibration and prediction datasets [39,40,41,42]. In food safety applications, sensitivity is prioritized to reduce false negatives (infected pods misclassified as intact), and specificity aims to decrease false positives (intact pods erroneously deemed contaminated). The F1-score offers a balanced single-metric summary that is especially insightful in the context of class imbalance prevalent at the initial and final stages of storage.

3. Results

3.1. Mold Incidence and Sample Distribution During Storage

Weekly observation of the 600-pod cohort indicated non-linear fluctuations in natural mold prevalence during the storage duration. The occurrence of mold was minimal in the initial weeks (Weeks 0–2: 14–16 moldy pods per 100 analyzed), reached its zenith during the mid-storage phase (Weeks 2–3), and led to a diminished usable sample count at Week 4 (11 pairs). The Week 4 reduction is significant for context: it does not indicate a decrease in the total number of infected pods, but rather that numerous severely degraded pods at this stage could not be accurately categorized as distinctly ‘moldy’ or ‘intact’ through visual inspection alone and were omitted from the modeling dataset to prevent training the models on ambiguous ground truth labels. This directly affects the interpretation of late-storage model performance, as outlined in Section 4.
The final balanced dataset has 170 samples (85 intact, 85 moldy) that encompasses the complete natural spectrum of infection severities observed in commercial operations. The non-monotonic infection pattern observed, instead of a straightforward linear increase, aligns with the lag–exponential–stationary phases of fungal growth kinetics under regulated storage conditions, as well as the interplay between temperature, relative humidity, and pathogen-specific reproductive cycles [3,5].

3.2. Spectral Characteristics and Temporal Trends

3.2.1. Spectral Features Associated with Mold Infection

Averaged NIR spectra (800–2500 nm) revealed systematic disparities between intact and moldy pods across all storage weeks, with moldy pods consistently demonstrating greater spectral absorption intensity (Figure 1). Three spectral areas were the most informative for mold differentiation. The 938 nm and 975–980 nm wavelengths correspond to O–H stretching overtones in water, and their increased absorption in moldy pods is associated with localized moisture accumulation due to hyphal disruption of cellular compartments and metabolic water generation from fungal respiration [43,44]. The 1035 nm area corresponds to C–H and O–H vibrations in carbohydrates (glucose, sucrose, cellulose), and its modified absorption indicates substrate depletion since Aspergillus spp. and Penicillium spp. utilize host sugars and polysaccharides as key energy sources [45,46]. Further discrimination was achieved using wavelengths at 826 and 839 nm. These wavelengths might be associated with C–H third overtone vibrations related to lipid molecules, as reported in previous NIRS studies [47,48].
The temporal spectral evolution over storage weeks indicated a gradual decline in total absorbance, attributable to the continuous moisture loss from both pericarp and pulp tissues. Notwithstanding this overarching trend, the spectral disparity between undamaged and moldy pods persisted over the weeks, establishing the biochemical foundation for classification. The intensity of this contrast peaked at Week 2, when fungal biomass and related biochemical alterations generated significant spectral divergence, and decreased by Week 4, as advanced degradation in both intact (senescent) and moldy pods diminished inter-class spectral differentiation.

3.2.2. Principal Component Analysis

The preprocessing methods of SNV and MSC produced PCA score plots that were visually analogous, exhibiting minimal inter-class differentiation. The initial two principal components collectively accounted for a consistently elevated percentage of total spectral variation across all time points (Week 0–5 and overall storage: PC1 + PC2 = 97%, 97%; 93%, 94%; 97%, 98%; 97%, 97%; 93%, 93%; 96%, 96%; and 96%, 96%, respectively), indicating the predominance of baseline scatter effects within these datasets. PC1 represented the predominant portion of this variance, notably capturing extensive baseline alterations, whereas PC2 contributed somewhat to inter-class differentiation. Conversely, preprocessing using first and second derivatives significantly improved class discrimination by mitigating baseline offsets and clarifying overlapping absorption bands; however, this resulted in a decrease in cumulative variance maintained by the initial two components. The second derivative exhibited marginally enhanced temporal cluster resolution compared to all preprocessing methods analyzed (Figure 2).
Weekly PCA score plots demonstrate patterns dependent on the infection stage. At Week 0, undamaged and moldy samples exhibited considerable overlap, indicative of infection during the pre-symptomatic phase when biochemical differences are minor. Week 2 exhibited the most significant differentiation along PC1, with undamaged and moldy pods creating discrete clusters indicative of the exponential phase of fungal growth, characterized by heightened metabolic activity in moisture redistribution and carbohydrate depletion. Week 3 exhibited moderate cluster differentiation, along with heightened within-class variance in the moldy group, indicating diverse infection severities. By Week 4, notable spectral overlap reemerged, despite elevated overall infection incidence, as severely deteriorated pods diverged from consistent mold spectral signatures and coincided with late-stage senescent intact pods (Supplementary Figure S2). PC1 loading plots consistently pointed out 826, 839, 938, 949–960, 975–980, and 1035 nm as the most discriminative wavelengths across several weeks [43,44,47].

3.3. PLS-DA Classification Performance

PLS-DA models served as the linear classification standard. Table 1 displays the confusion matrix outcomes and classification accuracy for each preprocessing technique during the entire storage duration (n = 170). Among all preprocessing methods, the original (unprocessed) spectra attained the best prediction accuracy (60.00%), whilst SNV and MSC produced the lowest accuracy (50.59%). The calibration accuracies (60.00–75.29%) frequently exceeded the corresponding prediction values (50.59–60.00%), indicating a gap suggestive of model overfitting. Significantly, derivative-based preprocessing (1D: 50.59%; 2D: 55.29%) failed to enhance prediction compared to simpler methods, indicating that the increased spectral complexity from derivatives posed a hurdle to the linear PLS-DA framework.
As for weekly analysis, the highest prediction accuracy attained by PLS-DA was 85.71% (Week 0, SNV and MSC), while performance varied throughout weeks (Supplementary Table S1). A distinctive feature of PLS-DA models was their asymmetric performance: notably high sensitivity (0.43–1.00 for mold identification) coupled with generally low specificity (0.00–1.00, often below 0.60), leading to elevated false-positive rates. The overall storage PLS-DA models attained prediction accuracies ranging from 50.59% to 60%, somewhat surpassing the 50% random-chance threshold for binary classification.
Significant findings from the PLS-DA results reveal flawless calibration accuracy (100%) at Weeks 4 and 5 for multiple preprocessing techniques, succeeded by markedly diminished prediction accuracy (36–75%), suggesting overfitting; and an overall model efficacy (optimal prediction: 60% with original spectra) that was insufficient for any viable quality control application.

3.4. Non-Linear Classification Results (ANN)

Artificial neural network (ANN) models exhibited consistently superior prediction accuracy compared to PLS-DA across all preprocessing techniques and storage durations (Table 2, Supplementary Table S2), with enhancements of around 8–20% in the majority of weekly comparisons. The performance landscape exhibited a distinct temporal pattern dictated by the stage of fungal infection at each time point (Table 3). During the initial storage phase (Weeks 0–1), SNV and MSC preprocessing demonstrated optimal performance, with MSC-ANN attaining a prediction accuracy of 87.14% and an F1-score of 0.87 at Week 0. This robust early-stage performance demonstrates the model’s capacity to differentiate recently colonized pods, which exhibit identifiable fungal biochemical signatures, from healthy tissue prior to the manifestation of outward symptoms. Peak detection performance was maximized at Week 2, with SNV preprocessing prediction accuracy reaching 85.00%, indicating the study’s most balanced and practically significant outcome. The examination of the confusion matrix for this model indicated that 83.75% of undamaged pods and 86.25% of moldy pods were accurately categorized in the prediction set. The analogous sensitivity and specificity values suggest that the model does not consistently favor either class, a beneficial attribute for effective quality control, where both false negatives (food safety risk) and false positives (economic loss) must be managed. Week 3 exhibited robust performance, especially in SNV preprocessing (79.38% prediction), signifying that dependable detection persists during the vigorous fungal colonization phase. Prediction accuracy significantly decreased from Week 4 forward (71.82–76.36%), accompanied by rising false negative rates of 22–33% (infected pods erroneously identified as intact) during advanced degradation stages. The total storage model for Weeks 0–5 indicated that first derivative preprocessing attained the maximum prediction accuracy (63.53%). This significantly diminished performance compared to weekly models illustrates the inherent difficulty of utilizing a singular static classifier for a chemically changing system. The false negative rate of 31–44% in the overall model signifies that generalized classifiers overlook a substantial proportion of infected pods at various storage phases, underscoring the necessity for week-adaptive techniques outlined in Section 4.

3.5. ANN Classification Outcomes and Performance Metrics

Sensitivity, specificity, and F1-scores for ANN models spanning different storage weeks and preprocessing methods are shown in Supplementary Table S3. Week 2 consistently demonstrated superior performance metrics across most preprocessing strategies. During Week 2, employing SNV preprocessing on the prediction set resulted in a sensitivity of 0.84, a specificity of 0.86, and an F1-score of 0.85, indicating a balanced and robust classification performance. The MSC preprocessing for Week 0 in prediction had a specificity of 0.89 and a sensitivity of 0.86, resulting in an F1-score of 0.87. The assessment metrics revealed distinct patterns across storage durations. Weeks 2 and 3 consistently exhibited the highest sensitivity, specificity, and F1-scores, signifying that mold-related physiological changes were most evident during the mid-storage phase. Week 0 models exhibited heightened specificity, indicating a strong ability to reliably identify intact pods, crucial for averting the incorrect rejection of viable fruit. Conversely, Weeks 4 and 5 demonstrated reduced performance across all metrics, likely attributable to considerable degradation and increased biological heterogeneity in both intact and moldy pods, complicating classification efforts. Among preprocessing techniques, SNV and MSC had the most consistently superior performance across the weeks, particularly in the prediction set. SNV preprocessing achieved the highest F1-scores for Week 2 (0.85) and Week 3 (0.81), indicating a balanced precision and recall. The initial derivative preprocessing showed strong classification effectiveness for the extensive storage model, with a sensitivity of 0.78 and a specificity of 0.77, but with heightened variability over weeks. The preprocessing of the second derivative demonstrated moderate effectiveness, with sensitivity and specificity values often between 0.64 and 0.58 (Table 4). The findings demonstrate that scatter correction methods (SNV and MSC) are very effective for NIR-based mold identification in sweet tamarind, as they reduce spectral variations caused by physical inconsistencies in pod surface characteristics.

4. Discussion

4.1. The Detection Window: Fungal Growth Phase Biology Explains Weekly Performance

The primary discovery of this study is that Week 2 not only demonstrates optimal classification ability, but that this peak performance coincides exactly with the transition from the lag phase to the exponential phase of Aspergillus and Penicillium growth within the pod. In the lag period (Weeks 0–1), fungal biomass is minimal, and metabolic changes are minor, resulting in poor spectrum contrast and therefore low detection sensitivity. During the exponential phase (Weeks 2–3), hyphal proliferation increasingly disrupts cellular compartments, yielding three simultaneously detectable biochemical signals: (1) localized moisture accumulation due to compromised cell membrane integrity; (2) progressive carbohydrate depletion as host sugars are utilized as fungal carbon sources; and (3) metabolic water production resulting from aerobic fungal respiration. The three pathways function synergistically to provide the most pronounced spectral divergence from healthy tissue, elucidating the elevated sensitivity (0.84–0.90) and specificity (0.69–0.86) noted in Weeks 2–3.
The decrease in performance during Week 4 indicates the initiation of the stagnant and decline stages of fungal development, during which tissue architecture is significantly impaired. Two concurrent phenomena generate spectral ambiguity at this stage: first, significantly degraded moldy pods display atypical spectral profiles that diverge from the coherent mold signature established during active colonization; and second, advanced senescence in intact pods leads to moisture loss and chemical alterations that partially resemble mold-associated spectral characteristics (Figure 3). During the later stage of storage, tamarind pods’ physiological changes, specifically senescence and moisture loss, advanced in both intact and moldy classes, providing mixed symptoms that contribute to NIR spectral heterogeneity. Classification accuracy, thereby, declined sharply due to the escalated false negative predictions (Supplementary Table S2). The convergence of spectral profiles between late-stage intact and moldy pods constitutes the principal constraint on late-storage classification performance, representing an intrinsic biological limitation rather than a defect in the model or preprocessing. These data indicate a pragmatic principle: NIRS-based mold screening is most dependable when conducted during the active infection phase, specifically Weeks 2–3 in commercial ambient storage, when intervention provides the maximum economic and food safety advantage.

4.2. Why ANN Outperforms PLS-DA: Non-Linearity in Fungal Spectral Signatures

The 8–20% enhancement in accuracy of ANN compared to PLS-DA substantiates that the spectral–biochemical correlations resulting from fungal infection are inherently non-linear. The evolution of accuracy clearly captured the outperforming scenario of neural networks over typical linear classification (Figure 4). PLS-DA presumes a linear transformation from spectrum space to class affiliation, suitable when a singular predominant chemical alteration facilitates class differentiation. Conversely, mold-induced spectral changes in sweet tamarind result from a minimum of four simultaneous biochemical processes (moisture redistribution, carbohydrate metabolism, lipid modification, and structural cell-wall degradation), each generating partially overlapping spectral responses across various wavelength ranges. The ANN’s ability to describe multiplicative and interaction relationships among spectral features enables it to uncover discriminative patterns inaccessible to PLS-DA [17,18]. This discovery corresponds with the extensive literature on biological quality classification using NIR data, wherein non-linear models (such as ANN and support vector machines) routinely surpass linear discriminant methods when the analyte of interest elicits intricate multivariate spectrum alterations [49,50,51].
The asymmetric performance of PLS-DA—characterized by high sensitivity and low specificity—is mechanistically explicable: the linear model identifies any notable deviation from the intact spectral baseline as ‘moldy,’ effectively classifying infected pods accurately while concurrently misclassifying intact pods exhibiting natural variations in moisture or carbohydrate levels as contaminated. This systematic bias favoring false positives would be economically untenable in commercial operations and further substantiates the utilization of ANN for this application.

4.3. Preprocessing Strategy: Matching Transformation to Infection Stage

The performance patterns dependent on preprocessing observed throughout the weeks indicate a physiologically cohesive narrative. SNV and MSC exhibit optimal performance during the initial-to-mid-storage period (Weeks 0–3) since the multiplicative scatter effects from pod surface flaws predominantly influence the raw spectral variance, obscuring the more nuanced compositional variations linked to early mold infection. Eliminating these physical scattering effects allows SNV and MSC to reveal the fundamental absorption changes associated with composition, hence enabling models to concentrate on infection-relevant chemistry [27,28,29]. The benefit of preprocessing reduces in Weeks 4–5, as tissue disintegration induces authentic alterations in surface optical characteristics that can no longer be regarded as trivial measurement artifacts.
The preprocessing of first and second derivatives proves increasingly effective in late storage as it improves the resolution of overlapping spectral bands instead of addressing physical scatter—an apt transformation when spectral complexity stems from multiple overlapping chemical changes rather than surface physics [30]. The enhanced efficacy of second derivative preprocessing in Week 5 (F1: 0.81) exemplifies this notion distinctly. From an operational standpoint, our findings indicate that adaptive preprocessing—choosing the transformation method according to the known storage duration—may enhance detection performance during the whole storage period. An SNV or MSC model used during Weeks 1–3, in conjunction with a derivative-based model during Weeks 4–5, would collectively sustain F1-scores over 0.72 throughout commercial storage, in contrast to the 0.59–0.65 attained by any singular preprocessing method applied uniformly [52].

4.4. Toward a Week-Adaptive Classification Architecture

The 30–35% accuracy disparity between week-specific models (up to 85%) and the overall storage model (63.53%) constitutes the most significant quantitative finding of this study. A solitary static classifier is inherently insufficient for overseeing a biochemically dynamic storage system. This constraint can be effectively addressed in commercial practice, as storage duration is a commonly accessible metadata variable inside commercial cold chains and distribution systems.
We propose a week-adaptive classification architecture as the rational implementation framework for the technology proposed herein. The spectrometer controller or associated software requests the pod’s recorded storage date during measurement. The duration of storage in days is correlated with a certain storage-week category (Week 0–5), and the relevant week-calibrated ANN model, together with the accompanying optimal preprocessing technique, is automatically employed for classification. This study indicates that the system may achieve a forecast accuracy of 77–87% throughout the entire commercial storage period, in contrast to 57–64% for a generalized model. Incorporating storage duration as an explicit covariate within a singular ANN model, instead of choosing from a repository of week-specific models, would enable the classifier to interpolate between calibrated time points for pods assessed at non-integer storage weeks [52,53,54].

4.5. Spatial Averaging Strategy for Heterogeneous Infection

The six-position spectral averaging approach employed in this study addresses a fundamental challenge in NIRS-based mold detection: spatial heterogeneity of internal infection. Internal mold typically originates from specific entry points (natural microcracks, insect damage sites, the peduncle attachment zone) and spreads unevenly within the pod [4,26]. A single-point measurement may miss the infection entirely or, conversely, sample only heavily infected tissue, producing either false negatives or unrepresentatively extreme spectra.
By integrating spectra from anterior, medial, and posterior positions on both pod sides, the averaging approach provides a comprehensive pod-level assessment. This strategy maintains a practical throughput of approximately 2–3 min per pod (six measurements plus positioning), although this rate represents a limitation for high-volume commercial operations processing thousands of pods per day [9,10]. Potential throughput improvements include conveyor-belt systems with multiple simultaneous probe positions, imaging-based NIR spectrometers that capture spatially resolved spectra in a single acquisition, or multispectral cameras that sacrifice wavelength resolution for speed [48,55].

4.6. Interactance Mode and Pericarp Penetration: Why Measurement Geometry Matters

The choice of interactance measurement geometry for a commodity with a 2–3 mm fibrous pericarp requires clear justification, since it constitutes a conscious and significant scientific decision. In interactance mode, the illumination and collecting fibers are situated in proximity on the same surface, establishing a geometry that necessitates photons to traverse a brief lateral distance within the sample prior to capture. This enables light to partially infiltrate the pericarp and engage with the underlying pulp tissue, merging the compositional sensitivity of transmittance with the convenience of a surface-contact probe [18]. Pure reflectance would predominantly sample the upper layer, significantly neglecting the pulp chemistry where fungal colonization initiates; complete transmittance is unfeasible for opaque commodities of this size and configuration. This study successfully demonstrates the detection of mold-related pulp chemistry via the intact pericarp, affirming the suitability of interactance geometry for thick-skinned leguminous fruits and offering a methodological framework for future research on similar commodities.

4.7. Toward Portable Implementation: Spectral Simplification

The discriminative wavelengths determined via PCA loading analysis (938, 975–980, and 1035 nm) reside within the short-wave NIR spectrum (800–1100 nm), which can be detected by compact InGaAs photodiode detector arrays currently available at a significantly reduced cost compared to full-range FT-NIR instruments. The concentration of discriminative information indicates that a portable screening device could be developed utilizing a narrow-band LED array or a compact filter-based spectrometer focused on these three specific wavelength regions, instead of necessitating the comprehensive 800–2500 nm instrument employed in this study. A portable device utilizing a six-position rotational measurement protocol, informed by the validated averaging strategy, along with on-device ANN inference (achievable on contemporary microcontroller platforms for models of this complexity), would constitute a commercially viable solution for packinghouse settings in developing markets where full-bench FT-NIR instruments are financially unfeasible [56]. The creation and verification of this gadget indicate the rational progression in converting these experimental discoveries into commercial use.

5. Conclusions

NIR spectroscopy combined with ANN classification offers an efficient non-destructive method for detecting mold in commercially preserved Sithong sweet tamarind. The enhanced efficacy of ANN compared to PLS-DA substantiates that fungal infection triggers non-linear, multi-faceted spectrum changes that linear classifiers fail to describe effectively. Detection reliability is fundamentally determined by the biology of the infection stage, rather than solely by modeling restrictions, a constraint that renders week-adaptive calibration essential rather than simply advantageous. The identification of critical NIR wavelengths via PCA loading analysis facilitates the creation of compact, portable sensors appropriate for deployment in packinghouses within resource-constrained environments.
This study is constrained by its focus on a particular cultivar and location under controlled conditions, as well as the decrease in usable samples at later storage phases due to ambiguity in ground-truth labeling. Future research must focus on correlating identified NIR spectral markers with quantitative aflatoxin levels, validating the week-adaptive classification framework across various tamarind cultivars and growing regions, and creating field-deployable prototype instruments that target the identified discriminative wavelengths for practical packinghouse assessment.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/horticulturae12040462/s1, Figure S1: Sithong sweet tamarind pod internally infested by mold after 5-week storage (a,b). Mold infestation on tamarind pulp observed using stereo microscope (c–g). Colony and morphology of conidia, conidiophore, sterigma and vesicle of Aspergillus sp. (h,i), and conidia, conidiophore and sterigma of Penicillium sp. (j,k) observed by a compound light microscope; Figure S2: Principal component scores plot for week 0, 2 and 4 with original and preprocessing such as standard normal variate (SNV), multiplicative scatter correction (MSC), 1st derivative and 2nd derivative; Table S1: Confusion matrix results for PLS-DA model with different preprocessing methods evaluated weekly across storage duration; Table S2: Confusion matrix results for ANN model (10 repetitions) with different preprocessing methods evaluated weekly across storage duration; Table S3: Sensitivity, specificity, and F1-score of ANN models from original and preprocessed spectra for mold classification in sweet tamarind across storage duration.

Author Contributions

Conceptualization, P.S. and P.M.; methodology, M.Z.A. and P.S.; software, M.Z.A.; validation, P.S. and P.M.; formal analysis, M.Z.A.; investigation, M.Z.A. and P.S.; resources, P.S. and D.N.; data curation, M.Z.A.; writing—original draft preparation, M.Z.A.; writing—review and editing, P.S. and P.M.; visualization, M.Z.A.; supervision, P.S. and P.M.; project administration, P.S. and D.N.; funding acquisition, P.S. and D.N. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Master of Science Program in Horticulture, Faculty of Agriculture, Chiang Mai University, under the CMU Presidential Scholarship. Also, this work was supported by the Uttaradit Rajabhat University (URU) and the Fundamental Fund from Thailand Science Research and Innovation (TSRI): 4779184.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data will be made available on request. The spectral datasets and analysis code supporting the conclusions of this article are available from the corresponding author upon reasonable request.

Acknowledgments

The authors thank the Department of Plant and Soil Sciences and the Postharvest Technology Research Center at CMU for supporting research materials and instruments.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Abbreviations

The following abbreviations are used in this manuscript:
ANNArtificial neural network
PCAPrincipal component analysis
PLS-DAPartial least squares discriminant analysis
NIRSNear-infrared spectroscopy
SNVStandard normal variate
MSCMultiplicative scatter correction
FT-NIRFourier-transform near-infrared
RHRelative humidity

References

  1. Tridge. Fresh Tamarind—Global Trade Intelligence. Available online: https://www.tridge.com/intelligences/tamarind (accessed on 15 December 2024).
  2. Karnjanatawe, K. Versatile Tamarind. Bangkok Post. 2020. Available online: https://www.bangkokpost.com/life/social-and-lifestyle/2013091/versatile-tamarind (accessed on 28 January 2026).
  3. Poonwan, N.; Boon-Long, J.; Poosuwan, S.; Boriraj, V. Fungi and their toxins present on sweet tamarind. Bull. Dep. Med. Sci. 1988, 30, 3–8. [Google Scholar]
  4. Mishra, G.; Panda, B.K.; Ramirez, W.A.; Jung, H.; Singh, C.B.; Lee, S.H.; Lee, I. Research advancements in optical imaging and spectroscopic techniques for nondestructive detection of mold infection and mycotoxins in cereal grains and nuts. Compr. Rev. Food Sci. Food Saf. 2021, 20, 4612–4651. [Google Scholar] [CrossRef]
  5. El-Banna, A.A.; El-Aziz, A.A.E. Effect of storage conditions on the physical properties and chemical composition of tamarind (Tamarindus indica L.) pods. J. Stored Prod. Res. 2001, 37, 47–59. [Google Scholar]
  6. Abbott, J.A. Quality measurement of fruits and vegetables. Postharvest Biol. Technol. 1999, 15, 207–225. [Google Scholar] [CrossRef]
  7. Zhang, X.; Yang, J. Advanced chemometrics toward robust spectral analysis for fruit quality evaluation. Trends Food Sci. Technol. 2024, 144, 104612. [Google Scholar] [CrossRef]
  8. Nicolaï, B.M.; Beullens, K.; Bobelyn, E.; Peirs, A.; Saeys, W.; Theron, K.I.; Lammertyn, J. Nondestructive measurement of fruit and vegetable quality by means of NIR spectroscopy: A review. Postharvest Biol. Technol. 2007, 46, 99–118. [Google Scholar] [CrossRef]
  9. Cen, H.; He, Y. Theory and application of near infrared reflectance spectroscopy in determination of food quality. Trends Food Sci. Technol. 2007, 18, 72–83. [Google Scholar] [CrossRef]
  10. Stuart, B.H. Infrared Spectroscopy: Fundamentals and Applications; John Wiley & Sons: Chichester, UK, 2004. [Google Scholar]
  11. Gowen, A.A.; O’Donnell, C.P.; Cullen, P.J.; Downey, G.; Frias, J.M. Hyperspectral imaging—An emerging process analytical tool for food quality and safety control. Trends Food Sci. Technol. 2007, 18, 590–598. [Google Scholar] [CrossRef]
  12. Li, P.; Su, G.; Du, G.; Jiang, L.; Dong, Y.; Shan, Y. Portable LWNIR and SWNIR spectroscopy with pattern recognition technology for accurate and nondestructive detection of hidden mold infection in citrus. Microchem. J. 2023, 193, 109203. [Google Scholar] [CrossRef]
  13. Moscetti, R.; Monarca, D.; Cecchini, M.; Haff, R.P.; Contini, M.; Massantini, R. Detection of mold-damaged chestnuts by near-infrared spectroscopy. Postharvest Biol. Technol. 2014, 93, 83–90. [Google Scholar] [CrossRef]
  14. Qiao, L.; Luo, C.; Yang, B.; Dong, T.; Li, D. Calibration maintenance application of near-infrared spectrometric model in food analysis: A review. J. Food Process. Preserv. 2023, 47, e16898. [Google Scholar] [CrossRef]
  15. Jiang, X.; Ge, K.; Liu, Z.; Chen, N.; Ouyang, A.; Liu, Y.; Huang, Y.; Li, J.; Hu, M. Non-destructive online detection of early moldy core apples based on Vis/NIR transmission spectroscopy. Chem. Biol. Technol. Agric. 2024, 11, 63. [Google Scholar] [CrossRef]
  16. Luo, W.; Zhao, C.; Wang, W.; Ni, D.; He, Y. Spectrum classification of citrus tissues infected by fungi and multispectral image identification of early rotten oranges. Spectrochim. Acta A Mol. Biomol. Spectrosc. 2022, 272, 120949. [Google Scholar] [CrossRef] [PubMed]
  17. Marini, F. Artificial neural networks in foodstuff analyses: Trends and perspectives. Anal. Chim. Acta 2009, 635, 121–131. [Google Scholar] [CrossRef] [PubMed]
  18. Kuzy, J.; Erisman, L. Artificial intelligence in food safety: A perspective on recent advancements and applications of deep learning. Food Control 2022, 139, 109039. [Google Scholar]
  19. Hasanzadeh, B.; Abbaspour-Gilandeh, Y.; Soltani-Nazarloo, A.; Cruz-Gámez, E.D.L.; Hernández-Hernández, J.L.; Martínez-Arroyo, M. Non-destructive measurement of quality parameters of apple fruit by using visible/near-infrared spectroscopy and multivariate regression analysis. Sustainability 2022, 14, 14918. [Google Scholar] [CrossRef]
  20. Ali, M.Z.; Seehanam, P.; Theanjumpol, P.; Sonthiya, K.; Suksai, K.; Maniwara, P. Utilization of near infrared spectroscopy coupled with chemometrics for non-destructive detection of mold in sweet tamarind. Appl. Food Res. 2025, 5, 101241. [Google Scholar] [CrossRef]
  21. Fan, S.; Li, J.; Xia, Y.; Tian, X.; Guo, Z.; Huang, W. Long-term evaluation of soluble solids content of apples with biological variability by using near-infrared spectroscopy and calibration transfer method. Postharvest Biol. Technol. 2019, 151, 79–87. [Google Scholar] [CrossRef]
  22. Tirado-Kulieva, V.A.; Torres-Guevara, F.A.; Gonzales-Malca, J.A.; Castro, W.; Seguí, L. Scientific trends in spectroscopy and regression chemometric modelling for the estimation of whole fruit quality: A systematic review. Chemometr. Intell. Lab. Syst. 2026, 269, 105612. [Google Scholar] [CrossRef]
  23. Guo, Z.; Chen, X.; Zhang, Y.; Sun, C.; Jayan, H.; Majeed, U.; Watson, N.J.; Zou, X. Dynamic nondestructive detection models of apple quality in critical harvest period based on near-infrared spectroscopy and intelligent algorithms. Foods 2024, 13, 1698. [Google Scholar] [CrossRef]
  24. Vega-Castellote, M.; Sánchez, M.T.; Wold, J.P.; Afseth, N.K.; Pérez-Marín, D. Near infrared light penetration in watermelon related to internal quality evaluation. Postharvest Biol. Technol. 2023, 204, 112477. [Google Scholar] [CrossRef]
  25. Maniwara, P.; Nakano, K.; Ohashi, S.; Boonyakiat, D.; Seehanam, P.; Theanjumpol, P.; Poonlarp, P. Evaluation of NIRS as non-destructive test to evaluate quality traits of purple passion fruit. Sci. Hortic. 2019, 257, 108712. [Google Scholar] [CrossRef]
  26. Fernández-Ahumada, E.; Félix, J.M.; Pedregosa, A.; Guerrero, J.E.; Garrido-Varo, A. Mathematical and statistical approaches in near infrared spectroscopy. In Infrared Spectroscopy—Life and Biomedical Sciences; IntechOpen: London, UK, 2012. [Google Scholar]
  27. Rinnan, Å.; van den Berg, F.; Engelsen, S.B. Review of the most common pre-processing techniques for near-infrared spectra. TrAC Trends Anal. Chem. 2009, 28, 1201–1222. [Google Scholar] [CrossRef]
  28. 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]
  29. Geladi, P.; MacDougall, D.; Martens, H. Linearization and scatter-correction for near-infrared reflectance spectra of meat. Appl. Spectrosc. 1985, 39, 491–500. [Google Scholar] [CrossRef]
  30. Savitzky, A.; Golay, M.J. Smoothing and differentiation of data by simplified least squares procedures. Anal. Chem. 1964, 36, 1627–1639. [Google Scholar] [CrossRef]
  31. Jolliffe, I.T.; Cadima, J. Principal component analysis: A review and recent developments. Philos. Trans. R. Soc. A 2016, 374, 20150202. [Google Scholar] [CrossRef]
  32. Wold, S.; Esbensen, K.; Geladi, P. Principal component analysis. Chemom. Intell. Lab. Syst. 1987, 2, 37–52. [Google Scholar] [CrossRef]
  33. Granato, D.; Santos, J.S.; Escher, G.B.; Ferreira, B.L.; Maggio, R.M. Use of principal component analysis (PCA) and hierarchical cluster analysis (HCA) for multivariate association between bioactive compounds and functional properties in foods. Compr. Rev. Food Sci. Food Saf. 2018, 17, 773–787. [Google Scholar] [CrossRef]
  34. Brereton, R.G. Pattern recognition in chemometrics. Chemom. Intell. Lab. Syst. 2015, 149, 90–96. [Google Scholar] [CrossRef]
  35. Barker, M.; Rayens, W. Partial least squares for discrimination. J. Chemom. 2003, 17, 166–173. [Google Scholar] [CrossRef]
  36. 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]
  37. Agatonovic-Kustrin, S.; Beresford, R. Basic concepts of artificial neural network (ANN) modeling and its application in pharmaceutical research. J. Pharm. Biomed. Anal. 2000, 22, 717–727. [Google Scholar] [CrossRef] [PubMed]
  38. ElMasry, G.; Wang, N.; ElSayed, A.; Ngadi, M. Hyperspectral imaging for nondestructive determination of some quality attributes for strawberry. J. Food Eng. 2007, 81, 98–107. [Google Scholar] [CrossRef]
  39. Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef]
  40. Powers, D.M. Evaluation: From precision, recall and F-measure to ROC, informedness, markedness and correlation. arXiv 2011, arXiv:2010.16061. [Google Scholar]
  41. Fawcett, T. An introduction to ROC analysis. Pattern Recognit. Lett. 2006, 27, 861–874. [Google Scholar] [CrossRef]
  42. Chicco, D.; Jurman, G. The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genom. 2020, 21, 6. [Google Scholar] [CrossRef]
  43. Williams, P.C. Implementation of near-infrared technology. In Near-Infrared Technology in the Agricultural and Food Industries, 2nd ed.; American Association of Cereal Chemists: St. Paul, MN, USA, 2001; pp. 145–169. [Google Scholar]
  44. Siesler, H.W.; Ozaki, Y.; Kawata, S.; Heise, H.M. Near-Infrared Spectroscopy: Principles, Instruments, Applications; John Wiley & Sons: Weinheim, Germany, 2008. [Google Scholar]
  45. Pandiselvam, R.; Prithviraj, V.; Manikantan, M.R.; Kothakota, A.; Rusu, A.V.; Trif, M.; Khaneghah, A.M. Recent advancements in NIR spectroscopy for assessing the quality and safety of horticultural products: A comprehensive review. Front. Nutr. 2022, 9, 973457. [Google Scholar] [CrossRef]
  46. Pasquini, C. Near infrared spectroscopy: A mature analytical technique with new perspectives—A review. Anal. Chim. Acta 2018, 1026, 8–36. [Google Scholar] [CrossRef]
  47. Reich, G. Near-infrared spectroscopy and imaging: Basic principles and pharmaceutical applications. Adv. Drug Deliv. Rev. 2005, 57, 1109–1123. [Google Scholar] [CrossRef]
  48. Huang, H.; Liu, L.; Ngadi, M.O. Recent developments in hyperspectral imaging for assessment of food quality and safety. Sensors 2014, 14, 7248–7276. [Google Scholar] [CrossRef] [PubMed]
  49. Ballabio, D.; Consonni, V. Classification tools in chemistry. Part 1: Linear models. PLS-DA Anal. Methods 2013, 5, 3790–3798. [Google Scholar] [CrossRef]
  50. Balabin, R.M.; Lomakina, E.I. Support vector machine regression (SVR/LS-SVM)—An alternative to neural networks (ANN) for analytical chemistry? Analyst 2011, 136, 1703–1712. [Google Scholar] [CrossRef] [PubMed]
  51. Ncama, K.; Opara, U.L.; Tesfay, S.Z.; Fawole, O.A.; Magwaza, L.S. Application of Vis/NIR spectroscopy for predicting sweetness and flavour parameters of Valencia orange and Star Ruby grapefruit. J. Food Eng. 2017, 193, 86–94. [Google Scholar] [CrossRef]
  52. Mishra, P.; Woltering, E.; Brouwer, B.; Hogeveen-van Echtelt, E. Improving moisture and soluble solids content prediction in pear fruit using near-infrared spectroscopy with variable selection and model updating approach. Postharvest Biol. Technol. 2021, 171, 111348. [Google Scholar] [CrossRef]
  53. Mishra, P.; Asaari, M.S.M.; Herrero-Langreo, A.; Lohumi, S.; Diezma, B.; Scheunders, P. Close range hyperspectral imaging of plants: A review. Biosyst. Eng. 2017, 164, 49–67. [Google Scholar] [CrossRef]
  54. Anderson, N.T.; Walsh, K.B.; Subedi, P.P.; Hayes, C.H. Achieving robustness across season, location and cultivar for a NIRS model for intact mango fruit dry matter content. Postharvest Biol. Technol. 2020, 168, 111202. [Google Scholar] [CrossRef]
  55. Lorente, D.; Aleixos, N.; Gómez-Sanchis, J.; Cubero, S.; García-Navarrete, O.L.; Blasco, J. Recent advances and applications of hyperspectral imaging for fruit and vegetable quality assessment. Food Bioprocess Technol. 2012, 5, 1121–1142. [Google Scholar] [CrossRef]
  56. Zou, X.B.; Zhao, J.W.; Povey, M.J.; Holmes, M.; Mao, H.P. Variables selection methods in near-infrared spectroscopy. Anal. Chim. Acta 2010, 667, 14–32. [Google Scholar] [CrossRef]
Figure 1. Averaged near-infrared (NIR) spectra (800–2500 nm) of intact and moldy Sithong tamarind pods were measured weekly during a five-week commercial storage at 25 °C and 60% relative humidity for (a) week 0; (b) week 1; (c) week 2; (d) week 3; (e) week 4; (f) week 5; and (g) whole storage.
Figure 1. Averaged near-infrared (NIR) spectra (800–2500 nm) of intact and moldy Sithong tamarind pods were measured weekly during a five-week commercial storage at 25 °C and 60% relative humidity for (a) week 0; (b) week 1; (c) week 2; (d) week 3; (e) week 4; (f) week 5; and (g) whole storage.
Horticulturae 12 00462 g001
Figure 2. Principal component scores plot of original and preprocessed spectra obtained from the whole storage period (5 weeks) for intact (n = 85; dot mark) and moldy (n = 85; triangle mark) tamarind pods.
Figure 2. Principal component scores plot of original and preprocessed spectra obtained from the whole storage period (5 weeks) for intact (n = 85; dot mark) and moldy (n = 85; triangle mark) tamarind pods.
Horticulturae 12 00462 g002
Figure 3. Sweet tamarind pulp was stored at 25 °C and 60% relative humidity in a controlled growth chamber at Weeks 0, 2, and 4.
Figure 3. Sweet tamarind pulp was stored at 25 °C and 60% relative humidity in a controlled growth chamber at Weeks 0, 2, and 4.
Horticulturae 12 00462 g003
Figure 4. Evolution of accuracy for classifying intact and moldy tamarind pods obtained from PLS-DA and ANN classification models.
Figure 4. Evolution of accuracy for classifying intact and moldy tamarind pods obtained from PLS-DA and ANN classification models.
Horticulturae 12 00462 g004
Table 1. Confusion matrix results for the PLS-DA model with different preprocessing methods for the whole storage.
Table 1. Confusion matrix results for the PLS-DA model with different preprocessing methods for the whole storage.
Data TypeCalibration (n = 85)Prediction (n = 85)
ClassIntactMoldAccuracy (%)ClassIntactMoldAccuracy (%)
OriginalIntact321171.76Intact33960.00
Mold1329Mold2518
SNVIntact321174.12Intact241851.76
Mold1131Mold2320
MSCIntact321175.29Intact231950.59
Mold1032Mold2320
1DIntact251860.00Intact192350.59
Mold1626Mold1924
2DIntact281561.18Intact231955.29
Mold1824Mold1924
Note: SNV = standard normal variate; MSC = multiplicative scatter correction; 1D = first derivative; 2D = second derivative; n = number of samples.
Table 2. Confusion matrix results for the ANN model (10 repetitions) with different preprocessing methods for the whole storage.
Table 2. Confusion matrix results for the ANN model (10 repetitions) with different preprocessing methods for the whole storage.
Data TypeCalibration (n = 85)Prediction (n = 85)
ClassIntactMoldAccuracy (%)ClassIntactMoldAccuracy (%)
OriginalIntact30112965.88Intact31110961.41
Mold161259Mold219211
SNVIntact30912166.00Intact3239760.59
Mold168252Mold238192
MSCIntact26616458.12Intact27414656.94
Mold192228Mold220210
1DIntact3359577.29Intact28813263.53
Mold98322Mold178252
2DIntact27515560.94Intact25516558.12
Mold177243Mold191239
Note: SNV = standard normal variate; MSC = multiplicative scatter correction; 1D = first derivative; 2D = second derivative; n = number of samples.
Table 3. Summary comparison of best PLS-DA vs. ANN prediction accuracy per storage week.
Table 3. Summary comparison of best PLS-DA vs. ANN prediction accuracy per storage week.
WeekOptimal Data Preprocessing and Accuracy; PLS-DAOptimal Data Preprocessing and Accuracy; ANNAccuracy Gain (%)F1-Score (ANN)Key Observation
Week 0SNV; 85.71%MSC; 87.14%+1.430.87ANN marginal advantage; scatter correction critical
Week 1Original; 68.75%Original; 76.88%+8.130.75ANN notable gain; same preprocessing optimal
Week 2MSC; 75.00%SNV; 85.00%+10.000.85ANN clear advantage; optimal detection window
Week 3Original; 68.75%SNV; 79.38%+10.630.81Largest ANN gain; active colonization phase
Week 42D; 72.73%Original; 76.36%+3.630.75Moderate ANN gain; degradation-induced heterogeneity
Week 5Original; 75.00%2D; 80.00%+5.000.81ANN recovery with derivative preprocessing
OverallOriginal; 60.00%1D; 63.53%+3.530.65ANN superior overall; week-specific models recommended
Notes: Accuracies sourced directly from prediction set confusion matrices (Table 1 and Table 2). SNV = standard normal variate; MSC = multiplicative scatter correction; 1D = first derivative; 2D = second derivative.
Table 4. Sensitivity, specificity, and F1-score of ANN models from original and preprocessed spectra for mold classification in sweet tamarind for the whole storage.
Table 4. Sensitivity, specificity, and F1-score of ANN models from original and preprocessed spectra for mold classification in sweet tamarind for the whole storage.
Data TypeClassificationPrediction
SensitivitySpecificityF1-ScoreSensitivitySpecificityF1-Score
Original0.700.620.670.740.490.65
SNV0.720.600.680.770.450.66
MSC0.620.540.600.650.490.60
1D0.780.770.780.690.590.65
2D0.640.580.620.610.560.59
Values represent model performance metrics for classification (training set) and prediction (testing set) across all storage weeks and preprocessing methods.
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.

Share and Cite

MDPI and ACS Style

Ali, M.Z.; Seehanam, P.; Naksavi, D.; Maniwara, P. Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics. Horticulturae 2026, 12, 462. https://doi.org/10.3390/horticulturae12040462

AMA Style

Ali MZ, Seehanam P, Naksavi D, Maniwara P. Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics. Horticulturae. 2026; 12(4):462. https://doi.org/10.3390/horticulturae12040462

Chicago/Turabian Style

Ali, Muhammad Zeeshan, Pimjai Seehanam, Darunee Naksavi, and Phonkrit Maniwara. 2026. "Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics" Horticulturae 12, no. 4: 462. https://doi.org/10.3390/horticulturae12040462

APA Style

Ali, M. Z., Seehanam, P., Naksavi, D., & Maniwara, P. (2026). Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics. Horticulturae, 12(4), 462. https://doi.org/10.3390/horticulturae12040462

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop