End-to-End Pre-Harvest Apple Quality Grading System Using Computer Vision and Deep Learnin

Firas Tlili
Published

0
  • Project creator

Project Description

Apple Grading System is an end-to-end intelligent solution for automated apple quality assessment before harvest. It leverages computer vision and deep learning to detect apples in images, classify their health condition, extract visual features, and assign standardized quality grades through a user-friendly web interface.

The system follows a multi-stage pipeline where input images are processed using a fine-tuned YOLOv8 model for apple detection. Each detected apple is cropped and passed to a ResNet18-based classifier to identify diseases such as blotch, rot, and scab, or determine if the fruit is healthy. Additional image processing techniques are applied to extract key visual features like color quality and size estimation.

A rule-based grading engine combines classification results with extracted features (e.g., redness, uniformity, and size) to assign grades (A, B, or C), reflecting the overall quality of each apple. The final output includes annotated images, detailed per-apple analysis, and aggregated grading summaries.

The backend is built with FastAPI, providing RESTful endpoints for single and batch image analysis, while efficiently handling asynchronous uploads and model inference. Results are stored in a SQLite database using SQLAlchemy, enabling persistent history tracking and quick retrieval of past analyses.

On the frontend, a React-based single-page application offers an interactive experience with features such as drag-and-drop uploads, batch processing, visual result dashboards, history management, and PDF export capabilities.

The system is designed for scalability and deployment flexibility, with trained models exported in multiple formats including PyTorch, ONNX, TensorFlow, and TFLite for cross-platform compatibility.

Overall, this project demonstrates a complete AI-powered pipeline that integrates machine learning, backend services, and modern frontend development to deliver a practical agricultural quality control solution.