One-day project ✍(◔◡◔)
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.
- 50x50px tiles containing a pool or not.
- ~1500 tiles for positive class, ~1500 for negative class.
- No segmentation masks, no coordinates. Just
pool
orno pool
for each tile. - Private dataset ¯\_(ツ)_/¯
- 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 (¬‿¬)).
- Class Activation Maps on tiles
- Input image
- Heatmap generated by the CNN
- Binarization and contour detection
- Draw bounding boxes
- HSV filtering on blue shades before feeding a tile in the CNN might improve the results...?
- Binarization and contour detection need some finetuning.
├── 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