Skip to content

Train a probabilistic color model to recognize recycling-bin blue color and use it to segment unseen images into blue regions.

Notifications You must be signed in to change notification settings

lmqZach/Bin-Detection

Repository files navigation

Recycling Bin Detection

File Structure

|-- ROOT
  |-- README.md
  |-- BinDetector_Report.pdf
  |-- Pipfile
  |-- requirements.txt
  |-- run_tests.py
  |-- tests
  |   |-- test_simple.py
  |   |-- testset
  |-- bin_detection
  |   |-- data
  |       |-- ```
  |   |-- roipoly
  |       |-- ```
  |       |-- bin_detector.py
  |       |-- bin_weight.npy
  |       |-- requirements.txt
  |       |-- test_bin_detector.py
  |       |-- test_roipoly.py

Report

Objective

Train a probabilistic color model to recognize recycling-bin blue color and use it to segment unseen images into blue regions.

Detailed Tasks

  1. This project utilize the pixel classification method from: https://github.com/lmqZach/Pixel-Classification

  2. Given the blue regions, detect blue recycling bins and draw a bounding box around each one. The data and starter code for this part is contained in the folder bin detection. You must implement one of the models from Pixel Classification., either Logistic Regression or Na ̈ıve Bayes or Gaussian Discriminant Analysis for color classification.

Overview:

With the increasing trend of building an environment-friendly community, col- lecting recyclables has become very impor- tant. However, finding all blue recycling bins over one road when collecting is still a problem for the human employee. People might not identify each container precisely over a long time. Hence, it will be better if we have an excellent classifier to help hu- man drivers detect the recycle bins and im- prove the efficiency of collecting recyclables. In this report, I proposed one model that can easily and quickly find and make bounding blue recycling bins. This model first uses one color classifier based on lo- gistic regression, morphological operations, and bounding area extension to identify blue recycling bins.

Screen Shot 2022-05-09 at 16 25 05

Figure 1: Overview of Training and Testing Process

Technical Approach

For this problem, other than the 3-color classification in the previous project, we want to generate a binary output to only verify whether this pixel is blue. Hence, our output is a two dimension one-hot encoder, and weight w is an 3 ∗ 2 matrix. Before training, we use roipoly function provided for generate the training labels. Suppose each image has size of (n,m) pixels and 3-RGB channels. The roipoly will generate an (n, m) matrix with each elements in it to be either 0(non blue) or 1(blue).

Algorithm

We using the following algorithm for training:

Screen Shot 2022-05-09 at 17 21 46

We use the following for algorithm to generate the boundary box:

Screen Shot 2022-05-09 at 17 27 05

When generating the box, we find that, the width of any blue recycle bin is always shorter than length. Hence, we only select the boxes with a greater value in length.

Result

For Blue Bin Detection, since we only use the train data for training weight w, we do not perform detection during training. For validation, the precision is 100%, and for test, the score is 9.5/10

Example of Segmented Color Images

Screen Shot 2022-05-09 at 17 35 38

Screen Shot 2022-05-09 at 17 35 47

Screen Shot 2022-05-09 at 17 35 57

About

Train a probabilistic color model to recognize recycling-bin blue color and use it to segment unseen images into blue regions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages