Code Monkey home page Code Monkey logo

grid-mae's Introduction

GRID-MAE

  • Investigate using multiscale grids in a Vision Transformer Masked Autoencoder.

Question

  • Will it be worth the computational requirements?

Architecture

  • Smallest will likely do

Prior Art

SATMAE

CIMAE

HARDWARE

  • V100s - 16GB?

DATA

METADATA

Example

category	location_id	image_id	timestamp	polygon

0 airport 0 6 2015-07-25T08:45:14Z POLYGON ((32.666164117900003 39.932541952376475, 32.711078120537337 39.932541952376475, 32.711078120537337 39.967113357199999, 32.666164117900003 39.967113357199999, 32.666164117900003 39.932541952376475))

Installation

  • pytorch as pre instructions
  • geopandas to get bonus gdal
  • rasterio via conda-forge
  • tensorboard via conda-forge
  • pip install timm
  • pip install opencv-python
  • [so far]

Environment

  • I had started with a python 3.10 and default installed the rest which gave timm 0.9.16 and an error

  • satmae advises

    • python 3.8
    • pytorch 1.10
    • cuda 11.1
    • timm 0.4.12

Running

  • rasterio.errors.RasterioIOError: '/dataset/fmow_sentinel/fmow-sentinel/train\parking_lot_or_garage/parking_lot_or_garage_927/parking_lot_or_garage_927_109.tif' does not exist in the file system, and is not recognized as a supported dataset name.

Problem

General

  • Multiscale adaptation for segmentation based on general layers

Geoscience

  • Could be remote sensing, but any domain for geoscience, geophysics, geology, structure etc.

Loss functions

  • might be continuous or one hot
  • assume mse default for testing this and getting to work

Simple Example

  • To keep it in human finger space [and patch space]
  • Take a set of geophysics grids at 100m resolution
  • Take another set at 200m resolution

Padding

  • Planets, surface etc. - not rectangles

Data Loader

  • Likely want on the fly grid slicing into tiles, not directory structures full of sliced up grids in folders

Overlap training tiles

  • Is this useful for autoencoders here beyond smoothing reasons

Input channels

  • Needs to be general

Groupings

  • Resolution groupings - this is a satmae parameter already

Xbatcher?

Data Sources

  • Assume all files the same
  • Read from a data directory
  • Stack

test type runs

python -m main_pretrain.py
--batch_size 8 --accum_iter 16
--epochs 1 --warmup_epochs 1
--input_size 96 --patch_size 8
--mask_ratio 0.75
--model_type group_c
--dataset_type grid
--grouped_bands 0 --grouped_bands 1
--blr 0.0001 --num_workers 8
--output_dir ./output_dir
--log_dir ./output_dir

  • python -m main_pretrain.py --batch_size 8 --accum_iter 16 --epochs 3 --warmup_epochs 1 --input_size 96 --patch_size 8 --mask_ratio 0.75 --model_type group_c --dataset_type grid --grouped_bands 0 --grouped_bands 1 --blr 0.0001 --num_workers 8 --output_dir ./output_dir --log_dir ./output_dir

1 epoch test

python main_pretrain.py --batch_size 8 --accum_iter 16 --epochs 1 --warmup_epochs 1 --input_size 96 --patch_size 8 --mask_ratio 0.75 --model_type group_c --dataset_type grid --grouped_bands 0 --grouped_bands 1 --blr 0.0001 --num_workers 8 --input_channels 2 --output_dir ./output_dir --log_dir ./output_dir

#parser.add_argument('--model', default='mae_vit_base_patch16', type=str, metavar='MODEL', help='Name of model to train')

small test

python main_pretrain.py --model mae_vit_base_patch16_small --batch_size 8 --accum_iter 16 --epochs 30 --warmup_epochs 1 --input_size 96 --patch_size 8 --mask_ratio 0.75 --model_type group_c --dataset_type grid --grouped_bands 0 --grouped_bands 1 --blr 0.0001 --num_workers 8 --input_channels 2 --output_dir ./output_dir_small --log_dir ./output_dir_small

ww

python ww_test.py --model mae_vit_base_patch16_small --batch_size 8 --accum_iter 16 --epochs 30 --warmup_epochs 1 --input_size 96 --patch_size 8 --mask_ratio 0.75 --model_type group_c --dataset_type grid --grouped_bands 0 --grouped_bands 1 --blr 0.0001 --num_workers 8 --input_channels 2 --output_dir ./output_dir_small --log_dir ./output_dir_small --weightwatcher_path ww_test_details_small.csv

TODO

  • Training
    • Handle nodata [same thing as below basically]
  • Handle nodata
  • Handle valid data
  • Handle one hot data [although mostly interested in other things here]
    • Handle different loss functions
  • The Hard Part
    • geospatial inference [BASICS DONE]
      • Check for edge cases
    • reference dataset - take from first of the list [currently hardcoded a trial]

grid-mae's People

Contributors

richardscottoz avatar

Watchers

Kostas Georgiou avatar  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.