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!