Next Article in Journal
The Dynamic Response Mechanism of In Situ Stress and Three-Dimensional Modeling Methods for Pressure Boost and Capacity Expansion in Gas Storage
Previous Article in Journal
Improvement of the Fluidity of Heavy Oil Using a Composite Viscosity Reducer
Previous Article in Special Issue
Comparative Effects of Total, Water-Extractable, and Water-Unextractable Arabinoxylans from Wheat Bran on Dough and Noodle Properties
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Deep Learning-Based Digital, Hyperspectral, and Near-Infrared (NIR) Imaging for Process-Level Quality Control in Ecuador’s Agri-Food Industry: An ISO-Aligned Framework

by
Alexander Sánchez-Rodríguez
1,*,
Richard Dennis Ullrich-Estrella
1,
Carlos Ernesto González-Gallardo
1,
María Belén Jácome-Villacres
1,
Gelmar García-Vidal
2 and
Reyner Pérez-Campdesuñer
2
1
Faculty of Engineering Sciences and Industries, Universidad UTE, Quito 170527, Ecuador
2
Faculty of Law, Administrative and Social Sciences, Universidad UTE, Quito 170527, Ecuador
*
Author to whom correspondence should be addressed.
Processes 2025, 13(11), 3544; https://doi.org/10.3390/pr13113544
Submission received: 14 October 2025 / Revised: 28 October 2025 / Accepted: 2 November 2025 / Published: 4 November 2025
(This article belongs to the Special Issue Processing and Quality Control of Agro-Food Products)

Abstract

Ensuring consistent quality and safety in agri-food processing is a strategic priority for firms seeking compliance with international standards such as ISO 9001 and ISO 22000. Traditional inspection practices in Ecuador’s food industry remain largely destructive, labor-intensive, and subjective, limiting real-time decision-making. This study developed a non-destructive, ISO-aligned framework for process-level quality control by integrating digital (RGB) imaging for surface-level inspection, hyperspectral imaging (HSI) for internal-quality prediction (e.g., moisture, firmness, and freshness), near-infrared spectroscopy (NIRS) for compositional and authenticity analysis, and deep learning (DL) models for automated classification of ripeness, maturity, and defects. Experimental results across four flagship commodities—bananas, cacao, coffee, and shrimp—achieved classification accuracies above 88% and ROC AUC values exceeding 0.90, confirming the robustness of AI-driven, multimodal (RGB–HSI–NIRS) inspection under semi-industrial conveyor conditions. Beyond technological performance, the findings demonstrate that digital inspection reinforces ISO principles of evidence-based decision-making, conformity verification, and traceability, thereby operationalizing the Plan–Do–Check–Act (PDCA) cycle at digital speed. The study contributes theoretically by advancing the conceptualization of Quality 4.0 as a socio-technical transformation that embeds AI-driven sensing and analytics within management standards, and practically by providing a roadmap for Ecuadorian SMEs to strengthen export competitiveness through automated, real-time, and auditable quality assurance.

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 (R2 > 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.

2. Theoretical Framework

2.1. ISO Standards and Food Quality Management

International standards provide the governance architecture for modern food quality and safety systems. ISO 9001:2015 specifies the requirements for a Quality Management System (QMS) organized around the process approach, risk-based thinking, and the Plan–Do–Check–Act (PDCA) cycle to ensure consistent, evidence-based control of processes and outputs, including customer focus, leadership, and continual improvement [1]. In parallel, ISO 22000 [2] defines the Food Safety Management System (FSMS) and integrates HACCP concepts from Codex with PDCA and risk-based thinking across the food chain; the standard clarifies how the management-system PDCA and the operational PDCA interact to govern hazards from farm to fork [19,20].
Within this family, traceability is treated as a distinct, complementary capability. ISO 22005 establishes general principles and basic requirements for designing and implementing feed-and-food traceability systems, aligning with Codex definitions and is intended to complement ISO 22000 implementations by enhancing recall readiness, provenance verification, and supply chain transparency [21,22]. Credible certification and surveillance over time also depend on the competence and rigor of auditing; ISO 19011 [19] provides overarching guidelines for auditing management systems (planning, principles, and auditor competence) and underpins consistent conformity assessment across integrated systems.
For export-oriented economies, such as Ecuador, where bananas, cacao, coffee, and shrimp are strategic sectors, formal conformance is often a de facto market-access requirement because international buyers condition procurement on recognized schemes and demonstrable traceability. This expectation is reinforced by public regulation: for example, Regulation (EC) No. 178/2002 of the European Parliament and of the Council establishes that the traceability of food and feed must be ensured at all stages of production, processing, and distribution (Art. 18), enabling rapid recalls and cross-border accountability [22]. In this context, ISO-based QMS/FSMS frameworks do not merely signal internal discipline; they underwrite transactional trust by making controls auditable, repeatable, and portable across multi-tier supply networks [1,19].
However, traditional control practices—such as manual inspection, destructive sampling, and off-line laboratory testing—struggle to keep pace with global throughput and the PDCA cadence implied by ISO clauses on monitoring and measurement, control of nonconforming outputs, analysis/evaluation, and improvement. ISO’s own implementation and auditing guidance emphasizes systematic, timely tracking, and evidence sufficiency—needs best met when measurement becomes pervasive and digital (e.g., computer vision, spectroscopy, IoT) and when data flow seamlessly into QMS/FSMS analytics for real-time decisions [1,2,19]. As organizations modernize, audit programs must also adapt—validating measurement-system integrity (including metrological traceability), data governance, and (where relevant) algorithm life-cycle controls—so that digitally enabled quality and safety systems continue to satisfy ISO principles and withstand certification scrutiny [19].

2.2. Artificial Intelligence in Food Quality Control

Artificial intelligence (AI) in food quality control encompasses digital (RGB) imaging and computer vision, deep learning (DL), and spectroscopic sensing (HSI and NIRS), enabling machines to perform perception and decision-making tasks that human inspectors traditionally carry out. Across commodities, convolutional neural networks (CNNs) consistently outperform manual grading for defect detection [5], surface-quality assessment, and product classification while reducing subjectivity and enabling accurate, line-speed inspection [3]. Recent reviews synthesize evidence of high accuracy across fruits, vegetables, grains, meats, and seafood, and document the shift from handcrafted features toward end-to-end CNNs and lightweight architectures for embedded industrial deployment [23,24,25,26].

2.2.1. Hyperspectral Imaging (HSI)

Hyperspectral imaging (HSI) integrates imaging and spectroscopy by capturing hundreds of contiguous spectral bands at each spatial pixel, generating a three-dimensional data cube (x, y, λ) that encodes both spatial and chemical information. Each pixel contains a unique spectral “fingerprint” of the material’s composition and structure, allowing the simultaneous analysis of external and internal product attributes invisible to RGB cameras—such as moisture, pigment concentration, tissue firmness, or microbial spoilage indicators.
In agri-food applications, HSI bridges the gap between laboratory-based spectroscopy and high-throughput vision inspection. Line-scan (“push-broom”) systems acquire spectral lines synchronously with conveyor motion, providing pixel-level reflectance spectra in real-time. Calibration typically involves dark/white references, geometric alignment, and reflectance normalization. Preprocessing steps include spectral smoothing (Savitzky–Golay), scatter correction (SNV, MSC), and noise removal to ensure comparability across sessions and lighting conditions [13,27].
Coupled with DL, HSI achieves state-of-the-art performance for internal-quality prediction, freshness assessment, and safety screening. Spectral–spatial CNNs and 3D CNNs extract both wavelength-dependent and morphological patterns, enabling the accurate discrimination of ripeness, firmness, and compositional attributes in products such as bananas, tomatoes, apples, shrimp, and fish fillets [13,28]. These hybrid models outperform traditional chemometric methods (PLSR, LDA) by learning nonlinear spectral interactions directly from raw reflectance data.
From an ISO perspective, HSI provides objective and traceable measurement evidence that can be directly linked to ISO 9001:2015 (§9.1.3 Monitoring and measurement results) and ISO 22000:2018 (§8.5.4 Monitoring and measurement of CCPs). Because each spectral acquisition is time-stamped, reproducible, and non-destructive, it enables evidence-based decision-making and conformity verification without interrupting production. The digital trace generated by HSI supports automated nonconformity detection and real-time corrective actions, effectively accelerating the “Check” and “Act” stages of the PDCA cycle.
However, HSI adoption faces constraints. Its data volumes are substantial, requiring robust data pipelines and storage, while system calibration demands consistent illumination and temperature control. Equipment cost and operator expertise also limit diffusion among SMEs, highlighting the importance of simplified, miniaturized HSI systems and university–industry collaborations to reduce adoption barriers.

2.2.2. Near-Infrared Spectroscopy (NIRS)

Near-infrared spectroscopy (NIRS) complements HSI by focusing on molecular-level compositional analysis. Operating typically in the 800–2500 nm range, NIRS measures overtones and combination vibrations of C–H, N–H, and O–H bonds—signals that correlate with chemical constituents such as moisture, proteins, fats, sugars, and volatile compounds. Unlike HSI, NIRS does not provide spatial information but excels in rapid, point-based analysis suitable for bulk or inline monitoring.
NIRS has been widely applied in coffee, cereals, cocoa, and meat processing to assess product authenticity, adulteration, and quality attributes [29,30,31]. In coffee, NIRS coupled with chemometrics or DL regression can classify post-harvest processing methods, detect adulterants in ground coffee, and predict sensory attributes with high accuracy. In cocoa and grains, NIRS models quantify moisture and fat content, while in aquaculture, they support freshness evaluation by correlating spectral responses with biochemical markers.
The advantages of NIRS include portability, low cost, and high analytical speed (seconds per scan). Portable fiber-optic probes or benchtop spectrometers can perform compositional analysis in situ, providing near-real-time data to feed into enterprise QMS/FSMS systems. In an ISO-aligned context, NIRS fulfills roles in verification and conformity control (ISO 22000:2018 §8.8), providing quantitative evidence of compliance with compositional specifications and authenticity claims.
Recent deep learning models, including one-dimensional CNNs, LSTMs, and Transformer-based spectral encoders, have improved robustness to noise and batch variation, achieving superior performance over classical chemometric approaches. However, challenges remain: standardization across instruments, spectral drift, and transferability of models across product origins or varieties require domain adaptation and spectral alignment techniques [32,33]. Addressing these gaps is essential to ensuring traceability and metrological reliability in accordance with the ISO 9001 and ISO 19011 auditing principles.

2.2.3. Integration with Deep Learning and ISO-Aligned Quality Systems

When integrated into DL pipelines, HSI and NIRS provide complementary insights: HSI captures where quality deviations occur (spatial distribution), while NIRS quantifies what compositional changes are present (chemical structure). Combining these modalities enhances predictive accuracy and allows for multivariate fusion models that detect both surface-level and internal nonconformities.
Digital (RGB) imaging and computer-vision, HSI, and NIRS systems collectively generate native digital evidence—spectra, timestamps, classification probabilities, and traceable identifiers—that can be seamlessly incorporated into ISO-based management systems. Each inspection event becomes a verifiable data point for conformity evidence (§8.6) and continuous improvement (§10.2). Furthermore, when coupled with blockchain or cloud-based QMS platforms, these data streams form tamper-evident digital logs, ensuring transparency and accountability in audits [34].
By translating sensory and spectral data into standardized quality metrics, AI-driven inspection systems transform the ISO Plan–Do–Check–Act (PDCA) cycle into a continuous, data-driven feedback loop. This convergence between AI technologies and ISO standards embodies the core of the Quality 4.0 paradigm, linking real-time measurement with organizational learning and digital traceability across the agri-food value chain.

2.3. AI Applications in Ecuadorian Agri-Food Quality Control

Banana. As Ecuador’s flagship export, bananas have been an early testbed for AI-driven inspection. Deep learning models can now diagnose foliar diseases, such as Black Sigatoka, directly from leaf images, with EfficientNet-based pipelines achieving ~88% accuracy after augmentation—enabling earlier interventions that protect yield and post-harvest quality [4]. At the packing line, CNN-based visual grading has achieved high precision for ripeness and quality attributes from RGB images. A recent study on processes reported accuracies above 95% and discussed dual models that combined RGB with spectral cues [6]. Complementing vision, hyperspectral and multispectral methods enable the non-destructive assessment of internal attributes (e.g., firmness, soluble solids), with classical chemometrics and spectral–spatial learning delivering validation accuracies exceeding 90% for maturity discrimination [35,36]. Survey and application papers further document a near 98% classification accuracy for banana ripeness tasks under controlled conditions, including dual CNN/HSI approaches [6,37]. Together, these tools support ISO-aligned objectives: objective measurement (ISO 9001) and continuous monitoring for nonconformities prior to export.
Cacao. For fine-flavor cacao, on-tree pod maturity estimation is pivotal for uniform fermentation. Field-validated detectors (Faster R-CNN/Mask R-CNN; YOLO variants) now segment and classify pods by ripeness in complex backgrounds, reporting robust average precision and demonstrating feasibility for harvest timing [9]. At the bean level, NIR–HSI with chemometrics discriminates cocoa hybrids and quantifies compositional attributes at single-bean resolution, which is crucial for varietal authentication and premium lots [10]. Recent systematic reviews of AI in cocoa have confirmed the growing use of YOLO/SSD architectures for disease detection and ripeness tasks, with an emphasis on deployable, resource-efficient models for producer contexts [38]. These developments strengthen ISO 22000 documentation by linking maturity and varietal claims to objective, traceable measurements.
Coffee. In Ecuador and beyond, automated bean inspection mitigates the subjectivity of manual defect grading. A CNN-based pipeline applied to beans from Imbabura (Ecuador) reported high recognition performance for morphological defects and argued for replacing purely manual inspection in local mills [7]. At scale, object-detection models (YOLO family) have reached strong performance in classifying green coffee beans and flaws [39], while multimodal, real-time systems fuse NIR snapshot–HSI with deep learning for defect sorting on conveyors [40]. Beyond visual defects, spectroscopy extends to process/authenticity claims: NIRS with chemometrics has been shown to classify post-harvest processing and origin with high accuracy, improving traceability and claims verification in specialty markets [8]. These capabilities directly reinforce ISO 22000’s emphasis on transparency and verification along the chain.
Shrimp. For Ecuador’s dominant aquaculture product (Penaeus vannamei), HSI enables the line-speed monitoring of freshness and processing quality. During hot-air drying, HSI models predict moisture, color, and texture with strong fits (e.g., R2 > 0.9), enabling the non-destructive control of water activity and sensory attributes [11]. Complementary studies report near-ceiling accuracy (99%) for freshness classification using CNN/LSTM and YOLOv8 variants on image data, with Grad-CAM visualizations increasing explainability and offering a rapid alternative to periodic microbiological tests [41]. Data-fusion approaches that combine HSI and electronic-nose signals further improve moisture/freshness estimation relevant to HACCP verification [42]. Upstream, remote sensing supports traceability and biosecurity: fine-tuned Vision Transformers and U-Net delineate Ecuadorian shrimp ponds at high fidelity, providing spatial baselines for certification, environmental monitoring, and supply chain mapping [12].
Taken together, these Ecuador-relevant case threads demonstrate that AI—utilizing RGB vision, HSI/NIR spectroscopy, and geospatial analytics—addresses both visible (surface defects, color grade) and non-visible (moisture, composition, origin) attributes in near real-time. This enables 100% inspection, richer digital traceability, and earlier corrective actions—capabilities that operationalize ISO 9001’s evidence-based decisions and ISO 22000’s verification/traceability requirements in export-oriented banana, cacao, coffee, and shrimp chains.

2.4. Quality 4.0 as an Integrative Framework

The adoption of AI in food quality management is most coherently framed by Quality 4.0, i.e., the alignment of traditional quality philosophies with Industry 4.0 technologies (AI/ML, big data analytics, IoT, cloud/edge, blockchain) [18]. Systematic reviews conclude that Quality 4.0 extends the scope of quality from reactive inspection to connected, data-driven, and predictive control, improving operational efficiency and traceability while preserving foundational quality principles [43,44,45].
A central insight of this literature is that Quality 4.0 operationalizes ISO 9001 at digital speed. Implementation guidelines show how ISO 9001’s PDCA can be mapped to cyber-physical architectures: IoT sensors and computer vision expand “Do/Check” with continuous, in-line monitoring; analytics dashboards provide evidence for “Check”; and predictive/prescriptive models accelerate corrective and preventive actions in “Act.” Empirical and conceptual work further underscore the role of organizational readiness (skills, data governance, culture) in realizing these benefits [46,47,48]. In practice, this means embedding AI models in processes (sorting, drying, storage), integrating their outputs into the QMS as objective evidence, and automating nonconformity handling and trend analysis consistent with ISO clauses on performance evaluation and improvement.
On the food-safety side, Quality 4.0 augments ISO 22000 by strengthening hazard control, verification, and end-to-end traceability. Blockchain-enabled ledgers can immutably record quality and safety events (e.g., CCP checks, spectroscopic measurements), thereby enhancing auditability and recall management while reducing the risk of data tampering. Studies propose integration patterns that combine blockchain with ISO 9001/22000 documentation and IoT data streams [34,49,50]. For agri-food chains, where multi-tier provenance and cold-chain integrity are crucial, these architectures establish trustworthy digital trails that align with ISO requirements for documented information and verification.
Crucially, Quality 4.0 does not replace ISO standards; it provides the technological means to implement them more effectively. Reviews emphasize that the most significant gains occur when firms pair digital sensing/AI with disciplined QMS/FSMS design—using standards to define what to measure and control, and utilizing digital tools to achieve this at scale and speed [43,44]. This complementarity is particularly consequential in emerging economies, where reliance on manual inspection limits compliance and responsiveness. Digital, non-destructive instrumentation, combined with AI, can enable 100% inspection, provide richer audit evidence, and facilitate faster PDCA cycles without prohibitive laboratory overheads [47,48].

2.5. Advantages and Challenges of AI Adoption

The advantages of AI-based food quality control are well-documented: speed (line-speed, non-destructive inspection), accuracy/consistency (higher and more stable detection/classification rates than manual checks), traceability (native digital logs linking results to lots/units), and coverage (feasibility of 100% inspection instead of sampling). In vision and spectroscopy applications, hyperspectral imaging (HSI) and near-infrared spectroscopy (NIRS), when paired with machine learning, routinely deliver strong performance for defect detection, freshness/moisture prediction, and compositional or authenticity assessment—capabilities that directly support evidence-based decisions and verification under ISO 9001/22000 [13,51,52,53]. For export-oriented firms in Ecuador, these gains translate into more reliable compliance with buyer specifications and a lower risk of shipment rejections, as decisions are grounded in objective, auditable measurements rather than intermittent, subjective appraisals [51,52].
Adoption, however, faces technical, economic, and organizational hurdles. Up-front costs for line-scan cameras, spectrometers, controlled illumination, and compute/edge hardware remain significant—especially for SMEs—and HSI pipelines add complexity in calibration, high-volume data handling, and model maintenance [13,51,52]. Firms also report skills gaps in data science and MLOps, and broader Industry 4.0 studies highlight limited digital maturity, weak data governance, and change management challenges as persistent barriers [48,54,55]. In Latin America, connectivity constraints exacerbate these issues: regional diagnostics reveal pronounced digital divides—particularly in rural areas—impacting real-time data transfer and cloud integration [56,57]. Trust and governance add further friction: black-box perceptions can reduce operator acceptance and complicate audits, motivating the development of explainable AI (XAI) and transparent decision trails in quality contexts [58,59]. From an operational perspective, sustaining models in production requires monitoring model/data drift, as well as managing technical debt to prevent silent performance decay [54,60,61].
Mitigation pathways include staged deployments with ROI pilots, miniaturized/portable NIRS to lower capital expenditures where HSI is prohibitive, workforce upskilling through university–industry partnerships, and policy instruments that expand rural connectivity and incentivize SME digitalization [42,48,53,56]. Together, these measures help convert AI’s technical promise into resilient, ISO-aligned quality systems.

2.6. Research Objectives and Hypotheses

Based on the literature and the identified research gap, this study pursued the following objectives:
  • To analyze how artificial intelligence (AI) technologies—specifically deep learning (DL), hyperspectral imaging (HSI), near-infrared spectroscopy (NIRS), and computer vision—can enhance ISO-aligned quality control in Ecuador’s banana, cacao, coffee, and shrimp industries.
  • To compare the effectiveness of AI-based inspection methods against traditional, manual, or laboratory-based quality control practices in terms of classification accuracy, detection speed, and digital traceability.
  • To conceptualize and validate a Quality 4.0 framework that integrates AI-driven sensing and analytics (HSI, NIRS, DL) with ISO principles for evidence-based, auditable, and real-time food quality management in emerging economies.
From these objectives, the following hypotheses were formulated:
  • Main Hypothesis (H0): The adoption of AI-based systems in Ecuador’s food industry significantly improves quality outcomes—such as the accuracy of defect detection, the consistency of grading, and the completeness of traceability—compared to traditional inspection methods.
  • Specific Hypothesis 1 (H1): Deep learning-based computer vision reduces inspection time and increases classification consistency for surface-level attributes (ripeness, maturity, and defects) in bananas and cacao relative to manual inspection.
  • Specific Hypothesis 2 (H2): Spectroscopy-based methods (HSI and NIRS) improve the detection of internal or non-visible attributes (e.g., moisture, spoilage, sweetness, and compositional integrity) in coffee and shrimp, thereby enhancing conformity verification under ISO-based quality standards.
Together, these objectives and hypotheses delineate a testable pathway for demonstrating how AI can operationalize ISO-based quality management in Ecuador’s agri-food chains. In Section 3, these constructs are translated into measurable evaluation criteria: (i) speed, defined as inspection throughput and latency; (ii) accuracy and consistency, measured through classification metrics and spectral regression performance (R2, RMSE); and (iii) traceability, assessed through the completeness and timeliness of digital inspection records (lot-level chain-of-custody and time-to-trace indicators).
By grounding the analysis in Ecuador’s flagship export commodities and by establishing explicit, technology-linked metrics, the study aims to generate both empirical evidence for Quality 4.0 in emerging economies and practical guidance for firms seeking faster, more reliable, and auditable process-level quality control.

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:
  • Square ground sampling and line rate
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):
G S D x = F O V N pixels = 300 m m 1024 = 0.293 m m / p x
The along-track sampling was set to approximately the same value, ( G S D y G S D x ) . For a given belt speed v (m/s), the required line-scan rate ensuring square pixels is defined in Equation (2):
f line v G S D y
Thus, at v = 0.50 m / s , f line 0.50 / 0.000293 1706 lines / s ; and at v = 1.00 m / s , f line 3413 lines / s .
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):
b = v t int
To limit blur to a quarter-pixel, the exposure time t int was bounded as expressed in Equation (4):
b 0.25 G S D y t int 0.25 G S D y v
For G S D y = 0.293 m m and v = 1.00 m / s , the maximum allowable integration time was calculated as shown in Equation (5):
t int 73 μ s
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 t RGB such that v t RGB 0.25 G S D x . At v = 0.50 m / s this gives t RGB 147 μ s ; at v = 1.00 m / s , t RGB 73 μ s . 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).
Accuracy = T P + T N T P + T N + F P + F N
Precision = T P T P + F P
Recall   ( Sensitivity ) = T P T P + F N
Specificity = T N T N + F P
where T P , T N , F P , and F N 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 (R2), root mean squared error (RMSE), and residual predictive deviation (RPD), as shown in Equations (10)–(12).
R 2 = 1 ( y i y ^ i ) 2 ( y i y ˉ ) 2
R M S E = ( y i y ^ i ) 2 n
R P D = S D R M S E
where y i are observed values, y ^ i are predicted values, y ˉ is the mean of observed data, and S D 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 R P D > 2 indicate good and R P D > 3 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 (R2 > 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.

Author Contributions

Conceptualization, A.S.-R.; methodology, A.S.-R., C.E.G.-G., G.G.-V. and R.D.U.-E.; software, R.D.U.-E. and G.G.-V.; validation, M.B.J.-V., C.E.G.-G. and G.G.-V.; formal analysis, A.S.-R., R.P.-C. and C.E.G.-G.; investigation, A.S.-R., C.E.G.-G., M.B.J.-V., R.D.U.-E., G.G.-V. and R.P.-C.; resources, C.E.G.-G. and M.B.J.-V.; data curation, R.D.U.-E. and R.P.-C.; writing—original draft preparation, A.S.-R.; writing—review and editing, G.G.-V.; visualization, M.B.J.-V. and R.D.U.-E.; supervision, M.B.J.-V.; project administration, R.P.-C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

The study did not involve any clinical procedures, biomedical experimentation, or collection of sensitive personal data. In Ecuador, according to Acuerdo Ministerial 4883 del Ministerio de Salud Pública (Registro Oficial Suplemento 173, del 12 de diciembre de 2013), ethical review by an Institutional Review Board (IRB) or Comité de Ética de Investigación en Seres Humanos (CEISH) is required only for biomedical or clinical research that may pose physical or psychological risks to the participants. Our study, being observational, non-interventional, and of minimal risk, was exempt under this regulation. Nevertheless, we affirm that all procedures complied with the ethical standards of the 2013 revision of the Declaration of Helsinki, including respect for informed consent, privacy, and voluntary participation. Participants were informed of the study’s purpose and their right to withdraw at any time without consequence. No personal or identifiable information was recorded. The above is assumed to be an exemption from the ethical compliance requirement.

Informed Consent Statement

Verbal and written informed consent were obtained from all study participants. Before participating, they were informed about the purpose of the research, the voluntary nature of their participation, and the confidentiality of their responses. The study did not require sensitive personal data and was conducted in full compliance with the ethical principles established in the Declaration of Helsinki (2013 revision).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

The authors thank the anonymous reviewers of the journal for their constructive suggestions, which significantly improved the quality of the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. ISO 9001:2015; Quality Management Systems—Requirements. International Organization for Standardization (ISO): Geneva, Switzerland, 2015.
  2. ISO 22000:2018; Food Safety Management Systems—Requirements for Any Organization in the Food Chain. International Organization for Standardization (ISO): Geneva, Switzerland, 2018.
  3. Tian, S.; Tian, H.; Yang, Q.; Xu, H. Internal quality assessment of kiwifruit by bulk optical properties and online transmission spectra. Food Control 2022, 141, 109191. [Google Scholar] [CrossRef]
  4. Arman, S.E.; Bhuiyan, A.B.A.; Abdullah, H.M.; Islam, S.; Chowdhury, T.T.; Hossain, A. BananaLSD: A banana leaf images dataset for classification of banana leaf diseases using machine learning. Data in Brief. 2023, 50, 109608. [Google Scholar] [CrossRef] [PubMed]
  5. Ding, H.; Hou, H.; Wang, L.; Cui, X.; Yu, W.; Wilson, D.I. Application of Convolutional Neural Networks and Recurrent Neural Networks in Food Safety. Foods 2025, 14, 247. [Google Scholar] [CrossRef] [PubMed]
  6. Martínez-Mora, O.; Capuñay-Uceda, O.; Caucha-Morales, L.; Sánchez-Ancajima, R.; Ramírez-Morales, I.; Córdova-Márquez, S.; Cuenca-Mayorga, F. Artificial vision-based dual CNN classification of banana ripeness and quality attributes using RGB images. Processes 2025, 13, 1982. [Google Scholar] [CrossRef]
  7. Cevallos, M.; Sandoval-Pillajo, L.; Caranqui-Sánchez, V.; Ortega-Bustamante, C.; Pusdá-Chulde, M.; García-Santillán, I. Morphological Defects Classification in Coffee Beans Based on Convolutional Neural Networks. In Technologies and Innovation. CITI 2024. Communications in Computer and Information Science; Valencia-García, R., Borodulina, T., Del Cioppo-Morstadt, J., Moran-Castro, C.E., Vera-Lucio, N., Eds.; Springer: Cham, Switzerland, 2025; Volume 2276. [Google Scholar] [CrossRef]
  8. Santos-Rivera, M.; Viswanathan, L.; Sheibani, F. Enhancing Coffee Quality and Traceability: Chemometric Modeling for Post-Harvest Processing Classification Using Near-Infrared Spectroscopy. Spectrosc. J. 2025, 3, 20. [Google Scholar] [CrossRef]
  9. Restrepo-Arias, J.F.; Montoya-Castaño, M.J.; Moreno-De La Espriella, M.F.; Branch-Bedoya, J.W. An Application of Deep Learning Models for the Detection of Cocoa Pods at Different Ripening Stages: An Approach with Faster R-CNN and Mask R-CNN. Computation 2025, 13, 159. [Google Scholar] [CrossRef]
  10. Cruz-Tirado, J.P.; Fernández Pierna, J.A.; Rogez, H.; Fernandes Barbin, D.; Baeten, V. Authentication of cocoa (Theobroma cacao) bean hybrids by NIR-hyperspectral imaging and chemometrics. Food Control 2020, 118, 107445. [Google Scholar] [CrossRef]
  11. Xu, W.; Zhang, F.; Wang, J.; Ma, Q.; Sun, J.; Tang, Y.; Wang, J.; Wang, W. Real-Time Monitoring of the Quality Changes in Shrimp (Penaeus vannamei) with Hyperspectral Imaging Technology during Hot Air Drying. Foods 2022, 11, 3179. [Google Scholar] [CrossRef]
  12. Jacome, D.; Wang, J.; Ge, Y. Enhancing semantic segmentation of Ecuadorian shrimp ponds through fine-tuned vision transformers and U-Net architectures utilizing open-source remote sensing data. Int. J. Digit. Earth 2025, 18, 2538214. [Google Scholar] [CrossRef]
  13. Nikzadfar, M.; Rashvand, M.; Zhang, H.; Shenfield, A.; Genovese, F.; Altieri, G.; Matera, A.; Tornese, I.; Laveglia, S.; Paterna, G.; et al. Hyperspectral Imaging Aiding Artificial Intelligence: A Reliable Approach for Food Qualification and Safety. Appl. Sci. 2024, 14, 9821. [Google Scholar] [CrossRef]
  14. Lun, Z.; Wu, X.; Dong, J.; Wu, B. Deep Learning-Enhanced Spectroscopic Technologies for Food Quality Assessment: Convergence and Emerging Frontiers. Foods 2025, 14, 2350. [Google Scholar] [CrossRef]
  15. Xiao, Y.; Zhou, L.; Zhao, Y.; Qi, H.; Pu, Y.; Zhang, C. Deep learning-based regression of food quality attributes using near-infrared spectroscopy and hyperspectral imaging: A review. Food Chem. 2025, 493, 145932. [Google Scholar] [CrossRef]
  16. Nadimi, M.; Paliwal, J. Recent Applications of Near-Infrared Spectroscopy in Food Quality Analysis. Foods 2024, 13, 2633. [Google Scholar] [CrossRef] [PubMed]
  17. Zou, Z.; Yuan, D.; Wu, Q.; Wang, Q.; Li, M.; Zhen, J.; Xu, C.; Yin, S.; Cui, Q.; Zhou, M.; et al. Salmon origin traceability based on hyperspectral imaging data fusion strategy and improved deep learning method. Food Control 2024, 166, 110740. [Google Scholar] [CrossRef]
  18. Minglana, J.; Tobias, R.R.; Roxas, R.E. Artificial intelligence applications in quality management systems: A bibliometric study. In Proceeding of the TENCON 2021—2021 IEEE Region 10 Conference (TENCON), Auckland, New Zealand, 7–10 December 2021; pp. 947–952. [Google Scholar] [CrossRef]
  19. ISO 19011:2018; Guidelines for Auditing Management Systems. International Organization for Standardization (ISO): Geneva, Switzerland, 2018.
  20. Codex Alimentarius Commission. General Principles of Food Hygiene: CXC 1-1969; FAO/WHO: Roma, Italy, 2020. [Google Scholar]
  21. ISO 22005:2007; Traceability in the Feed and Food Chain—General Principles and Basic Requirements for System Design and Implementation. International Organization for Standardization (ISO): Geneva, Switzerland, 2007.
  22. European Parliament & Council. Regulation (EC) No 178/2002 of 28 January 2002 laying down the general principles and requirements of food law. Off. J. Eur. Communities 2002, L31, 1–24. [Google Scholar]
  23. Zhao, J.; Yu, Y.; Lu, S.; Huang, Y.; Yu, X.; Mao, X.; Yu, Y.; Li, Z.; Liu, H. Convolutional neural networks in the realm of food quality and safety evaluation: Current achievements and future prospects. Trends Food Sci. Technol. 2025, 163, 105162. [Google Scholar] [CrossRef]
  24. Shehzad, K.; Ali, U.; Munir, A. Computer Vision for Food Quality Assessment: Advances and Challenges. Glob. J. Mach. Learn. Comput. 2025, 1, 76–92. [Google Scholar] [CrossRef]
  25. Peres, F.A.P.; Bondarczuk, B.A.; Gomes, L.d.C.; Jardim, L.d.C.; Corrêa, R.G.d.F.; Baierle, I.C. Advances in Food Quality Management Driven by Industry 4.0: A Systematic Review-Based Framework. Foods 2025, 14, 2429. [Google Scholar] [CrossRef]
  26. El Sakka, M.; Ivanovici, M.; Chaari, L.; Mothe, J. A Review of CNN Applications in Smart Agriculture Using Multimodal Data. Sensors 2025, 25, 472. [Google Scholar] [CrossRef]
  27. Yang, C.; Guo, Z.; Fernandes Barbin, D.; Dai, Z.; Watson, N.; Povey, M.; Zou, X. Hyperspectral Imaging and Deep Learning for Quality and Safety Inspection of Fruits and Vegetables: A Review. J. Agric. Food Chem. 2025, 73, 10019–10035. [Google Scholar] [CrossRef]
  28. Wu, D.; Sun, D.W. Hyperspectral Imaging Technology: A Nondestructive Tool for Food Quality and Safety Evaluation and Inspection. In Advances in Food Process Engineering Research and Applications. Food Engineering Series; Yanniotis, S., Taoukis, P., Stoforos, N., Karathanos, V., Eds.; Springer: Boston, MA, USA, 2013; pp. 581–606. [Google Scholar] [CrossRef]
  29. Belchior, V.; Botelho, B.G.; Franca, A.S. Comparison of Spectroscopy-Based Methods and Chemometrics to Confirm Classification of Specialty Coffees. Foods 2022, 11, 1655. [Google Scholar] [CrossRef]
  30. de Carvalho Couto, C.; Freitas-Silva, O.; Morais Oliveira, E.M.; Sousa, C.; Casal, S. Near-Infrared Spectroscopy Applied to the Detection of Multiple Adulterants in Roasted and Ground Arabica Coffee. Foods 2022, 11, 61. [Google Scholar] [CrossRef]
  31. Boadu, V.G.; Teye, E.; Amuah, C.L.Y.; Lamptey, F.P.; Sam-Amoah, L.K. Portable NIR Spectroscopic Application for Coffee Integrity and Detection of Adulteration with Coffee Husk. Processes 2023, 11, 1140. [Google Scholar] [CrossRef]
  32. Wójcicki, K. Near-infrared spectroscopy as a green technology to monitor coffee roasting. Foods Raw Mater. 2022, 10, 295–303. [Google Scholar] [CrossRef]
  33. Páscoa, R.N.M.J.; Sarraguça, M.C.; Magalhães, L.M.; Santos, J.R.; Rangel, A.O.S.S.; Lopes, J.A. Chapter 103—Use of Near-Infrared Spectroscopy for Coffee Beans Quality Assessment. In Coffee in Health and Disease Prevention; Academic Press: Cambridge, MA, USA, 2015; pp. 933–942. [Google Scholar] [CrossRef]
  34. Muruganandham, R.; Venkatesh, K.; Devadasan, S.R.; Harish, V. TQM through the integration of blockchain with ISO 9001:2015 standard based quality management system. Total Qual. Manag. Bus. Excell. 2022, 34, 291–311. [Google Scholar] [CrossRef]
  35. Rajkumar, P.; Wang, N.; EImasry, G.; Raghavan, G.S.V.; Gariepy, Y. Studies on banana fruit quality and maturity stages using hyperspectral imaging. J. Food Eng. 2012, 108, 194–200. [Google Scholar] [CrossRef]
  36. Wang, Z.; Erasmus, S.W.; Liu, X.; van Ruth, S.M. Study on the Relations between Hyperspectral Images of Bananas (Musa spp.) from Different Countries, Their Compositional Traits and Growing Conditions. Sensors 2020, 20, 5793. [Google Scholar] [CrossRef]
  37. Wang, G.; Gao, Y.; Xu, F.; Sang, W.; Han, Y.; Liu, Q. A Banana Ripeness Detection Model Based on Improved YOLOv9c Multifactor Complex Scenarios. Symmetry 2025, 17, 231. [Google Scholar] [CrossRef]
  38. Chang, S.-J.; Huang, C.-Y. Deep Learning Model for the Inspection of Coffee Bean Defects. Appl. Sci. 2021, 11, 8226. [Google Scholar] [CrossRef]
  39. Adiwijaya, N.O.; Sarno, R.; Wijaya, D.R. Real Time Detection of Coffee Bean Defects Using YOLO Method and SAHI (Slicing Aided Hyper Inference) Framework. In Proceedings of the 2024 Beyond Technology Summit on Informatics International Conference (BTS-I2C), Jember, Indonesia, 19 December 2024; pp. 286–291. [Google Scholar] [CrossRef]
  40. Kang, Z.; Zhao, Y.; Chen, L.; Guo, Y.; Mu, Q.; Wang, S. Advances in Machine Learning and Hyperspectral Imaging in the Food Supply Chain. Food Eng. Rev. 2022, 14, 596–616. [Google Scholar] [CrossRef]
  41. Suárez, P.L.; Sappa, A.; Carpio, D.; Velesaca, H.; Burgos, F.; Urdiales, P. Deep Learning Based Shrimp Classification. In Advances in Visual Computing. ISVC 2022. Lecture Notes in Computer Science; Bebis, G., Li, B., Yao, A., Liu, Y., Duan, Y., Lau, M., Khadka, R., Crisan, A., Chang, R., Eds.; Springer: Cham, Switzerland, 2022; Volume 13598, pp. 36–45. [Google Scholar] [CrossRef]
  42. Wang, J.; Wang, W.; Xu, W.; An, H.; Ma, Q.; Sun, J.; Wang, J. Fusing hyperspectral imaging and electronic nose data to predict moisture content in Penaeus vannamei during solar drying. Front. Nutr. 2024, 11, 1220131. [Google Scholar] [CrossRef]
  43. Liu, H.C.; Liu, R.; Gu, X.; Yang, M. From total quality management to Quality 4.0: A systematic literature review and future research agenda. Front. Eng. Manag. 2023, 10, 191–205. [Google Scholar] [CrossRef]
  44. Kumar, P.; Bhamu, J.; Bhadu, J.; Saraswat, P. Exploring industry 4.0 technologies for sustainable development goals: A systematic literature review. Int. J. Prod. Manag. Eng. 2025, 13, 27–44. [Google Scholar] [CrossRef]
  45. American Society for Quality (ASQ). Quality 4.0. Available online: https://asq.org/quality-resources/quality-4-0 (accessed on 14 October 2025).
  46. Chiarini, A.; Cherrafi, A. Integrating ISO 9001 and Industry 4.0. An implementation guideline and PDCA model for manufacturing sector. Total Qual. Manag. Bus. Excell. 2023, 34, 1629–1654. [Google Scholar] [CrossRef]
  47. Komkowski, T.; Antony, J.; Garza-Reyes, J.A.; Tortorella, G.L.; Pongboonchai-Empl, T. A systematic review of the integration of Industry 4.0 with quality-related operational excellence methodologies. Qual. Manag. J. 2023, 30, 3–15. [Google Scholar] [CrossRef]
  48. Sony, M.; Naik, S. Industry 4.0 integration with socio-technical systems theory: A systematic review and proposed theoretical model. Technol. Soc. 2020, 61, 101248. [Google Scholar] [CrossRef]
  49. Singh, A.; Gutub, A.; Nayyar, A.; Khan, M.K. Redefining food safety traceability system through blockchain: Findings, challenges and open issues. Multimed. Tools Appl. 2023, 82, 21243–21277. [Google Scholar] [CrossRef]
  50. Galvez, J.F.; Mejuto, J.C.; Simal-Gándara, J. Future challenges on the use of blockchain for food traceability analysis. TrAC Trends Anal. Chem. 2018, 107, 222–232. [Google Scholar] [CrossRef]
  51. Qin, J.; Chao, K.; Kim, M.S.; Lu, R.; Burks, T.F. Hyperspectral and multispectral imaging for evaluating food safety and quality. J. Food Eng. 2013, 118, 157–171. [Google Scholar] [CrossRef]
  52. Liu, D.; Zeng, X.A.; Sun, D.W. Recent developments and applications of hyperspectral imaging for quality evaluation of agricultural products: A review. Crit. Rev. Food Sci. Nutr. 2015, 55, 1744–1757. [Google Scholar] [CrossRef]
  53. Wang, Y.; Zhang, C.; Li, X.; Xing, L.; Lv, M.; He, H.; Pan, L.; Ou, X. Miniaturized NIRS Coupled with Machine Learning Algorithm for Noninvasively Quantifying Gluten Quality in Wheat Flour. Foods 2025, 14, 2393. [Google Scholar] [CrossRef]
  54. Raj, A.; Dwivedi, G.; Sharma, A.; Jabbour, A.B.L.d.S.; Rajak, S. Barriers to the adoption of industry 4.0 technologies in the manufacturing sector: An inter-country comparative perspective. Int. J. Prod. Econ. 2020, 224, 107546. [Google Scholar] [CrossRef]
  55. Varbanovaa, M.; Dutra de Barcellosaa, M.; Kirovac, M.; de Steura, H.; Gellyncka, X. Industry 4.0 implementation factors for agri-food and manufacturing SMEs in Central and Eastern Europe. Serbian J. Manag. 2023, 18, 167–179. [Google Scholar] [CrossRef]
  56. World Bank. Digital Connectivity in Latin America and the Caribbean: Closing the Rural Gap; World Bank: Washington, DC, USA, 2025. [Google Scholar]
  57. Sistema Económico Latinoamericano y del Caribe—SELA. Brecha Digital y Conectividad Rural en América Latina; SELA: Caracas, Venezuela, 2024. [Google Scholar]
  58. Senoner, J.; Netland, N.; Stefan Feuerriegel, S. Using Explainable Artificial Intelligence to Improve Process Quality: Evidence from Semiconductor Manufacturing. Manag. Sci. 2022, 68, 5704–5723. [Google Scholar] [CrossRef]
  59. Hassija, V.; Chamola, V.; Mahapatra, A.; Singal, A.; Goel, D.; Huang, K.; Scardapane, S.; Spinelli, I.; Mahmud, M.; Hussain, A. Interpreting Black-Box Models: A Review on Explainable Artificial Intelligence. Cogn. Comput. 2024, 16, 45–74. [Google Scholar] [CrossRef]
  60. Sculley, D.; Holt, G.; Golovin, D.; Davydov, E.; Phillips, T.; Ebner, D.; Chaudhary, V.; Young, M.; Crespo, J.; Dennison, D. Hidden technical debt in machine learning systems. In Advances in Neural Information Processing Systems (NeurIPS); NIPS: Montreal, Canada, 2015; pp. 2503–2511. [Google Scholar]
  61. Hinder, F.; Vaquet, V.; Hammer, B. One or two things we know about concept drift—A survey on monitoring in evolving environments. Part A: Detecting concept drift. Front. Artif. Intell. 2024, 7, 1330257. [Google Scholar] [CrossRef]
  62. Cordovés-García, A.; Cordovés-Rodríguez, A.; Nuñez-Buñay, K.T.; Lastre-Aleaga, A.M.; Lorente-Leyva, L.L. Pineapple drying analysis in packing plants through computational fluid dynamics. Int. J. Des. Nat. Ecodynamics 2022, 17, 29–35. [Google Scholar] [CrossRef]
  63. Villamar Torres, R.O. Machine Learning Techniques to Enhance Management and Decision-Making in Commercial Banana Plantations (Musa AAA) in Ecuador. In IV International Congress of the Turkish Journal of Agriculture—Food Science and Technology; TURSTEP: Niğde, Türkiye, 2025; p. 633. Available online: https://www.turjaf.com/index.php/TURSTEP/article/view/499 (accessed on 14 October 2025).
  64. Pal, C.; Das, S.; Akuli, A.; Adhikari, S.K.; Dey, A. Cocoa-Net: Performance analysis on classification of cocoa beans using structural image features. Informatica 2024, 48, 41–54. [Google Scholar] [CrossRef]
  65. Arwatchananukul, S.; Xu, D.; Charoenkwan, P.; Moon, S.A.; Saengrayap, R. Implementing a deep learning model for defect classification in Thai Arabica green coffee beans. Smart Agric. Technol. 2024, 9, 100680. [Google Scholar] [CrossRef]
  66. Hao, D.; Zhang, C.; Wang, R.; Qiao, Q.; Gao, L.; Lin, R. A non-destructive deep learning–based method for shrimp freshness assessment in food processing. Processes 2025, 13, 2895. [Google Scholar] [CrossRef]
  67. Valeriano, J.M.L.; Hortinela, C.C. Classification of salmon freshness in situ using convolutional neural network. Eng. Proc. 2025, 92, 12. [Google Scholar] [CrossRef]
  68. Sabzi, S.; Abbaspour-Gilandeh, Y.; García-Mateos, G.; Ruiz-Canales, A.; Molina-Martínez, J.M.; Arribas, J.I. An automatic non-destructive method for classification of the ripeness stage of Red Delicious apples in orchards using aerial video. Agronomy 2019, 9, 84. [Google Scholar] [CrossRef]
  69. Ortiz-Rangel, D.; Rocha-Lona, L.; Bada-Carbajal, L.; Garza-Reyes, J.; Nadeem, S. Implementation of Quality Management System ISO 9001 in A Telecom Network Operation Centre—A Case Study. In Proceedings of the International Conference on Industrial Engineering and Operations Management; IEOM Society International: Singapore, 2021; pp. 1022–1030. [Google Scholar] [CrossRef]
  70. Bravi, L.; Murmura, F. Evidences about ISO 9001:2015 and ISO 9004:2018 implementation in different-size organisations. Total Qual. Manag. Bus. Excell. 2021, 33, 1366–1386. [Google Scholar] [CrossRef]
Figure 1. Experimental workflow for AI-based food quality control. The diagram represents the sequential stages of the process-level inspection pipeline aligned with the Plan–Do–Check–Act (PDCA) cycle. It outlines sample acquisition from four commodities (banana, cacao, coffee, shrimp), system setup with conveyor-based RGB, hyperspectral (400–1000 nm), and NIR devices, data preprocessing, model training and validation using deep learning architectures (CNN, YOLO, 3D CNN) and traditional machine learning algorithms (PLSR, SVM), performance evaluation, statistical validation, and mapping of results to the ISO 9001, 22000, and 22005 requirements.
Figure 1. Experimental workflow for AI-based food quality control. The diagram represents the sequential stages of the process-level inspection pipeline aligned with the Plan–Do–Check–Act (PDCA) cycle. It outlines sample acquisition from four commodities (banana, cacao, coffee, shrimp), system setup with conveyor-based RGB, hyperspectral (400–1000 nm), and NIR devices, data preprocessing, model training and validation using deep learning architectures (CNN, YOLO, 3D CNN) and traditional machine learning algorithms (PLSR, SVM), performance evaluation, statistical validation, and mapping of results to the ISO 9001, 22000, and 22005 requirements.
Processes 13 03544 g001
Figure 2. ISO-based Plan–Do–Check–Act (PDCA) alignment of the AI-driven quality control framework. The figure illustrates how the proposed multimodal system (digital, HSI, and NIRS imaging) integrates within the ISO continuous improvement cycle. Each quadrant represents a PDCA stage—Plan, Do, Check, and Act—while the central node, Digital Traceability & Auditability, highlights the generation of verifiable, time-stamped evidence that supports conformity verification and continual improvement.
Figure 2. ISO-based Plan–Do–Check–Act (PDCA) alignment of the AI-driven quality control framework. The figure illustrates how the proposed multimodal system (digital, HSI, and NIRS imaging) integrates within the ISO continuous improvement cycle. Each quadrant represents a PDCA stage—Plan, Do, Check, and Act—while the central node, Digital Traceability & Auditability, highlights the generation of verifiable, time-stamped evidence that supports conformity verification and continual improvement.
Processes 13 03544 g002
Figure 3. Original and preprocessed images with spectral feature representations across commodities. (a) Banana; (b) Cacao; (c) Coffee; (d) Shrimp. For each commodity, the first column shows the raw RGB image on the conveyor; the second shows the segmented/preprocessed version after background removal and masking; the third displays a representative hyperspectral (HSI) reflectance map (400–1000 nm) in false color with scale bar; and the fourth shows a near-infrared (NIR) reflectance map (800–2500 nm) with scale bar.
Figure 3. Original and preprocessed images with spectral feature representations across commodities. (a) Banana; (b) Cacao; (c) Coffee; (d) Shrimp. For each commodity, the first column shows the raw RGB image on the conveyor; the second shows the segmented/preprocessed version after background removal and masking; the third displays a representative hyperspectral (HSI) reflectance map (400–1000 nm) in false color with scale bar; and the fourth shows a near-infrared (NIR) reflectance map (800–2500 nm) with scale bar.
Processes 13 03544 g003
Figure 4. Representative multimodal outputs of AI-based quality inspection across commodities under semi-industrial conveyor conditions. (a) Banana: Ripeness classification using a CNN–HSI pipeline, with peel regions segmented as green, turning, and yellow (Accuracy = 97%). (b) Cacao: Pod maturity detection with a YOLOv8 object detector, showing bounding boxes and confidence scores (AUC = 0.91). (c) Coffee: Defect identification in Coffea arabica beans using a CNN–YOLO pipeline; defective beans in red, conforming ones in green (Accuracy = 92%). (d) Shrimp: Freshness mapping via HSI–CNN regression; false-color heat maps show freshness indices (R2 = 0.95). The figure illustrates how AI-driven digital, hyperspectral, and NIR imaging jointly capture surface and internal quality attributes for ISO-aligned inspection.
Figure 4. Representative multimodal outputs of AI-based quality inspection across commodities under semi-industrial conveyor conditions. (a) Banana: Ripeness classification using a CNN–HSI pipeline, with peel regions segmented as green, turning, and yellow (Accuracy = 97%). (b) Cacao: Pod maturity detection with a YOLOv8 object detector, showing bounding boxes and confidence scores (AUC = 0.91). (c) Coffee: Defect identification in Coffea arabica beans using a CNN–YOLO pipeline; defective beans in red, conforming ones in green (Accuracy = 92%). (d) Shrimp: Freshness mapping via HSI–CNN regression; false-color heat maps show freshness indices (R2 = 0.95). The figure illustrates how AI-driven digital, hyperspectral, and NIR imaging jointly capture surface and internal quality attributes for ISO-aligned inspection.
Processes 13 03544 g004
Figure 5. Confusion matrix for banana ripeness classification using the CNN–HSI model. The heatmap shows the predicted versus actual ripeness stages (green: green, turning; yellow: turning; export-ready). Darker diagonal cells indicate correct classifications, confirming the model’s high accuracy (97%) and balanced performance.
Figure 5. Confusion matrix for banana ripeness classification using the CNN–HSI model. The heatmap shows the predicted versus actual ripeness stages (green: green, turning; yellow: turning; export-ready). Darker diagonal cells indicate correct classifications, confirming the model’s high accuracy (97%) and balanced performance.
Processes 13 03544 g005
Figure 6. ROC curve for banana ripeness classification using the CNN–HSI model (AUC = 0.98). The curve illustrates the trade-off between sensitivity and specificity, confirming excellent but not perfect discrimination under semi-industrial conditions.
Figure 6. ROC curve for banana ripeness classification using the CNN–HSI model (AUC = 0.98). The curve illustrates the trade-off between sensitivity and specificity, confirming excellent but not perfect discrimination under semi-industrial conditions.
Processes 13 03544 g006
Figure 7. Confusion matrix for cacao pod maturity classification using the YOLO–CNN model. The plot shows the predicted versus actual maturity levels (immature, mid-ripe, ripe). Diagonal dominance confirmed strong classification capability (88% accuracy) under heterogeneous field conditions.
Figure 7. Confusion matrix for cacao pod maturity classification using the YOLO–CNN model. The plot shows the predicted versus actual maturity levels (immature, mid-ripe, ripe). Diagonal dominance confirmed strong classification capability (88% accuracy) under heterogeneous field conditions.
Processes 13 03544 g007
Figure 8. ROC curve for cacao pod maturity classification using the YOLO–CNN model (AUC = 0.91). The curve demonstrates reliable discrimination among maturity stages under field conditions, indicating high but realistic classification performance.
Figure 8. ROC curve for cacao pod maturity classification using the YOLO–CNN model (AUC = 0.91). The curve demonstrates reliable discrimination among maturity stages under field conditions, indicating high but realistic classification performance.
Processes 13 03544 g008
Figure 9. Confusion matrix for coffee bean defect detection using the CNN–YOLO pipeline. The figure visualizes the classification outcomes for defective and non-defective beans. High diagonal intensity indicates accurate defect recognition (92% accuracy) and reliable discrimination.
Figure 9. Confusion matrix for coffee bean defect detection using the CNN–YOLO pipeline. The figure visualizes the classification outcomes for defective and non-defective beans. High diagonal intensity indicates accurate defect recognition (92% accuracy) and reliable discrimination.
Processes 13 03544 g009
Figure 10. ROC curve for coffee bean defect detection using the CNN–YOLO pipeline (AUC = 0.94). The curve confirms the model’s strong discriminative ability without implying perfect separation between classes.
Figure 10. ROC curve for coffee bean defect detection using the CNN–YOLO pipeline (AUC = 0.94). The curve confirms the model’s strong discriminative ability without implying perfect separation between classes.
Processes 13 03544 g010
Figure 11. Confusion matrix for shrimp freshness classification using the HSI–NIRS–CNN model. The heatmap shows the predicted versus actual freshness categories (fresh vs. less fresh). The concentration of values along the diagonal indicates excellent detection consistency (95% accuracy) for real-time monitoring.
Figure 11. Confusion matrix for shrimp freshness classification using the HSI–NIRS–CNN model. The heatmap shows the predicted versus actual freshness categories (fresh vs. less fresh). The concentration of values along the diagonal indicates excellent detection consistency (95% accuracy) for real-time monitoring.
Processes 13 03544 g011
Figure 12. ROC curve for shrimp freshness classification using the HSI–NIRS–CNN model (AUC = 0.96). The curve displays excellent discrimination between freshness categories while maintaining realistic sensitivity–specificity trade-offs.
Figure 12. ROC curve for shrimp freshness classification using the HSI–NIRS–CNN model (AUC = 0.96). The curve displays excellent discrimination between freshness categories while maintaining realistic sensitivity–specificity trade-offs.
Processes 13 03544 g012
Figure 13. Comparative performance of AI-based quality classification across commodities. The bar chart displays the main classification metrics—accuracy, sensitivity, specificity, and precision (%)—for banana, cacao, coffee, and shrimp. The comparison highlights consistently high performance across all models, with accuracy above 88% and specificity ≥90% in every case, confirming the robustness and generalizability of the proposed framework.
Figure 13. Comparative performance of AI-based quality classification across commodities. The bar chart displays the main classification metrics—accuracy, sensitivity, specificity, and precision (%)—for banana, cacao, coffee, and shrimp. The comparison highlights consistently high performance across all models, with accuracy above 88% and specificity ≥90% in every case, confirming the robustness and generalizability of the proposed framework.
Processes 13 03544 g013
Table 1. Summary of samples and stratification.
Table 1. Summary of samples and stratification.
CommodityUnit of AnalysisClasses/StrataTotal NDistribution
per Class/Stratum
Lots/Batches (Traceability)
Bananas (Musa AAA)FruitRipeness: green/turning/yellow/export-ready36090/90/90/906 lots (2 provinces × 3 packing houses)
Cacao (Theobroma cacao)—podsPodMaturity: immature/mid-ripe/fully ripe21070/70/706 lots (3 farms × 2 harvest dates)
Cacao—beansIndividual beanVarietal authentication (binary)900450/4506 post-harvest fermentation lots
Coffee (Coffea arabica)Individual beanDefect vs. non-defect (binary)24001200/12008 lots (4 cooperatives × 2 weeks)
Shrimp (Penaeus vannamei)Individual specimenFresh vs. semi-dried (binary)480240/2406 lots (3 plants × 2 shifts)
Table 2. Stratified dataset splits (70% train, 15% validation, 15% test).
Table 2. Stratified dataset splits (70% train, 15% validation, 15% test).
CommodityTrainValidationTestApprox. Distribution per Class (Stratified)
Bananas (360)2525454Per class (90): 63/13/14
Cacao—pods (210)1473132Per class (70): 49/10/11
Cacao—beans (900)630135135Per class (450): 315/67/68
Coffee (2400)1680360360Per class (1200): 840/180/180
Shrimp (480)3367272Per class (240): 168/36/36
Table 3. Equipment specifications for digital (RGB) imaging and spectral sensing.
Table 3. Equipment specifications for digital (RGB) imaging and spectral sensing.
DeviceParameterSpecification
Conveyor system Length1.0 m (adjustable speed up to 1.05 m/s)
ControlCalibrated for a balance between throughput and exposure to minimize motion blur
RGB cameraResolution1920 × 1080 px (≈12 MP equivalent)
SensorCMOS sensor
Frame rate30 fps
Mounting50 cm above conveyor
Illumination SourceDual LED lamps
Power2 × 100 W
Color temperature≈5500 K (daylight)
AccessoriesDiffusers to ensure uniform illumination
Hyperspectral imaging (HSI) TypePush-broom line-scan system
Spectral range400–1000 nm
Spectral resolution≈2.8 nm
Number of bands224
OpticsAdjustable fore-optic lens, synchronized with conveyor motion
Near-infrared spectroscopy (NIRS) Range800–2500 nm
Spectral resolution≈10 nm
Measurement modePortable, spot acquisition
Replicates3 replicate scans per sample averaged
Calibration Reference standardsWhite (Spectralon®) and dark references before each session
CorrectionsReflectance normalization, geometric alignment, and illumination correction
Table 4. Motion-artifact control and synchronization parameters (examples at two belt speeds).
Table 4. Motion-artifact control and synchronization parameters (examples at two belt speeds).
ParameterSymbolValue @ 0.50 m/sValue @ 1.00 m/sNotes
Cross-track FOV/pixelsFOV/ N 300 mm/1024 px300 mm/1024 pxFixed geometry
Ground sampling (x) G S D x 0.293 mm/px0.293 mm/px F O V / N
Target along-track sampling G S D y ≈0.293 mm/px≈0.293 mm/pxSquare pixels
Required HSI line rate f line ≥1706 lines/s≥3413 lines/s v / G S D y
Max integration time (¼ px blur) t int , max ≤147 µs≤73 µs 0.25 G S D y / v
RGB exposure (¼ px blur) t RGB ≤147 µs≤73 µsGlobal shutter + strobe
Spectral setting224 bands (std)112–224 bands2× binning if needed
Trigger sourceEncoder (HW)Encoder (HW)One line/0.29 mm
Table 5. Methodological summary of AI-based quality control across commodities.
Table 5. Methodological summary of AI-based quality control across commodities.
ProductTechnique AppliedVariables AnalyzedAI ModelKey Metrics
BananaRGB imaging + HSIRipeness stage, surface color, firmnessCNN, spectral–spatial CNNAccuracy, Precision, Recall
CacaoRGB imaging + NIRS/HSIPod maturity, bean composition, and hybrid authenticationYOLO, CNN, PLSR chemometricsAccuracy, Precision, Specificity
CoffeeRGB imaging + NIRSMorphological defects, processing method, and adulterationCNN, YOLO, PLSR/SVMAccuracy, Confusion Matrix, R2 (spectroscopy)
ShrimpHSI + NIRS + RGB imagingMoisture, freshness, texture, and color changes3D CNN, PLSR, SVMR2, RMSE, Accuracy, Sensitivity/Specificity
Table 6. Performance metrics for banana classification.
Table 6. Performance metrics for banana classification.
MetricValue95% CI
Accuracy97%(94–100)
Sensitivity96%(91–100)
Specificity98%(95–100)
Precision100%(97–100)
Table 7. Performance metrics for cacao classification.
Table 7. Performance metrics for cacao classification.
MetricValue95% CI
Accuracy88%(84–92)
Sensitivity86%(81–91)
Specificity90%(85–94)
Precision89%(84–93)
Table 8. Performance metrics for coffee defect detection.
Table 8. Performance metrics for coffee defect detection.
MetricValue95% CI
Accuracy92%(88–96)
Sensitivity90%(85–95)
Specificity94%(90–98)
Precision94%(89–97)
Table 9. Performance metrics for shrimp freshness classification.
Table 9. Performance metrics for shrimp freshness classification.
MetricValue95% CI
Accuracy95%(92–98)
Sensitivity93%(88–97)
Specificity97%(93–100)
Precision96%(92–99)
Table 10. Comparative summary of AI-based classification performance across commodities.
Table 10. Comparative summary of AI-based classification performance across commodities.
ProductAccuracySensitivitySpecificityPrecision
Banana97%96%98%100%
Cacao88%86%90%89%
Coffee92%90%94%94%
Shrimp95%93%97%96%
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

Sánchez-Rodríguez, A.; Ullrich-Estrella, R.D.; González-Gallardo, C.E.; Jácome-Villacres, M.B.; García-Vidal, G.; Pérez-Campdesuñer, R. Deep Learning-Based Digital, Hyperspectral, and Near-Infrared (NIR) Imaging for Process-Level Quality Control in Ecuador’s Agri-Food Industry: An ISO-Aligned Framework. Processes 2025, 13, 3544. https://doi.org/10.3390/pr13113544

AMA Style

Sánchez-Rodríguez A, Ullrich-Estrella RD, González-Gallardo CE, Jácome-Villacres MB, García-Vidal G, Pérez-Campdesuñer R. Deep Learning-Based Digital, Hyperspectral, and Near-Infrared (NIR) Imaging for Process-Level Quality Control in Ecuador’s Agri-Food Industry: An ISO-Aligned Framework. Processes. 2025; 13(11):3544. https://doi.org/10.3390/pr13113544

Chicago/Turabian Style

Sánchez-Rodríguez, Alexander, Richard Dennis Ullrich-Estrella, Carlos Ernesto González-Gallardo, María Belén Jácome-Villacres, Gelmar García-Vidal, and Reyner Pérez-Campdesuñer. 2025. "Deep Learning-Based Digital, Hyperspectral, and Near-Infrared (NIR) Imaging for Process-Level Quality Control in Ecuador’s Agri-Food Industry: An ISO-Aligned Framework" Processes 13, no. 11: 3544. https://doi.org/10.3390/pr13113544

APA Style

Sánchez-Rodríguez, A., Ullrich-Estrella, R. D., González-Gallardo, C. E., Jácome-Villacres, M. B., García-Vidal, G., & Pérez-Campdesuñer, R. (2025). Deep Learning-Based Digital, Hyperspectral, and Near-Infrared (NIR) Imaging for Process-Level Quality Control in Ecuador’s Agri-Food Industry: An ISO-Aligned Framework. Processes, 13(11), 3544. https://doi.org/10.3390/pr13113544

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