Lab Assignment 3 - GeoSnipes/Big-Data GitHub Wiki
5-2 15 Naga Venkata Satya Pranoop Mutha
5-2 23 Geovanni West
Use the project dataset for Image Classification or Object Detection Problem. Handle fuzzy classification/ object detection task using at least two classification algorithms (e.g., Decision Tree, Random Forest, Naïve Bayes). Report the accuracy and confusion matrix obtained.In the Wiki Page, include a brief description of your dataset and your approach and results for image classification.
Decision Trees (DTs) are a form of non-parametric supervised learning method used in classification and regression machine learning. The main objective is to develop a model that predicts the value of a target variable by learning simple decision rules inferred from the data features.
Random forests use forms an ensemble technique for either classification or regression problems. They operate by creating numerous decision tree and give you the best tree with the best result.
Naive Bayes classifiers are a family of simple probabilistic classifiers based on applying Bayes theorem with strong independence assumptions between the features.
A confusion matrix is a tabular representation of the performance of a classification model on a set of test data for which the true values are known.
First, we ran our feature extraction on our three categories of training images: pizza, fries, and hamburgers. These categories are just a small sample of what will be in our final project
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/Categories.png?raw=true)
And these produced this features file.
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/features.jpg?raw=true)
We then ran our object detection program on our sample video. It successfully found the images and showed them in a box. An example of object detection is:
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/pizza2.png?raw=true)
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/fries2.png?raw=true)
Now we ran the decision tree model and confusion matrix and accuracy was generated based on our model.
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/Dec%20Tree.png?raw=true)
Now we ran the random forrest model and confusion matrix and accuracy was generated based on our model.
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/RFconfusionmatrix.jpg?raw=true)
Now we ran the naive bayes model and confusion matrix and accuracy was generated based on our model.
![](https://github.com/GeoSnipes/Big-Data/raw/master/lab_assignments/Lab%203/FuzzyImageClassificationScala/Documentation/NBconfusionmatrix.jpg?raw=true)
Note: Models need a lot more training data to actually produce a good accuracy rating. Based on our dataset, based on our dataset, the accuracies given are not acceptable. A lot more training dataset is needed.
Clarifai API: This is a powerful visual recognition API. Its main features are:
- Automatically tag our images and video by content. It searches and analyzes our visual data without relying on additional text descriptions.
- We can even find similar images too.
To generate the API key for Clarifai, we go to https://www.clarifai.com/api
This is the source code in Android for calling Clarifai API:
Home Page:
Selecting Photos from Gallery or Local:
Outputs for various examples: