This project provide a workflow that trains a random forest/decision tree/SVM machine model upon given multispectral samples in xls format (which is a standard output of ArcGIS), and apply the model on a given image to output prediction result in Tiff.
Required packages include GDAL, NumPy, sklearn, xlrd, pickle (only if you wish to save the model).
A Sentinel-2 image of Yancheng, Jiangsu, China shot on 08/04/2021The two crops are easily recognizable as the rape is flowering, showing a bright-green and yellow tone, while the wheat is dark green.
Sampling:
The NDVI (Normalized Difference Vegetation Index) was added into the spectral data to help the random forest model identify crops from water and buildings.
The classification result
Notice that, the water are identified through NDVI.
Unfortunately, since my hard disk storing these data were accidentally broken months ago, I cannot upload more examples. Later on, the same method was applied on a more virtually indistinguishable sample (wheat and maize). A CNN classifier based on UNet was also tested. Samples were generated by splitting the image into 256x256 chunks, with rotating and adding random noise.