In CNN, how to map from fully connected layer to output image? In CNN, where the last layers are fully connected, how to make pixel-wise prediction to output an image(binary matrix), if the number of neurons in the last layer is less than the size of the image?
 A: 1 - U-net and similars
If your last few layers are fully connected, then they are, by definition, carrying global features of your images.
You can use transposed convolutional layers to obtain an image again, but you lose the fine detail in the image doing that.
To overcome that, the U-net and similar architectures were created. The idea is the same: convolution and downsampling (by using strides or pooling) followed by upsampling and convolutions (by using interpolation or tranposed convolutions), though there's an important detail. Layers in the downsampling network are connected, by means of skip connections, to layers with equal resolution in the upsampling network.

This will allow you to get an output map, as you desire, with preserved fine detail.

2 - Actually, tailored fully convolutional architectures will suffice
If you can do away with the fully connected layers (I suppose you're using these because you're doing transfer learning), you can use a fully convolutional architecture, where the only layers used are padded convolutions that preserve the dimensions of the input. You can also add skip connections, and also parallel branches with different receptive fields, adjusting padding accordingly.
A: 
The convolutional generation process is called unpooling and "deconvolution"(formally  transposed convolutional layer) as shown above. 
And we can also use RNN to generate pixels as stated in these paper: DRAW: A Recurrent Neural Network For Image Generation and Pixel Recurrent Neural Networks. 
Reference:
1. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks
2. https://datascience.stackexchange.com/a/12110/9191
