# How to train a FCNN with audio spectrogram images?

I'm working on an audio dereverberation deep learning model, based on the U-net architecture. The idea of my project came from image denoising with autoencoders. I feed the reverberated spectrogram to the network, and the network should give me the cleaned version. I train the network with pairs of spectrograms, the clean version, and the reverberated version.

This is the link to one of the papers I'm following for this project: https://arxiv.org/pdf/1803.08243.pdf

My problem is, how to save spectrograms of audio data for the training. I have done two tests:

1. I have saved spectrograms as RGB images, so they are 3D tensors, so exactly what a convolutional network wants in input from training. The trained model is then able to output a reconstructed version of the input spectrogram with less reverb. The problem with this solution is that, then I can't recover the audio from the cleaned spectrogram which is an RGB image.

2. I have saved directly the spectrogram matrix with numpy.save(), and then reload with numpy.load(). With this solution I can obtain in output, directly the de-reverberated spectrogram matrix, which can be fed to the Griffin-lim algorithm to recover the audio (this because I consider just the magnitude of the spectrogram). The problem of this solution is that, I don't know if I can feed this 2D NumPy array (the stft matrix) directly to the convolutional network, or I need to do some kind of preprocessing.