DOI: 10.3390/agriengineering8070264 ISSN: 2624-7402

Towards Faster and More Reliable Image-Based Quality Inspection in the Agri-Food Industry Through Optimized Data Pipelines and Neural Architectures

Elia Giacobazzi, Pietro Orlandi, Giorgia Franchini, Filippo Muzzini, Mattia Neri, Matteo Roffilli

Efficient deep learning systems are increasingly essential for automated quality inspection in the agri-food industry. This work systematically investigates the impact of optimized data-loading and augmentation pipelines on both training efficiency and predictive performance of convolutional neural networks for fruit defect classification. Benchmark experiments compare CPU-based preprocessing, multithreaded tf.data pipelines, GPU-accelerated workflows, and NVIDIA DALI, showing up to a 16× reduction in training time together with significantly improved GPU utilization. Building on these findings, the optimized pipeline is deployed on a large-scale industrial dataset comprising more than 3 million tangerine image patches. Carefully designed augmentation strategies—including geometric transformations and color perturbations—are introduced to enhance data diversity while preserving the intrinsic visual characteristics of the product. The substantial reduction in training time enables a more efficient exploration of candidate architectures through a tailored Neural Architecture Search (NAS) framework designed for resource-constrained industrial settings. The proposed framework explores internal CNN hyperparameters while preserving architectural depth to satisfy real-time inference constraints. To reduce the computational cost of NAS, a Random Forest–based performance predictor is trained on early-epoch indicators such as the F1-score and used to rapidly screen candidate models. A genetic algorithm is then employed to efficiently explore the search space and identify high-performing configurations. Experimental results demonstrate that the proposed end-to-end workflow significantly accelerates the model development cycle while maintaining or modestly improving classification accuracy. While the reductions in training time are substantial, the predictive-performance improvements observed through NAS are comparatively modest and should be interpreted primarily as evidence that the proposed framework can identify competitive configurations under industrial deployment constraints. The resulting framework provides a practical and scalable workflow for developing and deploying automated visual inspection systems in industrial agri-food production lines.

More from our Archive