# Pixel-wise classification on a large image using deep learning network

I am trying to classify every pixel on a large image (satellite image ~ 6000x4000 pixels) as belonging to one of the 4 classes:"Cloud", "Thin Cloud", "Clear", "Shadow." To that extent, I have taken inspiration from the paper "Brain Tumor Segmentation with Deep Neural Networks" where I design a neural network that looks something like this:

The idea is that the network above will predict the class of the pixel by processing the 31x31 patch centered on that pixel.

Training and testing on various patches have been carried out however the main problem is full-image inference. Since the image is so large, it takes almost 2 hours to extract a patch at each pixel and then process it to determine the pixel class. In the paper, however, the authors "[feed] as input a full image and not individual patches. Therefore, convolutions at all layers can be extended to obtain all label probabilities $p(Yij|X)$ for the entire image."

So, my questions are:

1. If I run all the convolution layers on my image, will I get a 4x5970x3970 dim tensor.
2. How do I then make the leap to pixel-level classification for every pixel in my 6000x4000 image?
• Is it essential that you process each image in one go and are you strongly tied to this architecture? I think there are easier ways to solve this problem. – MachineEpsilon Nov 2 '17 at 5:12
• Hi @NaN, yes, I am strongly tied to this architecture. Having said that, what might these easier ways be? As for processing the image in one go, I am mainly concerned about speed when classifying around ~6000x4000 or ~24,000,000 pixels.Currently, my naive way extracts and processes 24,000,000 patches in ~2 hours. So,I am looking to speed up this process, and the authors of the paper suggest that the full image be processed in one go. I am open to other suggestions,however. – Guru Rahul Pradhan Nov 2 '17 at 11:48

Given the 4x5970x3970 image (call it out), you can get a 5970x3970 image labels with 0,1,2,3 at each pixel by:
labels[i,j] = argmax_k out[k,i,j]