Pits of image segmentation
06 Aug 2018Tree Detection Project
Memory Error
The satellite images are too big to copy to GPU or to perform convolutions on. A typical type of an image is 100K * 100K * 4 pixel. One natural solution for this is to divide the image in a predefined number of tiles and train on small batches.
Our Solution:
- Divide into 512 * 512 * 3 tiles
- Set small batch size
Unbalanced data
A typical problem in machine learning is unbalanced data. One class is much larger and our positive class is very small. In our case,we labeled the center area of the palm tree as 1, labeled other areas as 0.that means the majority of the mask images are 0, and only a few sample pixels are 1. Our first attemp using FCN model achieve good error rate by classifying all data as negative.
Things to Try:
- Oversampling or Weight adjusting
- Cascade or Thresholding
- Use binary cross-entropy instead of global accuracy
Our Solution:
- Switch models from FCN model to Unet Model.
- Use Convolution to enlarge the area
img = cv2.GaussianBlur(img,(5,5),0)
np.where(img[:,:,:]>0,1,0)
Boundary Issue
Because of zero-paddings procedure on the boundary, the performance on the edge of those tiles is not very good.
Things to try:
- Conditional random field (CRF) A post-processing to generate better boundaries
Our Solution: We used some overlap between tiles to counteract for loss in the convolutional layer and stitch them together.