The program follows these main steps:
- Data Preparation: It starts with organizing the data into folders where each category has training and validation subfolders containing images of specific products.
- Feature Extraction: Utilizes Histogram of Oriented Gradients (HoG) for feature extraction from images in the training folders of each category.
- Model Training: Applies Support Vector Machine (SVM) machine learning classifier using the extracted features for training.
- Model Evaluation: Tests the trained model using images from the validation folders of each category and computes validation accuracy.
The initial model suffered from overfitting, evident from the 100% training accuracy and lower validation accuracy (86%). To mitigate this issue, the following steps were taken:
- Data Augmentation: Techniques like data augmentation were applied to increase the diversity of training data, thereby reducing overfitting.
- Cross Validation: Employed cross-validation techniques to ensure the model's generalizability and robustness.
- Parameter Tuning: Explored various SVM parameters to optimize the model's performance.
After implementing the aforementioned strategies, the validation accuracy increased to 89%, indicating improved performance in classifying products. However, issues with training accuracy still persist and require further investigation and refinement.
Product Classification /: Contains the dataset organized into categories with training and validation images.main.py/: Source code for the product classification program .controlledAugmentation.py: Script for augmenting dataset using specified values for each augmentation property.randomAugmentation.py: Script for augmenting dataset randomly -hopefully it results a good accuracy-.program.png: image for the program after running it.README.md: Overview and instructions for the repository.
- Ensure Python and required libraries are installed.
- Organize your dataset into categories with training and validation subfolders.
- Run the scripts in the
main.py/.
- Python (version >= 3.0)
- OpenCV
- scikit-learn
- NumPy
- tkinter
- Mohamed Amir
- Ahmed Abdelaziz
This project is licensed under the MIT License.
