Spectral X-ray imaging using deep learning