This project presents an Automated Visual Inspection System designed to classify and sort fruits—apples, bananas, and oranges—into "Fresh" or "Rotten" categories using computer vision and a robotic arm (MechARM 270 Pi). Developed as a practical solution to reduce human error in fruit quality control, the system leverages image processing, machine learning (KNN), and robotic motion to automate the sorting process.
⚠️ To successfully run and test this project, you will need hardware equipment alongside the software setup.
- MechARM 270 Pi with AI Kit 2023
- High-resolution Camera with consistent lighting
- 5 Sorting Bins
- Suction Pump (or adaptive gripper for better handling)
- Fruits (apples, bananas, oranges)
- Python 3.x
- OpenCV
- Scikit-learn
- pymycobot (for robotic arm communication)
-
Clone the Repository
git clone https://github.com/Chaahna/Automated-Visual-Inspection-System-with-ML-and-CV cd Automated-Visual-Inspection-System-with-ML-and-CV -
Install Dependencies
pip install -r requirements.txt
-
Connect and Calibrate Hardware
- Mount the camera above the fruit placement area.
- Connect the MechARM via USB or serial.
- Ensure suction pump or gripper is responsive.
-
Run the Program Open and run the main script via Colab or locally.
👉 Colab Notebook
- Sourced from Kaggle: Fruits Fresh and Rotten
- Categories: Fresh/Rotten Apples, Bananas, and Oranges
- Images resized to 100x100 and normalized
- Classification Algorithm: K-Nearest Neighbors (KNN), k=3
- Feature Extraction:
- Color (HSV histograms)
- Texture (Laplacian variance)
- 📹 Watch Demo on YouTube
- Snapshot below shows successful classification and robotic action in real time.
For detailed methodology, system architecture, results, and future enhancements, please refer to the full project report PDF available in this repository:
📘 Chaahna_Course Project Report CIS 496K.pdf
- Use adaptive grippers for better fruit handling
- Explore deep learning models for higher classification accuracy
- Expand dataset for more fruit categories