Conv2D Kernel size for audio-related tasks

So I've been working on this audio-rec task for a while now, and I've had some good luck using 2D convolutions on the spectrogram of audio (I've also tried Mel-spectrograms, the difference is minor in my opinion). Up until now I've been using this network structure:

    X = Conv2D(filters=64, kernel_size=5, padding='same', activation='relu')(X_input)
X = Conv2D(filters=64, kernel_size=5, padding='same', activation='relu')(X)
X = MaxPooling2D()(X)

X = Conv2D(filters=128, kernel_size=5, padding='same', activation='relu')(X)
X = Conv2D(filters=128, kernel_size=5, padding='same', activation='relu')(X)
X = MaxPooling2D()(X)

X = Conv2D(filters=256, kernel_size=3, padding='same', activation='relu')(X)
X = Conv2D(filters=256, kernel_size=3, padding='same', activation='relu')(X)
X = MaxPooling2D()(X)


This works well, but its not awesome. Now I was thinking about why it's not really that good last night and I thought of one reason: the conv2D Kernel size! So I have a few questions to ask the StackExchange community:

1) Since audio in a spectrogram is very disperse spatially, I think my Kernel size should be much larger (keep in mind my input size is 64x64). This way the model will be able to learn more about larger segments of images, does that make sense? Additionally, should I even be using a square kernel? Time and frequency are different units, unlike images where both axes are of the same units.

2) what about Conv2D stride, and the MaxPooling2D pool size? so many hyperparameters! I'm thinking that stride might help because audio is really non-spatial in a spectrogram, I mean check this one out: If you can see there are segments of the picture where it seems like there are lines above and below the primary (brightest) spots. This is very common in spectrograms and I believe these are actually octaves above and below the actual sound: Please correct me if I'm wrong.

Here are some details about the audio being analyzed:

length: < 0.05 seconds (yeah, that short)

num_classes: 7

desc: beatboxing audio

If anyone has any comments at all about my network structure, hyperparams, questions, insults, anything, please leave an answer or comment, and I will get back to you within a day. I'm super excited to hear what you guys think!

Thanks.

SIDE NOTE PLEASE READ: - if you have enough rep to edit this post could you please add audio and spectrogram to the tags. I don't have enough rep to create tags and I think this would help those stuck on similar challenges to find this question. Thanks!

• Thanks for the edit @Michael, much appreciated! – Nikita Jerschow Dec 22 '19 at 2:37
• Re: parallel lines in spectrograms - yeah, even if you had a single-note melody on a single acoustic instrument, you're going to see at least some faint ones - these are overtones/harmonics. It's actually what makes the exact same notes sound different on different instruments. – jkm Dec 24 '19 at 9:13
• As for Conv filter sizes - covering larger areas can be handled simply by the fact that deeper layers operate on the pooled outputs of the previous ones, e.g. a 3x3 convolution of pooled 3x3 convolutions effectively covers a 9x9 area. Larger individual filters mostly boost the 'sophistication' of the local patterns you could detect, but it's a fairly computationally expensive hyperparameter. – jkm Dec 24 '19 at 9:24
• You say that your audio is 0.05 seconds long, what do you mean by that? What are the dimensions of your spectrogram patches that your network processes? And what is the time and frequency resolution of the spectrograms. The appropriate kernel sizes depends a lot on this! – jonnor May 16 '20 at 13:51
• Also, how many samples is your training set. The suggested network has a very large amount of parameters, and will require a lot of samples to train. – jonnor May 16 '20 at 13:52

Convolutional Neural Networks (such as the one you utilize) tend to increase the information density per neuron from the lower layers to the higher ones. Therefore, it is useful to decrease the kernel size when reaching deeper layers as you already did. From experience, I can tell you that $$5\times 5$$ kernels in early layers with $$3 \times 3$$ kernels in subsequent layers are a very good starting point.