Skip to content

Feed Forward Neural Network model for Room classification using CNTK

Notifications You must be signed in to change notification settings

bartkowiaktomasz/microsoft-cntk-room-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Feed Forward Neural Network Room classifier for Object detection (Microsoft Image Recognition Challenge for Rooms)

This repository contains a model developed to classify the list of objects (features) such as toilet, table to one of five categories (room types): Bathroom, Bedroom, Kitchen, Living Room, Office. This is a part of the object detection architecture developed as a group project at ICL. The high-level view of the architecture is presented below:

Object detection architecture

The output from the Convolutional Neural Network contains names of regonised objects and their posistions (in JSON format) on the input image. The JSON response for the training set is then converted to two numpy arrays of size NxM and Nx1, where N is the number of training examples and M is a number of objects (features), so the second array is, in effect, a label matrix.

FFNN model

A simple feed forward neural network was created with two hidden layers created using Microsoft CNTK API. The network was trained using training dataset, validated (using cross validation) and tested on unseen subset of the data. The proportions are: 80:10:10 for training, validation and test accordingly. Test set is subtracted first from the dataset and then K-fold cross validation is used on the remaining part to be able to evaluate the performance of the model and tune the hyper-parameters. After that, the performance on unseen test set is measured. The resulting confusion matrix can be seen below:

Confusion matrix for the FFNN

Input:

  • features (Data/object_result.dat)
  • labels (Data/types_result.dat)

features is a matrix of size NxM where N is a number of samples and M is the number of features (objects, i.e. lamp, table) whereas labels is a vector of size Nx1 and contains labels or numbers representing particular room type.

Output:

  • K classification models to be used in the web application (each model is created for each fold)
  • Confusion matrix for K-fold cross valuation

Dependencies

  • matplotlib 1.5.3
  • seaborn 0.8.1
  • numpy 1.14
  • cntk 2.3.0
  • easydict 1.6
  • Pillow 4.3.0
  • utils 0.9.0
  • PyYAML 3.12

Use

  1. To allow the program to execute you might be asked to set the environment variable KMP_DUPLICATE_LIB_OK to TRUE by: export KMP_DUPLICATE_LIB_OK=TRUE
  2. Run the script with python3 FFNN_classificator.py

About

Feed Forward Neural Network model for Room classification using CNTK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages