https://github.com/rydzze/objectverifier
Project for Pattern Recognition
https://github.com/rydzze/objectverifier
django machine-learning opencv pattern-recognition python yolov8
Last synced: about 2 months ago
JSON representation
Project for Pattern Recognition
- Host: GitHub
- URL: https://github.com/rydzze/objectverifier
- Owner: rydzze
- Created: 2024-05-07T15:04:40.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T15:47:20.000Z (almost 2 years ago)
- Last Synced: 2024-07-09T20:09:15.198Z (almost 2 years ago)
- Topics: django, machine-learning, opencv, pattern-recognition, python, yolov8
- Language: Jupyter Notebook
- Homepage:
- Size: 94.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ObjectVerifier
## Original Author
This project is created and maintained by [rydzze](https://github.com/rydzze).
## Introduction
Pattern recognition is a process of using machine learning algorithms to classify input data into various objects, classes, or categories based on identifying patterns, features, or regularities within the data. This project addresses an operational challenge in a semiconductor and machine tooling contract manufacturer, which currently relies on a labour-intensive and error-prone manual stock counting process. The goal is to develop an automated parts recognition and counting system to improve stock management accuracy and efficiency. By leveraging pattern recognition techniques, the system will identify and count various parts from images, significantly reducing manual effort and errors.
## Problem Statements and Objectives
### Problem Statements
1. **Manual Stock Counting**:
- The current process is labour-intensive and prone to errors, leading to inaccuracies in stock levels and part identification.
2. **Operational Inefficiency**:
- Manual counting is time-consuming and inefficient, impacting overall operational efficiency.
3. **Error-Prone Identification**:
- Human errors in part identification can lead to mismanagement of stock and resources.
### Objectives
1. **Develop Accurate Pattern Recognition System**:
- Create a robust system for accurate part recognition and counting using PCA and machine learning models.
2. **User-Friendly Interface**:
- Implement a simple and intuitive interface for users to upload images and visualize recognition results.
3. **Integrate Advanced Counting Algorithms**:
- Use OpenCV and YOLOv8 to ensure accurate part counting and validate with various parts arrangements.
## Design Description and Implementation
The project uses PCA for dimensionality reduction and SVM and KNN for classification tasks, optimizing computational complexity and classifier efficiency. The system includes visualization of training and testing sets, comprehensive performance evaluation metrics, and model export in pickle format for easy deployment. A GUI developed with HTML, CSS, and JavaScript for the front end, and Python with the Django framework for the back end allows users to upload images and see classification results. The counting algorithm, implemented with OpenCV and YOLOv8, uses parameters like 24 epochs and image size of 1600 pixels, with training on Google Colab, ensuring effective model training and evaluation.
## Experiment Setup
High-resolution images were captured using a Canon EOS M50 Mark II and a SIGMA 50mm lens, with around 289 raw images collected for four distinct objects. A miniature studio with diverse backdrops and lighting conditions ensured effective pattern recognition. Each image was systematically tagged, and details were recorded for reproducibility. For recognition purposes, 55 images per object were selected and split into 60% training and 40% testing sets, following standard machine learning model training and testing procedures to ensure accurate system performance assessment.
## Sample Images of Objects for Recognition
Object 1
Object 2
Object 3
Object 4
## Performance Evaluation
### Support Vector Machine (SVM)
**Accuracy**: 0.875 (87.5%)
Classification Report
Confusion Matrix
Object
Precision
Recall
F1-Score
1
0.65
1.00
0.78
2
1.00
0.56
0.72
3
1.00
1.00
1.00
4
1.00
1.00
1.00
### K-Nearest Neighbours (KNN)
**Accuracy**: 0.693 (69.3%)
Classification Report
Confusion Matrix
Object
Precision
Recall
F1-Score
1
0.61
0.70
0.65
2
0.64
0.56
0.60
3
0.87
0.57
0.68
4
0.71
1.00
0.83
## User Interface


## DISCLAIMER
The counting algorithm is not fully developed as the YOLOv8 model was primarily built to detect objects. However, the best model from the training phase was exported and is available for further development. This model can serve as a foundation for enhancing the counting algorithm to achieve more accurate and reliable results in the future.
## Contributors
We'd like to give credit to the following contributors who have helped in the development of this project:
- [Muhammad Ariff Ridzlan](https://github.com/rydzze)
- [Muhammad Hafiz](https://github.com/IbnAsmuni)
- [Muhammad Sufi Kai](https://github.com/juniechuu)
- [Chew Jia Jun](https://github.com/JiaJun-Chew)
---
## [Google Drive Link](https://drive.google.com/drive/folders/1n7XPssmnlnPYAvxD96D1TJIbkQQjsiEm?usp=sharing) for Actual Project Files w/ ML Models
- **dataset.h5** can be found in `Parts Recognition` dir.
- **pca.pkl**, **svm.pkl**, and **knn.pkl** can be found in `webapp/ml_models` dir.