TensorFlow neural network for processing Raster Tiles.
- Clone the repository
- Go to
tiles_tf\tf_env\Scripts>activate.batfor activating Virtual Environment with all needed dependencies.
-
QGIS. The code provided proposes you to create a vector grid any size you like. You may also use you own vector layer. This code HAS TO BE EXTREMELY UPGRADED. After creating the grid (or upload your own vector layer) you have to categorize vectors giving objects appropriate attributes. Then, the raster will be clipped with this vector.
-
There are 3 datasets created:
trfor training data,valfor validation data andrawfor testing the neural network (actually there is that sort of data that has to be processed).
There are also metafiles created (required in TensorFlow Documentation).
- Run
python3 learn.pyfor training the neural network. You will be asked for the name of your neural network. There are50iterations by default. It could be changed in code in line 93. It is recommended to have at least 3o iteractions. Has to be verified. Changebatch_sizein line 91 to the number your images number could be divided (recommended near 3% of the total number).
TAKES TIME TO PROCEED. You will see the accuracy of the neural network during the process. Once the neural network is ready you can use it with any similar dataset, so it is preferable to spend time and efforts to make the model as good, nice and shiny as it is possible.
-
Run
python3 check.pyfor checking data from dataset stored intiles\rawfolder to be categorized. Images would be copied to folders0and1and appropriate metafile is created. -
The metafile created could be joined with the grid layer created using the key field.
-
Custom categories number
-
Read theory to make it more efficient.
-
Visualize the neural network
Some information to inspire:
- CNN is FUN (in Russian)
- Some scientific stuff
- CityClass Project (in Russian)
- Buildings in Nigeria with github page
- Collecting Urban Data and results
Idea: define tiles with artificial objects (buildings primarily).
Input: cellsize - 100m, Bing Imagery, 710 training images, 362 validation images, batch_size = 30, n_epoch = 50.
Checked category = 1 (All the images categorized as 1 were categorized correctly (not the same with category 0. There are some tiles with buildings). General accuracy up to 95% (After 5 iteraction it was 85%))




