GithubHelp home page GithubHelp logo

sodawave / swimming-pool-detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonas1312/swimming-pool-detection

0.0 0.0 0.0 26.07 MB

Swimming Pool Detection on Aerial Images With AI.

Python 0.30% Jupyter Notebook 99.70%

swimming-pool-detection's Introduction

Swimming Pool Detection on Aerial Images

One-day project ✍(◔◡◔)

Problematic

Detect pools on aerial images. Can be used for market analysis for a swimming pool seller or fight against tax evasion of undeclared swimming pools: 12,000 illegal swimming pools detected in Provence thanks to artificial intelligence.

Proposed Approach

Data

  • 50x50px tiles containing a pool or not.
  • ~1500 tiles for positive class, ~1500 for negative class.
  • No segmentation masks, no coordinates. Just pool or no pool for each tile.
  • Private dataset ¯\_(ツ)_/¯

Algorithm

  • Convolutional Neural Network (resnet50) with class activation maps to generate a heatmap. Simple computer vision algorithms to detect "blobs" and return the swimming pools' coordinates.
  • Inference is done on 800x1600px images. No need to split the image into 50x50 patches since the network uses a Global Average Pooling layer.
  • Network is trained with simple data aug, Adam (with lr=3e-4 (¬‿¬)).
  1. Class Activation Maps on tiles
  2. Input image
  3. Heatmap generated by the CNN
  4. Binarization and contour detection
  5. Draw bounding boxes

Results

Result 1

Result 2

Result 3

Result 4

Result 5

Some Remarks

  • HSV filtering on blue shades before feeding a tile in the CNN might improve the results...?
  • Binarization and contour detection need some finetuning.

Repo structure

├── README.md
├── pool_detection_example_notebook.ipynb     <- notebook for inference with some visualizations
├── models                                    <- model weights
├── src
│   ├── pool_detector.py                      <- inference
│   ├── data
│   │   └── split_dataset.py                  <- generate train/test/valid sets
│   ├── models
│   │   ├── predict_cnn.py                    <- check results
│   │   └── train_cnn.py                      <- train cnn

swimming-pool-detection's People

Contributors

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