Git Product home page Git Product logo

historical-building-recognition-system's Introduction

Historical-Building-Recognition-System

This historical building recognition system can perform classification of the historical buildings in Malacca, Malaysia. The model is trained with images of three historical buildings, namely Stadhuys, St Paul Church, and A'Famosa. The images are taken from different angles and at different times of a day.

Data description

The input data for this project are 3 historical buildings in Malacca, which consist of A'Famosa, Stadhuys, and St. Paul Church. The pictures are taken at multiple angle, day, time and weather. The pictures are taken once per week and at 3 different times to capture the different variations of lighting and weather for 3 weeks.

A'Famosa Stadhuys St Paul Church
AFamosa Stadhuys StPaul

Experiment setup

The total number of pictures collected is 162, each building consists of 54 pictures. The pictures are cropped to extract the area of interest and then resized to 100x100. All 162 cropped and resized pictures are then separated to training and testing set at 114 and 48 respectively.

Description of design & implementation

Preprocessing

flowchart1

  1. Classify the images collected from Week 1 to Week 3 into 3 folders, which are A Famosa, Stadhuys and St Paul Church.
  2. Rename all of the images, with the prefix 1 representing A Famosa, 2 representing Stadhuys and 3 representing St Paul Church. We used a program called Bulk Rename Utility to rename all of the images with their respective prefixes.
  3. Crop the ROI using a program called BatchCrop and resized it to 100 * 100 pixels.
  4. Put all of the resized images into a folder called Data.

Import images

flowchart2

  1. Import all of the images from the ‘Data’ folder and they will be converted using a for loop in the program. All of the data will be kept in an array.
  2. Convert the array into a numpy array so that we can see the shape of it.
  3. Reshape the numpy array into (162,10000).
  4. Save the reshaped numpy array into image.txt.

Feature extraction using PCA

flowchart3

  1. Load the images and labels from ‘image.txt’ and ‘label.txt’ respectively.
  2. Split the data into training and testing set. Set the random state as 42 to make sure the splitting is always the same everytime the program is run.
  3. Extract the top 50 eigenfaces from the dataset.
  4. Project the input data on the eigenface orthonormal basis.
  5. Observe the intraclass and interclass distance. Intraclass distance is the distance between two points in the same class. Interclass distance is the distance between two points in different classes.

Classification

flowchart4

  1. Use StandardScaler to scale the data.
  2. Apply transformation to data.
  3. Create a model (NN, SVC, KNN) with 3 hidden layers. Fit the training data to the model to train the model.
  4. Observe the classification report and confusion matrix. The accuracy is stated in the classification report.

Authors

Joey Lim, Y.F.,Tan.

Others

This project is made for my TPR 2251 Pattern Recognition subject. The original program of this assignment is modified and updated.

historical-building-recognition-system's People

Contributors

joeylim0328 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.