Date of Submission:
19/05/2025
Project Title: Fruit Classification Project
Documentation
Course Title: CS-504
Course Code: Digital Image Processing(DIP)
Submitted To:
Sir Muhammad Ismail
Submitted By:
Muhammad Rizwan
AG No: 2021-ag-7823
M Hammad Akhtar
AG No: 2021-ag-7740
Zohaib Maqsood
AG No: 2021-ag-7831
Ahmad Iqbal
AG No: 2021-ag-7899
Project Title: Fruit Classification Project
Documentation
Objectives
To classify fruit images into different categories (Apple, Banana, Orange) using
extracted features and machine learning models, and to evaluate model
performance.
Key Features
This project focuses on building a fruit classification system using a dataset of fruit
images. Images were collected, categorized, and manually labeled with specific
features. Three machine learning models (Decision Tree, K-Nearest Neighbors, and
Support Vector Machine) were trained and evaluated.
Code Implementation
The dataset consists of three categories: Apple, Banana, Orange.
Each category contains 35-40 images.
Images were renamed sequentially and organized in separate folders per
category.
Features labeled for each image:
Is_Round
Color_Red
Is_Elongated
Peel_Texture_Visible
Labels are encoded as 1 (feature present), -1 (feature absent), 0
(uncertain).
5. Tools and Technologies Used
Python (Pandas, scikit-learn)
Jupyter Notebook / Google Colab
Microsoft Excel (for dataset labeling)
Image dataset collected manually or via web search
6. Methodology
Step 1: Dataset Preparation
Images collected and placed in folders named after categories.
Images renamed sequentially ([Link], [Link], ...).
1
Created an Excel sheet with image names, categories, and manually
labeled features.
Step 2: Feature Extraction
Basic image features manually labeled based on visual characteristics.
Step 3: Model Training
Loaded labeled dataset into Jupyter Notebook.
Split data into training and testing sets.
Trained three classifiers:
o Decision Tree
o K-Nearest Neighbors (KNN)
o Support Vector Machine (SVM)
Step 4: Model Evaluation
Evaluated model accuracy on the test set.
Compared results to select the best performing model.
7. Results
Accuracy
Model
(%)
Decision
95.83
Tree
KNN 91.67
SVM 95.83
The Decision Tree and SVM models showed the highest accuracy of
95.83%.
8. Conclusion
The project successfully classified fruit images into three categories with high
accuracy using simple manually labeled features and traditional machine learning
models. This demonstrates the effectiveness of feature-based image classification
and machine learning algorithms.
9. Future Work
Automate feature extraction using advanced image processing or deep
learning.
Expand dataset with more fruit categories and images.
2
Implement real-time fruit classification using a camera.
10. Code
Click here to view the Colab notebook.
[Link]
uDsJISyWsonYhENNs?usp=sharing
Output: