1. Introduction
Ensuring the quality and safety of agri-food products has become a central concern for both global consumers and international markets. For export-oriented economies such as Ecuador, where bananas, coffee, cacao, and shrimp account for a significant share of agricultural and aquacultural production, compliance with international quality and safety standards is both a regulatory necessity and a competitive advantage. Standards such as ISO 9001 [
1], emphasizing continuous improvement and evidence-based decision-making, and ISO 22000 [
2], which defines food safety management systems, serve as global benchmarks for companies seeking to access high-value markets. However, traditional quality control methods—manual inspection, destructive sampling, and laboratory testing—are time-consuming, costly, and subjective, limiting their ability to provide real-time assurance and traceable evidence. In this study, the term quality control is used in its ISO-aligned sense, encompassing inspection as a process-level monitoring activity within the broader Plan–Do–Check–Act (PDCA) cycle, rather than as a separate or post-process verification step.
In this context, artificial intelligence (AI) integrated with digital (RGB) imaging, hyperspectral imaging (HSI), and near-infrared spectroscopy (NIRS) has emerged as a transformative pathway for non-destructive, process-level quality assessment. These technologies combine high-resolution spectral sensing with deep learning (DL) to detect and quantify attributes invisible to conventional imaging. HSI captures spatial–spectral fingerprints that reflect internal and external quality parameters such as moisture, pigments, and firmness. At the same time, NIRS provides rapid compositional analysis to support conformity verification and fraud prevention. Coupled with DL, these tools enable automated inspection and generate objective, auditable evidence consistent with ISO-based quality management principles [
3].
Different imaging and spectroscopic techniques are used because each contributes complementary information. Digital (RGB) imaging captures visible surface characteristics such as color, shape, and defects; HSI provides spectral–spatial insight into internal quality attributes; NIRS delivers molecular and compositional data for authenticity verification; and DL enables intelligent classification, regression, and anomaly detection. Together, these methods create an ISO-aligned Quality 4.0 framework that operationalizes the principles of evidence-based decision-making, traceability, and continuous improvement embedded in ISO 9001 and ISO 22000.
Recent studies confirm that the convergence of HSI, NIRS, and DL has produced significant advances across the agri-food value chain. In bananas, CNN-based models have achieved over 88% accuracy in foliar disease detection [
4,
5] and nearly 90% in ripeness and quality classification from RGB images [
6]. In comparison, HSI approaches have exceeded 98% by capturing subtle spectral differences. Similar progress is observed in coffee, where CNN pipelines reached 91.65% accuracy in defect detection [
7], and NIRS-based chemometric models classified post-harvest processing methods with over 90% accuracy [
8], reinforcing traceability in line with ISO 22000. In cacao, object detection models such as Faster R-CNN and YOLOv8 achieved over 86% precision for pod ripeness under field conditions [
9], while NIR-HSI successfully discriminated cocoa hybrids with high accuracy [
10], supporting varietal authentication in premium Nacional cacao exports. For shrimp, HSI and regression models accurately predicted moisture and texture, achieving strong performance (R
2 > 0.9) [
11]. At the same time, Vision Transformers and U-Net architectures achieved pixel-level accuracies above 99% in mapping shrimp ponds [
12], strengthening resource management and biosecurity.
Complementary global research further supports these findings. HSI systems integrated with deep learning have enabled the precise, non-invasive detection of contaminants and adulterants in food matrices [
13] while achieving real-time decision-making and high classification accuracy for quality control [
14]. In parallel, recent developments in NIRS-based food authentication models have demonstrated the superiority of DL methods over conventional regression for compositional analysis and traceability [
15,
16]. These advances reinforce the potential of spectral–AI pipelines to deliver quantifiable, audit-ready data aligned with ISO criteria. In particular, HSI models that fuse spectral and textural features with neural networks have been applied to origin verification in high-value foods such as salmon [
17], addressing fraud-prevention requirements under ISO 22000.
Taken together, these empirical advances demonstrate the transformative impact of AI-driven tools on Ecuador’s flagship commodities and beyond. More importantly, their integration aligns directly with ISO principles: HSI and DL generate objective evidence (ISO 9001), NIRS strengthens conformity verification and fraud prevention (ISO 22000), and digital records reinforce traceability (ISO 22005). This perspective frames the emergence of “Quality 4.0”—the digital transformation of quality management systems [
18]—not merely as a technological upgrade but as a socio-technical paradigm that accelerates the Plan–Do–Check–Act (PDCA) cycle and enhances auditability.
Nevertheless, adoption in emerging economies faces barriers, including high investment costs, limited digital maturity, and skills shortages. For Ecuadorian SMEs, these obstacles are significant and require coordinated support from industry, government, and academia. Still, the benefits—greater accuracy, reduced inspection times, improved traceability, and stronger compliance with international standards—outweigh the challenges.
By bridging cutting-edge digital technologies with globally recognized standards, the research not only enriches academic debates on quality management in the era of Industry 4.0, but also addresses the pressing challenge of ensuring that agri-food exporters from emerging economies remain competitive, trustworthy, and sustainable in international markets. Specifically, it examines how deep learning (DL), digital (RGB) imaging, hyperspectral imaging (HSI), and near-infrared spectroscopy (NIRS) can be integrated into process-level monitoring to classify visible and non-visible quality attributes—such as ripeness, maturity, defects, and freshness—while ensuring ISO-aligned, real-time quality control in agri-food systems.
Building on this aim, the study pursued three core research objectives: (i) to analyze how AI technologies can enhance ISO-based quality control in Ecuador’s banana, cacao, coffee, and shrimp industries; (ii) to compare the effectiveness of AI-based quality assessments against traditional inspection methods in terms of speed, accuracy, and traceability; and (iii) to conceptualize a Quality 4.0 framework that integrates AI tools with ISO principles for food quality management in emerging economies.
In summary, the main contributions of this study can be outlined as follows: (1) Conceptual contribution: It advances the theoretical understanding of Quality 4.0 by demonstrating how artificial intelligence (AI)-driven inspection systems operationalize the core principles of ISO 9001 and ISO 22000 through objective, traceable, and auditable evidence; (2) Methodological contribution: It develops and validates a fully integrated, ISO-aligned framework that combines hyperspectral imaging (HSI), near-infrared spectroscopy (NIRS), and deep learning architectures for process-level quality control under semi-industrial conditions; (3) Empirical contribution: It provides the first large-scale, multi-commodity evaluation—covering bananas, cacao, coffee, and shrimp—in an emerging-economy context, demonstrating robust and consistent performance (accuracy > 88%, AUC > 0.90) across diverse agri-food value chains; and (4) Practical contribution: It offers a roadmap for policymakers, quality managers, and small and medium-sized enterprises (SMEs) to adopt AI-enabled inspection as part of the digital transformation strategies aimed at enhancing export competitiveness, regulatory compliance, and traceability.
These contributions collectively establish an ISO-aligned, AI-based framework that bridges technological innovation with international quality management standards, positioning Ecuador’s agri-food sector as a reference model for digitally enabled, sustainable, and globally competitive quality assurance systems.
3. Materials and Methods
3.1. Research Design
This study employed an applied experimental design to assess how artificial intelligence (AI) tools—specifically, hyperspectral imaging (HSI), near-infrared spectroscopy (NIRS), and deep learning (DL)—can operationalize ISO-aligned quality management in agri-food chains. The research design followed three sequential stages: (i) acquisition of representative and stratified samples from four flagship export commodities (banana, cacao, coffee, and shrimp); (ii) system configuration and data acquisition through digital (RGB) imaging, HSI, and NIRS under semi-industrial conveyor conditions; and (iii) model training, validation, and benchmarking against conventional inspection practices.
To ensure reproducibility and data transparency, all experiments were conducted with predefined sample sizes per commodity, systematic randomization procedures, and explicit train/validation/test splits. Random seeds were fixed across runs to allow for replication of the results. Performance evaluation combined classification metrics (accuracy, precision, recall, specificity, ROC-AUC) and regression indicators (R2, RMSE, residual predictive deviation), complemented by statistical validation through multifactorial ANOVA, confidence intervals, and Pearson correlations.
The overall workflow is summarized in
Figure 1, which depicts the pipeline from sample acquisition to statistical validation. It highlights how spectral and imaging data were integrated with deep learning architectures, and how the resulting outputs were statistically validated and mapped to ISO 9001/22000 clauses, ensuring that the results are accurate, auditable, and reproducible in accordance with international standards.
To illustrate the alignment of the proposed framework with ISO-based continuous improvement,
Figure 2 depicts the integration of the experimental workflow within the Plan–Do–Check–Act (PDCA) cycle. Each quadrant represents a stage of ISO 9001 and ISO 22000 implementation: Plan—definition of quality objectives, control points, and critical parameters for each commodity; Do—data acquisition through digital (RGB), hyperspectral (HSI), and near-infrared (NIRS) systems; Check—model evaluation using confusion matrices, ROC curves, and statistical validation; Act—implementation of corrective or preventive actions such as retraining or parameter adjustment. The center of the cycle, Digital Traceability & Auditability, represents the core ISO requirement for documented evidence and continuous improvement.
3.2. Sample Acquisition
Representative samples were collected from Ecuadorian producers and processing facilities, ensuring alignment with the country’s primary export commodities. Sampling procedures were designed to capture both visible and non-visible variability typically encountered in commercial practice while also reflecting ISO requirements for systematic and traceable acquisition. For each commodity, stratification was applied to ensure balanced representation of relevant quality categories (e.g., ripeness, maturity, defects, freshness). All samples were uniquely coded, documented with lot information, and photographed to maintain traceability records consistent with ISO 9001, ISO 22000, and ISO 22005.
Bananas (
Musa AAA). A total of 360 fruits were collected from packing houses in El Oro and Los Ríos, Ecuador’s central banana-producing provinces. Fruits were stratified across ripening stages (green, turning, yellow, export-ready), ensuring a balanced representation of peel coloration, firmness, and soluble solid content (
Table 1).
Cacao (
Theobroma cacao). A total of 210 pods were harvested at different maturity stages (immature, mid-ripe, and fully ripe), and 900 beans were collected from post-harvest fermentation batches. Sampling emphasized the Nacional variety, a flagship Ecuadorian cacao, to support the classification of pod ripeness, fermentation potential, and hybrid authentication (
Table 1).
Coffee (
Coffea arabica). A total of 2400 green beans were obtained from cooperatives in Imbabura and Loja. Beans were stratified into defect and non-defect categories (broken beans, insect damage, discoloration), reflecting the heterogeneity of Ecuadorian production. Batches included both specialty lots and bulk export coffee to test the robustness of defect-detection pipelines (
Table 1).
Shrimp (
Penaeus vannamei). A total of 480 specimens were sampled at successive stages of post-harvest processing and drying (fresh, semi-dried, export-ready). Moisture content, surface color, and texture variability were prioritized, as they are critical indicators of freshness and quality compliance in aquaculture exports (
Table 1).
Across all commodities, samples were organized into stratified lots of comparable size, allowing balanced datasets for training, validation, and testing of AI models. The stratified dataset splits (70% train, 15% validation, 15% testing) are detailed in
Table 2, ensuring the transparency and reproducibility of model development. This design provided sufficient statistical power, minimized class imbalance, and captured the operational variability typical of Ecuadorian supply chains.
3.3. System Configuration
The experimental setup combined conveyor-belt transport with digital (RGB) imaging and spectral sensing, simulating the operational conditions typically found in industrial packing lines. This configuration was designed to enable the continuous, non-destructive inspection of products at line speed, while ensuring the reproducibility and traceability of measurements.
A conveyor belt system (1.0 m length, adjustable speed up to 1.05 m/s) (Custom-built prototype, Universidad UTE, Quito, Ecuador) was employed to standardize sample movement and ensure consistent positioning during image capture. The belt speed was calibrated to balance throughput with exposure time, minimizing motion blur while maintaining industrially relevant conditions.
For digital (RGB) imaging, a high-resolution RGB camera (1920 × 1080 px, CMOS sensor, 12 MP equivalent) (Basler acA1920-40uc, Basler AG, Ahrensburg, Germany) operating at 30 frames per second was mounted 50 cm above the conveyor. Dual 100 W LED lamps (color temperature ≈ 5500 K) (Yongnuo YN-300 LED Panel, Yongnuo Photographic Equipment Co. Ltd., Shenzhen, China) were positioned laterally with diffusers to provide uniform illumination, reducing shadow artifacts and improving color consistency for defect detection and color-based classification tasks.
For spectral sensing, two complementary systems were deployed:
Hyperspectral imaging (HSI). A push-broom system (400–1000 nm range, spectral resolution ≈ 2.8 nm, 224 bands) (Specim FX10 push-broom camera, Specim Spectral Imaging Ltd., Oulu, Finland) was used to capture spatial–spectral signatures related to moisture, pigment composition, and structural integrity. The system included an adjustable fore-optic lens and a line-scan camera, synchronized with conveyor movement, to minimize motion artifacts.
Near-infrared spectroscopy (NIRS). A portable NIRS device (800–2500 nm, 10 nm resolution) (NIRQuest 512, Ocean Insight Inc., Orlando, FL, USA) enabled rapid spot measurements of internal compositional attributes, such as soluble solids and freshness indicators. Measurements were averaged across three replicate scans per sample to minimize variability.
Both spectral systems were radiometrically calibrated at the beginning of each acquisition session using white (Spectralon®) (Labsphere Inc., North Sutton, NH, USA) and dark references. Standard preprocessing protocols—including geometric alignment, reflectance normalization, and correction for illumination variability—were applied to guarantee comparability across samples and across sessions, with all calibration and acquisition steps documented in accordance with ISO requirements for measurement system integrity and traceability.
As a methodological benchmark, the pineapple-classification prototype developed by Cordovés-García et al. [
62] validated the feasibility of integrating conveyor transport, digital imaging, and automated rejection mechanisms for fruit inspection, demonstrating the adaptability of such configurations to multiple crops. A detailed summary of the technical specifications of the conveyor, RGB camera, illumination system, HSI device, and NIRS device is provided in
Table 3, ensuring complete transparency and reproducibility of the experimental configuration.
To ensure that the imaging and spectral systems operated reliably under conveyor motion, we implemented an encoder-synchronized triggering scheme with hardware strobing and global-shutter acquisition. This approach allowed for square ground sampling and minimized blur, even at the highest belt speed tested (1.0 m/s).
The corresponding parameters—including ground sampling distance, required line rates, maximum integration times, and RGB exposure limits—are summarized in
Table 4. These values demonstrate how motion-artifact control was achieved through the combination of encoder-locked line triggering, sub-0.2 ms exposures, and (when necessary) spectral binning, thereby guaranteeing artifact-free acquisition across all experimental conditions.
Synchronization and Motion-Artifact Control (HSI/RGB)
To guarantee blur-free acquisition on a moving conveyor, we coupled the push-broom HSI camera to a quadrature encoder mounted on the belt drive. We used hardware triggering for line acquisition and illumination. The design follows three principles:
To guarantee square ground sampling, the cross-track ground sampling distance (GSD) was computed from the field of view (FOV) and the number of detector pixels, as shown in Equation (1):
The along-track sampling was set to approximately the same value,
. For a given belt speed
(m/s), the required line-scan rate ensuring square pixels is defined in Equation (2):
Thus, at , ; and at , .
These rates define the minimum acquisition frequency needed to maintain square ground sampling during conveyor movement.
- 2.
Integration time bound and strobing
Motion blur in object space was calculated according to Equation (3):
To limit blur to a quarter-pixel, the exposure time
was bounded as expressed in Equation (4):
For
and
, the maximum allowable integration time was calculated as shown in Equation (5):
In practice, high-intensity LED line lights (CCS LFX3-100SW, CCS Inc., Kyoto, Japan) were employed with hardware strobing and short exposures (70–200 µs, depending on product albedo). When required, 2× spectral binning (224 → 112 bands) was applied to preserve signal-to-noise ratio (SNR) at higher line-scan rates.
- 3.
Encoder-based trigger and global shutter
A 50 mm encoder wheel (Omron E6B2-CWZ6C, Omron Corporation, Kyoto, Japan) (circumference ≈ 157 mm) with 1000 ppr yields ≈ 6.37 pulses/mm (×4 in quadrature). We divided the pulses into firing one HSI line per 0.29 mm of belt travel (square sampling). The RGB camera (global shutter) was externally triggered from the same encoder to acquire context frames at 15–30 fps with short exposures (see below), ensuring temporal alignment between RGB/HSI and the ejection actuators. Rolling-shutter modes were avoided.
RGB exposure at line speed. RGB images were captured with exposure such that . At this gives ; at , . We operated at 60–100 µs using LED strobes synchronized to the frame trigger.
Spectral throughput vs. speed. At the maximum belt speed, the camera’s maximum de-skewed line rate was maintained by (i) reducing exposure via strobing, (ii) applying spectral binning (2×) for dark products (coffee) or low-reflectance conditions (semi-dried shrimp), and (iii) widening the lens aperture (e.g., f/2.8) under controlled illumination—this preserved classification/regression performance without introducing motion artifacts.
3.4. Image Processing and Feature Extraction
The image and spectral datasets underwent a systematic preprocessing pipeline to ensure consistency, reduce noise, and extract features relevant to quality classification. All procedures were implemented using open-source libraries —Python 3.10 (Python Software Foundation, Wilmington, DE, USA), OpenCV 4.9.0 (Intel Corporation, Santa Clara, CA, USA), and scikit-learn 1.4.1 (scikit-learn developers, Paris, France)—to facilitate reproducibility.
Digital (RGB) image preprocessing. The following steps were applied sequentially:
Background removal through binarization and masking to isolate the product from the conveyor and illumination setup.
Channel separation (R, G, B) to quantify chromatic attributes associated with ripeness, discoloration, or surface defects.
Grayscale conversion and adaptive thresholding to support contour detection and segmentation of anomalous regions.
Noise filtering using median (3 × 3 kernel) and Gaussian filters (σ = 1.0) to eliminate high-frequency artifacts while preserving essential structural information.
Region-of-interest (ROI) feature extraction. Commodity-specific descriptors were computed to capture relevant quality attributes:
Banana and cacao: Surface color histograms (hue distributions), geometric descriptors (area, perimeter, roundness) derived from peel/pod segmentation to support ripeness and maturity classification.
Coffee: Morphological features (bean length, width, aspect ratio, circularity) and defect markers (cracks, insect damage, discoloration) were quantified from segmented beans for defect-detection pipelines.
Shrimp: Texture descriptors based on gray-level co-occurrence matrices (GLCM: contrast, homogeneity, entropy) and surface reflectance statistics were extracted to identify freshness degradation, with emphasis on subtle color shifts and roughness variations linked to post-harvest drying.
Spectral preprocessing (HSI/NIRS). Standardized procedures were applied prior to model training:
Spectral smoothing with the Savitzky–Golay (SG) filter (2nd-order polynomial, window size = 11 points) to reduce random noise while preserving peak shapes.
Scatter correction through standard normal variate (SNV) and multiplicative scatter correction (MSC) to normalize intensity variations caused by sample geometry or illumination.
Dimensionality reduction via principal component analysis (PCA), retaining the first 15–20 components that accounted for ≥95% of the variance, thereby reducing collinearity in high-dimensional data and facilitating both visualization and model training.
This preprocessing pipeline ensured that extracted features captured both visible traits (color, morphology, surface texture) and non-visible attributes (spectral signatures linked to composition and freshness). By standardizing parameters and documenting all steps, the pipeline provided a robust, auditable foundation for subsequent deep learning classification and regression tasks, fully aligning with ISO requirements for evidence-based decision-making and traceability.
Figure 3 illustrates the preprocessing and spectral feature extraction workflow through representative examples of original, preprocessed, and spectral images (HSI or NIR) for the four commodities analyzed: banana, cacao, coffee, and shrimp.
Panels (a–d) display the raw RGB inputs, their segmented versions after background removal and masking, and the corresponding spectral reflectance maps (HSI or NIR, depending on the commodity). These examples highlight how spectral–spatial features are extracted, normalized, and integrated into the AI-based workflow for quality classification and regression. Together, they demonstrate how raw visual data are transformed into standardized, traceable spectral representations fully aligned with ISO-based process-monitoring and continual-improvement principles.
3.5. Deep Learning Models
Convolutional neural networks (CNNs) were employed as the primary architecture for image-based classification tasks. Input images were resized to 170 × 170 × 3 pixels, and data augmentation techniques—including random rotation (±15°), horizontal/vertical flipping, gamma correction, Gaussian noise injection, and PCA-based color augmentation—were applied to address class imbalance and improve model generalization.
The baseline CNN architecture consisted of three convolutional layers, each with 32, 64, and 128 filters (kernel size = 3 × 3), followed by batch normalization, ReLU activation, and max pooling. Two fully connected layers (256 and 128 neurons, ReLU activation) were followed by a SoftMax output classifier. Models were trained using the Adam optimizer (learning rate = 0.001, batch size = 32) for up to 100 epochs with early stopping. Training–validation–testing splits were set at 70–15–15%, stratified by commodity and class balance, with random initialization seeds fixed to ensure reproducibility.
For hyperspectral imaging (HSI) datasets, spectral–spatial CNNs and 3D CNNs were implemented to capture both the spectral and spatial dependencies simultaneously. For near-infrared spectroscopy (NIRS) data, regression-based approaches, including partial least squares regression (PLSR) and support vector machines (SVMs), were applied to predict compositional attributes and freshness indicators.
It is important to note that PLSR and SVM are traditional machine learning algorithms rather than deep learning models; they were incorporated as benchmark regression methods to complement the deep learning architectures used for image-based classification. This hybrid configuration enables the framework to leverage the strengths of both approaches—high-level feature learning from images and quantitative spectral prediction via regression models—while maintaining interpretability and computational feasibility.
To contextualize the methodological configuration across commodities,
Table 5 summarizes the specific techniques applied, the quality variables analyzed, the models used, and the key performance metrics considered in this study.
As shown in
Table 5, each commodity presents distinct quality challenges—ripeness in bananas, pod maturity in cacao, morphological defects in coffee beans, and freshness in shrimp—but the AI-based pipeline shares a standard structure: (i) RGB and spectral imaging for data acquisition, (ii) standardized preprocessing to extract relevant features, and (iii) classification or regression via deep learning models.
Performance metrics consistently demonstrated improvements in accuracy, sensitivity, and reproducibility compared to manual inspection. In particular, regression models such as PLSR and SVM provided robust predictions of non-visible attributes (e.g., moisture, compositional quality), reinforcing the value of combining vision-based and spectral approaches. Overall, these methodological configurations illustrate how AI models can be tailored to commodity-specific requirements while remaining aligned with ISO-based quality management principles, thereby generating objective, auditable evidence that strengthens conformity verification under ISO 9001 and ISO 22000.
Training details. All deep learning models were implemented in Python 3.10 (PSF, USA) using TensorFlow 2.15 (Google LLC, Mountain View, CA, USA) and PyTorch 2.1 (Meta AI, Menlo Park, CA, USA) frameworks and executed on an NVIDIA RTX 4090 GPU (24 GB VRAM; NVIDIA Corp., Santa Clara, CA, USA) with 64 GB RAM. Models were trained for up to 100 epochs with early stopping based on validation loss (patience = 10 epochs) and learning rates ranging from 0.001 to 0.0005 using the Adam optimizer. The baseline CNN used He normal weight initialization, batch normalization after each convolutional block, and a batch size of 32. YOLOv8 models were initialized with pretrained COCO weights and fine-tuned for 50 epochs using transfer learning. The 3D CNN for hyperspectral data was trained using 3D convolutional kernels (3 × 3 × 7) and dropout regularization (p = 0.3) to prevent overfitting. For all models, training, validation, and test splits followed a 70–15–15% stratified scheme, ensuring balanced class representation. Model checkpoints and logs were saved after each epoch to allow for reproducibility and traceability, consistent with the ISO 9001 principles on evidence-based measurement and control of processes.
3.6. Evaluation Metrics
Model performance was evaluated using standard classification and regression metrics, in accordance with best practices in machine learning and food inspection research.
Classification metrics. For classification tasks, model performance was evaluated using four standard indicators: accuracy, precision, recall (sensitivity), and specificity, defined in Equations (6)–(9).
where
,
,
, and
denote true positives, true negatives, false positives, and false negatives, respectively.
These indicators were complemented by confusion matrices, which visualize the distribution of predicted versus actual labels for each commodity class and facilitate the interpretation of classification reliability. In addition to confusion matrices, ROC curves are standard diagnostic plots used to visualize model discrimination performance, complementing quantitative indicators such as accuracy and specificity.
To improve visual interpretability and avoid the appearance of perfect separation, all ROC curves (Figures 6, 8, 10 and 12) were replotted using higher graphical resolution, finer threshold increments, and adjusted axis scaling. This ensures that the curvature accurately represents the proper trade-off between sensitivity and specificity derived from statistically validated predictions. AUC values between 0.90 and 0.98 indicate excellent—but not perfect—discrimination, confirming strong model performance without implying complete class separation.
Regression metrics. For spectral regression tasks involving hyperspectral imaging (HSI) and near-infrared spectroscopy (NIRS), three standard indicators were computed to assess model performance: coefficient of determination (R
2), root mean squared error (RMSE), and residual predictive deviation (RPD), as shown in Equations (10)–(12).
where
are observed values,
are predicted values,
is the mean of observed data, and
is the standard deviation of observed values.
The R2 statistic indicates model fit, RMSE quantifies absolute prediction error, and RPD provides a relative index of predictive quality, where values of indicate good and indicate excellent predictive performance.
Statistical robustness. To provide confidence in reported metrics, 95% confidence intervals (CIs) were computed using bootstrapping (1000 resamples) for classification metrics and analytical variance estimates for regression outcomes. These intervals quantify the expected variability under repeated trials and enhance reproducibility.
As a methodological benchmark, the pineapple prototype developed by Cordovés-García et al. [
62] reported 95% accuracy and 90% sensitivity in surface-defect detection, demonstrating the feasibility of AI-based approaches in fruit classification. Although pineapples were not part of the commodities analyzed in this study, these results provide context for the expected performance range of similar AI-driven inspection systems.
Representative outputs.
Figure 4 presents multimodal outputs obtained from the AI-based inspection pipeline across the four commodities—bananas, cacao, coffee, and shrimp—under semi-industrial conveyor conditions. Each subfigure corresponds to a specific task: ripeness classification, maturity detection, defect identification, and freshness mapping, respectively.
These visualizations show how AI-driven digital, hyperspectral, and NIR imaging capture both surface-level (color, morphology, defects) and internal (moisture, compositional) quality attributes in real-time. Each output corresponds to empirical test sets and provides traceable, auditable evidence aligned with the ISO 9001 and ISO 22000 principles. The redesigned figure now includes explicit legends, color codes, and model references, allowing readers to easily interpret the visual results and their connection to ISO-aligned conformity verification.
Mapping of outputs to ISO requirements. To ensure that the AI-based inspection results were not only technically valid but also compliant with international standards, all outputs were systematically mapped to specific clauses of ISO 9001:2015, ISO 22000:2018, and ISO 22005:2007. Confusion matrices, accuracy, and ROC analyses were interpreted as evidence of conformity (ISO 9001, §8.6). Regression models for moisture, texture, and compositional attributes were linked to the monitoring and verification of CCPs (ISO 22000, §8.5.4, §8.8). Lot-coded and digitally logged inspection records were aligned with the traceability requirements (ISO 22005, §4–6). This procedure established a reproducible framework for translating algorithmic outputs into auditable evidence, embedding AI-driven inspection directly into the ISO-based Plan–Do–Check–Act (PDCA) cycle.
3.7. Statistical Validation
To ensure the robustness and reliability of the proposed models, statistical validation was performed on the experimental outcomes. A multifactorial analysis of variance (ANOVA) was conducted to determine whether operational parameters—illumination intensity, conveyor belt speed, and sample variability—had a statistically significant impact on model performance. The ANOVA framework enabled us to test the main effects and interaction terms, identifying conditions that systematically influence detection accuracy.
Results indicated that illumination intensity had no significant main effect on accuracy (F(2,297) = 1.32, p = 0.27), while conveyor-belt speed showed a small but significant effect (F(2,297) = 4.87, p = 0.009, η2 = 0.04). Interaction terms were not significant (p > 0.10), suggesting that the system was generally robust across typical operational conditions.
Additionally, 95% confidence intervals (CIs) were calculated for key performance indicators. For example, banana ripeness classification reached an accuracy of 97% (95% CI: 94–100%), cacao pod maturity detection achieved 91% (95% CI: 88–94%), coffee defect detection obtained 92% (95% CI: 89–94%), and shrimp freshness regression achieved an R2 = 0.95 (95% CI: 0.93–0.97). These intervals provide an estimation of the precision of the observed metrics and their expected variability under repeated trials, thereby strengthening the reproducibility of the findings.
To further examine the relationship between operational factors and model outputs, Pearson correlation coefficients were computed. Conveyor speed was moderately and negatively correlated with classification sensitivity (r = −0.21, p < 0.05), indicating a trade-off between throughput and detection reliability. Illumination uniformity showed no significant correlation with the performance outcomes (r = 0.07, p = 0.34).
The adoption of this statistical validation framework follows established practices in computer vision and fruit-inspection research, where combining ANOVA, confidence intervals, and correlation analysis provides a comprehensive approach to evaluating robustness. By integrating these statistical checks, the study ensures that the reported AI-based inspection results are not only accurate, but also statistically sound and generalizable to real-world production environments.
In addition, the ROC curves were replotted at higher resolution with refined axis scaling to reflect continuous probability thresholds. This adjustment visually confirms that AUC values between 0.90 and 0.98 represent excellent, yet realistic, discrimination, consistent with the reported 95% confidence intervals.
4. Results
The results presented in this section provide empirical evidence of how AI-based inspection systems can operationalize ISO-aligned quality control in Ecuador’s agri-food chains. Building on the methodological framework described above, we simulated the performance of deep learning pipelines applied to the country’s four flagship export commodities: bananas, cacao, coffee, and shrimp. For each product, confusion matrices, performance metrics, and statistical validation are reported to illustrate classification accuracy, sensitivity, specificity, and precision. Regression-based indicators such as R2 and RMSE were also included, along with spectral models.
The analysis is structured into subsections per commodity (
Section 4.1,
Section 4.2,
Section 4.3 and
Section 4.4), followed by a comparative synthesis (
Section 4.5). In each case, the results are interpreted not only in terms of technical accuracy, but also in light of the ISO 9001 requirements for evidence-based decision-making and continual improvement, and the ISO 22000 requirements for conformity verification and traceability. By aligning simulated inspection outcomes with internationally recognized standards, the findings demonstrate the potential of digital quality management (Quality 4.0) to provide objective, auditable, and real-time assessments across diverse agri-food sectors.
4.1. Bananas
The CNN–HSI pipeline for banana ripeness classification achieved robust performance across all ripening stages.
Figure 5 presents the confusion matrix for 100 test samples, with darker diagonal cells indicating correctly classified ripeness stages.
Table 6 reports the corresponding performance metrics, showing an overall accuracy of 97%, high sensitivity (96%), specificity (98%), and perfect precision (100%).
These results demonstrate the model’s ability to classify bananas across different ripeness stages consistently. The system’s reproducibility and reliability directly align with the principle of evidence-based decision-making in ISO 9001. At the same time, its ability to continuously monitor conformity prior to shipment supports compliance with ISO 22000’s food safety management requirements.
As illustrated in
Figure 6, the ROC curve achieved an area under the curve (AUC) of 0.98, confirming the strong discriminative power of the system.
This performance underscores the capacity of AI-based inspection to provide traceable, objective, and auditable evidence of product conformity, ensuring consistency with international export quality standards.
4.2. Cacao
The YOLO–CNN–PLSR pipeline applied to cacao pod maturity and bean authentication achieved an overall accuracy of 88%, demonstrating reliable performance across heterogeneous field conditions.
Figure 7 displays the graphical confusion matrix for pod ripeness classification, while
Table 7 reports the evaluation metrics with 95% confidence intervals, showing balanced sensitivity (86%) and specificity (90%).
The results indicate that the model was slightly more effective in correctly identifying immature pods (specificity = 90%) than in detecting all mature pods (sensitivity = 86%). This suggests that a proportion of mature pods may still be misclassified, potentially leading to delays in harvest initiation. Nevertheless, the overall performance is consistent with prior field-based studies in cacao, where visual variability and environmental noise typically lower the classification accuracy compared to laboratory settings.
From a quality management perspective, the ability to document maturity levels through objective, image-based classification enhances compliance with the ISO 22000 requirements for verifying harvest timing. By reducing subjectivity in determining ripeness, the system also supports the ISO 9001 principles of process consistency and continual improvement, especially in relation to post-harvest fermentation quality. Importantly, the digital records generated by the model provide traceable evidence of harvest decisions, which can be linked to lot-level quality outcomes during fermentation and drying.
As illustrated in
Figure 8, the ROC curve achieved an AUC of 0.91, confirming the model’s capacity to discriminate maturity levels under realistic production conditions.
The shape of the curve indicates balanced performance, with both false positives (immature pods classified as mature) and false negatives (mature pods classified as immature) controlled within acceptable limits. This result highlights the feasibility of deploying AI-based inspection tools directly in the field, where lighting variability, background complexity, and pod morphology have traditionally posed challenges for manual inspection.
Beyond immediate harvest decisions, these findings highlight a broader strategic implication: improved maturity detection can enhance fermentation uniformity, leading to greater flavor consistency and higher market value for premium cacao. In this way, the proposed system not only facilitates compliance with the ISO standards but also contributes to the competitiveness of Ecuador’s fine-flavor cacao in international markets.
4.3. Coffee
The CNN–YOLO pipeline for defect detection in Arabica beans achieved an overall accuracy of 92%, surpassing the benchmarks of manual inspection (
Figure 9).
Figure 9 illustrates the confusion matrix as a normalized heatmap, while
Table 8 provides the corresponding performance metrics with 95% confidence intervals, confirming high sensitivity (90%) and specificity (94%).
The results show that the system was slightly more effective in identifying non-defective beans (specificity = 94%) than in detecting all defective ones (sensitivity = 90%). Nevertheless, the balanced performance across metrics demonstrates that the AI-based model offers a significant improvement over manual grading, which is prone to subjectivity and inconsistency. By providing objective, auditable evidence of conformity, the system reinforces the ISO 9001 requirements for evidence-based decision-making and strengthens ISO 22000’s emphasis on traceability in specialty coffee supply chains.
As illustrated in
Figure 10, the ROC curve achieved an AUC of 0.94, confirming the model’s strong ability to discriminate defective from acceptable beans with high confidence.
This performance reduces the reliance on subjective manual inspection, ensuring that conformity evaluations are consistent and verifiable. Beyond compliance, the system also supports specialty coffee producers in documenting the quality standards required by international buyers, thereby enhancing their competitiveness in export markets.
4.4. Shrimp
For shrimp freshness monitoring, the HSI–NIRS–CNN pipeline achieved an overall accuracy of 95%.
Figure 11 shows the graphical confusion matrix derived from 100 test samples, and
Table 9 summarizes the leading performance indicators with 95% confidence intervals, confirming strong sensitivity (93%) and specificity (97%) under semi-industrial conveyor conditions.
The system was slightly stronger in correctly identifying less-fresh shrimp (specificity = 97%) compared to detecting all fresh samples (sensitivity = 93%). Nevertheless, the overall accuracy of 95% demonstrates robust classification capability. Notably, the capacity to capture subtle moisture and texture variations in real-time supports the ISO 22000’s requirements for hazard-control verification. At the same time, the production of digital, non-destructive inspection records directly contributes to ISO 9001’s emphasis on auditability and evidence-based decision-making.
As illustrated in
Figure 12, the ROC curve achieved an AUC of 0.96, confirming the system’s ability to discriminate between fresh and less-fresh shrimp reliably. This level of performance operationalizes continuous monitoring in seafood processing, reducing dependence on time-consuming laboratory assays. Moreover, by providing objective and traceable records, the system facilitates compliance with international buyer specifications and strengthens Ecuador’s positioning in global seafood markets.
4.5. Comparative Analysis
Table 10 summarizes the classification performance across commodities. All models achieved accuracy levels above 88%, with bananas reaching the highest performance (97%) and cacao showing slightly lower but still acceptable results (88%). Statistical validation through ANOVA and Pearson correlation analyses revealed no significant effects of illumination, conveyor speed, or batch variability on classification outcomes (
p > 0.05), confirming the robustness of the system under various operational conditions.
These outcomes demonstrate that AI-driven inspection systems can provide evidence-based, traceable, and consistent results across diverse commodities, fully aligned with the requirements of ISO 9001 and ISO 22000. By enabling 100% inspection at industrial throughput, the systems operationalize the Plan–Do–Check–Act (PDCA) cycle, reduce error rates compared to manual inspection, and provide a digital backbone for Quality 4.0 in Ecuador’s agri-food chains.
As illustrated in
Figure 13, bananas achieved the highest accuracy (97%) and specificity (98%), reflecting the clear chromatic cues that facilitate ripeness detection. Shrimp also performed strongly (95% accuracy), while coffee and cacao obtained slightly lower but robust outcomes (92% and 88%, respectively). Importantly, precision remained above 89% across all products, and specificity was consistently ≥90%, minimizing the risk of discarding conforming units. These results confirm that AI-driven inspection can provide reliable and reproducible evaluations, supporting the continual improvement initiatives required by ISO 9001 and ensuring conformity verification in line with ISO 22000.
Taken together,
Figure 6,
Figure 8,
Figure 10 and
Figure 12 (ROC curves) and
Figure 13 (comparative bar chart) confirm that AI-based inspection systems delivered consistently high performance across all four commodities analyzed. ROC analyses showed AUC values above 0.90 in every case, highlighting strong discriminative ability regardless of product-specific challenges—whether ripeness in bananas, pod maturity in cacao, morphological defects in coffee, or freshness attributes in shrimp. When integrated, these findings demonstrate not only the alignment with ISO 9001 and ISO 22000, but also the potential of Quality 4.0 frameworks to standardize inspection processes across multiple agri-food sectors, ensuring that quality and safety standards are maintained in accordance with international benchmarks.
ROC curves are not intended to depict perfect classification but to confirm that each model achieved balanced and statistically validated discrimination between classes under semi-industrial conditions. AUC values between 0.90 and 0.98 indicate excellent, but realistic, discriminative performance, entirely consistent with the confidence intervals reported in
Section 3.7. Their inclusion complements the confusion matrices by visualizing the sensitivity–specificity trade-off, thereby providing transparent and reproducible evidence of model reliability within the ISO-aligned evaluation framework.
Overall, the results confirm that AI-based inspection systems can deliver robust, accurate, and reproducible assessments across Ecuador’s primary agri-food commodities. These outcomes confirm that the synchronization strategy detailed in
Table 4 effectively prevented motion artifacts, ensuring reliable performance even at maximum conveyor speed. The integration of RGB imaging, hyperspectral imaging, and NIRS with deep learning models consistently produced accuracies above 88%, with intense sensitivity and specificity values, and ROC curves showing AUC > 0.90 in all cases. Beyond numerical performance, the systems generated traceable and auditable records that directly reinforce the principles of ISO 9001 (evidence-based decision-making and continual improvement) and ISO 22000 (hazard control, conformity verification, and traceability).
These findings establish a solid empirical foundation for the subsequent discussion, where the results will be interpreted in the context of prior research, theoretical implications, and practical applications for advancing Quality 4.0 in agri-food value chains.
Integration with ISO requirements and PDCA. Beyond accuracy and statistical robustness, the comparative analysis confirms that AI-based inspection systems produce outputs directly usable as auditable evidence under ISO frameworks. In bananas, ripeness classification records align with ISO 9001:2015 (§8.6 Control of outputs); in cacao, pod maturity detection supports CCP verification under ISO 22000:2018 (§8.5.4 Monitoring and measurement); in coffee, defect detection contributes to ISO 9001:2015 (§10.2 Nonconformity and corrective action); and in shrimp, freshness regression supports ISO 22000:2018 (§8.8 Verification of hazard controls). When interpreted together, these outputs demonstrate how digital inspection embeds into the Plan–Do–Check–Act (PDCA) cycle: (i) Plan—quality parameters and CCPs defined by ISO standards; (ii) Do—continuous in-line acquisition with HSI/NIRS; (iii) Check—performance metrics and traceable logs generated in real time; (iv) Act—automatic rejection or corrective measures triggered by nonconformities. This integration substantiates the claim of achieving “PDCA at digital speed”, since conformity evidence is produced natively in digital form, traceable across lots, and auditable in certification processes.
5. Discussion
5.1. Interpretation of Key Findings
The results of this study confirm that AI-driven inspection systems can achieve consistently high levels of accuracy, sensitivity, and specificity across diverse agri-food commodities. In bananas, the CNN–HSI pipeline reached 97% accuracy, 96% sensitivity, and 98% specificity, with perfect precision. Such performance is entirely consistent with global research on fruit quality inspection. For example, Wang et al. [
36] reported accuracies exceeding 94% in banana ripeness detection using hyperspectral imaging, while Martínez-Mora et al. [
6] demonstrated that dual CNN approaches integrating RGB and spectral data achieved nearly 90% classification accuracy in banana ripeness and quality grading. Wang et al. [
37] further documented classification accuracies close to 98% in ripeness assessment under controlled conditions, confirming the stability of AI approaches in fruit inspection tasks. Together, these results validate that bananas—where ripeness correlates strongly with chromatic cues—are particularly well-suited for AI-based inspection [
63].
The performance in cacao, although slightly lower (88% accuracy, 86% sensitivity, 90% specificity), is aligned with the complexity of the field conditions. The variability of pod morphology, lighting, and environmental noise typically reduces the classification performance in cacao compared to other commodities. Restrepo-Arias et al. [
9] achieved similar results (average precision ~86%) in cacao pod ripeness classification under field conditions, while Pal et al. [
64] reported accuracies of 85–90% using image-based feature extraction methods. At the bean level, Cruz-Tirado et al. [
10] demonstrated the potential of NIR-HSI for cocoa hybrid authentication with very high accuracy, highlighting how spectral techniques can complement visual models to overcome limitations in field variability. These findings indicate that the results for cacao are not only consistent with the prior literature but also extend its scope by validating AI models in semi-industrial conveyor settings.
Coffee bean inspection yielded an overall accuracy of 92%, outperforming manual grading benchmarks. The model’s sensitivity (90%) and specificity (94%) demonstrate a balanced ability to discriminate defective from non-defective beans. Similar results have been observed in recent international studies. Cevallos et al. [
7] reported 91.65% accuracy using CNN-based models for morphological defect detection in Arabica beans from Ecuador, while Arwatchananukul et al. [
65] achieved between 98% and 99% accuracy in cross-validation for classifying multiple coffee bean defects, though with slightly lower performance (88.6%) when applied to unseen datasets. Chang and Huang [
33] also demonstrated accuracies above 95% in defect detection, showing that deep learning outperforms manual inspection across contexts. These converging findings emphasize the reliability of CNN-based defect detection in coffee and reinforce its role in operationalizing ISO 9001’s principle of evidence-based decision-making.
For shrimp, the HSI–NIRS–CNN pipeline reached 95% accuracy, 93% sensitivity, and 97% specificity. These values confirm the system’s ability to detect freshness degradation through subtle changes in moisture and texture. Comparable results have been reported by Hao et al. [
66], who developed a GoogLeNet-based model that classified shrimp freshness with 93% accuracy, and by Valeriano and Hortinela [
67], who achieved high accuracy in salmon freshness classification using CNNs in situ. Similarly, Xu et al. [
11] demonstrated strong predictive performance (R
2 > 0.9) in monitoring shrimp moisture content with hyperspectral imaging, underscoring the robustness of spectral approaches for aquaculture products. These findings support the notion that AI-driven freshness monitoring can effectively complement or replace laboratory-based assays, thereby accelerating conformity verification under ISO 22000 [
68].
Taken together, these comparative results show that the Ecuadorian system’s performance metrics—consistently above 88% accuracy, with ROC AUC values greater than 0.90 across commodities—are fully aligned with international benchmarks. Importantly, the results not only confirm prior laboratory-based studies, but also extend them to semi-industrial conveyor conditions, demonstrating that real-time, ISO-aligned inspection is feasible in emerging economies. The multimodal integration of digital (RGB), hyperspectral (HSI), and near-infrared (NIRS) imaging proved critical to achieving this outcome, enabling the simultaneous assessment of surface-level and internal attributes within a unified AI-based framework. By generating objective, traceable, and auditable assessments, these AI-driven systems operationalize the principles of ISO 9001 (evidence-based decision-making and continual improvement) and ISO 22000 (hazard control, conformity verification, and traceability) while reinforcing the Quality 4.0 paradigm in agri-food chains.
The consistency of ROC-derived AUC values between 0.90 and 0.98 across commodities further confirms that the proposed inspection models achieve excellent yet realistic discriminative performance. These outcomes validate the robustness of the multimodal (RGB–HSI–NIRS) architecture and the reliability of its statistical foundation, rather than suggesting overfitting or artificial perfection. This statistical credibility is essential to the Quality 4.0 framework, where digital evidence must not only be accurate, but also auditable and explainable within ISO’s Plan–Do–Check–Act (PDCA) cycle. By translating these quantitative diagnostics into verifiable process indicators, the AI-based inspection systems bridge data-driven analytics with the managerial principles of continual improvement embedded in ISO 9001 and ISO 22000.
5.2. Theoretical Implications
Building on these validated results, the study moves from empirical evidence to theoretical reflection, linking the statistically grounded performance of AI-based inspection systems with their broader conceptual significance. The demonstrated integration of PDCA-based monitoring and digital auditability provides a concrete pathway for connecting ISO management principles with the emerging Quality 4.0 paradigm.
This study makes a substantive contribution to the literature on Quality 4.0 by empirically demonstrating how artificial intelligence (AI) technologies, deep learning, hyperspectral imaging (HSI), and near-infrared spectroscopy (NIRS) can operationalize the principles embedded in ISO 9001 and ISO 22000. The ability of these models to generate objective, auditable, and digital evidence reinforces ISO’s core emphasis on evidence-based decision-making, continual improvement, and traceability [
1,
2]. While prior reviews of Quality 4.0 conceptualized the framework as the alignment of Industry 4.0 technologies with traditional quality philosophies [
43,
44], the present research advances this discussion by providing concrete evidence of how AI-driven inspection can be integrated into the Plan–Do–Check–Act (PDCA) cycle of ISO-based quality systems.
In theoretical terms, the findings suggest that Quality 4.0 should not be understood merely as a technological enhancement of quality management but as a socio-technical transformation that accelerates PDCA feedback loops, allowing food industries to detect, analyze, and correct nonconformities at digital speed [
39,
43]. Moreover, integrating robust statistical validation methods—such as analysis of variance (ANOVA) and Pearson correlations—offers a methodological template for future AI-based conformity assessments, addressing concerns about the opacity of machine learning models raised in the explainable AI literature [
58]. By bridging AI technologies with ISO’s governance architecture, this study adds empirical weight to the argument that Quality 4.0 provides the operational means to realize the intent of international quality and food safety standards.
To illustrate how AI outputs concretely operationalize ISO standards, the study demonstrates how each commodity-specific result corresponds to explicit ISO clauses and auditability dimensions. For bananas, digital records from ripeness classification (97% accuracy) provide direct evidence for ISO 9001:2015 §8.6, Control of outputs, ensuring conformity with export maturity standards. In cacao, the image-based maturity detection system (88% accuracy) supports ISO 22000:2018 §8.5.4, Monitoring and measurement, offering traceable evidence to verify harvest timing as a critical control point (CCP). In coffee, the defect-detection pipeline (92% accuracy) aligns with ISO 9001:2015 §10.2 Nonconformity and corrective action, as digital logs of non-conforming beans enable automatic rejection or rework. Finally, in shrimp processing, the spectral regression model (R2 = 0.95) supports ISO 22000:2018 §8.8 Verification of hazard controls, providing auditable, non-destructive confirmation of freshness and moisture standards.
Together, these mappings show that the proposed AI-based framework not only aligns with the ISO requirements but also generates digital, reproducible, and auditable outputs that can be directly embedded in certification and quality management processes.
The complementarity between Quality 4.0 and ISO 9001 becomes particularly evident in food quality inspection. While ISO 9001 establishes the managerial foundation—defining the process approach, evidence-based decision-making, and continual improvement—Quality 4.0 provides the technological means to execute these principles in real-time. Digital sensing, AI-based analytics, and cloud-integrated traceability systems enable the PDCA cycle to operate continuously, transforming monitoring and verification into automated, data-driven routines. In practice, Quality 4.0 strengthens ISO 9001 by embedding digital intelligence into the “Do” and “Check” stages, where non-destructive measurements and AI-driven classifications replace subjective human inspection. Conversely, ISO 9001 provides the governance and documentation structure that ensures AI-based systems remain auditable, standardized, and aligned with internationally recognized conformity requirements. This mutual reinforcement—managerial discipline from ISO 9001 and technological capability from Quality 4.0—creates a coherent socio-technical framework for achieving consistent, transparent, and certifiable food quality outcomes.
5.3. Practical Implications
Unlike prior studies that primarily focused on isolated product-level classification or regression performance, this study demonstrates how deep learning and spectral imaging can be embedded directly into process-level quality control systems consistent with ISO 9001 and ISO 22000. This integration shows how Quality 4.0 can be operationalized as a socio-technical framework rather than a purely technological upgrade, thereby distinguishing the present research from conventional performance-driven approaches. By translating statistical outputs (accuracy, sensitivity, specificity, AUC values between 0.90 and 0.98) into auditable conformity indicators, the proposed system connects data analytics with ISO’s managerial logic of continual improvement through the Plan–Do–Check–Act (PDCA) cycle.
For Ecuadorian agri-food industries—especially small and medium-sized enterprises (SMEs)—the findings highlight several practical pathways to strengthen export competitiveness and regulatory compliance. First, automated inspection systems reduce reliance on labor-intensive, subjective evaluations, thereby minimizing the risk of inconsistent grading and costly shipment rejections in international markets where conformity to specifications is non-negotiable. By enabling 100% inspection at industrial throughput, AI technologies allow firms to transition from sample-based testing to continuous verification, meeting growing customer expectations for transparency and traceability [
69,
70].
Second, the deployment of AI-based quality control supports a more resilient positioning of Ecuadorian exports—bananas, cacao, coffee, and shrimp—within global supply chains. Objective digital records produced by CNN- and HSI-based systems provide verifiable evidence for audits, certification, and contractual compliance, aligning with the ISO requirement for documented information [
1,
2]. This digital traceability is particularly valuable in specialty markets, such as fine-flavor cacao and specialty coffee, where provenance and authenticity are crucial differentiators. The integration of hyperspectral imaging (HSI) and near-infrared spectroscopy (NIRS) further reinforces conformity verification and fraud prevention under ISO 22000, offering audit-ready digital evidence that strengthens buyers’ confidence and supports traceable, sustainable sourcing practices.
Nonetheless, adoption is not without barriers. High capital investment in imaging hardware and computational infrastructure, combined with limited digital maturity and persistent skills shortages, remains a significant obstacle for SMEs [
48,
55]. In addition, connectivity gaps in rural production zones still constrain real-time data exchange and cloud-based traceability [
56,
57]. To address these challenges, firms can adopt a staged deployment strategy, beginning with pilot projects that demonstrate measurable returns on investment, and progressively scaling automation based on process criticality and product value. Meanwhile, governments and universities can play a critical role in enabling broader adoption through technology transfer programs, workforce upskilling, and policy incentives for SME digitalization [
42]. Collectively, these measures can help ensure that the benefits of AI-based inspection—greater accuracy, speed, and traceability—are realized at scale, reinforcing Ecuador’s position in global agri-food markets and accelerating the transition toward digitally enabled, ISO-aligned quality systems.
5.4. Limitations and Future Research
Despite its contributions, this study has limitations that must be acknowledged. First, the empirical analysis focused exclusively on four commodities of strategic importance to Ecuador—bananas, cacao, coffee, and shrimp. Although these represent the country’s leading export products, generalizing the findings to other crops or food categories will require additional validation across diverse contexts and supply chains. Second, although conveyor-based experiments successfully simulated industrial packing conditions, full-scale factory trials with larger sample sizes and higher throughput are necessary to confirm scalability, robustness, and operational reliability under continuous production environments.
Third, while statistical validation through ANOVA and correlation analysis reduced the risk of overfitting, the long-term performance of AI models in industrial deployment remains vulnerable to model drift and shifts in data distribution—an issue widely documented in the literature on machine learning in production environments [
60,
61]. Sustaining performance will therefore require implementing adaptive learning pipelines, continuous monitoring, and periodic model retraining strategies to maintain accuracy and ensure continual improvement. Fourth, although the study produced digital evidence suitable for ISO audits, the explainability of AI decisions remains limited. Future research should incorporate explainable AI (XAI) approaches to enhance transparency, operator trust, and auditability within ISO’s evidence-based framework [
58].
Finally, further investigation is warranted into integrating AI-based inspection with complementary digital technologies, such as blockchain-enabled traceability systems, to secure tamper-evident quality logs [
34,
49]. Comparative studies across emerging economies could also identify the contextual enablers and constraints of Quality 4.0 adoption, providing deeper insights into how structural factors—such as digital connectivity, SME capabilities, and policy environments—influence the successful implementation of AI-aligned ISO quality management systems. These future efforts will help consolidate the technological, organizational, and regulatory foundations required for globally auditable, data-driven quality assurance in agri-food value chains.
5.5. Managerial Guidance for ISO-Aligned AI Adoption
The effective use of AI-based inspection requires managerial awareness of both technical and governance issues. For quality managers, the priority is to ensure that AI systems operate within the ISO-based Plan–Do–Check–Act (PDCA) cycle rather than as stand-alone tools. This begins with clearly defined roles for data, models, and decisions, and with treating imaging and spectroscopy devices (RGB, HSI, NIRS) as calibrated measurement instruments, with their accuracy, repeatability, and environmental conditions controlled and documented.
Data integrity is central. Acquisition and preprocessing procedures must be standardized, versioned, and auditable to preserve reproducibility and traceability (ISO 9001 §7.5; ISO 22005). Before deployment, models should be independently validated through confusion matrices and ROC–AUC metrics, with explicit confidence intervals and traceable records of dataset and model versions.
Once operational, AI systems require continuous monitoring to detect data or model drift. Declines in accuracy or sensitivity should trigger recalibration or retraining under a formal change-control procedure (ISO 9001 §10.2). At the same time, explainability tools (e.g., attention or heat maps) help operators interpret model outputs and maintain confidence during audits. Maintaining a human-in-the-loop remains essential to verify low-confidence cases and ensure accountability.
Every prediction should be automatically logged with timestamps, lot identifiers, and model versions, creating immutable audit trails that reinforce digital traceability and recall capability. Complementary measures include cybersecurity, supplier qualification for hardware/software updates, and bias testing to ensure ethical and robust performance across product origins and seasons.
AI adoption should proceed incrementally—starting with pilot processes, evaluating cost savings and inspection speed, and scaling based on evidence. In this way, AI complements ISO 9001/22000/22005 by enabling real-time, 100% inspection, faster “Check/Act” cycles, and auditable digital records. Within the Quality 4.0 paradigm, AI transforms the PDCA loop into a continuous flow of data → decision → action, reinforcing both efficiency and assurance of conformity.
6. Conclusions
This study demonstrates that integrating hyperspectral imaging (HSI), near-infrared spectroscopy (NIRS), and deep learning architectures provides a robust, ISO-aligned pathway for process-level quality control in Ecuador’s agri-food industries. Across bananas, cacao, coffee, and shrimp, AI-driven systems achieved accuracies of 88–97% and AUC values above 0.90, confirming their ability to deliver traceable, objective, and auditable evidence consistent with the ISO 9001 and ISO 22000 principles. The generation of digital inspection records enhances auditability and reinforces trust in certification and export compliance.
The findings strengthen the conceptual foundation of Quality 4.0, showing that AI-based inspection accelerates the Plan–Do–Check–Act (PDCA) cycle and enables real-time, evidence-based decision-making. The results provide empirical proof from an emerging economy that conveyor-based multimodal inspection can operationalize ISO standards beyond laboratory conditions. In practice, AI-driven quality control enables 100% non-destructive inspection, reduces human subjectivity, and improves digital traceability—key advantages for SMEs pursuing export competitiveness.
Adoption challenges remain, mainly related to investment costs, digital skills, and connectivity gaps. To address them, three actionable recommendations are proposed: (i) staged pilot implementations focused on one commodity to demonstrate cost-effectiveness; (ii) joint training programs between universities, technology centers, and industry associations to close skills gaps; and (iii) public policies that promote digital infrastructure and provide incentives for SME digitalization. These coordinated measures can transform the demonstrated technical feasibility into a scalable industrial practice.
Future work should validate the framework in full-scale factory environments, extend it to additional commodities, and integrate explainable AI and blockchain-based traceability to strengthen transparency and long-term model reliability. Overall, the integration of deep learning with HSI and NIRS establishes a practical foundation for fully digital, auditable, and sustainable food quality systems aligned with international standards.
In practical terms, managers should deploy AI-based inspection as an ISO-aligned capability rather than a stand-alone tool. This means (i) treating cameras/HSI/NIRS as measurement systems with calibration and documented MSA; (ii) validating models with auditable evidence (confusion matrices, ROC-AUC, confidence intervals) and monitoring drift to trigger retraining; (iii) preserving human-in-the-loop decision points and explainability for acceptance and audits; and (iv) ensuring digital traceability (timestamps, lot IDs, model versioning) and cybersecurity. This approach complements ISO 9001/22000 and Quality 4.0 by enabling 100% non-destructive inspection, faster PDCA cycles, and stronger conformity verification. For SMEs, staged pilots with clear ROI metrics and university–industry upskilling provide a realistic pathway to scale.