Skip to content

sahilrider/Machine-Vision-Challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine-Vision-Challenge

This Machine Learning Challenge was given from TTH unit by TCS. There were four sub challenges. They are:

  1. Floor cleanliness index
  2. Flower freshness index
  3. Container filled index
  4. Baggage fitment index

I have attempted to solve two challenges which are Flower freshness index and Baggage fitment index.


Flower Freshness Index

Problem Statement

In Hotels, flowers are kept in flowerpots to create ambient experience. This looks good till the flowers are fresh. When flowers are wilted, the effect is reversed.. So it is important to check the freshness and keep it changed to retain the high level customer experience. This manual task can be automated using machine vision. Continuous monitoring can be done using camera feed instead of random checks carried by human.
For challenge purpose, consider set of flowers and confirm the freshness index

Approach

  • For this challenge a scraped various types of flowers image from google.
  • I divided entire image into two classes fresh and wilted and three sets which are train, validation and test set.
  • I built a CNN model which is then trained on train data and validated on the validation dataset.
  • After hyperparameter tuning, I tried my best to reduce overfitting.
  • Further, Model is tested on the test data and prediction was made.

Model

Result

Training Set Accuracy : 85.03%
Validation Set Accuracy : 83.99%
Test Set Accuracy : 77.5%

Testing Project

Method 1 : On Google Colab

  • Unzip the data file
  • Upload whole folder to google drive
  • Open notebook using Google Colab
  • Turn on GPU acceleration
  • Run the notebook

Method 2 : Using Anaconda

  • Install all dependencies
  • Unzip data file
  • Launch Jupyter Notebook using Anaconda navigator
  • Run the notebook

Baggage Fitment Index

Problem Statement

Normally overhead cabins in the aircraft are constrained by dimensions. So oversized baggage creates a lot of problems including delay when they are allowed to board the cabin. So before onboarding the passenger, baggage needs to be measured and indicate the customer to drop to luggage section. Few airports have physical model to do this task of fitment check. However it is cumbersome and time consuming, so it is advisable to use machine vision techniques so that customer need not do any additional task, thus creating superior customer experience.
For this challenge, assume two views of the camera are available.

Approach

For solving this problem it is assumed that there are two views of the camera which are perpendicular to each other. Let us assume there is a scenario where luggages are passed and two perpendicular views of the luggage is captured. Now for measuring the dimension, we have taken a reference object whose dimensions are already known. Now as we know the dimension of the reference object, other's dimensions can be calculated wrt to that.
To solve this problem, I have used opencv.

  • First I applied Canny edge detection on the image.
  • Found all the contours from the image
  • Assumed the leftmost contour to be reference object and calculated pixelsPerMetric metric to calculate the dimensions.
  • Calculated dimensions of all other contours.
  • Assuming the baggage to be the largest object in the image. Dimensions of largest one is returned.
  • From two images now we will have all the dimensions needed.
  • These dimensions can be compared with the original constraints to see the baggage will fit or needs to be dropped.

Result

Original Dimension : 18 x 6 x 5.5
Observed Dimension : 18.88 x 6.52 x 6.14

Result can be improved by adding margin of error to the reference object.

Testing Project

  • Install all dependencies
  • Write python final.py in command prompt, or
  • Run the notebook using Anaconda

End Notes

Both challenges were solved in a span of 7 days. For increasing accuracy more time needs to be invested. All above mentioned projects are good and can be taken as a capstone project and they will yield good results.

About

Winning Solution of Machine Vision Challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published