You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use fine tune one of the pretrained HTS-AT model for binary classification on a custom dataset. I have already managed to do the exact same thing with a pretrained BEATs model, but somehow I can't make it work with HTS-AT.
Here is a summary of what I do:
I create the HTSAT_Swin_Transformer model with the same config than in your ESC-50 fine tuning example, the only difference being num_classes=1 and loss_type = "clip_bce" since I do binary classification
I load one of the pretrained checkpoint (e.g. HTSAT_AudioSet_Saved_1.ckpt) and update all the model weights but sed_model.tscam_conv.weights and sed_model.tscam_conv.bias (I have verified all weights are correctly loaded)
I freeze all the parameters but tscam_conv ones (4.6K trainable params left)
I feed the model batches of raw audio frames (sampled at 32000Hz and zero-padded to fit longest audio clip in the batch) and compute the loss against its 0-1 targets with nn.BCELoss
I follow the exact same process with BEATs, the only difference being the layers names and the input data sample rate (16000Hz). Yet I can't get the HTS-AT model to learn anything. For example here is the val_loss after a few epochs over a few tries (blue is BEATs fine tuning for reference):
I have tried with different learning rates, pretrained weights and optimizers but it does not seem to have any effect.
My dataset being composed of roughly 10% of positives, the val_loss of a dummy model outputing a constant value of 0.10 would have an approximate val_loss of 0.27, which is what all my attempts seem to converge toward. Basically, the model is not learning anything from the input here.
The input data looks "normal". For example, here is what the sound of an ambulance looks like after HTSAT preprocessing:
Hi,
I am trying to use fine tune one of the pretrained HTS-AT model for binary classification on a custom dataset. I have already managed to do the exact same thing with a pretrained BEATs model, but somehow I can't make it work with HTS-AT.
Here is a summary of what I do:
HTSAT_Swin_Transformer
model with the same config than in your ESC-50 fine tuning example, the only difference beingnum_classes=1
andloss_type = "clip_bce"
since I do binary classificationHTSAT_AudioSet_Saved_1.ckpt
) and update all the model weights butsed_model.tscam_conv.weights
andsed_model.tscam_conv.bias
(I have verified all weights are correctly loaded)tscam_conv
ones (4.6K trainable params left)nn.BCELoss
I follow the exact same process with BEATs, the only difference being the layers names and the input data sample rate (16000Hz). Yet I can't get the HTS-AT model to learn anything. For example here is the
val_loss
after a few epochs over a few tries (blue is BEATs fine tuning for reference):I have tried with different learning rates, pretrained weights and optimizers but it does not seem to have any effect.
My dataset being composed of roughly 10% of positives, the
val_loss
of a dummy model outputing a constant value of 0.10 would have an approximateval_loss
of 0.27, which is what all my attempts seem to converge toward. Basically, the model is not learning anything from the input here.The input data looks "normal". For example, here is what the sound of an ambulance looks like after HTSAT preprocessing:
Am I missing a key detail?
The text was updated successfully, but these errors were encountered: