Giter Club home page Giter Club logo

imagegeolocation's Introduction

Photo Geolocation with Neural Networks

Building a neural network that predicts that can geotag an outdoor image and how to catch a cheating neural network with grad-cam

Pls checkout the medium article for a quick overview.

To train model:

python train.py

Problem Statement

Building a CNN model geotag an image - take an image as input and predict the location of that image as output.

The model was trained on a dataset of google streetview images. I scraped images of random locations in India for generating this dataset. The model is reasonably good in making predictions. It generally predicts in the vicinity of the actual location.

Pic of results

These are handpicked good examples. Even when the model's predicted location is wrong, the predicted grids are reasonable:

Pic of results2

I cropped out the bottom portion of the image. The model accuracy was not as great, but it was able to pick up some general patterns like landscape, buildings, vegetation, roads, terrain etc when making the prediction.

Pic of results2

Dataset Preparation

I overlayed an isometric grid onto the map of India. The resulting grids where the target variables the model needed to predict.

Pic of results4

I then uniformly sampled points in each grid, used google's streetview API to get the nearest location with a streetview image, and grabbed 4 images from the 360 view at angles 0,90,180 and 270 degrees.

Pic of results5

Evaluation

Method: Group KFold - 10 splits - grouped by location

Pic of results6

Confusion Matrix

Pic of results7

Average Accuracy: 25%

Shoulders of giants

  1. PlaNet geolocation with Convolutional Neural Networks - https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45488.pdf
  2. DeepGeo: Photo Localization with Deep Neural Network - https://arxiv.org/abs/1810.03077
  3. GradCam on ResNext: https://www.kaggle.com/skylord/grad-cam-on-resnext

imagegeolocation's People

Contributors

kvsnoufal 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.